├── .github ├── CODEOWNERS └── workflows │ └── rust.yml ├── LICENSE ├── documents ├── a000010_plot.jpg ├── a000010_program.jpg ├── a002487_plot.jpg ├── a002487_program.jpg ├── a003188_plot.jpg ├── a003188_program.jpg ├── arc-metadata-histogram.md ├── install.md ├── license-apache.txt ├── license-mit.txt ├── loda-rust-dashboard-2022-11-27.jpg ├── mining-on-raspberrypi.md ├── mining.md └── top100.md ├── readme.md ├── resources ├── programs │ ├── match_overflow │ │ ├── A050921.asm │ │ ├── A050921_1.asm │ │ ├── A051122.asm │ │ ├── A078683.asm │ │ ├── A089911.asm │ │ ├── A105995.asm │ │ ├── A106005.asm │ │ ├── A112282.asm │ │ ├── A132636.asm │ │ ├── A261606.asm │ │ ├── A289682.asm │ │ ├── A350253.asm │ │ └── readme.md │ ├── match_somewhat_faster │ │ ├── A046897.asm │ │ ├── A166673.asm │ │ ├── A292930.asm │ │ └── A304412.asm │ └── match_too_slow │ │ ├── A001157.asm │ │ ├── A006450.asm │ │ ├── A007887.asm │ │ ├── A008347.asm │ │ ├── A053767.asm │ │ ├── A054519.asm │ │ ├── A065608.asm │ │ ├── A089911.asm │ │ ├── A232637.asm │ │ ├── A328590.asm │ │ ├── A340867.asm │ │ └── readme.md ├── readme.md └── realtime metrics │ ├── grafana-dashboard.json │ ├── grafana.ini │ └── prometheus.yml ├── rust_project ├── .gitignore ├── .vscode │ └── launch.json ├── Cargo.lock ├── Cargo.toml ├── arc-competition │ ├── arc.Dockerfile │ ├── payload │ │ ├── .loda-rust │ │ │ ├── analytics-arc │ │ │ │ ├── analytics_log.txt │ │ │ │ ├── complexity_all.csv │ │ │ │ ├── complexity_dont_optimize.csv │ │ │ │ ├── dependencies.csv │ │ │ │ ├── histogram_instruction_bigram.csv │ │ │ │ ├── histogram_instruction_constant.csv │ │ │ │ ├── histogram_instruction_skipgram.csv │ │ │ │ ├── histogram_instruction_trigram.csv │ │ │ │ ├── histogram_instruction_unigram.csv │ │ │ │ ├── histogram_line_bigram.csv │ │ │ │ ├── histogram_line_skipgram.csv │ │ │ │ ├── histogram_line_trigram.csv │ │ │ │ ├── histogram_line_unigram.csv │ │ │ │ ├── histogram_source_bigram.csv │ │ │ │ ├── histogram_source_skipgram.csv │ │ │ │ ├── histogram_source_trigram.csv │ │ │ │ ├── histogram_source_unigram.csv │ │ │ │ ├── histogram_target_bigram.csv │ │ │ │ ├── histogram_target_skipgram.csv │ │ │ │ ├── histogram_target_trigram.csv │ │ │ │ ├── histogram_target_unigram.csv │ │ │ │ ├── indirect_memory_access.csv │ │ │ │ ├── last_analytics_timestamp.txt │ │ │ │ └── program_modified.csv │ │ │ └── config.toml │ │ └── loda-arc-challenge │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── programs-that-use-predicted-output-size │ │ │ ├── fill-predicted-size-1.asm │ │ │ └── resize-input-to-predicted-output-size-1.asm │ │ │ ├── programs │ │ │ ├── 007bbfb7-1.asm │ │ │ ├── 0b148d64-1.asm │ │ │ ├── 0c786b71-1.asm │ │ │ ├── 0d3d703e-2.asm │ │ │ ├── 1190e5a7-1.asm │ │ │ ├── 19bb5feb-1.asm │ │ │ ├── 1c0d0a4b-1.asm │ │ │ ├── 1cf80156-1.asm │ │ │ ├── 1f85a75f-1.asm │ │ │ ├── 1f876c06-1.asm │ │ │ ├── 2013d3e2-1.asm │ │ │ ├── 27f8ce4f-1.asm │ │ │ ├── 28bf18c6-1.asm │ │ │ ├── 2dc579da-1.asm │ │ │ ├── 2dee498d-1.asm │ │ │ ├── 31aa019c-1.asm │ │ │ ├── 3428a4f5-1.asm │ │ │ ├── 39a8645d-1.asm │ │ │ ├── 3af2c5a8-1.asm │ │ │ ├── 3c9b0459-1.asm │ │ │ ├── 3de23699-1.asm │ │ │ ├── 4258a5f9-1.asm │ │ │ ├── 44f52bb0-1.asm │ │ │ ├── 496994bd-1.asm │ │ │ ├── 49d1d64f-1.asm │ │ │ ├── 4c4377d9-1.asm │ │ │ ├── 50cb2852-1.asm │ │ │ ├── 5582e5ca-1.asm │ │ │ ├── 5614dbcf-1.asm │ │ │ ├── 59341089-1.asm │ │ │ ├── 5ad4f10b-1.asm │ │ │ ├── 5b6cbef5-1.asm │ │ │ ├── 60c09cac-1.asm │ │ │ ├── 6150a2bd-1.asm │ │ │ ├── 623ea044-1.asm │ │ │ ├── 67a3c6ac-1.asm │ │ │ ├── 68b16354-1.asm │ │ │ ├── 68b67ca3-1.asm │ │ │ ├── 6d0aefbc-1.asm │ │ │ ├── 6fa7a44f-1.asm │ │ │ ├── 73182012-1.asm │ │ │ ├── 7468f01a-1.asm │ │ │ ├── 74dd1130-1.asm │ │ │ ├── 7f4411dc-1.asm │ │ │ ├── 7fe24cdd-1.asm │ │ │ ├── 80af3007-1.asm │ │ │ ├── 88a62173-1.asm │ │ │ ├── 90c28cc7-1.asm │ │ │ ├── 9172f3a0-1.asm │ │ │ ├── 94f9d214-1.asm │ │ │ ├── 9565186b-1.asm │ │ │ ├── 9f236235-1.asm │ │ │ ├── a416b8f3-1.asm │ │ │ ├── a68b268e-1.asm │ │ │ ├── a740d043-1.asm │ │ │ ├── a79310a0-1.asm │ │ │ ├── a79310a0-2.asm │ │ │ ├── b6afb2da-1.asm │ │ │ ├── b91ae062-1.asm │ │ │ ├── b9b7f026-1.asm │ │ │ ├── bbc9ae5d-1.asm │ │ │ ├── bc1d5164-1.asm │ │ │ ├── bda2d7a6-2.asm │ │ │ ├── c3202e5a-1.asm │ │ │ ├── c3e719e8-1.asm │ │ │ ├── c59eb873-1.asm │ │ │ ├── c8f0f002-1.asm │ │ │ ├── ccd554ac-1.asm │ │ │ ├── ce8d95cc-1.asm │ │ │ ├── crop-first-object.asm │ │ │ ├── d10ecb37-1.asm │ │ │ ├── d19f7514-1.asm │ │ │ ├── d4b1c2b1-1.asm │ │ │ ├── e1baa8a4-1.asm │ │ │ ├── e98196ab-1.asm │ │ │ ├── eb281b96-1.asm │ │ │ ├── eb5a1d5d-1.asm │ │ │ ├── eb5a1d5d-2.asm │ │ │ ├── ed36ccf7-1.asm │ │ │ ├── f25fbde4-1.asm │ │ │ ├── f25ffba3-1.asm │ │ │ ├── f2829549-1.asm │ │ │ ├── f8b3ba0a-1.asm │ │ │ ├── f8ff0b80-1.asm │ │ │ ├── fafffa47-1.asm │ │ │ ├── repair-mosaic.asm │ │ │ ├── repair-symmetry-and-crop.asm │ │ │ └── repair-symmetry.asm │ │ │ └── solutions.csv │ ├── rakefile.rb │ ├── readme.md │ └── secret_data │ │ ├── evaluation │ │ └── f3cdc58f.json │ │ ├── solution │ │ └── solution_notXORdinary.json │ │ └── training │ │ ├── 1e0a9b12.json │ │ ├── 1e32b0e9.json │ │ ├── 1f0c79e5.json │ │ ├── 1f85a75f.json │ │ ├── 1f876c06.json │ │ ├── 4258a5f9.json │ │ └── 9565186b.json ├── loda-rust-cli │ ├── .gitignore │ ├── Cargo.toml │ ├── readme.md │ ├── src │ │ ├── analytics │ │ │ ├── analytics.rs │ │ │ ├── analytics_directory.rs │ │ │ ├── analytics_error.rs │ │ │ ├── analytics_mode.rs │ │ │ ├── analytics_timestamp_file.rs │ │ │ ├── analyze_dependencies.rs │ │ │ ├── analyze_indirect_memory_access.rs │ │ │ ├── analyze_instruction_constant.rs │ │ │ ├── analyze_instruction_ngram.rs │ │ │ ├── analyze_line_ngram.rs │ │ │ ├── analyze_program_complexity.rs │ │ │ ├── analyze_program_modified.rs │ │ │ ├── analyze_source_ngram.rs │ │ │ ├── analyze_target_ngram.rs │ │ │ ├── batch_program_analyzer.rs │ │ │ ├── deny_file.rs │ │ │ ├── dont_mine.rs │ │ │ ├── histogram_stripped_file.rs │ │ │ ├── mod.rs │ │ │ ├── program_rank.rs │ │ │ └── validate_programs.rs │ │ ├── arc │ │ │ ├── action_label_util.rs │ │ │ ├── analyze_direction.rs │ │ │ ├── arc_json_model.rs │ │ │ ├── arc_json_model_to_html.rs │ │ │ ├── arc_puzzles.rs │ │ │ ├── arc_work_model.rs │ │ │ ├── arc_work_model_from_json_model.rs │ │ │ ├── arc_work_model_impl_imagemeta.rs │ │ │ ├── arc_work_model_impl_input.rs │ │ │ ├── arc_work_model_impl_object.rs │ │ │ ├── arc_work_model_impl_output.rs │ │ │ ├── arc_work_model_impl_pair.rs │ │ │ ├── arc_work_model_impl_task.rs │ │ │ ├── arcathon_solution_coordinator.rs │ │ │ ├── arcathon_solution_json.rs │ │ │ ├── auto_repair_symmetry.rs │ │ │ ├── cellular_automaton.rs │ │ │ ├── center_of_mass.rs │ │ │ ├── checkerboard.rs │ │ │ ├── color.rs │ │ │ ├── color_map.rs │ │ │ ├── compare_input_output.rs │ │ │ ├── connected_component.rs │ │ │ ├── convolution2x2.rs │ │ │ ├── convolution3x3.rs │ │ │ ├── convolution3x3_with_mask.rs │ │ │ ├── convolution5x5_special.rs │ │ │ ├── convolution_with_program.rs │ │ │ ├── create_task_with_same_size.rs │ │ │ ├── diagonal_histogram.rs │ │ │ ├── experiment_with_convolution.rs │ │ │ ├── export_arc_task_json.rs │ │ │ ├── export_tasks.rs │ │ │ ├── generate_dataset_diva.rs │ │ │ ├── generate_dataset_for_texttransformer.rs │ │ │ ├── generate_dataset_for_visitiontransformer.rs │ │ │ ├── generate_dataset_gameoflife.rs │ │ │ ├── generate_dataset_histogram.rs │ │ │ ├── generate_pattern.rs │ │ │ ├── grid.rs │ │ │ ├── grid_to_label.rs │ │ │ ├── histogram.rs │ │ │ ├── html_log.rs │ │ │ ├── image.rs │ │ │ ├── image_border.rs │ │ │ ├── image_center_indicator.rs │ │ │ ├── image_collect.rs │ │ │ ├── image_color_profile.rs │ │ │ ├── image_compare.rs │ │ │ ├── image_corner_analyze.rs │ │ │ ├── image_count_unique_colors.rs │ │ │ ├── image_crop.rs │ │ │ ├── image_denoise.rs │ │ │ ├── image_detect_color_symmetry.rs │ │ │ ├── image_detect_hole.rs │ │ │ ├── image_draw_line_where.rs │ │ │ ├── image_drawrect.rs │ │ │ ├── image_export.rs │ │ │ ├── image_exterior_corners.rs │ │ │ ├── image_extract_rowcolumn.rs │ │ │ ├── image_fill.rs │ │ │ ├── image_find.rs │ │ │ ├── image_gravity.rs │ │ │ ├── image_grid.rs │ │ │ ├── image_histogram.rs │ │ │ ├── image_layout.rs │ │ │ ├── image_mask.rs │ │ │ ├── image_mask_boolean.rs │ │ │ ├── image_mask_count.rs │ │ │ ├── image_mask_distance.rs │ │ │ ├── image_mask_grow.rs │ │ │ ├── image_mask_solid_ground.rs │ │ │ ├── image_mix.rs │ │ │ ├── image_neighbour.rs │ │ │ ├── image_noise_color.rs │ │ │ ├── image_object_enumerate.rs │ │ │ ├── image_offset.rs │ │ │ ├── image_outline.rs │ │ │ ├── image_overlay.rs │ │ │ ├── image_padding.rs │ │ │ ├── image_palette.rs │ │ │ ├── image_periodicity.rs │ │ │ ├── image_position.rs │ │ │ ├── image_remove_duplicates.rs │ │ │ ├── image_remove_rowcolumn.rs │ │ │ ├── image_repair_offset.rs │ │ │ ├── image_repair_pattern.rs │ │ │ ├── image_repair_symmetry.rs │ │ │ ├── image_repair_trigram.rs │ │ │ ├── image_repeat.rs │ │ │ ├── image_replace_color.rs │ │ │ ├── image_replace_pattern.rs │ │ │ ├── image_replace_regex.rs │ │ │ ├── image_replace_simple.rs │ │ │ ├── image_resize.rs │ │ │ ├── image_rotate45.rs │ │ │ ├── image_rotate90.rs │ │ │ ├── image_rowcolumn_order.rs │ │ │ ├── image_set_pixel_where.rs │ │ │ ├── image_size.rs │ │ │ ├── image_skew.rs │ │ │ ├── image_sort.rs │ │ │ ├── image_split.rs │ │ │ ├── image_stack.rs │ │ │ ├── image_stats.rs │ │ │ ├── image_symmetry.rs │ │ │ ├── image_tile.rs │ │ │ ├── image_to_html.rs │ │ │ ├── image_to_number.rs │ │ │ ├── image_trim.rs │ │ │ ├── image_try_create.rs │ │ │ ├── image_unicode_formatting.rs │ │ │ ├── index_for_pixel.rs │ │ │ ├── inspect_predicted.rs │ │ │ ├── inspect_task.rs │ │ │ ├── lab_analyze_task.rs │ │ │ ├── label.rs │ │ │ ├── landmark_single_pixel.rs │ │ │ ├── largest_interior_rectangle.rs │ │ │ ├── linespan.rs │ │ │ ├── measure_density.rs │ │ │ ├── mod.rs │ │ │ ├── ngram.rs │ │ │ ├── number_to_image.rs │ │ │ ├── object_with_different_color.rs │ │ │ ├── object_with_smallest_value.rs │ │ │ ├── objects_and_gravity.rs │ │ │ ├── objects_and_mass.rs │ │ │ ├── objects_and_position.rs │ │ │ ├── objects_measure_mass.rs │ │ │ ├── objects_sort_by_property.rs │ │ │ ├── objects_to_grid.rs │ │ │ ├── objects_unique_color_count.rs │ │ │ ├── output_specification.rs │ │ │ ├── pixel_connectivity.rs │ │ │ ├── popular_objects.rs │ │ │ ├── prompt.rs │ │ │ ├── prompt_compact.rs │ │ │ ├── prompt_position.rs │ │ │ ├── prompt_run_length_encoding.rs │ │ │ ├── prompt_shape_transform.rs │ │ │ ├── random_image.rs │ │ │ ├── read_testdata.rs │ │ │ ├── readme.md │ │ │ ├── rectangle.rs │ │ │ ├── register_arc_functions.rs │ │ │ ├── reverse_color_popularity.rs │ │ │ ├── run_with_program.rs │ │ │ ├── shape3x3.rs │ │ │ ├── shape_identification.rs │ │ │ ├── shape_identification_from_single_color_object.rs │ │ │ ├── single_color_object.rs │ │ │ ├── single_color_object_satisfies_label.rs │ │ │ ├── single_color_object_to_label.rs │ │ │ ├── solve_logisticregression.rs │ │ │ ├── solve_one_color.rs │ │ │ ├── solve_split.rs │ │ │ ├── split.rs │ │ │ ├── split_to_label.rs │ │ │ ├── stack_strings.rs │ │ │ ├── subcommand_arc_metadata.rs │ │ │ ├── subcommand_arc_size.rs │ │ │ ├── subcommand_arc_web.rs │ │ │ ├── substitution_rule.rs │ │ │ ├── symmetry.rs │ │ │ ├── symmetry_to_label.rs │ │ │ ├── task_graph.rs │ │ │ ├── test_convert.rs │ │ │ ├── testdata │ │ │ │ ├── 007bbfb7.json │ │ │ │ ├── 00d62c1b.json │ │ │ │ ├── 017c7c7b.json │ │ │ │ ├── 0520fde7.json │ │ │ │ ├── 0692e18c.json │ │ │ │ ├── 0b148d64.json │ │ │ │ ├── 0dfd9992.json │ │ │ │ ├── 1190e5a7.json │ │ │ │ ├── 1c0d0a4b.json │ │ │ │ ├── 1d0a4b61.json │ │ │ │ ├── 1e0a9b12.json │ │ │ │ ├── 1f85a75f.json │ │ │ │ ├── 1f876c06.json │ │ │ │ ├── 2013d3e2.json │ │ │ │ ├── 21f83797.json │ │ │ │ ├── 2281f1f4.json │ │ │ │ ├── 23581191.json │ │ │ │ ├── 25d8a9c8.json │ │ │ │ ├── 27f8ce4f.json │ │ │ │ ├── 281123b4.json │ │ │ │ ├── 29ec7d0e.json │ │ │ │ ├── 2c608aff.json │ │ │ │ ├── 31aa019c.json │ │ │ │ ├── 3428a4f5.json │ │ │ │ ├── 3631a71a.json │ │ │ │ ├── 3906de3d.json │ │ │ │ ├── 39a8645d.json │ │ │ │ ├── 3af2c5a8.json │ │ │ │ ├── 3bdb4ada.json │ │ │ │ ├── 3d31c5b3.json │ │ │ │ ├── 4258a5f9.json │ │ │ │ ├── 44f52bb0.json │ │ │ │ ├── 45737921.json │ │ │ │ ├── 47996f11.json │ │ │ │ ├── 48131b3c.json │ │ │ │ ├── 496994bd.json │ │ │ │ ├── 49d1d64f.json │ │ │ │ ├── 50cb2852.json │ │ │ │ ├── 5521c0d9.json │ │ │ │ ├── 5614dbcf.json │ │ │ │ ├── 56ff96f3.json │ │ │ │ ├── 5ad4f10b.json │ │ │ │ ├── 5b6cbef5.json │ │ │ │ ├── 5c0a986e.json │ │ │ │ ├── 6150a2bd.json │ │ │ │ ├── 623ea044.json │ │ │ │ ├── 62ab2642.json │ │ │ │ ├── 63613498.json │ │ │ │ ├── 662c240a.json │ │ │ │ ├── 6773b310.json │ │ │ │ ├── 67b4a34d.json │ │ │ │ ├── 6a11f6da.json │ │ │ │ ├── 6a1e5592.json │ │ │ │ ├── 6b9890af.json │ │ │ │ ├── 6c434453.json │ │ │ │ ├── 6e82a1ae.json │ │ │ │ ├── 6f473927.json │ │ │ │ ├── 6f8cd79b.json │ │ │ │ ├── 72ca375d.json │ │ │ │ ├── 73ccf9c2.json │ │ │ │ ├── 7468f01a.json │ │ │ │ ├── 75b8110e.json │ │ │ │ ├── 780d0b14.json │ │ │ │ ├── 7bb29440.json │ │ │ │ ├── 7e0986d6.json │ │ │ │ ├── 7f4411dc.json │ │ │ │ ├── 7fe24cdd.json │ │ │ │ ├── 80af3007.json │ │ │ │ ├── 810b9b61.json │ │ │ │ ├── 84db8fc4.json │ │ │ │ ├── 8731374e.json │ │ │ │ ├── 88a62173.json │ │ │ │ ├── 8d5021e8.json │ │ │ │ ├── 8e2edd66.json │ │ │ │ ├── 90c28cc7.json │ │ │ │ ├── 929ab4e9.json │ │ │ │ ├── 94f9d214.json │ │ │ │ ├── 9565186b.json │ │ │ │ ├── 95990924.json │ │ │ │ ├── 95a58926.json │ │ │ │ ├── 96a8c0cd.json │ │ │ │ ├── 9ecd008a.json │ │ │ │ ├── ExtractObjects1.json │ │ │ │ ├── TopBottom2D6.json │ │ │ │ ├── TopBottom2D7.json │ │ │ │ ├── a59b95c0.json │ │ │ │ ├── a68b268e.json │ │ │ │ ├── a699fb00.json │ │ │ │ ├── a79310a0.json │ │ │ │ ├── aabf363d.json │ │ │ │ ├── ae3edfdc.json │ │ │ │ ├── af22c60d.json │ │ │ │ ├── af902bf9.json │ │ │ │ ├── arcathon_solution_format.json │ │ │ │ ├── b60334d2.json │ │ │ │ ├── b6afb2da.json │ │ │ │ ├── b8825c91.json │ │ │ │ ├── b9b7f026.json │ │ │ │ ├── ba26e723.json │ │ │ │ ├── bbc9ae5d.json │ │ │ │ ├── bc4146bd.json │ │ │ │ ├── be94b721.json │ │ │ │ ├── beb8660c.json │ │ │ │ ├── c1d99e64.json │ │ │ │ ├── c3202e5a.json │ │ │ │ ├── c444b776.json │ │ │ │ ├── c48954c1.json │ │ │ │ ├── ca8f78db.json │ │ │ │ ├── ccd554ac.json │ │ │ │ ├── cce03e0d.json │ │ │ │ ├── cd3c21df.json │ │ │ │ ├── cdecee7f.json │ │ │ │ ├── cf98881b.json │ │ │ │ ├── d037b0a7.json │ │ │ │ ├── d2abd087.json │ │ │ │ ├── d364b489.json │ │ │ │ ├── d406998b.json │ │ │ │ ├── d5d6de2d.json │ │ │ │ ├── d631b094.json │ │ │ │ ├── d687bc17.json │ │ │ │ ├── dbc1a6ce.json │ │ │ │ ├── dc0a314f.json │ │ │ │ ├── de493100.json │ │ │ │ ├── ded97339.json │ │ │ │ ├── e0fb7511.json │ │ │ │ ├── e7639916.json │ │ │ │ ├── e95e3d8e.json │ │ │ │ ├── e98196ab.json │ │ │ │ ├── e99362f0.json │ │ │ │ ├── e9afcf9a.json │ │ │ │ ├── ea32f347.json │ │ │ │ ├── ea959feb.json │ │ │ │ ├── ea9794b1.json │ │ │ │ ├── f2829549.json │ │ │ │ ├── f5b8619d.json │ │ │ │ ├── f8b3ba0a.json │ │ │ │ ├── f8ff0b80.json │ │ │ │ ├── f9012d9b.json │ │ │ │ ├── ff805c23.json │ │ │ │ └── solution_notXORdinary.json │ │ │ ├── time_util.rs │ │ │ ├── trace_path.rs │ │ │ ├── traverse_programs_and_models.rs │ │ │ └── verify_prediction.rs │ │ ├── common │ │ │ ├── create_csv_file.rs │ │ │ ├── find_files_recursively.rs │ │ │ ├── mine_event_directory_scan.rs │ │ │ ├── mod.rs │ │ │ ├── oeis_id_string_map.rs │ │ │ ├── oeis_ids_from_paths.rs │ │ │ ├── oeis_ids_from_programs.rs │ │ │ ├── oeis_ids_sorted.rs │ │ │ ├── parse_csv_data.rs │ │ │ ├── parse_csv_file.rs │ │ │ ├── pending_programs_with_priority.rs │ │ │ ├── record_bigram.rs │ │ │ ├── record_program_id.rs │ │ │ ├── record_skipgram.rs │ │ │ ├── record_trigram.rs │ │ │ ├── record_unigram.rs │ │ │ └── simple_log.rs │ │ ├── config │ │ │ ├── config.rs │ │ │ ├── default_config.toml │ │ │ ├── mod.rs │ │ │ ├── number_of_workers.rs │ │ │ └── validate_config.rs │ │ ├── lodacpp │ │ │ ├── lodacpp.rs │ │ │ ├── lodacpp_check.rs │ │ │ ├── lodacpp_check_execute.rs │ │ │ ├── lodacpp_error.rs │ │ │ ├── lodacpp_eval_steps.rs │ │ │ ├── lodacpp_eval_steps_execute.rs │ │ │ ├── lodacpp_eval_terms.rs │ │ │ ├── lodacpp_eval_terms_execute.rs │ │ │ ├── lodacpp_minimize.rs │ │ │ └── mod.rs │ │ ├── main.rs │ │ ├── mine │ │ │ ├── analytics_worker.rs │ │ │ ├── check_fixed_length_sequence.rs │ │ │ ├── coordinator_worker.rs │ │ │ ├── create_funnel.rs │ │ │ ├── create_genome_mutate_context.rs │ │ │ ├── create_prevent_flooding.rs │ │ │ ├── cronjob_worker.rs │ │ │ ├── funnel.rs │ │ │ ├── funnel_config.rs │ │ │ ├── genome.rs │ │ │ ├── genome_item.rs │ │ │ ├── genome_mutate_context.rs │ │ │ ├── histogram_instruction_constant.rs │ │ │ ├── metrics.rs │ │ │ ├── metrics_prometheus.rs │ │ │ ├── metrics_run_miner_loop.rs │ │ │ ├── metrics_worker.rs │ │ │ ├── mine_event_directory_state.rs │ │ │ ├── miner_sync_execute.rs │ │ │ ├── miner_worker.rs │ │ │ ├── mod.rs │ │ │ ├── moving_average.rs │ │ │ ├── performance_classifier.rs │ │ │ ├── popular_program_container.rs │ │ │ ├── postmine_worker.rs │ │ │ ├── prevent_flooding.rs │ │ │ ├── random_indexes_with_distance.rs │ │ │ ├── recent_program_container.rs │ │ │ ├── run_miner_loop.rs │ │ │ ├── save_candidate_program.rs │ │ │ ├── suggest_instruction.rs │ │ │ ├── suggest_line.rs │ │ │ ├── suggest_source.rs │ │ │ ├── suggest_target.rs │ │ │ ├── term_computer.rs │ │ │ ├── upload_worker.rs │ │ │ └── wildcard_checker.rs │ │ ├── oeis │ │ │ ├── mod.rs │ │ │ ├── name_row.rs │ │ │ ├── process_names_file.rs │ │ │ ├── process_stripped_file.rs │ │ │ ├── stripped_row.rs │ │ │ └── terms_to_program_id.rs │ │ ├── pattern │ │ │ ├── cluster_programs.rs │ │ │ ├── instruction_diff_between_constants.rs │ │ │ ├── measure_similarity.rs │ │ │ ├── mod.rs │ │ │ └── parse_csv_similar.rs │ │ ├── postmine │ │ │ ├── batch_lookup_names.rs │ │ │ ├── batch_lookup_terms.rs │ │ │ ├── candidate_program.rs │ │ │ ├── compare_two_programs.rs │ │ │ ├── filter_asm_files.rs │ │ │ ├── find_postmine_directories.rs │ │ │ ├── format_program.rs │ │ │ ├── git_absolute_paths_for_unstaged_files.rs │ │ │ ├── mine_event_directory_maintenance.rs │ │ │ ├── mod.rs │ │ │ ├── parent_dir_and_child_file.rs │ │ │ ├── path_for_oeis_program.rs │ │ │ ├── path_util.rs │ │ │ ├── postmine.rs │ │ │ ├── postmine_directory_maintenance.rs │ │ │ ├── postmine_error.rs │ │ │ ├── program_serializer_context_with_sequence_name.rs │ │ │ ├── terms_from_programs.rs │ │ │ └── validate_single_program.rs │ │ ├── similar │ │ │ ├── mod.rs │ │ │ ├── readme.md │ │ │ ├── similar.rs │ │ │ ├── word.rs │ │ │ ├── wordpair.rs │ │ │ └── words_from_program.rs │ │ ├── subcommand_analytics.rs │ │ ├── subcommand_arc.rs │ │ ├── subcommand_dependencies.rs │ │ ├── subcommand_evaluate.rs │ │ ├── subcommand_export_dataset.rs │ │ ├── subcommand_install.rs │ │ ├── subcommand_mine.rs │ │ ├── subcommand_pattern.rs │ │ ├── subcommand_similar.rs │ │ └── subcommand_test.rs │ └── web │ │ ├── static │ │ ├── arc_color.css │ │ ├── json_data_image.js │ │ ├── page_graph.css │ │ ├── page_graph.js │ │ ├── page_inspect_task.css │ │ ├── page_reply.css │ │ └── page_shared.css │ │ └── templates │ │ └── arc │ │ ├── info_edge.html │ │ ├── info_pixel.html │ │ ├── inspect_pixel.html │ │ ├── page_inspect_task.html │ │ ├── page_node_nonpixel.html │ │ ├── page_node_pixel.html │ │ ├── page_prompt.html │ │ ├── page_reply.html │ │ ├── page_task_list.html │ │ ├── wrap_edge.html │ │ └── wrap_pixel.html ├── loda-rust-core │ ├── .gitignore │ ├── Cargo.toml │ ├── src │ │ ├── control │ │ │ ├── dependency_manager.rs │ │ │ ├── execute_profile.rs │ │ │ └── mod.rs │ │ ├── execute │ │ │ ├── check_value.rs │ │ │ ├── compiletime_error.rs │ │ │ ├── eval_error.rs │ │ │ ├── mod.rs │ │ │ ├── node.rs │ │ │ ├── node_calc.rs │ │ │ ├── node_loop_constant.rs │ │ │ ├── node_loop_register.rs │ │ │ ├── node_loop_shared.rs │ │ │ ├── node_loop_simple.rs │ │ │ ├── node_loop_slow.rs │ │ │ ├── node_register_limit.rs │ │ │ ├── node_seq.rs │ │ │ ├── node_unofficial_function.rs │ │ │ ├── node_unofficial_loop_subtract.rs │ │ │ ├── program.rs │ │ │ ├── program_cache.rs │ │ │ ├── program_id.rs │ │ │ ├── program_runner.rs │ │ │ ├── program_runner_manager.rs │ │ │ ├── program_serializer.rs │ │ │ ├── program_serializer_context.rs │ │ │ ├── program_state.rs │ │ │ ├── register_index.rs │ │ │ ├── register_index_and_type.rs │ │ │ ├── register_type.rs │ │ │ ├── register_value.rs │ │ │ ├── run_mode.rs │ │ │ ├── semantic_binomial.rs │ │ │ ├── semantic_power.rs │ │ │ ├── semantic_simple.rs │ │ │ ├── semantics.rs │ │ │ └── test_program.rs │ │ ├── lib.rs │ │ ├── oeis │ │ │ ├── mod.rs │ │ │ └── oeis_id.rs │ │ ├── parser │ │ │ ├── create_program.rs │ │ │ ├── extract_offset.rs │ │ │ ├── extract_parameter_re.rs │ │ │ ├── extract_row_re.rs │ │ │ ├── instruction.rs │ │ │ ├── instruction_id.rs │ │ │ ├── instruction_parameter.rs │ │ │ ├── mod.rs │ │ │ ├── parameter_type.rs │ │ │ ├── parse_error.rs │ │ │ ├── parse_instruction_id.rs │ │ │ ├── parse_parameters.rs │ │ │ ├── parse_program.rs │ │ │ ├── remove_comment.rs │ │ │ ├── test_parse.rs │ │ │ └── validate_loops.rs │ │ ├── unofficial_function │ │ │ ├── assert.rs │ │ │ ├── debug.rs │ │ │ ├── mod.rs │ │ │ ├── product.rs │ │ │ ├── register_common_functions.rs │ │ │ ├── sort.rs │ │ │ ├── sum.rs │ │ │ ├── test_common_functions.rs │ │ │ ├── test_util.rs │ │ │ ├── unofficial_function.rs │ │ │ ├── unofficial_function_id.rs │ │ │ └── unofficial_function_registry.rs │ │ └── util │ │ │ ├── bigintvec.rs │ │ │ └── mod.rs │ └── tests │ │ ├── instruction_lpb_with_parametertype_indirect1 │ │ └── 000 │ │ │ └── A000001.asm │ │ ├── instruction_lpb_with_parametertype_indirect2 │ │ └── 000 │ │ │ └── A000001.asm │ │ ├── instruction_lpb_with_range_direct │ │ └── 000 │ │ │ └── A000001.asm │ │ ├── instruction_seq_detect_cycle1 │ │ └── 000 │ │ │ └── A000666.asm │ │ ├── instruction_seq_detect_cycle2 │ │ └── 000 │ │ │ ├── A000666.asm │ │ │ └── A000667.asm │ │ ├── instruction_seq_detect_cycle3 │ │ └── 000 │ │ │ ├── A000666.asm │ │ │ ├── A000667.asm │ │ │ └── A000668.asm │ │ ├── instruction_seq_detect_missing1 │ │ └── 000 │ │ │ ├── A000666.asm │ │ │ └── A000667.asm │ │ ├── instruction_seq_with_negative_parameter1 │ │ └── 000 │ │ │ ├── A000027.asm │ │ │ └── A000666.asm │ │ ├── instruction_seq_with_negative_parameter2 │ │ └── 000 │ │ │ ├── A000027.asm │ │ │ └── A000666.asm │ │ ├── instruction_seq_with_parametertype_indirect │ │ └── 000 │ │ │ ├── A000001.asm │ │ │ └── A000027.asm │ │ ├── load_simple1 │ │ └── 000 │ │ │ └── A000079.asm │ │ ├── load_simple2 │ │ └── 000 │ │ │ ├── A000001.asm │ │ │ └── A000079.asm │ │ ├── load_simple3 │ │ └── 000 │ │ │ └── A000120.asm │ │ ├── offset │ │ ├── 183 │ │ │ └── A183634.asm │ │ ├── 223 │ │ │ └── A223069.asm │ │ ├── 000 │ │ │ ├── A000203.asm │ │ │ └── A000247.asm │ │ └── 009 │ │ │ └── A009194.asm │ │ ├── parametertype_indirect1 │ │ └── 015 │ │ │ └── A015736.asm │ │ ├── parametertype_indirect2 │ │ ├── 002 │ │ │ └── A002212.asm │ │ └── 025 │ │ │ └── A025238.asm │ │ ├── parametertype_indirect3 │ │ ├── 159 │ │ │ └── A159631.asm │ │ └── 071 │ │ │ └── A071325.asm │ │ ├── parametertype_indirect4 │ │ └── 000 │ │ │ ├── A000041.asm │ │ │ └── A000203.asm │ │ ├── parametertype_indirect5 │ │ └── 355 │ │ │ └── A355497.asm │ │ ├── parametertype_indirect6 │ │ ├── 344 │ │ │ └── A344348.asm │ │ └── 022 │ │ │ └── A022843.asm │ │ └── parametertype_indirect7 │ │ └── 103 │ │ └── A103627.asm ├── loda-rust-web │ ├── .gitignore │ ├── Cargo.toml │ ├── build.sh │ ├── index.html │ ├── index.js │ ├── src │ │ └── lib.rs │ ├── web │ │ ├── chart-js │ │ │ ├── chart.min.js │ │ │ └── readme.md │ │ ├── codemirror │ │ │ ├── .editorconfig │ │ │ ├── .gitattributes │ │ │ ├── .npmignore │ │ │ ├── AUTHORS │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── addon │ │ │ │ ├── comment │ │ │ │ │ ├── comment.js │ │ │ │ │ └── continuecomment.js │ │ │ │ ├── dialog │ │ │ │ │ ├── dialog.css │ │ │ │ │ └── dialog.js │ │ │ │ ├── display │ │ │ │ │ ├── autorefresh.js │ │ │ │ │ ├── fullscreen.css │ │ │ │ │ ├── fullscreen.js │ │ │ │ │ ├── panel.js │ │ │ │ │ ├── placeholder.js │ │ │ │ │ └── rulers.js │ │ │ │ ├── edit │ │ │ │ │ ├── closebrackets.js │ │ │ │ │ ├── closetag.js │ │ │ │ │ ├── continuelist.js │ │ │ │ │ ├── matchbrackets.js │ │ │ │ │ ├── matchtags.js │ │ │ │ │ └── trailingspace.js │ │ │ │ ├── fold │ │ │ │ │ ├── brace-fold.js │ │ │ │ │ ├── comment-fold.js │ │ │ │ │ ├── foldcode.js │ │ │ │ │ ├── foldgutter.css │ │ │ │ │ ├── foldgutter.js │ │ │ │ │ ├── indent-fold.js │ │ │ │ │ ├── markdown-fold.js │ │ │ │ │ └── xml-fold.js │ │ │ │ ├── hint │ │ │ │ │ ├── anyword-hint.js │ │ │ │ │ ├── css-hint.js │ │ │ │ │ ├── html-hint.js │ │ │ │ │ ├── javascript-hint.js │ │ │ │ │ ├── show-hint.css │ │ │ │ │ ├── show-hint.js │ │ │ │ │ ├── sql-hint.js │ │ │ │ │ └── xml-hint.js │ │ │ │ ├── lint │ │ │ │ │ ├── coffeescript-lint.js │ │ │ │ │ ├── css-lint.js │ │ │ │ │ ├── html-lint.js │ │ │ │ │ ├── javascript-lint.js │ │ │ │ │ ├── json-lint.js │ │ │ │ │ ├── lint.css │ │ │ │ │ ├── lint.js │ │ │ │ │ └── yaml-lint.js │ │ │ │ ├── merge │ │ │ │ │ ├── merge.css │ │ │ │ │ └── merge.js │ │ │ │ ├── mode │ │ │ │ │ ├── loadmode.js │ │ │ │ │ ├── multiplex.js │ │ │ │ │ ├── multiplex_test.js │ │ │ │ │ ├── overlay.js │ │ │ │ │ └── simple.js │ │ │ │ ├── runmode │ │ │ │ │ ├── colorize.js │ │ │ │ │ ├── runmode-standalone.js │ │ │ │ │ ├── runmode.js │ │ │ │ │ └── runmode.node.js │ │ │ │ ├── scroll │ │ │ │ │ ├── annotatescrollbar.js │ │ │ │ │ ├── scrollpastend.js │ │ │ │ │ ├── simplescrollbars.css │ │ │ │ │ └── simplescrollbars.js │ │ │ │ ├── search │ │ │ │ │ ├── jump-to-line.js │ │ │ │ │ ├── match-highlighter.js │ │ │ │ │ ├── matchesonscrollbar.css │ │ │ │ │ ├── matchesonscrollbar.js │ │ │ │ │ ├── search.js │ │ │ │ │ └── searchcursor.js │ │ │ │ ├── selection │ │ │ │ │ ├── active-line.js │ │ │ │ │ ├── mark-selection.js │ │ │ │ │ └── selection-pointer.js │ │ │ │ ├── tern │ │ │ │ │ ├── tern.css │ │ │ │ │ ├── tern.js │ │ │ │ │ └── worker.js │ │ │ │ └── wrap │ │ │ │ │ └── hardwrap.js │ │ │ ├── bin │ │ │ │ ├── authors.sh │ │ │ │ ├── lint │ │ │ │ ├── release │ │ │ │ ├── source-highlight │ │ │ │ └── upload-release.js │ │ │ ├── demo │ │ │ │ ├── activeline.html │ │ │ │ ├── anywordhint.html │ │ │ │ ├── bidi.html │ │ │ │ ├── btree.html │ │ │ │ ├── buffers.html │ │ │ │ ├── changemode.html │ │ │ │ ├── closebrackets.html │ │ │ │ ├── closetag.html │ │ │ │ ├── complete.html │ │ │ │ ├── emacs.html │ │ │ │ ├── folding.html │ │ │ │ ├── fullscreen.html │ │ │ │ ├── hardwrap.html │ │ │ │ ├── html5complete.html │ │ │ │ ├── indentwrap.html │ │ │ │ ├── lint.html │ │ │ │ ├── loadmode.html │ │ │ │ ├── marker.html │ │ │ │ ├── markselection.html │ │ │ │ ├── matchhighlighter.html │ │ │ │ ├── matchtags.html │ │ │ │ ├── merge.html │ │ │ │ ├── multiplex.html │ │ │ │ ├── mustache.html │ │ │ │ ├── panel.html │ │ │ │ ├── placeholder.html │ │ │ │ ├── preview.html │ │ │ │ ├── requirejs.html │ │ │ │ ├── resize.html │ │ │ │ ├── rulers.html │ │ │ │ ├── runmode-standalone.html │ │ │ │ ├── runmode.html │ │ │ │ ├── search.html │ │ │ │ ├── simplemode.html │ │ │ │ ├── simplescrollbars.html │ │ │ │ ├── spanaffectswrapping_shim.html │ │ │ │ ├── sublime.html │ │ │ │ ├── tern.html │ │ │ │ ├── theme.html │ │ │ │ ├── trailingspace.html │ │ │ │ ├── variableheight.html │ │ │ │ ├── vim.html │ │ │ │ ├── visibletabs.html │ │ │ │ ├── widget.html │ │ │ │ └── xmlcomplete.html │ │ │ ├── doc │ │ │ │ ├── activebookmark.js │ │ │ │ ├── docs.css │ │ │ │ ├── internals.html │ │ │ │ ├── logo.png │ │ │ │ ├── logo.svg │ │ │ │ ├── manual.html │ │ │ │ ├── realworld.html │ │ │ │ ├── releases.html │ │ │ │ ├── reporting.html │ │ │ │ ├── upgrade_v2.2.html │ │ │ │ ├── upgrade_v3.html │ │ │ │ ├── upgrade_v4.html │ │ │ │ └── yinyang.png │ │ │ ├── index.html │ │ │ ├── keymap │ │ │ │ ├── emacs.js │ │ │ │ ├── sublime.js │ │ │ │ └── vim.js │ │ │ ├── lib │ │ │ │ ├── codemirror.css │ │ │ │ └── codemirror.js │ │ │ ├── mode │ │ │ │ ├── apl │ │ │ │ │ ├── apl.js │ │ │ │ │ └── index.html │ │ │ │ ├── asciiarmor │ │ │ │ │ ├── asciiarmor.js │ │ │ │ │ └── index.html │ │ │ │ ├── asn.1 │ │ │ │ │ ├── asn.1.js │ │ │ │ │ └── index.html │ │ │ │ ├── asterisk │ │ │ │ │ ├── asterisk.js │ │ │ │ │ └── index.html │ │ │ │ ├── brainfuck │ │ │ │ │ ├── brainfuck.js │ │ │ │ │ └── index.html │ │ │ │ ├── clike │ │ │ │ │ ├── clike.js │ │ │ │ │ ├── index.html │ │ │ │ │ ├── scala.html │ │ │ │ │ └── test.js │ │ │ │ ├── clojure │ │ │ │ │ ├── clojure.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── test.js │ │ │ │ ├── cmake │ │ │ │ │ ├── cmake.js │ │ │ │ │ └── index.html │ │ │ │ ├── cobol │ │ │ │ │ ├── cobol.js │ │ │ │ │ └── index.html │ │ │ │ ├── coffeescript │ │ │ │ │ ├── coffeescript.js │ │ │ │ │ └── index.html │ │ │ │ ├── commonlisp │ │ │ │ │ ├── commonlisp.js │ │ │ │ │ └── index.html │ │ │ │ ├── crystal │ │ │ │ │ ├── crystal.js │ │ │ │ │ └── index.html │ │ │ │ ├── css │ │ │ │ │ ├── css.js │ │ │ │ │ ├── gss.html │ │ │ │ │ ├── gss_test.js │ │ │ │ │ ├── index.html │ │ │ │ │ ├── less.html │ │ │ │ │ ├── less_test.js │ │ │ │ │ ├── scss.html │ │ │ │ │ ├── scss_test.js │ │ │ │ │ └── test.js │ │ │ │ ├── cypher │ │ │ │ │ ├── cypher.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── test.js │ │ │ │ ├── d │ │ │ │ │ ├── d.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── test.js │ │ │ │ ├── dart │ │ │ │ │ ├── dart.js │ │ │ │ │ └── index.html │ │ │ │ ├── diff │ │ │ │ │ ├── diff.js │ │ │ │ │ └── index.html │ │ │ │ ├── django │ │ │ │ │ ├── django.js │ │ │ │ │ └── index.html │ │ │ │ ├── dockerfile │ │ │ │ │ ├── dockerfile.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── test.js │ │ │ │ ├── dtd │ │ │ │ │ ├── dtd.js │ │ │ │ │ └── index.html │ │ │ │ ├── dylan │ │ │ │ │ ├── dylan.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── test.js │ │ │ │ ├── ebnf │ │ │ │ │ ├── ebnf.js │ │ │ │ │ └── index.html │ │ │ │ ├── ecl │ │ │ │ │ ├── ecl.js │ │ │ │ │ └── index.html │ │ │ │ ├── eiffel │ │ │ │ │ ├── eiffel.js │ │ │ │ │ └── index.html │ │ │ │ ├── elm │ │ │ │ │ ├── elm.js │ │ │ │ │ └── index.html │ │ │ │ ├── erlang │ │ │ │ │ ├── erlang.js │ │ │ │ │ └── index.html │ │ │ │ ├── factor │ │ │ │ │ ├── factor.js │ │ │ │ │ └── index.html │ │ │ │ ├── fcl │ │ │ │ │ ├── fcl.js │ │ │ │ │ └── index.html │ │ │ │ ├── forth │ │ │ │ │ ├── forth.js │ │ │ │ │ └── index.html │ │ │ │ ├── fortran │ │ │ │ │ ├── fortran.js │ │ │ │ │ └── index.html │ │ │ │ ├── gas │ │ │ │ │ ├── gas.js │ │ │ │ │ └── index.html │ │ │ │ ├── gfm │ │ │ │ │ ├── gfm.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── test.js │ │ │ │ ├── gherkin │ │ │ │ │ ├── gherkin.js │ │ │ │ │ └── index.html │ │ │ │ ├── go │ │ │ │ │ ├── go.js │ │ │ │ │ └── index.html │ │ │ │ ├── groovy │ │ │ │ │ ├── groovy.js │ │ │ │ │ └── index.html │ │ │ │ ├── haml │ │ │ │ │ ├── haml.js │ │ │ │ │ ├── index.html │ │ │ │ │ └── test.js │ │ │ │ ├── handlebars │ │ │ │ │ ├── handlebars.js │ │ │ │ │ └── index.html │ │ │ │ ├── haskell-literate │ │ │ │ │ ├── haskell-literate.js │ │ │ │ │ └── index.html │ │ │ │ ├── haskell │ │ │ │ │ ├── haskell.js │ │ │ │ │ └── index.html │ │ │ │ ├── haxe │ │ │ │ │ ├── haxe.js │ │ │ │ │ └── index.html │ │ │ │ ├── htmlembedded │ │ │ │ │ ├── htmlembedded.js │ │ │ │ │ └── index.html │ │ │ │ ├── htmlmixed │ │ │ │ │ ├── htmlmixed.js │ │ │ │ │ └── index.html │ │ │ │ ├── http │ │ │ │ │ ├── http.js │ │ │ │ │ └── index.html │ │ │ │ ├── idl │ │ │ │ │ ├── idl.js │ │ │ │ │ └── index.html │ │ │ │ ├── index.html │ │ │ │ ├── javascript │ │ │ │ │ ├── index.html │ │ │ │ │ ├── javascript.js │ │ │ │ │ ├── json-ld.html │ │ │ │ │ ├── test.js │ │ │ │ │ └── typescript.html │ │ │ │ ├── jinja2 │ │ │ │ │ ├── index.html │ │ │ │ │ └── jinja2.js │ │ │ │ ├── jsx │ │ │ │ │ ├── index.html │ │ │ │ │ ├── jsx.js │ │ │ │ │ └── test.js │ │ │ │ ├── julia │ │ │ │ │ ├── index.html │ │ │ │ │ └── julia.js │ │ │ │ ├── livescript │ │ │ │ │ ├── index.html │ │ │ │ │ └── livescript.js │ │ │ │ ├── lua │ │ │ │ │ ├── index.html │ │ │ │ │ └── lua.js │ │ │ │ ├── markdown │ │ │ │ │ ├── index.html │ │ │ │ │ ├── markdown.js │ │ │ │ │ └── test.js │ │ │ │ ├── mathematica │ │ │ │ │ ├── index.html │ │ │ │ │ └── mathematica.js │ │ │ │ ├── mbox │ │ │ │ │ ├── index.html │ │ │ │ │ └── mbox.js │ │ │ │ ├── meta.js │ │ │ │ ├── mirc │ │ │ │ │ ├── index.html │ │ │ │ │ └── mirc.js │ │ │ │ ├── mllike │ │ │ │ │ ├── index.html │ │ │ │ │ └── mllike.js │ │ │ │ ├── modelica │ │ │ │ │ ├── index.html │ │ │ │ │ └── modelica.js │ │ │ │ ├── mscgen │ │ │ │ │ ├── index.html │ │ │ │ │ ├── mscgen.js │ │ │ │ │ ├── mscgen_test.js │ │ │ │ │ ├── msgenny_test.js │ │ │ │ │ └── xu_test.js │ │ │ │ ├── mumps │ │ │ │ │ ├── index.html │ │ │ │ │ └── mumps.js │ │ │ │ ├── nginx │ │ │ │ │ ├── index.html │ │ │ │ │ └── nginx.js │ │ │ │ ├── nsis │ │ │ │ │ ├── index.html │ │ │ │ │ └── nsis.js │ │ │ │ ├── ntriples │ │ │ │ │ ├── index.html │ │ │ │ │ └── ntriples.js │ │ │ │ ├── octave │ │ │ │ │ ├── index.html │ │ │ │ │ └── octave.js │ │ │ │ ├── oz │ │ │ │ │ ├── index.html │ │ │ │ │ └── oz.js │ │ │ │ ├── pascal │ │ │ │ │ ├── index.html │ │ │ │ │ └── pascal.js │ │ │ │ ├── pegjs │ │ │ │ │ ├── index.html │ │ │ │ │ └── pegjs.js │ │ │ │ ├── perl │ │ │ │ │ ├── index.html │ │ │ │ │ └── perl.js │ │ │ │ ├── php │ │ │ │ │ ├── index.html │ │ │ │ │ ├── php.js │ │ │ │ │ └── test.js │ │ │ │ ├── pig │ │ │ │ │ ├── index.html │ │ │ │ │ └── pig.js │ │ │ │ ├── powershell │ │ │ │ │ ├── index.html │ │ │ │ │ ├── powershell.js │ │ │ │ │ └── test.js │ │ │ │ ├── properties │ │ │ │ │ ├── index.html │ │ │ │ │ └── properties.js │ │ │ │ ├── protobuf │ │ │ │ │ ├── index.html │ │ │ │ │ └── protobuf.js │ │ │ │ ├── pug │ │ │ │ │ ├── index.html │ │ │ │ │ └── pug.js │ │ │ │ ├── puppet │ │ │ │ │ ├── index.html │ │ │ │ │ └── puppet.js │ │ │ │ ├── python │ │ │ │ │ ├── index.html │ │ │ │ │ ├── python.js │ │ │ │ │ └── test.js │ │ │ │ ├── q │ │ │ │ │ ├── index.html │ │ │ │ │ └── q.js │ │ │ │ ├── r │ │ │ │ │ ├── index.html │ │ │ │ │ └── r.js │ │ │ │ ├── rpm │ │ │ │ │ ├── changes │ │ │ │ │ │ └── index.html │ │ │ │ │ ├── index.html │ │ │ │ │ └── rpm.js │ │ │ │ ├── rst │ │ │ │ │ ├── index.html │ │ │ │ │ └── rst.js │ │ │ │ ├── ruby │ │ │ │ │ ├── index.html │ │ │ │ │ ├── ruby.js │ │ │ │ │ └── test.js │ │ │ │ ├── rust │ │ │ │ │ ├── index.html │ │ │ │ │ ├── rust.js │ │ │ │ │ └── test.js │ │ │ │ ├── sas │ │ │ │ │ ├── index.html │ │ │ │ │ └── sas.js │ │ │ │ ├── sass │ │ │ │ │ ├── index.html │ │ │ │ │ ├── sass.js │ │ │ │ │ └── test.js │ │ │ │ ├── scheme │ │ │ │ │ ├── index.html │ │ │ │ │ └── scheme.js │ │ │ │ ├── shell │ │ │ │ │ ├── index.html │ │ │ │ │ ├── shell.js │ │ │ │ │ └── test.js │ │ │ │ ├── sieve │ │ │ │ │ ├── index.html │ │ │ │ │ └── sieve.js │ │ │ │ ├── slim │ │ │ │ │ ├── index.html │ │ │ │ │ ├── slim.js │ │ │ │ │ └── test.js │ │ │ │ ├── smalltalk │ │ │ │ │ ├── index.html │ │ │ │ │ └── smalltalk.js │ │ │ │ ├── smarty │ │ │ │ │ ├── index.html │ │ │ │ │ └── smarty.js │ │ │ │ ├── solr │ │ │ │ │ ├── index.html │ │ │ │ │ └── solr.js │ │ │ │ ├── soy │ │ │ │ │ ├── index.html │ │ │ │ │ ├── soy.js │ │ │ │ │ └── test.js │ │ │ │ ├── sparql │ │ │ │ │ ├── index.html │ │ │ │ │ └── sparql.js │ │ │ │ ├── spreadsheet │ │ │ │ │ ├── index.html │ │ │ │ │ └── spreadsheet.js │ │ │ │ ├── sql │ │ │ │ │ ├── index.html │ │ │ │ │ └── sql.js │ │ │ │ ├── stex │ │ │ │ │ ├── index.html │ │ │ │ │ ├── stex.js │ │ │ │ │ └── test.js │ │ │ │ ├── stylus │ │ │ │ │ ├── index.html │ │ │ │ │ └── stylus.js │ │ │ │ ├── swift │ │ │ │ │ ├── index.html │ │ │ │ │ ├── swift.js │ │ │ │ │ └── test.js │ │ │ │ ├── tcl │ │ │ │ │ ├── index.html │ │ │ │ │ └── tcl.js │ │ │ │ ├── textile │ │ │ │ │ ├── index.html │ │ │ │ │ ├── test.js │ │ │ │ │ └── textile.js │ │ │ │ ├── tiddlywiki │ │ │ │ │ ├── index.html │ │ │ │ │ ├── tiddlywiki.css │ │ │ │ │ └── tiddlywiki.js │ │ │ │ ├── tiki │ │ │ │ │ ├── index.html │ │ │ │ │ ├── tiki.css │ │ │ │ │ └── tiki.js │ │ │ │ ├── toml │ │ │ │ │ ├── index.html │ │ │ │ │ └── toml.js │ │ │ │ ├── tornado │ │ │ │ │ ├── index.html │ │ │ │ │ └── tornado.js │ │ │ │ ├── troff │ │ │ │ │ ├── index.html │ │ │ │ │ └── troff.js │ │ │ │ ├── ttcn-cfg │ │ │ │ │ ├── index.html │ │ │ │ │ └── ttcn-cfg.js │ │ │ │ ├── ttcn │ │ │ │ │ ├── index.html │ │ │ │ │ └── ttcn.js │ │ │ │ ├── turtle │ │ │ │ │ ├── index.html │ │ │ │ │ └── turtle.js │ │ │ │ ├── twig │ │ │ │ │ ├── index.html │ │ │ │ │ └── twig.js │ │ │ │ ├── vb │ │ │ │ │ ├── index.html │ │ │ │ │ └── vb.js │ │ │ │ ├── vbscript │ │ │ │ │ ├── index.html │ │ │ │ │ └── vbscript.js │ │ │ │ ├── velocity │ │ │ │ │ ├── index.html │ │ │ │ │ └── velocity.js │ │ │ │ ├── verilog │ │ │ │ │ ├── index.html │ │ │ │ │ ├── test.js │ │ │ │ │ └── verilog.js │ │ │ │ ├── vhdl │ │ │ │ │ ├── index.html │ │ │ │ │ └── vhdl.js │ │ │ │ ├── vue │ │ │ │ │ ├── index.html │ │ │ │ │ └── vue.js │ │ │ │ ├── wast │ │ │ │ │ ├── index.html │ │ │ │ │ ├── test.js │ │ │ │ │ └── wast.js │ │ │ │ ├── webidl │ │ │ │ │ ├── index.html │ │ │ │ │ └── webidl.js │ │ │ │ ├── xml │ │ │ │ │ ├── index.html │ │ │ │ │ ├── test.js │ │ │ │ │ └── xml.js │ │ │ │ ├── xquery │ │ │ │ │ ├── index.html │ │ │ │ │ ├── test.js │ │ │ │ │ └── xquery.js │ │ │ │ ├── yacas │ │ │ │ │ ├── index.html │ │ │ │ │ └── yacas.js │ │ │ │ ├── yaml-frontmatter │ │ │ │ │ ├── index.html │ │ │ │ │ └── yaml-frontmatter.js │ │ │ │ ├── yaml │ │ │ │ │ ├── index.html │ │ │ │ │ └── yaml.js │ │ │ │ └── z80 │ │ │ │ │ ├── index.html │ │ │ │ │ └── z80.js │ │ │ ├── package.json │ │ │ ├── rollup.config.js │ │ │ ├── src │ │ │ │ ├── addon │ │ │ │ │ └── runmode │ │ │ │ │ │ ├── codemirror-standalone.js │ │ │ │ │ │ ├── codemirror.node.js │ │ │ │ │ │ ├── runmode-standalone.js │ │ │ │ │ │ └── runmode.node.js │ │ │ │ ├── codemirror.js │ │ │ │ ├── display │ │ │ │ │ ├── Display.js │ │ │ │ │ ├── focus.js │ │ │ │ │ ├── gutters.js │ │ │ │ │ ├── highlight_worker.js │ │ │ │ │ ├── line_numbers.js │ │ │ │ │ ├── mode_state.js │ │ │ │ │ ├── operations.js │ │ │ │ │ ├── scroll_events.js │ │ │ │ │ ├── scrollbars.js │ │ │ │ │ ├── scrolling.js │ │ │ │ │ ├── selection.js │ │ │ │ │ ├── update_display.js │ │ │ │ │ ├── update_line.js │ │ │ │ │ ├── update_lines.js │ │ │ │ │ └── view_tracking.js │ │ │ │ ├── edit │ │ │ │ │ ├── CodeMirror.js │ │ │ │ │ ├── commands.js │ │ │ │ │ ├── deleteNearSelection.js │ │ │ │ │ ├── drop_events.js │ │ │ │ │ ├── fromTextArea.js │ │ │ │ │ ├── global_events.js │ │ │ │ │ ├── key_events.js │ │ │ │ │ ├── legacy.js │ │ │ │ │ ├── main.js │ │ │ │ │ ├── methods.js │ │ │ │ │ ├── mouse_events.js │ │ │ │ │ ├── options.js │ │ │ │ │ └── utils.js │ │ │ │ ├── input │ │ │ │ │ ├── ContentEditableInput.js │ │ │ │ │ ├── TextareaInput.js │ │ │ │ │ ├── indent.js │ │ │ │ │ ├── input.js │ │ │ │ │ ├── keymap.js │ │ │ │ │ ├── keynames.js │ │ │ │ │ └── movement.js │ │ │ │ ├── line │ │ │ │ │ ├── highlight.js │ │ │ │ │ ├── line_data.js │ │ │ │ │ ├── pos.js │ │ │ │ │ ├── saw_special_spans.js │ │ │ │ │ ├── spans.js │ │ │ │ │ └── utils_line.js │ │ │ │ ├── measurement │ │ │ │ │ ├── position_measurement.js │ │ │ │ │ └── widgets.js │ │ │ │ ├── model │ │ │ │ │ ├── Doc.js │ │ │ │ │ ├── change_measurement.js │ │ │ │ │ ├── changes.js │ │ │ │ │ ├── chunk.js │ │ │ │ │ ├── document_data.js │ │ │ │ │ ├── history.js │ │ │ │ │ ├── line_widget.js │ │ │ │ │ ├── mark_text.js │ │ │ │ │ ├── selection.js │ │ │ │ │ └── selection_updates.js │ │ │ │ ├── modes.js │ │ │ │ └── util │ │ │ │ │ ├── StringStream.js │ │ │ │ │ ├── bidi.js │ │ │ │ │ ├── browser.js │ │ │ │ │ ├── dom.js │ │ │ │ │ ├── event.js │ │ │ │ │ ├── feature_detection.js │ │ │ │ │ ├── misc.js │ │ │ │ │ └── operation_group.js │ │ │ ├── test │ │ │ │ ├── annotatescrollbar.js │ │ │ │ ├── comment_test.js │ │ │ │ ├── contenteditable_test.js │ │ │ │ ├── doc_test.js │ │ │ │ ├── driver.js │ │ │ │ ├── emacs_test.js │ │ │ │ ├── html-hint-test.js │ │ │ │ ├── index.html │ │ │ │ ├── lint.js │ │ │ │ ├── mode_test.css │ │ │ │ ├── mode_test.js │ │ │ │ ├── multi_test.js │ │ │ │ ├── run.js │ │ │ │ ├── scroll_test.js │ │ │ │ ├── search_test.js │ │ │ │ ├── sql-hint-test.js │ │ │ │ ├── sublime_test.js │ │ │ │ ├── test.js │ │ │ │ └── vim_test.js │ │ │ └── theme │ │ │ │ ├── 3024-day.css │ │ │ │ ├── 3024-night.css │ │ │ │ ├── abbott.css │ │ │ │ ├── abcdef.css │ │ │ │ ├── ambiance-mobile.css │ │ │ │ ├── ambiance.css │ │ │ │ ├── ayu-dark.css │ │ │ │ ├── ayu-mirage.css │ │ │ │ ├── base16-dark.css │ │ │ │ ├── base16-light.css │ │ │ │ ├── bespin.css │ │ │ │ ├── blackboard.css │ │ │ │ ├── cobalt.css │ │ │ │ ├── colorforth.css │ │ │ │ ├── darcula.css │ │ │ │ ├── dracula.css │ │ │ │ ├── duotone-dark.css │ │ │ │ ├── duotone-light.css │ │ │ │ ├── eclipse.css │ │ │ │ ├── elegant.css │ │ │ │ ├── erlang-dark.css │ │ │ │ ├── gruvbox-dark.css │ │ │ │ ├── hopscotch.css │ │ │ │ ├── icecoder.css │ │ │ │ ├── idea.css │ │ │ │ ├── isotope.css │ │ │ │ ├── juejin.css │ │ │ │ ├── lesser-dark.css │ │ │ │ ├── liquibyte.css │ │ │ │ ├── lucario.css │ │ │ │ ├── material-darker.css │ │ │ │ ├── material-ocean.css │ │ │ │ ├── material-palenight.css │ │ │ │ ├── material.css │ │ │ │ ├── mbo.css │ │ │ │ ├── mdn-like.css │ │ │ │ ├── midnight.css │ │ │ │ ├── monokai.css │ │ │ │ ├── moxer.css │ │ │ │ ├── neat.css │ │ │ │ ├── neo.css │ │ │ │ ├── night.css │ │ │ │ ├── nord.css │ │ │ │ ├── oceanic-next.css │ │ │ │ ├── panda-syntax.css │ │ │ │ ├── paraiso-dark.css │ │ │ │ ├── paraiso-light.css │ │ │ │ ├── pastel-on-dark.css │ │ │ │ ├── railscasts.css │ │ │ │ ├── rubyblue.css │ │ │ │ ├── seti.css │ │ │ │ ├── shadowfox.css │ │ │ │ ├── solarized.css │ │ │ │ ├── ssms.css │ │ │ │ ├── the-matrix.css │ │ │ │ ├── tomorrow-night-bright.css │ │ │ │ ├── tomorrow-night-eighties.css │ │ │ │ ├── ttcn.css │ │ │ │ ├── twilight.css │ │ │ │ ├── vibrant-ink.css │ │ │ │ ├── xq-dark.css │ │ │ │ ├── xq-light.css │ │ │ │ ├── yeti.css │ │ │ │ ├── yonce.css │ │ │ │ └── zenburn.css │ │ ├── codemirror_mode_loda.js │ │ ├── loda_rust_web.css │ │ └── promise-worker │ │ │ ├── promise-worker.js │ │ │ ├── promise-worker.register.js │ │ │ └── readme.md │ └── worker.js └── readme.md └── script ├── Gemfile ├── Gemfile.lock ├── arc_size.rb ├── config.rb ├── data ├── .gitignore └── readme.md ├── generate_csv_with_program_using_clear_instruction_with_variable_length.rb ├── miner_sync_advanced.rb ├── miner_sync_debug.rb ├── miner_sync_simple.rb ├── number_of_times_zap_instruction_can_be_applied.rb ├── rakefile.rb ├── readme.md ├── search_and_replace_loop_begin_with_constant_one.rb ├── task_add_mined_programs_to_repo.rb ├── task_benfords_law_with_constants.rb ├── task_cleanup_processed_files_from_mineevent_dir.rb ├── task_compare_loda_cpp_vs_loda_rust.rb ├── task_file_status_image.rb ├── task_maintenance_of_outlier_programs_repo.rb ├── task_program_ids.rb ├── task_remove_similarity_lsh_files.rb ├── task_terms_loda_cpp.rb ├── task_terms_loda_rust.rb ├── task_top100.rb ├── upload_program_files_to_server.rb ├── upload_program_files_to_server_from_commit.rb └── upload_program_files_to_server_from_csv.rb /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @neoneye 2 | -------------------------------------------------------------------------------- /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ develop ] 6 | pull_request: 7 | branches: [ develop ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Build 20 | run: | 21 | cd rust_project 22 | cargo build --verbose 23 | - name: Run tests 24 | run: | 25 | cd rust_project 26 | cargo test --verbose 27 | -------------------------------------------------------------------------------- /documents/a000010_plot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/documents/a000010_plot.jpg -------------------------------------------------------------------------------- /documents/a000010_program.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/documents/a000010_program.jpg -------------------------------------------------------------------------------- /documents/a002487_plot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/documents/a002487_plot.jpg -------------------------------------------------------------------------------- /documents/a002487_program.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/documents/a002487_program.jpg -------------------------------------------------------------------------------- /documents/a003188_plot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/documents/a003188_plot.jpg -------------------------------------------------------------------------------- /documents/a003188_program.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/documents/a003188_program.jpg -------------------------------------------------------------------------------- /documents/license-mit.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 LODA team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /documents/loda-rust-dashboard-2022-11-27.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/documents/loda-rust-dashboard-2022-11-27.jpg -------------------------------------------------------------------------------- /resources/programs/match_overflow/A050921.asm: -------------------------------------------------------------------------------- 1 | ; 2,3,7,5,11,7,29,17,19,11,23,13,53,29,31,17,137,19,1217,41,43,23,47,97,101,53,109,29,59,31,7937,257,67,137,71,37,149,1217,79,41 2 | 3 | mov $1,$0 4 | add $1,1 5 | mov $2,$0 6 | add $2,4 7 | lpb $2 8 | div $0,$2 9 | mov $3,$1 10 | mul $1,2 11 | max $3,0 12 | seq $3,10051 13 | sub $1,1 14 | sub $0,$3 15 | add $1,1 16 | mov $4,$0 17 | max $4,0 18 | cmp $4,$0 19 | mul $2,$4 20 | sub $2,1 21 | lpe 22 | mov $0,$1 23 | add $0,1 24 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A050921_1.asm: -------------------------------------------------------------------------------- 1 | ; 2,3,7,5,11,7,29,17,19,11,23,13,53,29,31,17,137,19,1217,41,43,23,47,97,101,53,109,29,59,31,7937,257,67,137,71,37,149,1217,79,41 2 | 3 | add $0,1 4 | mov $2,$0 5 | mov $0,1 6 | mov $1,$2 7 | pow $2,2 8 | lpb $2 9 | mov $3,$1 10 | seq $3,10051 11 | sub $0,$3 12 | mul $1,2 13 | sub $2,$0 14 | lpe 15 | mov $0,$1 16 | add $0,1 17 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A051122.asm: -------------------------------------------------------------------------------- 1 | ; A051122: a(n) = Fibonacci(n) AND Fibonacci(n+1). 2 | ; Coded manually 2021-03-30 by Simon Strandgaard, https://github.com/neoneye 3 | ; 0,1,0,2,1,0,8,5,0,34,17,16,128,105,96,578,537,536,16,4165,2624,2,17697,9504,9472,65553,55808,55618,317489,299040,295432,2053,2163968,1377506,263361,8437888,6328368,5247017,38010912,33623682,1576009,165153832 4 | 5 | add $0,1 6 | 7 | mov $5,$0 8 | seq $5,45 ; Fibonacci 9 | ; Now $5 holds Fibonacci(n+1). 10 | 11 | sub $0,1 12 | seq $0,45 ; Fibonacci 13 | ; Now $0 holds Fibonacci(n). 14 | 15 | ; Determine the number of times to loop 16 | mov $2,$5 17 | seq $2,70939 ; Length of binary representation of Fibonacci(n+1). 18 | 19 | mov $4,1 ; Inital scale factor 20 | lpb $2 21 | ; Do AND with the lowest bit 22 | mov $3,$0 23 | mul $3,$5 24 | mod $3,2 25 | ; Now $3 holds the bitwise AND with $0 and $5 26 | 27 | ; Scale up the bit, and add to result 28 | mul $3,$4 29 | add $1,$3 30 | 31 | div $0,2 ; Remove the lowest bit from Fibonacci(n) 32 | div $5,2 ; Remove the lowest bit from Fibonacci(n+1) 33 | 34 | mul $4,2 ; Double the scale factor. Example: 1,2,4,8,16,32 35 | sub $2,1 36 | lpe 37 | mov $0,$1 38 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A078683.asm: -------------------------------------------------------------------------------- 1 | ; 3,5,7,17,11,13,29,17,19,41,23,97,53,29,31,257,137,37,1217,41,43,89,47,97,101,53,109,113,59,61,7937,257,67,137,71,73,149,1217,79,641 2 | 3 | mov $2,$0 4 | sub $3,1 5 | add $2,2 6 | mov $4,$0 7 | lpb $2 8 | add $4,$4 9 | add $1,2 10 | sub $2,1 11 | mul $5,2 12 | add $4,2 13 | mov $3,$4 14 | seq $3,10051 15 | lpb $3 16 | sub $1,$0 17 | mul $2,0 18 | div $3,2 19 | add $6,4 20 | lpe 21 | sub $4,1 22 | lpe 23 | mov $0,$4 24 | add $0,2 25 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A089911.asm: -------------------------------------------------------------------------------- 1 | ; A089911: a(n) = Fibonacci(n) mod 12. 2 | ; 0,1,1,2,3,5,8,1,9,10,7,5,0,5,5,10,3,1,4,5,9,2,11,1,0,1,1,2,3,5,8,1,9,10,7,5,0,5,5,10 3 | 4 | mov $1,$0 5 | seq $1,45 6 | mod $1,12 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A105995.asm: -------------------------------------------------------------------------------- 1 | ; A105995: Fibonacci sequence (mod 14). 2 | ; 0,1,1,2,3,5,8,13,7,6,13,5,4,9,13,8,7,1,8,9,3,12,1,13,0,13,13,12,11,9,6,1,7,8,1,9,10,5,1,6 3 | 4 | mov $1,$0 5 | seq $1,45 ; Fibonacci 6 | mod $1,14 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A106005.asm: -------------------------------------------------------------------------------- 1 | ; A106005: Fibonacci sequence (mod 15). 2 | ; 0,1,1,2,3,5,8,13,6,4,10,14,9,8,2,10,12,7,4,11,0,11,11,7,3,10,13,8,6,14,5,4,9,13,7,5,12,2,14,1 3 | 4 | mov $1,$0 5 | seq $1,45 ; Fibonacci 6 | mod $1,15 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A112282.asm: -------------------------------------------------------------------------------- 1 | ; A112282: a(n) = (-1)^n*(2*n+1) (mod 9). 2 | ; 1,6,5,2,0,7,4,3,8,8,3,4,7,0,2,5,6,1,1,6,5,2,0,7,4,3,8,8,3,4,7,0,2,5,6,1,1,6,5,2 3 | 4 | mov $1,$0 5 | seq $1,199301 ; (2n+1)*8^n. 6 | mod $1,9 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A132636.asm: -------------------------------------------------------------------------------- 1 | ; A132636: a(n) = Fibonacci(n) mod n^3. 2 | ; Submitted by Simon Strandgaard 3 | ; 0,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,1685,7063,4323,4896,12525,15937,19271,10483,2060,22040,5674,15621,2752,3807,9340,432,46989,19305,11932,62155 4 | 5 | add $0,1 6 | mov $1,$0 7 | seq $0,45 ; Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1. 8 | pow $1,3 9 | mod $0,$1 10 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A261606.asm: -------------------------------------------------------------------------------- 1 | ; 0,1,1,2,3,5,8,13,21,34,55,29,24,53,17,10,27,37,4,41,45,26,11,37,48,25,13,38,51,29,20,49,9,58,7,5,12,17,29,46 2 | 3 | mov $2,$0 4 | add $0,1 5 | seq $2,45 6 | lpb $0 7 | mov $1,10 8 | mul $1,6 9 | mod $2,$1 10 | sub $0,1 11 | lpe 12 | mov $0,$1 13 | mov $0,$2 -------------------------------------------------------------------------------- /resources/programs/match_overflow/A289682.asm: -------------------------------------------------------------------------------- 1 | ; A289682: Catalan numbers read modulo 16. 2 | ; 1,1,2,5,14,10,4,13,6,14,12,2,12,4,8,13,6,6,12,6,4,12,8,2,12,12,8,4,8,8,0,13,6,6,12,14,4,12,8,6 3 | 4 | mov $1,$0 5 | seq $1,108 ; Catalan numbers: C(n) = binomial(2n,n)/(n+1) = (2n)!/(n!(n+1)!). 6 | mod $1,16 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/A350253.asm: -------------------------------------------------------------------------------- 1 | ; A350253: a(n) = A000045(n)^A000045(n+1) mod A000045(n+2). 2 | ; Submitted by Simon Strandgaard 3 | ; 0,1,1,3,3,1,8,13,1,55,55,1,144,233,1,987,987,1,2584,4181,1,17711,17711 4 | 5 | mov $1,$0 6 | mov $2,$0 7 | add $1,1 8 | add $2,2 9 | seq $0,45 10 | seq $1,45 11 | seq $2,45 12 | pow $0,$1 13 | mod $0,$2 14 | -------------------------------------------------------------------------------- /resources/programs/match_overflow/readme.md: -------------------------------------------------------------------------------- 1 | This is for programs that computes the correct sequence, but takes overflows when using 64bit signed integer. 2 | 3 | -------------------------------------------------------------------------------- /resources/programs/match_somewhat_faster/A046897.asm: -------------------------------------------------------------------------------- 1 | ; A046897: Sum of divisors of n that are not divisible by 4. 2 | ; Submitted by Simon Strandgaard 3 | ; 1,3,4,3,6,12,8,3,13,18,12,12,14,24,24,3,18,39,20,18,32,36,24,12,31,42,40,24,30,72,32,3,48,54,48,39,38,60,56,18,42,96,44,36,78,72,48,12,57,93,72,42,54,120,72,24,80,90,60,72,62,96,104,3,84,144,68,54,96,144,72,39,74,114,124,60,96,168,80,18,121,126,84,96,108,132,120,36,90,234,112,72,128,144,120,12,98,171,156,93 4 | 5 | mov $1,-1 6 | pow $1,$0 7 | sub $1,2 8 | gcd $1,6 9 | seq $0,593 10 | mul $0,$1 11 | -------------------------------------------------------------------------------- /resources/programs/match_somewhat_faster/A166673.asm: -------------------------------------------------------------------------------- 1 | ; A166673: Totally multiplicative sequence with a(p) = 3p+2 for prime p. 2 | ; Submitted by Simon Strandgaard 3 | ; 1,8,11,64,17,88,23,512,121,136,35,704,41,184,187,4096,53,968,59,1088,253,280,71,5632,289,328,1331,1472,89,1496,95,32768,385,424,391,7744,113,472,451,8704,125,2024,131,2240,2057,568,143,45056,529,2312,583,2624,161,10648,595,11776,649,712,179,11968,185,760,2783,262144,697,3080,203,3392,781,3128,215,61952,221,904,3179,3776,805,3608,239,69632,14641,1000,251,16192,901,1048,979,17920,269,16456,943,4544,1045,1144,1003,360448,293,4232,4235,18496 4 | 5 | mov $1,1 6 | mov $2,1 7 | add $0,1 8 | lpb $0 9 | mov $3,$0 10 | lpb $3 11 | mov $4,$0 12 | mod $4,$2 13 | cmp $4,0 14 | cmp $4,0 15 | mov $5,$2 16 | cmp $5,1 17 | add $2,1 18 | max $4,$5 19 | sub $3,$4 20 | cmp $6,3 21 | lpe 22 | mov $5,1 23 | lpb $0 24 | dif $0,$2 25 | sub $6,2 26 | mul $6,$2 27 | sub $4,$6 28 | add $4,1 29 | mul $5,$2 30 | add $5,$4 31 | mov $2,1 32 | lpe 33 | mul $1,$5 34 | lpe 35 | mov $0,$1 36 | -------------------------------------------------------------------------------- /resources/programs/match_somewhat_faster/A292930.asm: -------------------------------------------------------------------------------- 1 | ; A292930: Triangle read by rows: T(n,k) (n>=1, 3<=k<=n+2) is the number of k-sequences of balls colored with at most n colors such that exactly three balls are the same color as some other ball in the sequence 2 | ; Submitted by Jamie Morken(l1) 3 | ; 1,2,8,3,24,60,4,48,240,480,5,80,600,2400,4200,6,120,1200,7200,25200,40320,7,168,2100,16800,88200,282240,423360,8,224,3360,33600,235200,1128960,3386880,4838400,9,288,5040,60480,529200,3386880,15240960,43545600,59875200,10,360,7200,100800,1058400,8467200,50803200,217728000,598752000,798336000 4 | 5 | lpb $0 6 | mov $1,$2 7 | add $2,1 8 | sub $0,$2 9 | lpe 10 | add $1,1 11 | bin $1,$0 12 | mul $2,2 13 | add $0,1 14 | lpb $0 15 | sub $0,1 16 | add $2,2 17 | mul $1,$2 18 | mov $2,$0 19 | add $2,1 20 | lpe 21 | mov $0,$1 22 | sub $0,2 23 | div $0,2 24 | add $0,1 25 | -------------------------------------------------------------------------------- /resources/programs/match_somewhat_faster/A304412.asm: -------------------------------------------------------------------------------- 1 | ; A304412: If n = Product (p_j^k_j) then a(n) = Product ((p_j + 1)*(k_j + 1)). 2 | ; Submitted by Simon Strandgaard 3 | ; 1,6,8,9,12,48,16,12,12,72,24,72,28,96,96,15,36,72,40,108,128,144,48,96,18,168,16,144,60,576,64,18,192,216,192,108,76,240,224,144,84,768,88,216,144,288,96,120,24,108,288,252,108,96,288,192,320,360,120,864,124,384,192,21,336,1152,136,324,384,1152,144,144,148,456,144,360,384,1344,160,180,20,504,168,1152,432,528,480,288,180,864,448,432,512,576,480,144,196,144,288,162 4 | 5 | mov $1,1 6 | mov $2,1 7 | add $0,1 8 | lpb $0 9 | mov $3,$0 10 | lpb $3 11 | mov $4,$0 12 | mod $4,$2 13 | cmp $4,0 14 | cmp $4,0 15 | mov $5,$2 16 | cmp $5,1 17 | add $2,1 18 | max $4,$5 19 | sub $3,$4 20 | cmp $6,3 21 | lpe 22 | lpb $0 23 | dif $0,$2 24 | sub $6,2 25 | mul $6,$2 26 | sub $4,$6 27 | add $4,1 28 | mov $6,1 29 | lpe 30 | mul $1,$4 31 | lpe 32 | mov $0,$1 33 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A001157.asm: -------------------------------------------------------------------------------- 1 | ; A001157: sigma_2(n): sum of squares of divisors of n. 2 | ; Submitted by Simon Strandgaard 3 | ; 1,5,10,21,26,50,50,85,91,130,122,210,170,250,260,341,290,455,362,546,500,610,530,850,651,850,820,1050,842,1300,962,1365,1220,1450,1300,1911,1370,1810,1700,2210,1682,2500,1850,2562,2366,2650,2210,3410,2451,3255,2900,3570,2810,4100,3172,4250,3620,4210,3482,5460,3722,4810,4550,5461,4420,6100,4490,6090,5300,6500,5042,7735,5330,6850,6510,7602,6100,8500,6242,8866,7381,8410,6890,10500,7540,9250,8420,10370,7922,11830,8500,11130,9620,11050,9412,13650,9410,12255,11102,13671 4 | 5 | add $0,1 6 | mov $2,$0 7 | lpb $0 8 | mul $2,-1 9 | mov $3,$2 10 | dif $3,$0 11 | cmp $3,$2 12 | cmp $3,0 13 | mul $3,$0 14 | sub $0,1 15 | pow $3,2 16 | add $1,$3 17 | lpe 18 | add $1,1 19 | mov $0,$1 20 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A006450.asm: -------------------------------------------------------------------------------- 1 | ; A006450: Prime-indexed primes: primes with prime subscripts. 2 | ; Coded manually 2021-03-28 by Simon Strandgaard, https://github.com/neoneye 3 | ; 3,5,11,17,31,41,59,67,83,109,127,157,179,191,211,241,277,283,331,353,367,401,431,461,509,547,563,587,599,617,709,739,773,797,859,877,919,967,991,1031,1063,1087,1153,1171,1201,1217,1297,1409,1433,1447,1471 4 | 5 | mov $1,$0 6 | seq $1,40 7 | sub $1,1 8 | seq $1,40 9 | mov $0,$1 10 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A007887.asm: -------------------------------------------------------------------------------- 1 | ; A007887: a(n) = Fibonacci(n) mod 9. 2 | ; 0,1,1,2,3,5,8,4,3,7,1,8,0,8,8,7,6,4,1,5,6,2,8,1,0,1,1,2,3,5,8,4,3,7,1,8,0,8,8,7,6,4,1,5,6,2,8,1,0,1,1,2,3,5,8,4,3,7,1,8,0,8,8,7,6,4,1,5,6,2,8,1,0,1,1,2,3,5,8,4,3 3 | 4 | mov $1,$0 5 | seq $1,45 6 | mod $1,9 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A008347.asm: -------------------------------------------------------------------------------- 1 | ; A008347 a(n) = Sum_{i=0..n-1} (-1)^i * prime(n-i). 2 | ; Coded manually 2021-03-28 by Simon Strandgaard, https://github.com/neoneye 3 | ; 0,2,1,4,3,8,5,12,7,16,13,18,19,22,21,26,27,32,29,38,33,40,39,44,45,52,49,54,53,56,57,70,61,76,63,86,65,92,71,96,77,102,79,112,81,116,83,128,95,132,97,136,103,138,113,144,119,150,121,156,125,158,135,172,139,174,143 4 | 5 | mov $2,1 ; initial sign 6 | lpb $0 7 | sub $0,1 8 | mov $3,$0 9 | seq $3,40 ; prime(n-i) 10 | mul $3,$2 ; multiply by (-1)^i 11 | add $1,$3 ; add to sum 12 | mul $2,-1 ; alternate betweeen -1 and +1 13 | lpe 14 | mov $0,$1 15 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A053767.asm: -------------------------------------------------------------------------------- 1 | ; A053767: Sum of first n composite numbers. 2 | ; Coded manually 2021-03-28 by Simon Strandgaard, https://github.com/neoneye 3 | ; 0,4,10,18,27,37,49,63,78,94,112,132,153,175,199,224,250,277,305,335,367,400,434,469,505,543,582,622,664,708,753,799,847,896,946,997,1049,1103,1158,1214,1271,1329,1389,1451,1514,1578,1643,1709,1777,1846,1916,1988 4 | 5 | mov $2,0 6 | lpb $0 7 | mov $3,$2 8 | seq $3,2808 ; The composite numbers: numbers n of the form x*y for x > 1 and y > 1. 9 | add $1,$3 10 | 11 | ; update counters 12 | add $2,1 13 | sub $0,1 14 | lpe 15 | mov $0,$1 16 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A054519.asm: -------------------------------------------------------------------------------- 1 | ; A054519: Number of increasing arithmetic progressions of nonnegative integers ending in n, including those of length 1 or 2. 2 | ; Submitted by Simon Strandgaard 3 | ; 1,2,4,6,9,11,15,17,21,24,28,30,36,38,42,46,51,53,59,61,67,71,75,77,85,88,92,96,102,104,112,114,120,124,128,132,141,143,147,151,159,161,169,171,177,183,187,189,199,202,208,212,218,220,228,232,240,244,248,250,262,264,268,274,281,285,293,295,301,305,313,315,327,329,333,339,345,349,357,359,369,374,378,380,392,396,400,404,412,414,426,430,436,440,444,448,460,462,468,474 4 | 5 | lpb $0 6 | sub $0,1 7 | add $2,1 8 | mov $3,$0 9 | add $3,$2 10 | div $3,$2 11 | add $1,$3 12 | lpe 13 | add $1,1 14 | mov $0,$1 15 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A065608.asm: -------------------------------------------------------------------------------- 1 | ; 0,1,2,4,4,8,6,11,10,14,10,22,12,20,20,26,16,33,18,36,28,32,22,52,28,38,36,50,28,64,30,57,44,50,44,82,36,56,52,82 2 | 3 | add $0,1 4 | mov $2,$0 5 | lpb $0 6 | mov $3,$2 7 | dif $3,$0 8 | max $0,2 9 | cmp $3,$2 10 | cmp $3,0 11 | mul $3,$0 12 | sub $0,1 13 | trn $3,1 14 | add $1,$3 15 | lpe 16 | mov $0,$1 -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A089911.asm: -------------------------------------------------------------------------------- 1 | ; A089911: a(n) = Fibonacci(n) mod 12. 2 | ; 0,1,1,2,3,5,8,1,9,10,7,5,0,5,5,10,3,1,4,5,9,2,11,1,0,1,1,2,3,5,8,1,9,10,7,5,0,5,5,10,3,1,4,5,9,2,11,1,0,1,1,2,3,5,8,1,9,10,7,5,0,5,5,10,3,1,4,5,9,2,11,1,0,1,1,2,3,5,8,1,9,10,7,5,0,5,5,10,3,1,4,5,9,2,11,1,0,1,1 3 | 4 | mov $1,$0 5 | seq $1,45 6 | mod $1,12 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A232637.asm: -------------------------------------------------------------------------------- 1 | ; 1,2,7,13,14,21,25,26,31,37,41,42,49,50,55,61,62,69,73,74,81,82,87,93,97,98,103,109,110,117,121,122,127,133,137,138,145,146,151,157 2 | 3 | pow $3,0 4 | mov $4,2 5 | lpb $4 6 | sub $0,1 7 | sub $4,1 8 | add $0,$4 9 | add $0,1 10 | seq $0,82969 11 | div $0,8 12 | mov $2,$4 13 | mul $3,$0 14 | add $5,$2 15 | lpe 16 | min $3,1 17 | mul $3,$0 18 | mov $0,$5 19 | sub $0,$3 20 | mov $0,$3 -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A328590.asm: -------------------------------------------------------------------------------- 1 | ; A328590 a(n) = A328578(n) - A257993(n). 2 | ; Coded manually 2021-03-28 by Simon Strandgaard, https://github.com/neoneye 3 | ; 0,1,0,2,0,0,0,2,0,3,0,-1,0,3,0,2,0,0,0,4,0,4,0,-1,0,4,0,5,0,-2,0,2,0,1,0,0,0,3,0,4,0,-1,0,4,0,4,0,0,0,5,0,5,0,-1,0,5,0,3,0,-2,0,3,0,2,0,0,0,4,0,4,0,-1,0,5,0,5,0,0,0,5,0,6,0,-1,0,4,0,6,0,-2,0,4,0,5,0,0,0,5,0,5,0,-1,0,5,0 4 | 5 | mov $1,$0 6 | add $1,1 7 | seq $1,328578 ; Index of the least prime not dividing A276086(A276086(n)): a(n) = A257993(A276087(n)). 8 | seq $0,257993 ; Least gap in the partition having Heinz number n; index of the least prime not dividing n. 9 | sub $1,$0 10 | mov $0,$1 11 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/A340867.asm: -------------------------------------------------------------------------------- 1 | ; A340867 a(n) = (prime(n) - a(n-1)) mod 4; a(0)=0. 2 | ; Coded manually 2021-03-28 by Simon Strandgaard, https://github.com/neoneye 3 | ; 0,2,1,0,3,0,1,0,3,0,1,2,3,2,1,2,3,0,1,2,1,0,3,0,1,0,1,2,1,0,1,2,1,0,3,2,1,0,3,0,1,2,3,0,1,0,3,0,3,0,1,0,3,2,1,0,3,2,1,0,1,2,3,0,3,2,3,0,1,2,3,2,1,2,3,0,3,2,3,2,3,0,1,2,3,0 4 | 5 | mov $1,$0 6 | seq $1,8347 ; a(n) = Sum_{i=0..n-1} (-1)^i * prime(n-i). 7 | mod $1,4 8 | mov $0,$1 9 | -------------------------------------------------------------------------------- /resources/programs/match_too_slow/readme.md: -------------------------------------------------------------------------------- 1 | This is for programs that computes the correct sequence, but takes too long to complete. 2 | 3 | In LODA the first 250 terms must be computed in 10 mio cycles. 4 | -------------------------------------------------------------------------------- /resources/readme.md: -------------------------------------------------------------------------------- 1 | # Resources used by LODA Rust 2 | 3 | When the "LODA Lab" executable is running, it makes use of the files in this dir. 4 | 5 | 6 | ### The `program_creation_dates.csv` file 7 | 8 | Date when a LODA program got added to the git repository. 9 | 10 | This is useful when randomly picking a fairly recent `program_id`. 11 | 12 | This task is VERY time consuming. It took 15 hours to extract creation date from 28k files. 13 | 14 | To rebuild this file follow these steps: 15 | 16 | ``` 17 | PROMPT> pwd 18 | /Users/JOHNDOE/git/loda-rust/script 19 | PROMPT> rake data/program_creation_dates.csv 20 | PROMPT> cd .. 21 | PROMPT> cp script/data/program_creation_dates.csv resources/program_creation_dates.csv 22 | ``` 23 | -------------------------------------------------------------------------------- /resources/realtime metrics/prometheus.yml: -------------------------------------------------------------------------------- 1 | # my global config 2 | global: 3 | scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. 4 | evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. 5 | # scrape_timeout is set to the global default (10s). 6 | 7 | # Alertmanager configuration 8 | alerting: 9 | alertmanagers: 10 | - static_configs: 11 | - targets: 12 | # - alertmanager:9093 13 | 14 | # Load rules once and periodically evaluate them according to the global 'evaluation_interval'. 15 | rule_files: 16 | # - "first_rules.yml" 17 | # - "second_rules.yml" 18 | 19 | scrape_configs: 20 | - job_name: 'lodarust' 21 | scrape_interval: 500ms 22 | static_configs: 23 | - targets: ["localhost:8090"] 24 | 25 | -------------------------------------------------------------------------------- /rust_project/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | 3 | -------------------------------------------------------------------------------- /rust_project/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | resolver = "2" 3 | 4 | members = [ 5 | "loda-rust-core", 6 | "loda-rust-cli", 7 | "loda-rust-web" 8 | ] 9 | -------------------------------------------------------------------------------- /rust_project/arc-competition/arc.Dockerfile: -------------------------------------------------------------------------------- 1 | #################################################################################################### 2 | ## Builder 3 | #################################################################################################### 4 | FROM rust:1.71.1 AS builder 5 | WORKDIR /my_builddir 6 | COPY ./loda-rust-core loda-rust-core 7 | COPY ./loda-rust-cli loda-rust-cli 8 | COPY ./loda-rust-web loda-rust-web 9 | COPY ./Cargo.toml Cargo.toml 10 | COPY ./Cargo.lock Cargo.lock 11 | RUN cargo build -vv --locked --config net.git-fetch-with-cli=true --release -p loda-rust-cli 12 | 13 | #################################################################################################### 14 | ## Final image 15 | #################################################################################################### 16 | FROM debian:bullseye-slim 17 | COPY --from=builder /my_builddir/target/release/loda-rust /usr/local/bin/loda-rust 18 | COPY ./arc-competition/payload /root 19 | CMD ["loda-rust", "arc-competition"] 20 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/analytics_log.txt: -------------------------------------------------------------------------------- 1 | BatchProgramAnalyzer 2 | number of program files successfully analyzed: 88 3 | number of program files that could not be loaded: 0 4 | number of program files that was ignored: 0 5 | 6 | AnalyzeDependencies 7 | number of dependencies: 0 8 | 9 | AnalyzeIndirectMemoryAccess 10 | number of programs that uses indirect memory access: 1 11 | 12 | AnalyzeInstructionConstant 13 | number of constants processed unsuccessful: 364 14 | number of constants processed successful: 541 15 | number of items in histogram: 28 16 | 17 | AnalyzeInstructionNgram 18 | unigram: 16, bigram: 47, trigram: 96, skipgram: 55 19 | 20 | AnalyzeSourceNgram 21 | unigram: 49, bigram: 188, trigram: 373, skipgram: 211 22 | 23 | AnalyzeLineNgram 24 | unigram: 304, bigram: 497, trigram: 604, skipgram: 561, ignore count: 5 25 | 26 | AnalyzeTargetNgram 27 | unigram: 38, bigram: 155, trigram: 292, skipgram: 212 28 | 29 | AnalyzeProgramComplexity 30 | optimize: 0, dontoptimize: 1, optimize/total: 0.0% 31 | 32 | AnalyzeProgramModified 33 | timestamps: 88 34 | 35 | subcommand_analytics finished, elapsed: 23 ms 36 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/complexity_all.csv: -------------------------------------------------------------------------------- 1 | program id;is optimizable;comment 2 | 1;0;complex for other reasons, high chance it can be optimized 3 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/complexity_dont_optimize.csv: -------------------------------------------------------------------------------- 1 | program id 2 | 1 3 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/dependencies.csv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/rust_project/arc-competition/payload/.loda-rust/analytics-arc/dependencies.csv -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/histogram_instruction_bigram.csv: -------------------------------------------------------------------------------- 1 | count;word0;word1 2 | 451;mov;mov 3 | 122;f21;mov 4 | 116;mov;f21 5 | 103;mov;f11 6 | 102;add;add 7 | 94;mov;lps 8 | 94;lps;mov 9 | 94;add;lpe 10 | 90;mov;add 11 | 88;lpe;STOP 12 | 88;START;mov 13 | 73;f31;mov 14 | 70;f11;mov 15 | 68;mov;f31 16 | 20;f11;f11 17 | 18;f21;f21 18 | 18;div;mov 19 | 17;mov;f20 20 | 16;f20;mov 21 | 12;f11;f21 22 | 12;f11;div 23 | 9;f11;sub 24 | 6;sub;div 25 | 6;mul;f31 26 | 6;f21;f11 27 | 5;mul;mul 28 | 5;lpe;mov 29 | 4;f31;f21 30 | 4;f21;add 31 | 4;f11;mul 32 | 4;div;div 33 | 3;sub;mul 34 | 2;mov;f41 35 | 2;f41;mov 36 | 2;f11;f31 37 | 1;mul;mov 38 | 1;mul;cmp 39 | 1;mul;add 40 | 1;mov;mul 41 | 1;mov;f12 42 | 1;lpe;f11 43 | 1;f20;f31 44 | 1;f12;mov 45 | 1;f11;cmp 46 | 1;cmp;mul 47 | 1;cmp;mov 48 | 1;add;mov 49 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/histogram_instruction_constant.csv: -------------------------------------------------------------------------------- 1 | count;instruction;constant 2 | 195;add;100 3 | 91;mov;100 4 | 88;mov;102 5 | 25;mov;0 6 | 23;mov;1 7 | 17;mov;5 8 | 17;f20;1033 9 | 17;div;2 10 | 16;mov;3 11 | 7;sub;1 12 | 6;mov;255 13 | 5;mov;101 14 | 5;mov;2 15 | 4;mul;2 16 | 3;mov;110 17 | 3;mov;8 18 | 2;mul;3 19 | 2;mov;109 20 | 2;mov;107 21 | 2;mov;105 22 | 2;mov;42 23 | 2;mov;-1 24 | 2;div;3 25 | 1;mul;7 26 | 1;mov;108 27 | 1;mov;106 28 | 1;cmp;0 29 | 1;add;1 30 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/histogram_instruction_skipgram.csv: -------------------------------------------------------------------------------- 1 | count;word0;word2 2 | 493;mov;mov 3 | 106;mov;add 4 | 94;mov;lps 5 | 93;add;lpe 6 | 88;add;STOP 7 | 88;START;mov 8 | 86;mov;f21 9 | 74;mov;f11 10 | 73;lps;mov 11 | 66;mov;f31 12 | 64;f21;mov 13 | 48;f11;mov 14 | 47;f31;mov 15 | 43;f21;f21 16 | 36;f21;add 17 | 24;f31;add 18 | 20;lps;f11 19 | 19;f11;add 20 | 16;f11;f20 21 | 14;f11;div 22 | 11;f20;f11 23 | 11;f11;f11 24 | 9;mov;sub 25 | 9;f11;f21 26 | 9;div;mov 27 | 9;add;add 28 | 8;mov;div 29 | 7;mul;mov 30 | 7;f11;mul 31 | 7;div;f21 32 | 6;sub;mov 33 | 6;lpe;mov 34 | 6;f21;f11 35 | 6;f20;mov 36 | 6;f11;f31 37 | 6;add;mov 38 | 5;mul;f31 39 | 5;f31;f21 40 | 5;div;f11 41 | 3;sub;mul 42 | 2;mov;mul 43 | 2;mov;f41 44 | 2;mov;cmp 45 | 2;f41;mov 46 | 1;mul;mul 47 | 1;mul;f11 48 | 1;mov;f12 49 | 1;lps;add 50 | 1;f31;f11 51 | 1;f21;lpe 52 | 1;f12;add 53 | 1;div;f20 54 | 1;cmp;mul 55 | 1;cmp;add 56 | 1;add;f11 57 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/histogram_instruction_unigram.csv: -------------------------------------------------------------------------------- 1 | count;word 2 | 943;mov 3 | 197;add 4 | 150;f21 5 | 130;f11 6 | 94;lps 7 | 94;lpe 8 | 88;STOP 9 | 88;START 10 | 77;f31 11 | 22;div 12 | 17;f20 13 | 14;mul 14 | 9;sub 15 | 2;f41 16 | 2;cmp 17 | 1;f12 18 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/histogram_source_unigram.csv: -------------------------------------------------------------------------------- 1 | count;word 2 | 565;NONE 3 | 286;100 4 | 248;$0 5 | 94;$$81 6 | 88;STOP 7 | 88;START 8 | 88;102 9 | 88;$99 10 | 33;1 11 | 29;$3 12 | 28;0 13 | 28;$1 14 | 26;2 15 | 26;$5 16 | 24;$20 17 | 22;$2 18 | 21;$10 19 | 20;3 20 | 17;5 21 | 14;$4 22 | 9;$$83 23 | 6;255 24 | 6;$8 25 | 6;$6 26 | 6;$40 27 | 5;101 28 | 5;$97 29 | 5;$30 30 | 5;$15 31 | 5;$$82 32 | 4;$25 33 | 3;8 34 | 3;110 35 | 3;$7 36 | 3;$$84 37 | 2;42 38 | 2;109 39 | 2;107 40 | 2;105 41 | 2;-1 42 | 2;$14 43 | 2;$12 44 | 1;7 45 | 1;108 46 | 1;106 47 | 1;$9 48 | 1;$33 49 | 1;$21 50 | 1;$19 51 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/histogram_target_unigram.csv: -------------------------------------------------------------------------------- 1 | count;word 2 | 255;$0 3 | 186;$82 4 | 186;$80 5 | 182;$81 6 | 161;$1 7 | 104;$2 8 | 94;NONE 9 | 88;STOP 10 | 88;START 11 | 88;$$82 12 | 60;$5 13 | 59;$10 14 | 50;$3 15 | 30;$4 16 | 28;$11 17 | 22;$6 18 | 22;$20 19 | 20;$15 20 | 19;$30 21 | 17;$8 22 | 16;$83 23 | 16;$7 24 | 15;$16 25 | 14;$32 26 | 12;$25 27 | 12;$12 28 | 11;$9 29 | 11;$40 30 | 11;$21 31 | 10;$31 32 | 9;$14 33 | 8;$26 34 | 8;$13 35 | 6;$84 36 | 3;$41 37 | 3;$33 38 | 3;$17 39 | 1;$22 40 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/indirect_memory_access.csv: -------------------------------------------------------------------------------- 1 | program id 2 | 1 3 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/analytics-arc/last_analytics_timestamp.txt: -------------------------------------------------------------------------------- 1 | 2023-11-29T10:58:00Z -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/.loda-rust/config.toml: -------------------------------------------------------------------------------- 1 | arc_repository_data = "/data" 2 | 3 | loda_arc_challenge_repository = "/root/loda-arc-challenge" 4 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Simon Strandgaard 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/README.md: -------------------------------------------------------------------------------- 1 | # loda-arc-challenge 2 | Abstraction and Reasoning Challenge (ARC) experiments 3 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs-that-use-predicted-output-size/fill-predicted-size-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 ; set iteration counter = length of "train"+"test" vectors 5 | mov $82,102 ; address of vector[0].computed_output 6 | mov $83,103 ; address of vector[0].predicted_output_width 7 | mov $84,104 ; address of vector[0].predicted_output_height 8 | lps $80 9 | mov $0,$$83 ; predicted output width 10 | mov $1,$$84 ; predicted output height 11 | mov $2,1 ; fill color 12 | f31 $0,101010 ; Create new image with size (x, y) and filled with color z 13 | 14 | mov $$82,$0 ; save vector[x].computed_output image 15 | 16 | ; next iteration 17 | add $82,100 ; jump to address of next computed_output image 18 | add $83,100 ; jump to address of next predicted_output_width 19 | add $84,100 ; jump to address of next predicted_output_height 20 | lpe 21 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs-that-use-predicted-output-size/resize-input-to-predicted-output-size-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 ; set iteration counter = length of "train"+"test" vectors 5 | mov $81,100 ; address of vector[0].input 6 | mov $82,102 ; address of vector[0].computed_output 7 | mov $83,103 ; address of vector[0].predicted_output_width 8 | mov $84,104 ; address of vector[0].predicted_output_height 9 | lps $80 10 | mov $0,$$81 ; load vector[x].input image 11 | 12 | mov $1,$$83 ; predicted output width 13 | mov $2,$$84 ; predicted output height 14 | f31 $0,101200 ; Resize image to size width x height 15 | 16 | mov $$82,$0 ; save vector[x].computed_output image 17 | 18 | ; next iteration 19 | add $81,100 ; jump to address of next input image 20 | add $82,100 ; jump to address of next computed_output image 21 | add $83,100 ; jump to address of next predicted_output_width 22 | add $84,100 ; jump to address of next predicted_output_height 23 | lpe 24 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/007bbfb7-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:007bbfb7 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | ; tile_width 6 | mov $2,$0 7 | f11 $2,101000 ; Get width of image 8 | mov $3,5 9 | f20 $2,1033 ; Assert input[0] is less than or equal to input[1]. 10 | 11 | ; tile_height 12 | mov $3,$0 13 | f11 $3,101001 ; Get height of image 14 | mov $4,5 15 | f20 $3,1033 ; Assert input[0] is less than or equal to input[1]. 16 | 17 | ; tile 18 | mov $7,0 ; color 19 | mov $6,$3 ; height 20 | mov $5,$2 ; width 21 | f31 $5,101010 ; Create new image with size (x, y) and filled with color z 22 | 23 | ; mask 24 | mov $10,$0 ; image 25 | mov $11,$1 ; color 26 | f21 $10,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 27 | 28 | mov $11,$5 ; tile0 29 | mov $12,$0 ; tile1 30 | f31 $10,102110 ; Create a big composition of tiles. 31 | 32 | mov $0,$10 33 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/0b148d64-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 ; address of vector[0].InputImage 6 | mov $82,102 ; address of vector[0].ComputedOutputImage 7 | mov $83,109 ; address of vector[0].GridColor 8 | mov $84,110 ; address of vector[0].EnumeratedObjects 9 | lps $80 10 | mov $0,$$81 11 | mov $1,$$84 ; enumerated objects 12 | mov $2,$$83 ; grid color 13 | 14 | f31 $0,104111 ; Find the single object that has different colors than the other objects. With 1 ignore color. 15 | 16 | mov $1,255 ; color for the area to be trimmed 17 | mov $2,$$81 18 | f31 $0,102130 ; Pick pixels from color and image 19 | 20 | ; $1 is the color to be trimmed 21 | f21 $0,101161 ; trim with color 22 | 23 | mov $$82,$0 24 | add $81,100 25 | add $82,100 26 | add $83,100 27 | add $84,100 28 | lpe 29 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/0c786b71-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | mov $1,$0 10 | f11 $0,101190 ; Image: flip x 11 | f21 $0,101030 ; Image.hstack. horizontal stack of 2 images 12 | mov $1,$0 13 | f11 $0,101191 ; Image: flip y 14 | f21 $0,101040 ; Image.vstack. vertical stack of 2 images 15 | mov $$82,$0 16 | add $81,100 17 | add $82,100 18 | lpe 19 | 20 | ; template: "3af2c5a8-1.asm" 21 | ; mutate: InsertLineWithHistogram, no change 22 | ; mutate: CallRecentProgram, no change 23 | ; mutate: ReplaceLineWithHistogram 24 | ; mutate: CallRecentProgram, no change 25 | ; mutate: CallRecentProgram, no change 26 | ; mutate: ReplaceInstructionWithHistogram, no change 27 | ; mutate: ReplaceLineWithHistogram 28 | ; mutate: CallMediumPopularProgram, no change 29 | ; mutate: CallRecentProgram, no change 30 | ; mutate: CallRecentProgram, no change 31 | ; mutate: CallRecentProgram, no change 32 | ; mutate: CallRecentProgram, no change 33 | ; mutate: DecrementTargetValueWhereTypeIsDirect 34 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/1190e5a7-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:1190e5a7 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101140 ; remove duplicates 6 | f11 $0,101120 ; remove grid 7 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/19bb5feb-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | f11 $0,101160 ; Image: Trim border using histogram of border pixels 10 | f11 $0,101140 ; Image: Remove duplicate rows/columns 11 | f11 $0,101120 ; Image: remove grid patterns. 12 | mov $$82,$0 13 | add $81,100 14 | add $82,100 15 | lpe 16 | 17 | ; template: "90c28cc7-1.asm" 18 | ; mutate: InsertLineWithHistogram, no change 19 | ; mutate: SwapRegisters, no change 20 | ; mutate: CallLeastPopularProgram, no change 21 | ; mutate: InsertLineWithHistogram, no change 22 | ; mutate: InsertLineWithHistogram 23 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/1c0d0a4b-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 ; address of vector[0].ComputedOutputImage 7 | mov $83,108 ; address of vector[0].GridMask 8 | mov $84,109 ; address of vector[0].GridColor 9 | lps $80 10 | mov $0,$$81 11 | mov $1,$$84 ; grid color 12 | f21 $0,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 13 | mov $1,$$83 ; grid mask 14 | f21 $0,101254 ; xor 15 | mov $$82,$0 16 | add $81,100 17 | add $82,100 18 | add $83,100 19 | add $84,100 20 | lpe 21 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/1cf80156-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:1cf80156 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101160 ; trim 6 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/1f85a75f-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $3,$0 5 | f11 $3,101060 ; most popular color 6 | ; $3 is background_color 7 | 8 | ; remove noisy pixels 9 | mov $4,$0 10 | mov $5,3 ; number of noise colors to remove 11 | f21 $4,101092 ; denoise type 3 12 | ;mov $0,$4 13 | 14 | ; mask 15 | mov $6,$4 ; image 16 | mov $7,$3 ; color 17 | f21 $6,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 18 | ;mov $0,$6 19 | 20 | ; multiply input image by mask 21 | mov $8,$6 22 | mov $9,$3 23 | mov $10,$0 24 | f31 $8,102130 ; Pick pixels from one image. 25 | mov $0,$8 26 | 27 | ; remove space around the object 28 | f11 $0,101160 ; trim 29 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/2013d3e2-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:2013d3e2 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101160 ; trim 6 | mov $4,$0 7 | mov $5,$0 8 | f11 $4,101000 ; get width 9 | f11 $5,101001 ; get height 10 | div $4,2 11 | div $5,2 12 | mov $1,$4 13 | f21 $0,101220 ; get top rows 14 | mov $1,$5 15 | f21 $0,101222 ; get left columns 16 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/27f8ce4f-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $1,$0 5 | f11 $1,101060 ; most popular color 6 | 7 | ; tile_width 8 | mov $2,$0 9 | f11 $2,101000 ; Get width of image 10 | mov $3,5 11 | f20 $2,1033 ; Assert input[0] is less than or equal to input[1]. 12 | 13 | ; tile_height 14 | mov $3,$0 15 | f11 $3,101001 ; Get height of image 16 | mov $4,5 17 | f20 $3,1033 ; Assert input[0] is less than or equal to input[1]. 18 | 19 | ; tile 20 | mov $7,0 ; color 21 | mov $6,$3 ; height 22 | mov $5,$2 ; width 23 | f31 $5,101010 ; Create new image with size (x, y) and filled with color z 24 | 25 | ; mask 26 | mov $10,$0 ; image 27 | mov $11,$1 ; color 28 | f21 $10,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 29 | 30 | mov $11,$0 ; tile0 31 | mov $12,$5 ; tile1 32 | f31 $10,102110 ; Create a big composition of tiles. 33 | 34 | mov $0,$10 35 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/28bf18c6-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | f11 $0,101160 ; trim 5 | mov $1,$0 6 | f21 $0,101030 ; Image.hstack. horizontal stack of 2 images 7 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/2dee498d-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | mov $4,$0 10 | mov $5,$0 11 | f11 $4,101000 ; Get width of image 12 | f11 $5,101001 ; Get height of image 13 | div $4,3 14 | div $5,$4 15 | mov $1,$4 16 | f21 $0,101220 ; get N top rows 17 | mov $1,$4 18 | f21 $0,101222 ; get N left columns 19 | mov $$82,$0 20 | add $81,100 21 | add $82,100 22 | lpe 23 | 24 | ; template: "d10ecb37-x.asm" 25 | ; mutate: CallRecentProgram, no change 26 | ; mutate: CallRecentProgram, no change 27 | ; mutate: InsertLineWithHistogram, no change 28 | ; mutate: CallRecentProgram, no change 29 | ; mutate: CallRecentProgram, no change 30 | ; mutate: SetSourceToDirect 31 | ; mutate: CallRecentProgram, no change 32 | ; mutate: CallRecentProgram, no change 33 | ; mutate: CallRecentProgram, no change 34 | ; mutate: CallRecentProgram, no change 35 | ; mutate: InsertLineWithHistogram, no change 36 | ; mutate: ReplaceLineWithHistogram 37 | ; mutate: InsertLineWithHistogram, no change 38 | ; mutate: ToggleEnabled 39 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/31aa019c-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:31aa019c 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101070 ; most unpopular color 7 | mov $2,0 ; background color 8 | f31 $0,101051 ; replace colors other than 9 | mov $1,2 ; outline color 10 | mov $2,0 ; background color 11 | f31 $0,101080 ; draw outline 12 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/3428a4f5-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $5,$0 5 | f11 $5,101001 ; get height 6 | div $5,2 7 | 8 | mov $4,$0 9 | f21 $4,101221 ; get N bottom rows 10 | 11 | mov $1,$5 12 | f21 $0,101220 ; get N top rows 13 | 14 | mov $1,$4 15 | f21 $0,101254 ; xor 16 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/39a8645d-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:39a8645d 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,102000 ; most popular object 6 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/3af2c5a8-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:3af2c5a8 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101190 ; flip x 7 | f21 $0,101030 ; hstack 8 | mov $1,$0 9 | f11 $1,101191 ; flip y 10 | f21 $0,101040 ; vstack 11 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/3c9b0459-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:3c9b0459 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101192 ; flip xy 6 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/3de23699-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:3de23699 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $10,$0 6 | f11 $10,101060 ; most popular color 7 | 8 | f11 $0,101160 ; trim 9 | 10 | ; get corner pixel color 11 | mov $3,$0 12 | mov $4,0 13 | mov $5,0 14 | f31 $3,101002 ; get top/left pixel 15 | ; $3 now holds the color of the corner pixel 16 | 17 | ; remove border 18 | mov $1,1 ; number of columns = 1 19 | f21 $0,101224 ; remove top row 20 | f21 $0,101225 ; remove bottom row 21 | f21 $0,101226 ; remove left column 22 | f21 $0,101227 ; remove right column 23 | 24 | ; replace colors with the corner pixel color 25 | mov $1,$10 26 | mov $2,$3 27 | f31 $0,101051 ; replace colors other than 28 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/44f52bb0-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:44f52bb0 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101190 ; flip x 7 | cmp $0,$1 8 | mov $2,1 ; color when there is symmetry 9 | mul $2,$0 10 | cmp $0,0 11 | mul $0,7 ; color when there is no symmetry 12 | add $2,$0 13 | mov $0,1 ; output image width 14 | mov $1,1 ; output image height 15 | f31 $0,101010 ; create image 16 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/496994bd-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:496994bd 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | mov $2,$0 7 | f11 $2,101060 ; most popular color 8 | f11 $1,101191 ; flip y 9 | f31 $0,101150 ; overlay 10 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/49d1d64f-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $1,1 5 | mov $2,0 6 | f31 $0,102160 ; Expand by repeating the outer-most pixel border 7 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/4c4377d9-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:4c4377d9 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $0,101191 ; flip y 7 | f21 $0,101040 ; vstack 8 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/50cb2852-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $1,$0 5 | f11 $1,102140 ; Traverse all pixels in the 3x3 convolution and count how many have the same color as the center. 6 | mov $2,8 7 | f21 $1,101253 ; Convert to a mask image by converting `pixel_color >= threshold_color` to 1 and converting anything else to to 0. 8 | 9 | mov $2,$0 10 | mov $3,0 11 | f21 $2,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 12 | 13 | f21 $1,101255 ; AND between two masks 14 | 15 | mov $3,42 16 | mov $2,$0 17 | f31 $1,102131 ; Pick pixels from image and color. When the mask is 0 then pick from the image. When the mask is [1..255] then use the `default_color`. 18 | 19 | mov $0,$1 20 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/5582e5ca-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:5582e5ca 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: advanced 4 | 5 | mov $80,$99 6 | mov $81,100 7 | mov $82,102 8 | lps $80 9 | mov $0,$$81 10 | mov $1,$0 11 | f11 $1,101060 ; Image the 1 most popular colors, sorted by popularity 12 | mov $2,$1 13 | f31 $0,101051 ; Image: replace colors other than x with color y 14 | mov $$82,$0 15 | add $81,100 16 | add $82,100 17 | lpe 18 | 19 | ; template: "9565186b-1.asm" 20 | ; mutate: SetSourceToDirect 21 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/5614dbcf-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:5614dbcf 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,3 ; number of noise colors to remove 6 | f21 $0,101092 ; denoise type 3 7 | f11 $0,101140 ; remove duplicates 8 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/5ad4f10b-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:5ad4f10b 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | mov $2,$0 7 | mov $3,$0 8 | mov $9,$0 9 | 10 | f11 $3,101060 ; most popular color 11 | ; $3 is background_color 12 | 13 | mov $5,$0 ; noisy image 14 | mov $6,$3 ; background_color 15 | f21 $5,101090 ; denoise type 1 16 | ; $5 is denoised image 17 | 18 | ; $9 is noisy image 19 | mov $10,$5 ; denoised image 20 | f21 $9,101100 ; extract 1 noise color 21 | ; $9 is the most popular noise color 22 | 23 | mov $12,$5 ; denoised image 24 | f11 $12,101160 ; trim 25 | f11 $12,101140 ; remove duplicates 26 | 27 | mov $0,$12 28 | mov $1,$3 ; background color 29 | mov $2,$9 ; noise color 30 | f31 $0,101051 ; replace colors other than 31 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/5b6cbef5-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | ; tile_width 5 | mov $2,$0 6 | f11 $2,101000 ; Get width of image 7 | mov $3,5 8 | f20 $2,1033 ; Assert input[0] is less than or equal to input[1]. 9 | 10 | ; tile_height 11 | mov $3,$0 12 | f11 $3,101001 ; Get height of image 13 | mov $4,5 14 | f20 $3,1033 ; Assert input[0] is less than or equal to input[1]. 15 | 16 | ; tile 17 | mov $7,0 ; color 18 | mov $6,$3 ; height 19 | mov $5,$2 ; width 20 | f31 $5,101010 ; Create new image with size (x, y) and filled with color z 21 | 22 | ; mask 23 | mov $10,$0 ; image 24 | mov $11,$1 ; color 25 | f21 $10,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 26 | 27 | mov $11,$5 ; tile0 28 | mov $12,$0 ; tile1 29 | f31 $10,102110 ; Create a big composition of tiles. 30 | 31 | mov $0,$10 32 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/60c09cac-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | mov $1,$0 10 | f11 $1,101000 ; Get width of image 11 | mov $2,5 12 | f20 $1,1033 ; Assert input[0] is less than or equal to input[1]. 13 | mov $2,$0 14 | f11 $2,101001 ; Get height of image 15 | mov $3,5 16 | f20 $2,1033 ; Assert input[0] is less than or equal to input[1]. 17 | mov $5,$0 18 | f11 $5,101240 ; Number of unique colors in image. 19 | sub $5,1 20 | mul $1,$5 21 | mul $2,$5 22 | f31 $0,101200 ; Resize image to size width x height 23 | mov $$82,$0 24 | add $81,100 25 | add $82,100 26 | lpe 27 | 28 | ; template: "b91ae062-1.asm" 29 | ; mutate: ReplaceLineWithHistogram 30 | ; mutate: ReplaceLineWithHistogram 31 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/6150a2bd-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:6150a2bd 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,2 6 | f21 $0,101170 ; rotate 7 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/67a3c6ac-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:67a3c6ac 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101190 ; flip x 6 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/68b16354-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:68b16354 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101191 ; flip y 6 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/68b67ca3-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | f11 $0,101120 ; Image: remove grid patterns. 10 | f11 $1,101140 ; Image: Remove duplicate rows/columns 11 | mov $$82,$0 12 | add $81,100 13 | add $82,100 14 | lpe 15 | 16 | ; template: "90c28cc7-1.asm" 17 | ; mutate: CallRecentProgram, no change 18 | ; mutate: CallLeastPopularProgram, no change 19 | ; mutate: CallRecentProgram, no change 20 | ; mutate: CallRecentProgram, no change 21 | ; mutate: CallRecentProgram, no change 22 | ; mutate: CallLeastPopularProgram, no change 23 | ; mutate: ReplaceLineWithHistogram 24 | ; mutate: SetSourceToDirect, no change 25 | ; mutate: CallRecentProgram, no change 26 | ; mutate: CallRecentProgram, no change 27 | ; mutate: ReplaceSourceWithHistogram, no change 28 | ; mutate: IncrementSourceValueWhereTypeIsDirect, no change 29 | ; mutate: CallRecentProgram, no change 30 | ; mutate: CallRecentProgram, no change 31 | ; mutate: ReplaceLineWithHistogram 32 | ; mutate: IncrementTargetValueWhereTypeIsDirect 33 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/6d0aefbc-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:6d0aefbc 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101190 ; flip x 7 | f21 $0,101030 ; hstack 8 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/6fa7a44f-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:6fa7a44f 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: advanced 4 | 5 | mov $80,$99 6 | mov $81,100 7 | mov $82,102 8 | lps $80 9 | mov $0,$$81 10 | mov $1,$0 11 | f11 $1,101190 ; Image: flip x 12 | mov $1,$0 13 | f11 $1,101191 ; Image: flip y 14 | f21 $0,101040 ; Image.vstack. vertical stack of 2 images 15 | mov $$82,$0 16 | add $81,100 17 | add $82,100 18 | lpe 19 | 20 | ; template: "3af2c5a8-1.asm" 21 | ; mutate: ReplaceLineWithHistogram, no change 22 | ; mutate: ReplaceLineWithHistogram, no change 23 | ; mutate: CallLeastPopularProgram, no change 24 | ; mutate: ToggleEnabled 25 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/73182012-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | f11 $0,101160 ; Image: Trim border using histogram of border pixels 10 | mov $4,$0 11 | mov $5,$0 12 | f11 $4,101000 ; Get width of image 13 | f11 $5,101001 ; Get height of image 14 | div $4,2 15 | div $5,2 16 | mov $1,$4 17 | f21 $0,101220 ; get N top rows 18 | mov $1,$5 19 | f21 $0,101222 ; get N left columns 20 | mov $$82,$0 21 | add $81,100 22 | add $82,100 23 | lpe 24 | 25 | ; template: "2013d3e2-1.asm" 26 | ; mutate: ReplaceLineWithHistogram 27 | ; mutate: ReplaceLineWithHistogram 28 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/7468f01a-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:7468f01a 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101160 ; trim 6 | f11 $0,101190 ; flip x 7 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/74dd1130-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $1,-1 5 | f21 $0,101170 ; rotate counter clockwise by 90 6 | f11 $0,101191 ; Image: flip y 7 | 8 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/7f4411dc-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:7f4411dc 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101060 ; most popular color 7 | 8 | ; $0 is noisy image 9 | ; $1 is background_color 10 | f21 $0,101090 ; denoise type 1 11 | ; $0 is denoised image 12 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/7fe24cdd-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:7fe24cdd 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $5,$0 ; original corner 6 | 7 | ; construct top half 8 | mov $1,$0 9 | mov $2,1 10 | f21 $1,101170 ; rotate cw 11 | f21 $0,101030 ; hstack 12 | ; $0 is top half 13 | 14 | ; construct bottom half 15 | mov $6,2 16 | f21 $5,101170 ; rotate cw cw 17 | mov $1,$5 18 | mov $2,1 19 | f21 $1,101170 ; rotate cw 20 | mov $2,$5 21 | f21 $1,101030 ; hstack 22 | ; $1 is bottom half 23 | 24 | ; join top half and bottom half 25 | f21 $0,101040 ; vstack 26 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/80af3007-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $3,$0 5 | f11 $3,101060 ; most popular color 6 | ; $3 is background_color 7 | 8 | ; remove space around the object 9 | mov $5,$0 10 | f11 $5,101160 ; trim 11 | 12 | ; scaled down to 3x3 13 | mov $8,$5 14 | mov $9,3 15 | mov $10,3 16 | f31 $8,101200 ; resize 17 | 18 | ; mask 19 | mov $10,$8 ; image 20 | mov $11,$3 ; color 21 | f21 $10,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 22 | 23 | ; an empty tile 24 | mov $14,$3 ; color 25 | mov $13,3 ; height 26 | mov $12,3 ; width 27 | f31 $12,101010 ; Create new image with size (x, y) and filled with color z 28 | 29 | ; Layout tiles 30 | mov $15,$10 31 | mov $16,$12 ; tile0 32 | mov $17,$8 ; tile1 33 | f31 $15,102110 ; Create a big composition of tiles. 34 | mov $0,$15 35 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/88a62173-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:88a62173 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,102001 ; least popular object 6 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/90c28cc7-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:90c28cc7 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101160 ; trim 6 | f11 $0,101140 ; remove duplicates 7 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/9172f3a0-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:9172f3a0 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | mov $2,$0 7 | f11 $1,101000 ; get width 8 | f11 $2,101001 ; get height 9 | mul $1,3 10 | mul $2,3 11 | ; $1 is width 12 | ; $2 is height 13 | f31 $0,101200 ; resize image 14 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/94f9d214-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $5,$0 5 | f11 $5,101001 ; get height 6 | div $5,2 7 | 8 | mov $4,$0 9 | f21 $4,101221 ; get N bottom rows 10 | 11 | mov $1,$5 12 | f21 $0,101220 ; get N top rows 13 | 14 | mov $1,$4 15 | f21 $0,101256 ; or 16 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/9565186b-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:9565186b 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101060 ; most popular color 7 | mov $2,5 8 | f31 $0,101051 ; replace colors other than color 9 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/9f236235-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:9f236235 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | 6 | f11 $0,101120 ; remove grid 7 | f11 $0,101140 ; remove duplicates 8 | f11 $0,101190 ; flip x 9 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/a416b8f3-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:a416b8f3 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: advanced 4 | 5 | mov $80,$99 6 | mov $81,100 7 | mov $82,102 8 | lps $80 9 | mov $0,$$81 10 | mov $1,$0 11 | f21 $0,101030 ; Image.hstack. horizontal stack of 2 images 12 | mov $$82,$0 13 | add $81,100 14 | add $82,100 15 | lpe 16 | 17 | ; template: "6d0aefbc-1.asm" 18 | ; mutate: ReplaceTargetWithHistogram, no change 19 | ; mutate: ToggleEnabled 20 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/a79310a0-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:a79310a0 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,0 6 | mov $2,1 7 | f31 $0,101180 ; offset dx,dy 8 | mov $1,8 9 | mov $2,2 10 | f31 $0,101050 ; replace color with color 11 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/b6afb2da-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | mov $83,105 ; address of vector[0].OutputImageIsInputImageWithChangesLimitedToPixelsWithColor 8 | lps $80 9 | mov $0,$$81 10 | 11 | mov $4,$0 12 | f11 $4,102140 ; Traverse all pixels in the 3x3 convolution and count how many have the same color as the center. 13 | 14 | mov $5,$0 15 | mov $6,$$83 16 | f21 $5,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 17 | 18 | mov $8,42 19 | mov $7,$4 20 | mov $6,$5 21 | f31 $6,102131 ; Pick pixels from color and image. When the mask is 0 then pick the `default_color`. When the mask is [1..255] then pick from the image. 22 | 23 | mov $$82,$6 24 | add $81,100 25 | add $82,100 26 | add $83,100 27 | lpe 28 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/b91ae062-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:b91ae062 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101000 ; get width 7 | mov $2,5 8 | f20 $1,1033 ; Assert input[0] is less than or equal to input[1]. 9 | 10 | mov $2,$0 11 | f11 $2,101001 ; get height 12 | mov $3,5 13 | f20 $2,1033 ; Assert input[0] is less than or equal to input[1]. 14 | 15 | mov $5,$0 16 | f11 $5,101240 ; number of unique colors 17 | sub $5,1 18 | 19 | mul $1,$5 20 | mul $2,$5 21 | 22 | f31 $0,101200 ; resize image 23 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/b9b7f026-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:b9b7f026 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101060 ; most popular color 7 | ; $1 is background color 8 | f21 $0,101110 ; detect holes 9 | 10 | mov $2,$0 11 | f11 $2,101070 ; least popular color 12 | ; $2 is the corner color 13 | 14 | mov $0,1 ; width=1 15 | mov $1,1 ; height=1 16 | f31 $0,101010 ; create image with color 17 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/bbc9ae5d-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:bbc9ae5d 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $10,$0 6 | f11 $10,101000 ; get image width 7 | div $10,2 8 | ; $10 is the height of the final image 9 | mov $11,8 10 | f20 $10,1033 ; Assert input[0] is less than or equal to input[1]. 11 | 12 | mov $2,0 13 | mov $7,0 14 | lps $10 15 | 16 | ; clone the input image, and offset it 17 | mov $4,$7 18 | mov $5,0 19 | mov $3,$0 20 | f31 $3,101181 ; offset clamp 21 | 22 | ; glue onto the bottom of the result image 23 | f21 $2,101040 ; vstack 24 | 25 | add $7,1 26 | lpe 27 | mov $0,$2 28 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/bda2d7a6-2.asm: -------------------------------------------------------------------------------- 1 | ; ARC:bda2d7a6 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $33,$0 6 | f11 $33,101000 ; get width of image 7 | div $33,2 ; $33 is half width 8 | 9 | mov $30,$0 10 | f11 $30,101001 ; get height of image 11 | div $30,2 ; $30 is half height 12 | 13 | ; move the mid-row to the bottom 14 | mov $20,$0 15 | mov $21,0 16 | mov $22,$30 17 | f31 $20,101180 ; offset 18 | 19 | ; take just the mid row 20 | mov $21,1 21 | f21 $20,101221 ; take bottom row 22 | 23 | ; take half-width of the pixels 24 | mov $21,$33 25 | f21 $20,101222 ; take left half of image 26 | ; $20 is mid row, left half of input image 27 | 28 | mov $11,$20 29 | mov $12,1 30 | mov $13,0 31 | f31 $11,101180 ; offset, cycles the palette by 1 pixel 32 | 33 | mov $10,$20 34 | f21 $10,101040 ; vstack 35 | ; $10 is a 2xN image, the top row is the source colors, the bottom row is the target colors 36 | 37 | ; replace colors of the image using the palette image 38 | mov $1,$10 ; palette image 39 | f21 $0,101052 ; replace colors using palette image 40 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/c3202e5a-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 ; address of vector[0].InputImage 6 | mov $82,102 ; address of vector[0].ComputedOutputImage 7 | mov $83,110 ; address of vector[0].EnumeratedObjects 8 | lps $80 9 | mov $0,$$81 10 | 11 | mov $1,$$83 ; enumerated objects 12 | f21 $0,104000 ; Count unique colors in each object 13 | 14 | ; $1 is the enumerated objects 15 | f21 $0,104100 ; Pick object with the smallest value 16 | 17 | mov $1,255 ; color for the area to be trimmed 18 | mov $2,$$81 19 | f31 $0,102130 ; Pick pixels from color and image 20 | 21 | ; $1 is the color to be trimmed 22 | f21 $0,101161 ; trim with color 23 | 24 | mov $$82,$0 25 | add $81,100 26 | add $82,100 27 | add $83,100 28 | lpe 29 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/c3e719e8-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:c3e719e8 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | f11 $1,101060 ; most popular color 7 | 8 | ; tile_width 9 | mov $2,$0 10 | f11 $2,101000 ; Get width of image 11 | mov $3,5 12 | f20 $2,1033 ; Assert input[0] is less than or equal to input[1]. 13 | 14 | ; tile_height 15 | mov $3,$0 16 | f11 $3,101001 ; Get height of image 17 | mov $4,5 18 | f20 $3,1033 ; Assert input[0] is less than or equal to input[1]. 19 | 20 | ; tile 21 | mov $7,0 ; color 22 | mov $6,$3 ; height 23 | mov $5,$2 ; width 24 | f31 $5,101010 ; Create new image with size (x, y) and filled with color z 25 | 26 | ; mask 27 | mov $10,$0 ; image 28 | mov $11,$1 ; color 29 | f21 $10,101251 ; Convert to a mask image by converting `color` to 0 and converting anything else to to 1. 30 | 31 | mov $11,$0 ; tile0 32 | mov $12,$5 ; tile1 33 | f31 $10,102110 ; Create a big composition of tiles. 34 | 35 | mov $0,$10 36 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/c59eb873-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:c59eb873 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,$0 6 | mov $2,$0 7 | f11 $1,101000 ; get width 8 | f11 $2,101001 ; get height 9 | mul $1,2 10 | mul $2,2 11 | ; $1 is width 12 | ; $2 is height 13 | f31 $0,101200 ; resize image 14 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/ccd554ac-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $1,$0 5 | f11 $1,101000 ; Get width of image 6 | mov $2,5 7 | f20 $1,1033 ; Assert input[0] is less than or equal to input[1]. 8 | 9 | mov $2,$0 10 | f11 $2,101001 ; Get height of image 11 | mov $3,5 12 | f20 $2,1033 ; Assert input[0] is less than or equal to input[1]. 13 | 14 | ; $1 is count x = width of the image 15 | ; $2 is count y = height of the image 16 | f31 $0,102120 ; Make a big image by repeating the current image. 17 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/d4b1c2b1-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | mov $1,$0 10 | f11 $1,101000 ; Get width of image 11 | mov $2,5 12 | f20 $1,1033 ; Assert input[0] is less than or equal to input[1]. 13 | mov $2,$0 14 | f11 $2,101001 ; Get height of image 15 | mov $3,5 16 | f20 $2,1033 ; Assert input[0] is less than or equal to input[1]. 17 | mov $5,$0 18 | f11 $5,101240 ; Number of unique colors in image. 19 | sub $5,0 20 | mul $1,$5 21 | mul $2,$5 22 | f31 $0,101200 ; Resize image to size width x height 23 | mov $$82,$0 24 | add $81,100 25 | add $82,100 26 | lpe 27 | 28 | ; template: "b91ae062-1.asm" 29 | ; mutate: CallRecentProgram, no change 30 | ; mutate: CallRecentProgram, no change 31 | ; mutate: CallRecentProgram, no change 32 | ; mutate: ReplaceLineWithHistogram 33 | ; mutate: CallMediumPopularProgram, no change 34 | ; mutate: CallRecentProgram, no change 35 | ; mutate: DecrementSourceValueWhereTypeIsConstant 36 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/e1baa8a4-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | mov $1,3 10 | f21 $0,101092 ; Denoise type3. denoise noisy pixels. Takes a 2nd parameter: number of repair iterations. 11 | f11 $0,101140 ; Image: Remove duplicate rows/columns 12 | mov $$82,$0 13 | add $81,100 14 | add $82,100 15 | lpe 16 | 17 | ; template: "5614dbcf-1.asm" 18 | ; mutate: ReplaceLineWithHistogram 19 | ; mutate: ReplaceLineWithHistogram 20 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/eb281b96-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $1,$0 5 | f11 $1,101191 ; Image: flip y 6 | 7 | mov $2,1 ; number of rows = 1 8 | f21 $1,101224 ; remove top row 9 | 10 | f21 $0,101040 ; vstack 11 | 12 | mov $1,$0 13 | f11 $1,101191 ; Image: flip y 14 | 15 | mov $2,1 ; number of rows = 1 16 | f21 $1,101224 ; remove top row 17 | 18 | f21 $0,101040 ; vstack 19 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/eb5a1d5d-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:eb5a1d5d 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101140 ; remove duplicates 6 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/eb5a1d5d-2.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | mov $1,3 10 | f21 $0,101092 ; Denoise type3. denoise noisy pixels. Takes a 2nd parameter: number of repair iterations. 11 | f11 $0,101140 ; Image: Remove duplicate rows/columns 12 | mov $$82,$0 13 | add $81,100 14 | add $82,100 15 | lpe 16 | 17 | ; template: "5614dbcf-1.asm" 18 | ; mutate: ReplaceLineWithHistogram 19 | ; mutate: ReplaceLineWithHistogram 20 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/ed36ccf7-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:ed36ccf7 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | mov $1,-1 6 | f21 $0,101170 ; rotate 7 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/f25fbde4-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $1,0 5 | f21 $0,101161 ; Image: Trim border with color to be trimmed 6 | 7 | mov $1,$0 8 | f11 $1,101000 ; Get width of image 9 | mul $1,2 10 | 11 | mov $2,$0 12 | f11 $2,101001 ; Get height of image 13 | mul $2,2 14 | 15 | f31 $0,101200 ; Resize image 16 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/f25ffba3-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | lps $80 8 | mov $0,$$81 9 | mov $5,$0 10 | mov $1,$0 11 | mov $2,$0 12 | f11 $1,101191 ; Image: flip y 13 | f11 $2,101060 ; Image the 1 most popular colors, sorted by popularity 14 | f31 $0,101150 ; Image: Overlay another image by using a color as mask 15 | mov $$82,$0 16 | add $81,100 17 | add $82,100 18 | lpe 19 | 20 | ; template: "496994bd-1.asm" 21 | ; mutate: ReplaceLineWithHistogram 22 | ; mutate: InsertLineWithHistogram 23 | ; mutate: CallRecentProgram, no change 24 | ; mutate: SwapAdjacentRows 25 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/f2829549-1.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: simple 3 | 4 | mov $5,$0 5 | f11 $5,101000 ; get width 6 | div $5,2 7 | 8 | mov $4,$0 9 | f21 $4,101222 ; get N left columns 10 | 11 | mov $1,$5 12 | f21 $0,101223 ; get N right columns 13 | 14 | mov $1,$4 15 | f21 $0,101256 ; or 16 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/f8b3ba0a-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:f8b3ba0a 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: advanced 4 | 5 | mov $80,$99 6 | mov $81,100 7 | mov $82,102 8 | lps $80 9 | mov $0,$$81 10 | f11 $0,101230 ; Histogram of image. The most popular to the left, least popular to the right. The top row is the counters. The bottom row is the colors. 11 | mov $1,1 12 | f21 $0,101221 ; get N bottom rows 13 | mov $1,2 14 | f21 $0,101226 ; remove N left columns 15 | mov $1,1 16 | f21 $0,101170 ; Image: Rotate by x * 90 degrees 17 | mov $$82,$0 18 | add $81,100 19 | add $82,100 20 | lpe 21 | 22 | ; template: "f8ff0b80-1.asm" 23 | ; mutate: ReplaceSourceConstantWithHistogram 24 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/f8ff0b80-1.asm: -------------------------------------------------------------------------------- 1 | ; ARC:f8ff0b80 2 | ; Submitted by Simon Strandgaard 3 | ; Program Type: simple 4 | 5 | f11 $0,101230 ; convert image to histogram 6 | 7 | mov $1,1 ; number of rows = 1 8 | f21 $0,101221 ; take bottom row 9 | 10 | mov $1,1 ; number of columns = 1 11 | f21 $0,101226 ; remove left column 12 | 13 | mov $1,1 ; 90 degrees cw 14 | f21 $0,101170 ; rotate 15 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/repair-mosaic.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $81,100 6 | mov $82,102 7 | mov $83,105 ; address of vector[0].OutputImageIsInputImageWithChangesLimitedToPixelsWithColor 8 | lps $80 9 | mov $0,$$81 10 | mov $1,$$83 11 | f21 $0,102151 ; Repair damaged pixels and recreate big repeating patterns such as mosaics. 12 | mov $$82,$0 13 | add $81,100 14 | add $82,100 15 | add $83,100 16 | lpe 17 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/repair-symmetry-and-crop.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $82,102 ; address of vector[0].ComputedOutputImage 6 | mov $83,106 ; address of vector[0].RepairMask 7 | mov $84,107 ; address of vector[0].RepairedImage 8 | lps $80 9 | ; replace what is outside the repair mask with the color 255 10 | mov $0,$$83 ; repair mask 11 | mov $1,255 ; color for what to be removed 12 | mov $2,$$84 ; repaired image 13 | f31 $0,102130 ; Pick pixels from color and image. When the mask is 0 then pick the `default_color`. When the mask is [1..255] then pick from the image. 14 | 15 | ; crop out the repair mask 16 | mov $1,255 17 | f21 $0,101161 ; trim with color 18 | 19 | mov $$82,$0 20 | add $82,100 21 | add $83,100 22 | add $84,100 23 | lpe 24 | -------------------------------------------------------------------------------- /rust_project/arc-competition/payload/loda-arc-challenge/programs/repair-symmetry.asm: -------------------------------------------------------------------------------- 1 | ; Submitted by Simon Strandgaard 2 | ; Program Type: advanced 3 | 4 | mov $80,$99 5 | mov $82,102 ; address of vector[0].ComputedOutputImage 6 | mov $83,107 ; address of vector[0].RepairedImage 7 | lps $80 8 | mov $$82,$$83 9 | add $82,100 10 | add $83,100 11 | lpe 12 | -------------------------------------------------------------------------------- /rust_project/arc-competition/secret_data/solution/solution_notXORdinary.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /rust_project/arc-competition/secret_data/training/1e0a9b12.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 4, 0, 9], [0, 0, 0, 0], [0, 4, 6, 0], [1, 0, 0, 0]], "output": [[0, 0, 0, 0], [0, 0, 0, 0], [0, 4, 0, 0], [1, 4, 6, 9]]}, {"input": [[0, 0, 0, 0, 0, 9], [0, 0, 0, 8, 0, 0], [0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0], [4, 0, 7, 8, 0, 0], [4, 0, 7, 0, 0, 0]], "output": [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0], [4, 0, 7, 8, 0, 0], [4, 0, 7, 8, 0, 9]]}, {"input": [[0, 0, 0, 1, 0], [0, 3, 0, 0, 0], [0, 3, 0, 1, 2], [6, 0, 0, 0, 0], [0, 3, 0, 0, 0]], "output": [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 3, 0, 0, 0], [0, 3, 0, 1, 0], [6, 3, 0, 1, 2]]}], "test": [{"input": [[0, 2, 0, 4, 3], [5, 0, 0, 0, 0], [0, 0, 6, 0, 0], [5, 2, 0, 4, 0], [5, 0, 0, 0, 0]], "output": [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [5, 0, 0, 0, 0], [5, 2, 0, 4, 0], [5, 2, 6, 4, 3]]}]} -------------------------------------------------------------------------------- /rust_project/arc-competition/secret_data/training/9565186b.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[2, 2, 2], [2, 1, 8], [2, 8, 8]], "output": [[2, 2, 2], [2, 5, 5], [2, 5, 5]]}, {"input": [[1, 1, 1], [8, 1, 3], [8, 2, 2]], "output": [[1, 1, 1], [5, 1, 5], [5, 5, 5]]}, {"input": [[2, 2, 2], [8, 8, 2], [2, 2, 2]], "output": [[2, 2, 2], [5, 5, 2], [2, 2, 2]]}, {"input": [[3, 3, 8], [4, 4, 4], [8, 1, 1]], "output": [[5, 5, 5], [4, 4, 4], [5, 5, 5]]}], "test": [{"input": [[1, 3, 2], [3, 3, 2], [1, 3, 2]], "output": [[5, 3, 5], [3, 3, 5], [5, 3, 5]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/analytics/analytics_error.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | use std::fmt; 3 | 4 | #[derive(Debug, PartialEq)] 5 | pub enum AnalyticsError { 6 | BatchProgramAnalyzer(String), 7 | } 8 | 9 | impl fmt::Display for AnalyticsError { 10 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 11 | match self { 12 | Self::BatchProgramAnalyzer(message) => 13 | write!(f, "BatchProgramAnalyzer. message: {}", message), 14 | } 15 | } 16 | } 17 | 18 | impl Error for AnalyticsError {} 19 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/analytics/analytics_mode.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone, Copy, Debug, PartialEq)] 2 | pub enum AnalyticsMode { 3 | OEIS, 4 | ARC, 5 | } 6 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/arc_work_model_impl_output.rs: -------------------------------------------------------------------------------- 1 | use super::{arc_work_model}; 2 | 3 | impl arc_work_model::Output { 4 | pub fn update_image_meta(&mut self) -> anyhow::Result<()> { 5 | self.image_meta.analyze(&self.image)?; 6 | Ok(()) 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/pixel_connectivity.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] 2 | pub enum PixelConnectivity { 3 | /// Considers only the 4 neighbors around the center pixel, the top/bottom/left/right pixels. 4 | /// 5 | /// Don't visit the corners. 6 | Connectivity4, 7 | 8 | /// Considers all the 8 neighbors around the center pixel. 9 | /// 10 | /// This can be useful for diagonal flood filling via corners. 11 | Connectivity8, 12 | } 13 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/prompt.rs: -------------------------------------------------------------------------------- 1 | use super::{TaskGraph, Image}; 2 | 3 | pub trait PromptSerialize { 4 | /// Convert the `TaskGraph` to a string that can be used as a prompt for a language model. 5 | /// 6 | /// Known problem: It can only prompts about the first `test` pair. 7 | /// The tasks that have more than one `test` pair, will not create prompts for the remaining `test` pairs. 8 | fn to_prompt(&self, task_graph: &TaskGraph) -> anyhow::Result; 9 | } 10 | 11 | /// Reply from the language model 12 | pub trait PromptDeserialize { 13 | /// Extract image from the reply from the language model. 14 | fn image(&self) -> anyhow::Result; 15 | 16 | /// Extract status message from the reply from the language model. 17 | /// 18 | /// What kind of problems were there interpreting the reply. 19 | fn status(&self) -> Option; 20 | } 21 | 22 | #[derive(Debug, Clone)] 23 | pub enum PromptType { 24 | ShapeAndTransformConnectivity4, 25 | ShapeAndTransformConnectivity8, 26 | RunLengthEncoding, 27 | Position, 28 | Compact, 29 | } 30 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/read_testdata.rs: -------------------------------------------------------------------------------- 1 | use std::path::PathBuf; 2 | use std::fs; 3 | 4 | pub fn path_testdata(name: &str) -> anyhow::Result { 5 | let e = env!("CARGO_MANIFEST_DIR"); 6 | let relative_path = format!("src/arc/testdata/{}.json", name); 7 | let path = PathBuf::from(e).join(relative_path); 8 | if !path.is_file() { 9 | return Err(anyhow::anyhow!("missing testdata for name {:?}, path: {:?}", name, path)); 10 | } 11 | Ok(path) 12 | } 13 | 14 | pub fn read_testdata(name: &str) -> anyhow::Result { 15 | let path: PathBuf = path_testdata(name)?; 16 | let json_string: String = match fs::read_to_string(&path) { 17 | Ok(value) => value, 18 | Err(error) => { 19 | return Err(anyhow::anyhow!("cannot load file for name {:?}, error: {:?} path: {:?}", name, error, path)); 20 | } 21 | }; 22 | Ok(json_string) 23 | } 24 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/017c7c7b.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 1, 0], [1, 1, 0], [0, 1, 0], [0, 1, 1], [0, 1, 0], [1, 1, 0]], "output": [[0, 2, 0], [2, 2, 0], [0, 2, 0], [0, 2, 2], [0, 2, 0], [2, 2, 0], [0, 2, 0], [0, 2, 2], [0, 2, 0]]}, {"input": [[0, 1, 0], [1, 0, 1], [0, 1, 0], [1, 0, 1], [0, 1, 0], [1, 0, 1]], "output": [[0, 2, 0], [2, 0, 2], [0, 2, 0], [2, 0, 2], [0, 2, 0], [2, 0, 2], [0, 2, 0], [2, 0, 2], [0, 2, 0]]}, {"input": [[0, 1, 0], [1, 1, 0], [0, 1, 0], [0, 1, 0], [1, 1, 0], [0, 1, 0]], "output": [[0, 2, 0], [2, 2, 0], [0, 2, 0], [0, 2, 0], [2, 2, 0], [0, 2, 0], [0, 2, 0], [2, 2, 0], [0, 2, 0]]}], "test": [{"input": [[1, 1, 1], [0, 1, 0], [0, 1, 0], [1, 1, 1], [0, 1, 0], [0, 1, 0]], "output": [[2, 2, 2], [0, 2, 0], [0, 2, 0], [2, 2, 2], [0, 2, 0], [0, 2, 0], [2, 2, 2], [0, 2, 0], [0, 2, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/0520fde7.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[1, 0, 0, 5, 0, 1, 0], [0, 1, 0, 5, 1, 1, 1], [1, 0, 0, 5, 0, 0, 0]], "output": [[0, 0, 0], [0, 2, 0], [0, 0, 0]]}, {"input": [[1, 1, 0, 5, 0, 1, 0], [0, 0, 1, 5, 1, 1, 1], [1, 1, 0, 5, 0, 1, 0]], "output": [[0, 2, 0], [0, 0, 2], [0, 2, 0]]}, {"input": [[0, 0, 1, 5, 0, 0, 0], [1, 1, 0, 5, 1, 0, 1], [0, 1, 1, 5, 1, 0, 1]], "output": [[0, 0, 0], [2, 0, 0], [0, 0, 2]]}], "test": [{"input": [[1, 0, 1, 5, 1, 0, 1], [0, 1, 0, 5, 1, 0, 1], [1, 0, 1, 5, 0, 1, 0]], "output": [[2, 0, 2], [0, 0, 0], [0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/0692e18c.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 7, 0], [7, 7, 7], [0, 7, 0]], "output": [[0, 0, 0, 7, 0, 7, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 7, 0, 7, 0, 0, 0], [7, 0, 7, 7, 0, 7, 7, 0, 7], [0, 0, 0, 0, 0, 0, 0, 0, 0], [7, 0, 7, 7, 0, 7, 7, 0, 7], [0, 0, 0, 7, 0, 7, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 7, 0, 7, 0, 0, 0]]}, {"input": [[0, 0, 6], [0, 6, 0], [6, 0, 0]], "output": [[0, 0, 0, 0, 0, 0, 6, 6, 0], [0, 0, 0, 0, 0, 0, 6, 0, 6], [0, 0, 0, 0, 0, 0, 0, 6, 6], [0, 0, 0, 6, 6, 0, 0, 0, 0], [0, 0, 0, 6, 0, 6, 0, 0, 0], [0, 0, 0, 0, 6, 6, 0, 0, 0], [6, 6, 0, 0, 0, 0, 0, 0, 0], [6, 0, 6, 0, 0, 0, 0, 0, 0], [0, 6, 6, 0, 0, 0, 0, 0, 0]]}, {"input": [[4, 4, 0], [0, 0, 4], [0, 0, 4]], "output": [[0, 0, 4, 0, 0, 4, 0, 0, 0], [4, 4, 0, 4, 4, 0, 0, 0, 0], [4, 4, 0, 4, 4, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 4], [0, 0, 0, 0, 0, 0, 4, 4, 0], [0, 0, 0, 0, 0, 0, 4, 4, 0], [0, 0, 0, 0, 0, 0, 0, 0, 4], [0, 0, 0, 0, 0, 0, 4, 4, 0], [0, 0, 0, 0, 0, 0, 4, 4, 0]]}], "test": [{"input": [[0, 0, 3], [3, 3, 0], [0, 3, 0]], "output": [[0, 0, 0, 0, 0, 0, 3, 3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 3], [0, 0, 0, 0, 0, 0, 3, 0, 3], [3, 3, 0, 3, 3, 0, 0, 0, 0], [0, 0, 3, 0, 0, 3, 0, 0, 0], [3, 0, 3, 3, 0, 3, 0, 0, 0], [0, 0, 0, 3, 3, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 0, 0, 0], [0, 0, 0, 3, 0, 3, 0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/1e0a9b12.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 4, 0, 9], [0, 0, 0, 0], [0, 4, 6, 0], [1, 0, 0, 0]], "output": [[0, 0, 0, 0], [0, 0, 0, 0], [0, 4, 0, 0], [1, 4, 6, 9]]}, {"input": [[0, 0, 0, 0, 0, 9], [0, 0, 0, 8, 0, 0], [0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0], [4, 0, 7, 8, 0, 0], [4, 0, 7, 0, 0, 0]], "output": [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [4, 0, 0, 0, 0, 0], [4, 0, 7, 8, 0, 0], [4, 0, 7, 8, 0, 9]]}, {"input": [[0, 0, 0, 1, 0], [0, 3, 0, 0, 0], [0, 3, 0, 1, 2], [6, 0, 0, 0, 0], [0, 3, 0, 0, 0]], "output": [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 3, 0, 0, 0], [0, 3, 0, 1, 0], [6, 3, 0, 1, 2]]}], "test": [{"input": [[0, 2, 0, 4, 3], [5, 0, 0, 0, 0], [0, 0, 6, 0, 0], [5, 2, 0, 4, 0], [5, 0, 0, 0, 0]], "output": [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [5, 0, 0, 0, 0], [5, 2, 0, 4, 0], [5, 2, 6, 4, 3]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/2013d3e2.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 7, 7, 0, 0, 0, 0], [0, 0, 0, 6, 8, 8, 6, 0, 0, 0], [0, 0, 7, 8, 4, 4, 8, 7, 0, 0], [0, 0, 7, 8, 4, 4, 8, 7, 0, 0], [0, 0, 0, 6, 8, 8, 6, 0, 0, 0], [0, 0, 0, 0, 7, 7, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], "output": [[0, 0, 7], [0, 6, 8], [7, 8, 4]]}, {"input": [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 3, 6, 5, 3, 0, 0, 0, 0], [0, 0, 5, 2, 2, 6, 0, 0, 0, 0], [0, 0, 6, 2, 2, 5, 0, 0, 0, 0], [0, 0, 3, 5, 6, 3, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], "output": [[1, 0, 0], [0, 3, 6], [0, 5, 2]]}], "test": [{"input": [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8, 0, 0, 0, 0], [0, 0, 0, 4, 4, 8, 4, 0, 0, 0], [0, 0, 8, 8, 3, 3, 4, 0, 0, 0], [0, 0, 0, 4, 3, 3, 8, 8, 0, 0], [0, 0, 0, 4, 8, 4, 4, 0, 0, 0], [0, 0, 0, 0, 8, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], "output": [[0, 0, 0], [0, 4, 4], [8, 8, 3]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/25d8a9c8.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[4, 4, 4], [2, 3, 2], [2, 3, 3]], "output": [[5, 5, 5], [0, 0, 0], [0, 0, 0]]}, {"input": [[7, 3, 3], [6, 6, 6], [3, 7, 7]], "output": [[0, 0, 0], [5, 5, 5], [0, 0, 0]]}, {"input": [[2, 9, 2], [4, 4, 4], [9, 9, 9]], "output": [[0, 0, 0], [5, 5, 5], [5, 5, 5]]}, {"input": [[2, 2, 4], [2, 2, 4], [1, 1, 1]], "output": [[0, 0, 0], [0, 0, 0], [5, 5, 5]]}], "test": [{"input": [[4, 4, 4], [3, 2, 3], [8, 8, 8]], "output": [[5, 5, 5], [0, 0, 0], [5, 5, 5]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/3af2c5a8.json: -------------------------------------------------------------------------------- 1 | {"test": [{"input": [[4, 0, 0, 0], [0, 0, 0, 4], [4, 4, 0, 0]], "output": [[4, 0, 0, 0, 0, 0, 0, 4], [0, 0, 0, 4, 4, 0, 0, 0], [4, 4, 0, 0, 0, 0, 4, 4], [4, 4, 0, 0, 0, 0, 4, 4], [0, 0, 0, 4, 4, 0, 0, 0], [4, 0, 0, 0, 0, 0, 0, 4]]}], "train": [{"input": [[0, 0, 8, 0], [0, 8, 0, 8], [0, 0, 8, 0]], "output": [[0, 0, 8, 0, 0, 8, 0, 0], [0, 8, 0, 8, 8, 0, 8, 0], [0, 0, 8, 0, 0, 8, 0, 0], [0, 0, 8, 0, 0, 8, 0, 0], [0, 8, 0, 8, 8, 0, 8, 0], [0, 0, 8, 0, 0, 8, 0, 0]]}, {"input": [[0, 0, 3, 3], [0, 3, 0, 3], [3, 3, 3, 0]], "output": [[0, 0, 3, 3, 3, 3, 0, 0], [0, 3, 0, 3, 3, 0, 3, 0], [3, 3, 3, 0, 0, 3, 3, 3], [3, 3, 3, 0, 0, 3, 3, 3], [0, 3, 0, 3, 3, 0, 3, 0], [0, 0, 3, 3, 3, 3, 0, 0]]}, {"input": [[3, 3, 3, 3], [3, 0, 0, 0], [3, 0, 0, 0]], "output": [[3, 3, 3, 3, 3, 3, 3, 3], [3, 0, 0, 0, 0, 0, 0, 3], [3, 0, 0, 0, 0, 0, 0, 3], [3, 0, 0, 0, 0, 0, 0, 3], [3, 0, 0, 0, 0, 0, 0, 3], [3, 3, 3, 3, 3, 3, 3, 3]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/44f52bb0.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[2, 0, 2], [0, 2, 0], [2, 0, 2]], "output": [[1]]}, {"input": [[2, 0, 0], [2, 0, 0], [0, 2, 0]], "output": [[7]]}, {"input": [[2, 0, 2], [2, 0, 2], [2, 0, 2]], "output": [[1]]}, {"input": [[0, 0, 0], [2, 0, 2], [0, 0, 0]], "output": [[1]]}, {"input": [[2, 2, 0], [0, 2, 2], [0, 0, 0]], "output": [[7]]}, {"input": [[2, 2, 0], [0, 2, 0], [0, 0, 0]], "output": [[7]]}], "test": [{"input": [[2, 0, 2], [2, 2, 2], [2, 0, 2]], "output": [[1]]}, {"input": [[0, 0, 0], [2, 0, 0], [2, 0, 0]], "output": [[7]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/48131b3c.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 8, 0], [8, 0, 8], [0, 0, 0]], "output": [[8, 0, 8, 8, 0, 8], [0, 8, 0, 0, 8, 0], [8, 8, 8, 8, 8, 8], [8, 0, 8, 8, 0, 8], [0, 8, 0, 0, 8, 0], [8, 8, 8, 8, 8, 8]]}, {"input": [[7, 0], [0, 7]], "output": [[0, 7, 0, 7], [7, 0, 7, 0], [0, 7, 0, 7], [7, 0, 7, 0]]}, {"input": [[4, 0, 0, 0], [0, 4, 4, 4], [0, 0, 4, 0], [0, 4, 0, 0]], "output": [[0, 4, 4, 4, 0, 4, 4, 4], [4, 0, 0, 0, 4, 0, 0, 0], [4, 4, 0, 4, 4, 4, 0, 4], [4, 0, 4, 4, 4, 0, 4, 4], [0, 4, 4, 4, 0, 4, 4, 4], [4, 0, 0, 0, 4, 0, 0, 0], [4, 4, 0, 4, 4, 4, 0, 4], [4, 0, 4, 4, 4, 0, 4, 4]]}], "test": [{"input": [[0, 1, 0, 1], [1, 0, 0, 1], [0, 0, 1, 0], [1, 0, 0, 0]], "output": [[1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, 0, 1], [0, 1, 1, 1, 0, 1, 1, 1], [1, 0, 1, 0, 1, 0, 1, 0], [0, 1, 1, 0, 0, 1, 1, 0], [1, 1, 0, 1, 1, 1, 0, 1], [0, 1, 1, 1, 0, 1, 1, 1]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/496994bd.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[2, 2, 2], [2, 2, 2], [3, 3, 3], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]], "output": [[2, 2, 2], [2, 2, 2], [3, 3, 3], [0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0], [3, 3, 3], [2, 2, 2], [2, 2, 2]]}, {"input": [[2, 2, 2, 2, 2], [8, 8, 8, 8, 8], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], "output": [[2, 2, 2, 2, 2], [8, 8, 8, 8, 8], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [8, 8, 8, 8, 8], [2, 2, 2, 2, 2]]}], "test": [{"input": [[3, 3, 3, 3, 3, 3], [5, 5, 5, 5, 5, 5], [5, 5, 5, 5, 5, 5], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]], "output": [[3, 3, 3, 3, 3, 3], [5, 5, 5, 5, 5, 5], [5, 5, 5, 5, 5, 5], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [5, 5, 5, 5, 5, 5], [5, 5, 5, 5, 5, 5], [3, 3, 3, 3, 3, 3]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/49d1d64f.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[1, 2], [3, 8]], "output": [[0, 1, 2, 0], [1, 1, 2, 2], [3, 3, 8, 8], [0, 3, 8, 0]]}, {"input": [[1, 8, 4], [8, 3, 8]], "output": [[0, 1, 8, 4, 0], [1, 1, 8, 4, 4], [8, 8, 3, 8, 8], [0, 8, 3, 8, 0]]}, {"input": [[2, 1, 4], [8, 0, 2], [3, 2, 8]], "output": [[0, 2, 1, 4, 0], [2, 2, 1, 4, 4], [8, 8, 0, 2, 2], [3, 3, 2, 8, 8], [0, 3, 2, 8, 0]]}], "test": [{"input": [[2, 8], [1, 4], [3, 4]], "output": [[0, 2, 8, 0], [2, 2, 8, 8], [1, 1, 4, 4], [3, 3, 4, 4], [0, 3, 4, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/5614dbcf.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[3, 3, 3, 0, 0, 0, 8, 8, 8], [3, 3, 3, 0, 0, 0, 8, 5, 8], [3, 3, 3, 0, 0, 0, 8, 8, 8], [0, 0, 0, 7, 5, 7, 0, 0, 0], [0, 0, 0, 7, 7, 7, 0, 0, 0], [0, 0, 0, 7, 7, 7, 0, 0, 0], [6, 6, 6, 0, 0, 5, 9, 9, 9], [6, 6, 6, 0, 0, 0, 9, 9, 9], [6, 5, 6, 0, 5, 0, 9, 9, 5]], "output": [[3, 0, 8], [0, 7, 0], [6, 0, 9]]}, {"input": [[0, 0, 0, 2, 2, 2, 0, 0, 0], [0, 5, 0, 2, 2, 2, 0, 0, 0], [0, 0, 0, 2, 2, 2, 0, 0, 0], [5, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 5, 0, 0, 0, 5, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 5, 0, 7, 7, 7, 0, 0, 0], [0, 0, 0, 7, 7, 5, 0, 0, 0], [0, 0, 0, 7, 7, 7, 0, 0, 0]], "output": [[0, 2, 0], [0, 0, 0], [0, 7, 0]]}], "test": [{"input": [[4, 4, 4, 0, 0, 0, 0, 5, 0], [5, 4, 4, 0, 0, 0, 0, 0, 0], [4, 4, 4, 0, 5, 0, 0, 0, 0], [0, 0, 0, 3, 3, 3, 0, 5, 0], [0, 0, 0, 3, 3, 3, 0, 0, 0], [0, 0, 0, 3, 3, 3, 0, 0, 0], [0, 0, 5, 9, 9, 9, 0, 0, 0], [0, 0, 0, 9, 5, 9, 0, 0, 0], [0, 0, 0, 9, 9, 9, 0, 0, 0]], "output": [[4, 0, 0], [0, 3, 0], [0, 9, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/6150a2bd.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[3, 3, 8], [3, 7, 0], [5, 0, 0]], "output": [[0, 0, 5], [0, 7, 3], [8, 3, 3]]}, {"input": [[5, 5, 2], [1, 0, 0], [0, 0, 0]], "output": [[0, 0, 0], [0, 0, 1], [2, 5, 5]]}], "test": [{"input": [[6, 3, 5], [6, 8, 0], [4, 0, 0]], "output": [[0, 0, 4], [0, 8, 6], [5, 3, 6]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/662c240a.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[8, 9, 8], [9, 8, 8], [8, 8, 8], [2, 2, 1], [2, 2, 1], [1, 1, 2], [4, 4, 4], [4, 4, 3], [3, 3, 3]], "output": [[4, 4, 4], [4, 4, 3], [3, 3, 3]]}, {"input": [[1, 5, 5], [5, 1, 1], [5, 1, 1], [3, 3, 3], [3, 6, 3], [3, 6, 6], [7, 7, 7], [7, 2, 2], [7, 2, 2]], "output": [[3, 3, 3], [3, 6, 3], [3, 6, 6]]}, {"input": [[2, 2, 2], [2, 2, 3], [2, 3, 3], [5, 7, 7], [7, 5, 5], [7, 5, 5], [8, 8, 1], [1, 8, 1], [1, 8, 1]], "output": [[8, 8, 1], [1, 8, 1], [1, 8, 1]]}, {"input": [[8, 8, 4], [4, 4, 4], [4, 4, 8], [1, 1, 3], [1, 3, 3], [3, 3, 1], [6, 2, 2], [2, 2, 2], [2, 2, 6]], "output": [[8, 8, 4], [4, 4, 4], [4, 4, 8]]}], "test": [{"input": [[5, 4, 4], [4, 5, 4], [4, 5, 4], [3, 3, 2], [3, 3, 2], [2, 2, 3], [1, 1, 1], [1, 8, 8], [1, 8, 8]], "output": [[5, 4, 4], [4, 5, 4], [4, 5, 4]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/6f8cd79b.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 0, 0], [0, 0, 0], [0, 0, 0]], "output": [[8, 8, 8], [8, 0, 8], [8, 8, 8]]}, {"input": [[0, 0, 0], [0, 0, 0], [0, 0, 0], [0, 0, 0]], "output": [[8, 8, 8], [8, 0, 8], [8, 0, 8], [8, 8, 8]]}, {"input": [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], "output": [[8, 8, 8, 8], [8, 0, 0, 8], [8, 0, 0, 8], [8, 0, 0, 8], [8, 8, 8, 8]]}, {"input": [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]], "output": [[8, 8, 8, 8, 8, 8], [8, 0, 0, 0, 0, 8], [8, 0, 0, 0, 0, 8], [8, 0, 0, 0, 0, 8], [8, 8, 8, 8, 8, 8]]}], "test": [{"input": [[0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0]], "output": [[8, 8, 8, 8, 8, 8], [8, 0, 0, 0, 0, 8], [8, 0, 0, 0, 0, 8], [8, 0, 0, 0, 0, 8], [8, 0, 0, 0, 0, 8], [8, 0, 0, 0, 0, 8], [8, 8, 8, 8, 8, 8]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/7fe24cdd.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[8, 5, 0], [8, 5, 3], [0, 3, 2]], "output": [[8, 5, 0, 0, 8, 8], [8, 5, 3, 3, 5, 5], [0, 3, 2, 2, 3, 0], [0, 3, 2, 2, 3, 0], [5, 5, 3, 3, 5, 8], [8, 8, 0, 0, 5, 8]]}, {"input": [[3, 8, 2], [3, 2, 2], [8, 5, 2]], "output": [[3, 8, 2, 8, 3, 3], [3, 2, 2, 5, 2, 8], [8, 5, 2, 2, 2, 2], [2, 2, 2, 2, 5, 8], [8, 2, 5, 2, 2, 3], [3, 3, 8, 2, 8, 3]]}, {"input": [[0, 3, 0], [6, 6, 6], [0, 3, 0]], "output": [[0, 3, 0, 0, 6, 0], [6, 6, 6, 3, 6, 3], [0, 3, 0, 0, 6, 0], [0, 6, 0, 0, 3, 0], [3, 6, 3, 6, 6, 6], [0, 6, 0, 0, 3, 0]]}], "test": [{"input": [[2, 5, 0], [2, 5, 1], [3, 1, 1]], "output": [[2, 5, 0, 3, 2, 2], [2, 5, 1, 1, 5, 5], [3, 1, 1, 1, 1, 0], [0, 1, 1, 1, 1, 3], [5, 5, 1, 1, 5, 2], [2, 2, 3, 0, 5, 2]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/88a62173.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 2, 0, 0, 2], [2, 2, 0, 2, 2], [0, 0, 0, 0, 0], [0, 2, 0, 2, 2], [2, 2, 0, 2, 0]], "output": [[2, 2], [2, 0]]}, {"input": [[1, 0, 0, 1, 0], [0, 1, 0, 0, 1], [0, 0, 0, 0, 0], [1, 0, 0, 1, 0], [1, 1, 0, 0, 1]], "output": [[1, 0], [1, 1]]}, {"input": [[8, 8, 0, 0, 8], [8, 0, 0, 8, 0], [0, 0, 0, 0, 0], [8, 8, 0, 8, 8], [8, 0, 0, 8, 0]], "output": [[0, 8], [8, 0]]}], "test": [{"input": [[5, 5, 0, 5, 0], [0, 5, 0, 0, 5], [0, 0, 0, 0, 0], [5, 5, 0, 5, 5], [0, 5, 0, 0, 5]], "output": [[5, 0], [0, 5]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/8d5021e8.json: -------------------------------------------------------------------------------- 1 | {"test": [{"input": [[3, 3], [3, 0], [3, 3]], "output": [[3, 3, 3, 3], [0, 3, 3, 0], [3, 3, 3, 3], [3, 3, 3, 3], [0, 3, 3, 0], [3, 3, 3, 3], [3, 3, 3, 3], [0, 3, 3, 0], [3, 3, 3, 3]]}], "train": [{"input": [[0, 8], [0, 0], [0, 8]], "output": [[8, 0, 0, 8], [0, 0, 0, 0], [8, 0, 0, 8], [8, 0, 0, 8], [0, 0, 0, 0], [8, 0, 0, 8], [8, 0, 0, 8], [0, 0, 0, 0], [8, 0, 0, 8]]}, {"input": [[2, 0], [2, 2], [2, 0]], "output": [[0, 2, 2, 0], [2, 2, 2, 2], [0, 2, 2, 0], [0, 2, 2, 0], [2, 2, 2, 2], [0, 2, 2, 0], [0, 2, 2, 0], [2, 2, 2, 2], [0, 2, 2, 0]]}, {"input": [[0, 0], [0, 5], [5, 0]], "output": [[0, 5, 5, 0], [5, 0, 0, 5], [0, 0, 0, 0], [0, 0, 0, 0], [5, 0, 0, 5], [0, 5, 5, 0], [0, 5, 5, 0], [5, 0, 0, 5], [0, 0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/8e2edd66.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[9, 9, 0], [0, 0, 9], [0, 9, 0]], "output": [[0, 0, 0, 0, 0, 0, 0, 0, 9], [0, 0, 0, 0, 0, 0, 9, 9, 0], [0, 0, 0, 0, 0, 0, 9, 0, 9], [0, 0, 9, 0, 0, 9, 0, 0, 0], [9, 9, 0, 9, 9, 0, 0, 0, 0], [9, 0, 9, 9, 0, 9, 0, 0, 0], [0, 0, 9, 0, 0, 0, 0, 0, 9], [9, 9, 0, 0, 0, 0, 9, 9, 0], [9, 0, 9, 0, 0, 0, 9, 0, 9]]}, {"input": [[8, 8, 0], [0, 8, 8], [0, 8, 0]], "output": [[0, 0, 0, 0, 0, 0, 0, 0, 8], [0, 0, 0, 0, 0, 0, 8, 0, 0], [0, 0, 0, 0, 0, 0, 8, 0, 8], [0, 0, 8, 0, 0, 0, 0, 0, 0], [8, 0, 0, 0, 0, 0, 0, 0, 0], [8, 0, 8, 0, 0, 0, 0, 0, 0], [0, 0, 8, 0, 0, 0, 0, 0, 8], [8, 0, 0, 0, 0, 0, 8, 0, 0], [8, 0, 8, 0, 0, 0, 8, 0, 8]]}, {"input": [[7, 0, 7], [7, 7, 7], [0, 7, 0]], "output": [[0, 0, 0, 0, 7, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 7, 0, 7, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 7, 0, 0, 0, 0, 0, 7, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0], [7, 0, 7, 0, 0, 0, 7, 0, 7]]}], "test": [{"input": [[1, 1, 0], [0, 1, 0], [1, 0, 1]], "output": [[0, 0, 0, 0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 0, 0, 0, 0, 0, 1, 0], [0, 0, 1, 0, 0, 0, 0, 0, 1], [1, 0, 1, 0, 0, 0, 1, 0, 1], [0, 1, 0, 0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/94f9d214.json: -------------------------------------------------------------------------------- 1 | {"test": [{"input": [[0, 3, 0, 3], [3, 3, 3, 0], [0, 0, 0, 3], [3, 3, 3, 0], [0, 0, 1, 1], [0, 0, 1, 1], [0, 1, 0, 0], [1, 1, 0, 0]], "output": [[2, 0, 0, 0], [0, 0, 0, 0], [2, 0, 2, 0], [0, 0, 0, 2]]}], "train": [{"input": [[0, 0, 0, 0], [0, 3, 3, 0], [0, 0, 0, 0], [3, 0, 0, 3], [0, 0, 0, 1], [1, 0, 1, 1], [1, 1, 1, 1], [0, 1, 0, 1]], "output": [[2, 2, 2, 0], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 2, 0]]}, {"input": [[3, 3, 3, 3], [0, 3, 3, 0], [0, 0, 3, 3], [3, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1], [0, 1, 0, 0], [1, 0, 0, 1]], "output": [[0, 0, 0, 0], [2, 0, 0, 0], [2, 0, 0, 0], [0, 2, 2, 0]]}, {"input": [[0, 3, 3, 0], [0, 3, 0, 3], [0, 0, 3, 0], [3, 3, 3, 3], [1, 1, 1, 1], [1, 1, 0, 0], [1, 1, 0, 0], [0, 1, 1, 0]], "output": [[0, 0, 0, 0], [0, 0, 2, 0], [0, 0, 0, 2], [0, 0, 0, 0]]}, {"input": [[3, 3, 3, 3], [3, 0, 0, 0], [3, 0, 3, 3], [3, 3, 0, 3], [1, 1, 1, 0], [0, 1, 1, 1], [1, 0, 1, 1], [0, 1, 1, 1]], "output": [[0, 0, 0, 0], [0, 0, 0, 0], [0, 2, 0, 0], [0, 0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/9565186b.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[2, 2, 2], [2, 1, 8], [2, 8, 8]], "output": [[2, 2, 2], [2, 5, 5], [2, 5, 5]]}, {"input": [[1, 1, 1], [8, 1, 3], [8, 2, 2]], "output": [[1, 1, 1], [5, 1, 5], [5, 5, 5]]}, {"input": [[2, 2, 2], [8, 8, 2], [2, 2, 2]], "output": [[2, 2, 2], [5, 5, 2], [2, 2, 2]]}, {"input": [[3, 3, 8], [4, 4, 4], [8, 1, 1]], "output": [[5, 5, 5], [4, 4, 4], [5, 5, 5]]}], "test": [{"input": [[1, 3, 2], [3, 3, 2], [1, 3, 2]], "output": [[5, 3, 5], [3, 3, 5], [5, 3, 5]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/TopBottom2D6.json: -------------------------------------------------------------------------------- 1 | {"train":[{"input":[[0,0,2,0,2,0,0,0],[0,0,2,0,2,0,0,0],[0,0,2,2,2,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,4,0,4],[0,0,0,0,0,4,0,4],[0,0,0,0,0,4,4,4],[0,0,0,0,0,0,0,0]],"output":[[4,0,4],[4,0,4],[4,4,4]]},{"input":[[0,0,0,8,8,8,0],[7,7,7,8,0,0,0],[0,0,7,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]],"output":[[7,7,7],[0,0,7]]},{"input":[[0,0,0,0,0,0],[0,0,3,0,3,0],[0,0,3,3,3,0],[8,0,8,3,0,0],[8,8,8,0,0,0],[0,8,0,0,0,0]],"output":[[8,0,8],[8,8,8],[0,8,0]]},{"input":[[0,1,0,0],[0,0,0,0],[0,0,5,0],[0,0,0,0]],"output":[[5]]}],"test":[{"input":[[0,0,0,0,0,0,0,0],[0,0,3,3,0,0,0,0],[0,0,3,3,0,0,0,0],[0,0,6,6,0,0,0,0],[0,0,6,6,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0]],"output":[[6,6],[6,6]]},{"input":[[3,0,4,0,0,0],[3,0,4,0,0,0],[3,0,4,0,0,0],[3,0,4,4,4,4],[3,3,3,3,0,0],[0,0,0,0,0,0]],"output":[[3,0,0,0],[3,0,0,0],[3,0,0,0],[3,0,0,0],[3,3,3,3]]},{"input":[[0,0,0,0,0,0,0,0,0,0],[0,7,7,7,7,7,7,7,0,0],[0,7,7,7,7,7,7,7,0,0],[0,7,7,7,7,7,7,7,0,0],[0,0,0,0,0,0,0,0,0,0],[0,0,0,0,2,2,2,2,2,2],[0,0,0,0,2,0,0,0,0,2],[0,0,0,0,2,0,0,0,0,2],[0,0,0,0,2,0,0,0,0,2],[0,0,0,0,2,2,2,2,2,2]],"output":[[2,2,2,2,2,2],[2,0,0,0,0,2],[2,0,0,0,0,2],[2,0,0,0,0,2],[2,2,2,2,2,2]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/a79310a0.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[8, 8, 0, 0, 0], [8, 8, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], "output": [[0, 0, 0, 0, 0], [2, 2, 0, 0, 0], [2, 2, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]}, {"input": [[0, 8, 0], [0, 0, 0], [0, 0, 0]], "output": [[0, 0, 0], [0, 2, 0], [0, 0, 0]]}, {"input": [[0, 0, 0, 0, 0], [0, 8, 8, 8, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], "output": [[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 2, 2, 2, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]}], "test": [{"input": [[0, 0, 8, 0, 0], [0, 8, 8, 0, 0], [0, 0, 8, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]], "output": [[0, 0, 0, 0, 0], [0, 0, 2, 0, 0], [0, 2, 2, 0, 0], [0, 0, 2, 0, 0], [0, 0, 0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/aabf363d.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 0, 0, 0, 0, 0, 0], [0, 2, 2, 2, 0, 0, 0], [0, 0, 2, 0, 0, 0, 0], [0, 2, 2, 2, 2, 0, 0], [0, 0, 2, 2, 2, 0, 0], [0, 0, 0, 2, 0, 0, 0], [4, 0, 0, 0, 0, 0, 0]], "output": [[0, 0, 0, 0, 0, 0, 0], [0, 4, 4, 4, 0, 0, 0], [0, 0, 4, 0, 0, 0, 0], [0, 4, 4, 4, 4, 0, 0], [0, 0, 4, 4, 4, 0, 0], [0, 0, 0, 4, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]]}, {"input": [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 0, 0, 0], [0, 0, 3, 3, 3, 0, 0], [0, 3, 3, 3, 3, 0, 0], [0, 3, 3, 0, 0, 0, 0], [0, 0, 3, 3, 0, 0, 0], [6, 0, 0, 0, 0, 0, 0]], "output": [[0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 6, 0, 0, 0], [0, 0, 6, 6, 6, 0, 0], [0, 6, 6, 6, 6, 0, 0], [0, 6, 6, 0, 0, 0, 0], [0, 0, 6, 6, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0]]}], "test": [{"input": [[0, 0, 0, 0, 0, 0, 0], [0, 8, 8, 8, 0, 0, 0], [0, 8, 8, 8, 8, 8, 0], [0, 0, 0, 8, 8, 0, 0], [0, 0, 8, 8, 0, 0, 0], [0, 0, 8, 8, 8, 0, 0], [2, 0, 0, 0, 0, 0, 0]], "output": [[0, 0, 0, 0, 0, 0, 0], [0, 2, 2, 2, 0, 0, 0], [0, 2, 2, 2, 2, 2, 0], [0, 0, 0, 2, 2, 0, 0], [0, 0, 2, 2, 0, 0, 0], [0, 0, 2, 2, 2, 0, 0], [0, 0, 0, 0, 0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/arcathon_solution_format.json: -------------------------------------------------------------------------------- 1 | [{"task_name":"12997ef3","test":[{"output_id":0,"number_of_predictions":3,"predictions":[{"prediction_id":0,"output":[[8]]},{"prediction_id":1,"output":[[8,8],[8,8]]},{"prediction_id":2,"output":[[8,8,8],[8,8,8]]}]},{"output_id":1,"number_of_predictions":3,"predictions":[{"prediction_id":0,"output":[[7],[7]]},{"prediction_id":1,"output":[[7],[7]]},{"prediction_id":2,"output":[[7,7],[7,7],[7,7],[7,7]]}]}]},{"task_name":"13713586","test":[{"output_id":0,"number_of_predictions":3,"predictions":[{"prediction_id":0,"output":[[8,8,8,8],[8,8,8,8],[8,8,8,8]]},{"prediction_id":1,"output":[[8,8],[8,8]]},{"prediction_id":2,"output":[[8],[8]]}]}]}] -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/bbc9ae5d.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[1, 1, 0, 0, 0, 0]], "output": [[1, 1, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0], [1, 1, 1, 1, 0, 0]]}, {"input": [[2, 0, 0, 0, 0, 0, 0, 0]], "output": [[2, 0, 0, 0, 0, 0, 0, 0], [2, 2, 0, 0, 0, 0, 0, 0], [2, 2, 2, 0, 0, 0, 0, 0], [2, 2, 2, 2, 0, 0, 0, 0]]}, {"input": [[5, 5, 5, 0, 0, 0, 0, 0, 0, 0]], "output": [[5, 5, 5, 0, 0, 0, 0, 0, 0, 0], [5, 5, 5, 5, 0, 0, 0, 0, 0, 0], [5, 5, 5, 5, 5, 0, 0, 0, 0, 0], [5, 5, 5, 5, 5, 5, 0, 0, 0, 0], [5, 5, 5, 5, 5, 5, 5, 0, 0, 0]]}, {"input": [[8, 8, 8, 8, 0, 0]], "output": [[8, 8, 8, 8, 0, 0], [8, 8, 8, 8, 8, 0], [8, 8, 8, 8, 8, 8]]}, {"input": [[7, 0, 0, 0, 0, 0]], "output": [[7, 0, 0, 0, 0, 0], [7, 7, 0, 0, 0, 0], [7, 7, 7, 0, 0, 0]]}], "test": [{"input": [[1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0]], "output": [[1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/c48954c1.json: -------------------------------------------------------------------------------- 1 | {"test": [{"input": [[8, 8, 6], [6, 3, 6], [6, 8, 8]], "output": [[8, 8, 6, 6, 8, 8, 8, 8, 6], [6, 3, 6, 6, 3, 6, 6, 3, 6], [6, 8, 8, 8, 8, 6, 6, 8, 8], [6, 8, 8, 8, 8, 6, 6, 8, 8], [6, 3, 6, 6, 3, 6, 6, 3, 6], [8, 8, 6, 6, 8, 8, 8, 8, 6], [8, 8, 6, 6, 8, 8, 8, 8, 6], [6, 3, 6, 6, 3, 6, 6, 3, 6], [6, 8, 8, 8, 8, 6, 6, 8, 8]]}], "train": [{"input": [[7, 6, 7], [2, 7, 6], [1, 2, 7]], "output": [[7, 2, 1, 1, 2, 7, 7, 2, 1], [6, 7, 2, 2, 7, 6, 6, 7, 2], [7, 6, 7, 7, 6, 7, 7, 6, 7], [7, 6, 7, 7, 6, 7, 7, 6, 7], [6, 7, 2, 2, 7, 6, 6, 7, 2], [7, 2, 1, 1, 2, 7, 7, 2, 1], [7, 2, 1, 1, 2, 7, 7, 2, 1], [6, 7, 2, 2, 7, 6, 6, 7, 2], [7, 6, 7, 7, 6, 7, 7, 6, 7]]}, {"input": [[6, 1, 7], [1, 6, 7], [4, 7, 4]], "output": [[4, 7, 4, 4, 7, 4, 4, 7, 4], [7, 6, 1, 1, 6, 7, 7, 6, 1], [7, 1, 6, 6, 1, 7, 7, 1, 6], [7, 1, 6, 6, 1, 7, 7, 1, 6], [7, 6, 1, 1, 6, 7, 7, 6, 1], [4, 7, 4, 4, 7, 4, 4, 7, 4], [4, 7, 4, 4, 7, 4, 4, 7, 4], [7, 6, 1, 1, 6, 7, 7, 6, 1], [7, 1, 6, 6, 1, 7, 7, 1, 6]]}, {"input": [[1, 9, 4], [9, 1, 6], [6, 9, 4]], "output": [[4, 9, 6, 6, 9, 4, 4, 9, 6], [6, 1, 9, 9, 1, 6, 6, 1, 9], [4, 9, 1, 1, 9, 4, 4, 9, 1], [4, 9, 1, 1, 9, 4, 4, 9, 1], [6, 1, 9, 9, 1, 6, 6, 1, 9], [4, 9, 6, 6, 9, 4, 4, 9, 6], [4, 9, 6, 6, 9, 4, 4, 9, 6], [6, 1, 9, 9, 1, 6, 6, 1, 9], [4, 9, 1, 1, 9, 4, 4, 9, 1]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/d037b0a7.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 0, 6], [0, 4, 0], [3, 0, 0]], "output": [[0, 0, 6], [0, 4, 6], [3, 4, 6]]}, {"input": [[0, 2, 0], [7, 0, 8], [0, 0, 0]], "output": [[0, 2, 0], [7, 2, 8], [7, 2, 8]]}, {"input": [[4, 0, 0], [0, 2, 0], [0, 0, 0]], "output": [[4, 0, 0], [4, 2, 0], [4, 2, 0]]}], "test": [{"input": [[4, 0, 8], [0, 0, 0], [0, 7, 0]], "output": [[4, 0, 8], [4, 0, 8], [4, 7, 8]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/d631b094.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[0, 0, 0], [1, 0, 0], [0, 1, 0]], "output": [[1, 1]]}, {"input": [[0, 2, 0], [2, 0, 0], [0, 2, 0]], "output": [[2, 2, 2]]}, {"input": [[0, 7, 0], [0, 0, 0], [0, 0, 0]], "output": [[7]]}, {"input": [[0, 8, 0], [8, 8, 0], [8, 0, 0]], "output": [[8, 8, 8, 8]]}], "test": [{"input": [[4, 4, 0], [4, 0, 4], [0, 0, 4]], "output": [[4, 4, 4, 4, 4]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/e9afcf9a.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[3, 3, 3, 3, 3, 3], [9, 9, 9, 9, 9, 9]], "output": [[3, 9, 3, 9, 3, 9], [9, 3, 9, 3, 9, 3]]}, {"input": [[4, 4, 4, 4, 4, 4], [8, 8, 8, 8, 8, 8]], "output": [[4, 8, 4, 8, 4, 8], [8, 4, 8, 4, 8, 4]]}], "test": [{"input": [[6, 6, 6, 6, 6, 6], [2, 2, 2, 2, 2, 2]], "output": [[6, 2, 6, 2, 6, 2], [2, 6, 2, 6, 2, 6]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/f2829549.json: -------------------------------------------------------------------------------- 1 | {"test": [{"input": [[0, 0, 0, 1, 0, 5, 0], [7, 7, 7, 1, 5, 5, 0], [0, 0, 0, 1, 5, 0, 0], [7, 0, 0, 1, 5, 5, 5]], "output": [[3, 0, 3], [0, 0, 0], [0, 3, 3], [0, 0, 0]]}], "train": [{"input": [[7, 7, 0, 1, 5, 0, 0], [7, 0, 0, 1, 5, 0, 0], [0, 0, 0, 1, 5, 0, 5], [0, 0, 0, 1, 5, 5, 0]], "output": [[0, 0, 3], [0, 3, 3], [0, 3, 0], [0, 0, 3]]}, {"input": [[7, 7, 0, 1, 5, 0, 0], [0, 0, 0, 1, 0, 0, 0], [7, 7, 0, 1, 5, 0, 0], [0, 7, 7, 1, 5, 5, 0]], "output": [[0, 0, 3], [3, 3, 3], [0, 0, 3], [0, 0, 0]]}, {"input": [[0, 7, 7, 1, 5, 0, 0], [0, 0, 7, 1, 0, 5, 5], [0, 7, 0, 1, 5, 5, 0], [0, 0, 7, 1, 0, 0, 0]], "output": [[0, 0, 0], [3, 0, 0], [0, 0, 3], [3, 3, 0]]}, {"input": [[7, 0, 7, 1, 5, 5, 0], [7, 7, 0, 1, 5, 5, 5], [0, 7, 0, 1, 0, 0, 0], [0, 0, 0, 1, 5, 0, 5]], "output": [[0, 0, 0], [0, 0, 0], [3, 0, 3], [0, 3, 0]]}, {"input": [[7, 0, 0, 1, 0, 5, 0], [0, 0, 7, 1, 5, 0, 0], [0, 0, 0, 1, 5, 5, 5], [7, 7, 7, 1, 5, 5, 5]], "output": [[0, 0, 3], [0, 3, 0], [0, 0, 0], [0, 0, 0]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/f5b8619d.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[2, 0, 0], [0, 0, 0], [0, 0, 2]], "output": [[2, 0, 8, 2, 0, 8], [8, 0, 8, 8, 0, 8], [8, 0, 2, 8, 0, 2], [2, 0, 8, 2, 0, 8], [8, 0, 8, 8, 0, 8], [8, 0, 2, 8, 0, 2]]}, {"input": [[0, 5, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0], [5, 0, 0, 0, 0, 5], [0, 0, 0, 0, 0, 0]], "output": [[8, 5, 0, 0, 0, 8, 8, 5, 0, 0, 0, 8], [8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 0, 8], [8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 0, 8], [8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 0, 8], [5, 8, 0, 0, 0, 5, 5, 8, 0, 0, 0, 5], [8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 0, 8], [8, 5, 0, 0, 0, 8, 8, 5, 0, 0, 0, 8], [8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 0, 8], [8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 0, 8], [8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 0, 8], [5, 8, 0, 0, 0, 5, 5, 8, 0, 0, 0, 5], [8, 8, 0, 0, 0, 8, 8, 8, 0, 0, 0, 8]]}, {"input": [[0, 4], [0, 0]], "output": [[0, 4, 0, 4], [0, 8, 0, 8], [0, 4, 0, 4], [0, 8, 0, 8]]}], "test": [{"input": [[0, 0, 3, 0], [0, 0, 0, 0], [0, 0, 0, 3], [3, 0, 0, 0]], "output": [[8, 0, 3, 8, 8, 0, 3, 8], [8, 0, 8, 8, 8, 0, 8, 8], [8, 0, 8, 3, 8, 0, 8, 3], [3, 0, 8, 8, 3, 0, 8, 8], [8, 0, 3, 8, 8, 0, 3, 8], [8, 0, 8, 8, 8, 0, 8, 8], [8, 0, 8, 3, 8, 0, 8, 3], [3, 0, 8, 8, 3, 0, 8, 8]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/f9012d9b.json: -------------------------------------------------------------------------------- 1 | {"train": [{"input": [[2, 1, 2, 1, 2], [1, 1, 1, 1, 1], [2, 1, 2, 1, 2], [0, 0, 1, 1, 1], [0, 0, 2, 1, 2]], "output": [[1, 1], [2, 1]]}, {"input": [[8, 6, 0, 6], [6, 8, 6, 8], [8, 6, 8, 6], [6, 8, 6, 8]], "output": [[8]]}, {"input": [[2, 2, 5, 2, 2, 5, 2], [2, 2, 5, 2, 2, 5, 2], [5, 5, 5, 5, 5, 5, 5], [2, 2, 5, 2, 2, 5, 2], [2, 2, 5, 2, 2, 5, 2], [5, 5, 5, 5, 5, 0, 0], [2, 2, 5, 2, 2, 0, 0]], "output": [[5, 5], [5, 2]]}], "test": [{"input": [[8, 1, 8, 8, 0, 0, 0], [1, 8, 8, 1, 0, 0, 0], [8, 8, 1, 8, 0, 0, 0], [8, 1, 8, 8, 1, 8, 8], [1, 8, 8, 1, 8, 8, 1], [8, 8, 1, 8, 8, 1, 8], [8, 1, 8, 8, 1, 8, 8]], "output": [[1, 8, 8], [8, 8, 1], [8, 1, 8]]}]} -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/testdata/solution_notXORdinary.json: -------------------------------------------------------------------------------- 1 | [{"task_name":"3428a4f5","test":[{"output_id":0,"number_of_predictions":1,"predictions":[{"prediction_id":0,"output":[[3,0,3,0,3],[0,0,0,3,0],[0,0,0,0,3],[3,0,0,3,3],[3,3,0,3,0],[0,3,0,0,0]]}]},{"output_id":1,"number_of_predictions":1,"predictions":[{"prediction_id":0,"output":[[0,3,3,0,3],[3,3,0,3,0],[0,0,3,0,0],[0,0,3,3,0],[3,3,0,3,3],[0,3,3,0,3]]}]}]},{"task_name":"f2829549","test":[{"output_id":0,"number_of_predictions":1,"predictions":[{"prediction_id":0,"output":[[3,0,3],[0,0,0],[0,3,3],[0,0,0]]}]}]}] -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/arc/time_util.rs: -------------------------------------------------------------------------------- 1 | use chrono::prelude::*; 2 | 3 | /// Returns a human readable timestamp in UTC. 4 | /// 5 | /// Example: `1984-12-28T23:35:56Z` 6 | pub fn human_readable_utc_timestamp() -> String { 7 | let datetime: DateTime = Utc::now(); 8 | datetime.to_rfc3339_opts(SecondsFormat::Secs, true).to_string() 9 | } 10 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/common/oeis_id_string_map.rs: -------------------------------------------------------------------------------- 1 | use loda_rust_core::oeis::OeisId; 2 | use std::collections::HashMap; 3 | 4 | pub type OeisIdStringMap = HashMap; 5 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/common/oeis_ids_sorted.rs: -------------------------------------------------------------------------------- 1 | use loda_rust_core::oeis::{OeisId, OeisIdHashSet}; 2 | use std::iter::FromIterator; 3 | 4 | pub trait ToOeisIdVec { 5 | fn sorted_vec(&self) -> Vec; 6 | } 7 | 8 | impl ToOeisIdVec for OeisIdHashSet { 9 | fn sorted_vec(&self) -> Vec { 10 | let v0 = Vec::<&OeisId>::from_iter(self); 11 | let mut v1: Vec = v0.iter().map(|&oeis_id_ref| *oeis_id_ref).collect(); 12 | v1.sort(); 13 | v1 14 | } 15 | } 16 | 17 | #[cfg(test)] 18 | mod tests { 19 | use super::*; 20 | 21 | #[test] 22 | fn test_10000_oeis_id_sorted() { 23 | // Arrange 24 | let mut hs = OeisIdHashSet::new(); 25 | hs.insert(OeisId::from(2)); 26 | hs.insert(OeisId::from(5)); 27 | hs.insert(OeisId::from(3)); 28 | hs.insert(OeisId::from(1)); 29 | hs.insert(OeisId::from(4)); 30 | 31 | // Act 32 | let actual: Vec = hs.sorted_vec(); 33 | 34 | // Assert 35 | let expected: Vec = vec![ 36 | OeisId::from(1), OeisId::from(2), OeisId::from(3), OeisId::from(4), OeisId::from(5), 37 | ]; 38 | assert_eq!(actual, expected); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/common/parse_csv_file.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | use std::io::BufReader; 3 | use std::path::Path; 4 | use std::fs::File; 5 | use serde::de::DeserializeOwned; 6 | use super::parse_csv_data; 7 | 8 | pub fn parse_csv_file(path: &Path) -> Result, Box> { 9 | let file = File::open(path)?; 10 | let mut reader = BufReader::new(file); 11 | let records: Vec = parse_csv_data::(&mut reader)?; 12 | Ok(records) 13 | } 14 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/common/record_unigram.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | use serde::{Deserialize, Serialize}; 3 | use std::path::Path; 4 | use super::parse_csv_file; 5 | 6 | #[allow(dead_code)] 7 | #[derive(Debug, Deserialize, Serialize)] 8 | pub struct RecordUnigram { 9 | pub count: u32, 10 | pub word: String, 11 | } 12 | 13 | impl RecordUnigram { 14 | #[allow(dead_code)] 15 | pub fn parse_csv(path: &Path) -> Result, Box> { 16 | parse_csv_file::parse_csv_file(path) 17 | } 18 | } 19 | 20 | #[cfg(test)] 21 | mod tests { 22 | use super::*; 23 | use crate::common::parse_csv_data; 24 | 25 | #[test] 26 | fn test_10000_parse_ok() { 27 | let data = "\ 28 | count;word 29 | 28868;add 30 | 9898;mov 31 | 871;gcd 32 | "; 33 | let mut input: &[u8] = data.as_bytes(); 34 | let records: Vec = parse_csv_data(&mut input).unwrap(); 35 | let strings: Vec = records.iter().map(|record| { 36 | format!("{} {}", record.count, record.word) 37 | }).collect(); 38 | let strings_joined: String = strings.join(","); 39 | assert_eq!(strings_joined, "28868 add,9898 mov,871 gcd"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/config/mod.rs: -------------------------------------------------------------------------------- 1 | //! Load the `~/.loda-rust/config.toml` file. 2 | mod config; 3 | mod number_of_workers; 4 | mod validate_config; 5 | 6 | #[allow(unused_imports)] 7 | pub use config::{config_from_toml_content, Config, MinerCPUStrategy, MinerFilterMode}; 8 | 9 | pub use number_of_workers::NumberOfWorkers; 10 | pub use validate_config::{ValidateConfigTask, ValidateConfig}; 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/config/number_of_workers.rs: -------------------------------------------------------------------------------- 1 | use super::{Config, MinerCPUStrategy}; 2 | 3 | extern crate num_cpus; 4 | 5 | pub trait NumberOfWorkers { 6 | fn resolve_number_of_miner_workers(&self) -> usize; 7 | } 8 | 9 | impl NumberOfWorkers for Config { 10 | fn resolve_number_of_miner_workers(&self) -> usize { 11 | let miner_cpu_strategy = self.miner_cpu_strategy(); 12 | if miner_cpu_strategy == MinerCPUStrategy::Min { 13 | return 1; 14 | } 15 | let number_of_available_cpus: usize = num_cpus::get(); 16 | assert!(number_of_available_cpus >= 1_usize); 17 | assert!(number_of_available_cpus < 1000_usize); 18 | let number_of_threads: usize = match miner_cpu_strategy { 19 | MinerCPUStrategy::Min => 1, 20 | MinerCPUStrategy::Half => number_of_available_cpus / 2, 21 | MinerCPUStrategy::Max => number_of_available_cpus, 22 | MinerCPUStrategy::CPU { count } => count as usize, 23 | }; 24 | // Ensures that zero is never returned 25 | number_of_threads.max(1) 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/lodacpp/lodacpp.rs: -------------------------------------------------------------------------------- 1 | use std::path::{Path, PathBuf}; 2 | 3 | #[derive(Debug)] 4 | pub struct LodaCpp { 5 | loda_cpp_executable: PathBuf, 6 | } 7 | 8 | impl LodaCpp { 9 | pub fn new(loda_cpp_executable: PathBuf) -> Self { 10 | assert!(loda_cpp_executable.is_absolute()); 11 | assert!(loda_cpp_executable.is_file()); 12 | Self { 13 | loda_cpp_executable: loda_cpp_executable, 14 | } 15 | } 16 | 17 | pub fn loda_cpp_executable(&self) -> &Path { 18 | &self.loda_cpp_executable 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/lodacpp/lodacpp_error.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | #[derive(Debug, PartialEq)] 4 | pub enum LodaCppError { 5 | NonZeroExitCode, 6 | NoOutput, 7 | Timeout, 8 | ParseTerms, 9 | ParseSteps, 10 | } 11 | 12 | impl std::error::Error for LodaCppError {} 13 | 14 | impl fmt::Display for LodaCppError { 15 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 16 | match self { 17 | Self::NonZeroExitCode => write!(f, "Non-zero exit code"), 18 | Self::NoOutput => write!(f, "No output from loda-cpp"), 19 | Self::Timeout => write!(f, "Timeout"), 20 | Self::ParseTerms => write!(f, "Cannot extract terms from loda-cpp output"), 21 | Self::ParseSteps => write!(f, "Cannot extract steps from loda-cpp output"), 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/lodacpp/mod.rs: -------------------------------------------------------------------------------- 1 | //! Integration with the `loda-cpp` executable. 2 | mod lodacpp; 3 | mod lodacpp_check_execute; 4 | mod lodacpp_check; 5 | mod lodacpp_error; 6 | mod lodacpp_eval_steps_execute; 7 | mod lodacpp_eval_steps; 8 | mod lodacpp_eval_terms_execute; 9 | mod lodacpp_eval_terms; 10 | mod lodacpp_minimize; 11 | 12 | pub use lodacpp::LodaCpp; 13 | pub use lodacpp_check_execute::LodaCppCheck; 14 | pub use lodacpp_check::{LodaCppCheckResult, LodaCppCheckStatus}; 15 | pub use lodacpp_error::LodaCppError; 16 | pub use lodacpp_eval_steps_execute::LodaCppEvalStepsExecute; 17 | pub use lodacpp_eval_steps::LodaCppEvalSteps; 18 | pub use lodacpp_eval_terms_execute::LodaCppEvalTermsExecute; 19 | pub use lodacpp_eval_terms::LodaCppEvalTerms; 20 | pub use lodacpp_minimize::LodaCppMinimize; 21 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/mine/save_candidate_program.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::prelude::*; 3 | use std::path::Path; 4 | use chrono::{DateTime, Utc}; 5 | 6 | pub fn save_candidate_program( 7 | mine_event_dir: &Path, 8 | iteration: usize, 9 | content: &String, 10 | ) -> std::io::Result<()> 11 | { 12 | // Format filename as "19841231-235959-1234.asm" 13 | let now: DateTime = Utc::now(); 14 | let filename: String = format!("{}-{}.asm", now.format("%Y%m%d-%H%M%S"), iteration); 15 | 16 | // Write the file to the output dir 17 | let path = mine_event_dir.join(Path::new(&filename)); 18 | let mut file = File::create(&path)?; 19 | file.write_all(content.as_bytes())?; 20 | 21 | println!("candidate: {:?}", filename); 22 | Ok(()) 23 | } 24 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/oeis/mod.rs: -------------------------------------------------------------------------------- 1 | //! OEIS code for A-numbers, parsing of the `stripped` file and the `names` file. 2 | mod name_row; 3 | mod process_names_file; 4 | mod process_stripped_file; 5 | mod stripped_row; 6 | mod terms_to_program_id; 7 | 8 | pub use name_row::NameRow; 9 | pub use process_names_file::ProcessNamesFile; 10 | pub use process_stripped_file::ProcessStrippedFile; 11 | pub use stripped_row::StrippedRow; 12 | pub use terms_to_program_id::{TermsToProgramIdSet, load_terms_to_program_id_set}; 13 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/pattern/mod.rs: -------------------------------------------------------------------------------- 1 | //! Identify recurring patterns among similar programs. 2 | mod cluster_programs; 3 | mod instruction_diff_between_constants; 4 | mod measure_similarity; 5 | mod parse_csv_similar; 6 | 7 | pub use cluster_programs::Clusters; 8 | pub use instruction_diff_between_constants::instruction_diff_between_constants; 9 | pub use measure_similarity::ProgramSimilarity; 10 | pub use parse_csv_similar::RecordSimilar; 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/postmine/path_for_oeis_program.rs: -------------------------------------------------------------------------------- 1 | use loda_rust_core::oeis::OeisId; 2 | use super::ParentDirAndChildFile; 3 | use std::path::{Path, PathBuf}; 4 | 5 | /// Construct a path, like this: `/absolute/path/123/A123456.asm` 6 | pub fn path_for_oeis_program(loda_programs_oeis_dir: &Path, program_id: OeisId) -> ParentDirAndChildFile { 7 | assert!(loda_programs_oeis_dir.is_dir()); 8 | assert!(loda_programs_oeis_dir.is_absolute()); 9 | let dir_index: u32 = program_id.raw() / 1000; 10 | let dir_index_string: String = format!("{:0>3}", dir_index); 11 | let filename_string: String = format!("{}.asm", program_id.a_number()); 12 | let dir_path: PathBuf = loda_programs_oeis_dir.join(dir_index_string); 13 | let file_path: PathBuf = dir_path.join(filename_string); 14 | ParentDirAndChildFile::new(dir_path, file_path) 15 | } 16 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/postmine/postmine_error.rs: -------------------------------------------------------------------------------- 1 | use std::error::Error; 2 | use std::fmt; 3 | 4 | #[derive(Debug, PartialEq)] 5 | pub enum PostMineError { 6 | UnableToExtractFilenameFromPath, 7 | } 8 | 9 | impl fmt::Display for PostMineError { 10 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 11 | match self { 12 | Self::UnableToExtractFilenameFromPath => 13 | write!(f, "Unable to extract filename from path"), 14 | } 15 | } 16 | } 17 | 18 | impl Error for PostMineError {} 19 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/similar/mod.rs: -------------------------------------------------------------------------------- 1 | //! Identify similar programs. 2 | mod similar; 3 | mod word; 4 | mod wordpair; 5 | mod words_from_program; 6 | 7 | pub use similar::Similar; 8 | pub use word::Word; 9 | pub use wordpair::WordPair; 10 | pub use words_from_program::WordsFromProgram; 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/subcommand_analytics.rs: -------------------------------------------------------------------------------- 1 | //! The `loda-rust analytics-MODE` subcommands, prepares data for mining such as histograms/bloomfilters. 2 | use crate::analytics::Analytics; 3 | 4 | pub struct SubcommandAnalytics; 5 | 6 | impl SubcommandAnalytics { 7 | pub fn oeis() -> anyhow::Result<()> { 8 | Analytics::oeis_run_force() 9 | } 10 | 11 | pub fn arc() -> anyhow::Result<()> { 12 | Analytics::arc_run_force() 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/subcommand_dependencies.rs: -------------------------------------------------------------------------------- 1 | //! The `loda-rust dependencies` subcommand, prints dependencies of a program. 2 | use super::{DependencyManager,DependencyManagerFileSystemMode}; 3 | use loda_rust_core::unofficial_function::UnofficialFunctionRegistry; 4 | use crate::config::Config; 5 | use std::path::PathBuf; 6 | 7 | pub fn subcommand_dependencies(program_id: u64) { 8 | let config = Config::load(); 9 | let loda_programs_oeis_dir: PathBuf = config.loda_programs_oeis_dir(); 10 | let mut dm = DependencyManager::new( 11 | DependencyManagerFileSystemMode::System, 12 | loda_programs_oeis_dir, 13 | UnofficialFunctionRegistry::new(), 14 | ); 15 | if let Err(error) = dm.load(program_id) { 16 | panic!("Failure during loadin of program. error: {:?}", error); 17 | } 18 | dm.print_dependencies(); 19 | } 20 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/src/subcommand_similar.rs: -------------------------------------------------------------------------------- 1 | //! The `loda-rust similar` subcommand, identifies similar programs. 2 | use crate::similar::Similar; 3 | 4 | pub fn subcommand_similar() -> anyhow::Result<()> { 5 | Similar::run() 6 | } 7 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/static/arc_color.css: -------------------------------------------------------------------------------- 1 | .symbol_0 { 2 | background-color: #000; 3 | } 4 | .symbol_1 { 5 | background-color: #0074D9; /* blue */ 6 | } 7 | .symbol_2 { 8 | background-color: #FF4136; /* red */ 9 | } 10 | .symbol_3 { 11 | background-color: #2ECC40; /* green */ 12 | } 13 | .symbol_4 { 14 | background-color: #FFDC00; /* yellow */ 15 | } 16 | .symbol_5 { 17 | background-color: #AAAAAA; /* grey */ 18 | } 19 | .symbol_6 { 20 | background-color: #F012BE; /* fuschia */ 21 | } 22 | .symbol_7 { 23 | background-color: #FF851B; /* orange */ 24 | } 25 | .symbol_8 { 26 | background-color: #7FDBFF; /* teal */ 27 | } 28 | .symbol_9 { 29 | background-color: #870C25; /* brown */ 30 | } 31 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/static/page_graph.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | function hideVisibleByDefault() { 4 | const elements = document.getElementsByClassName("visiblebydefault"); 5 | for (var i = 0; i < elements.length; i++) { 6 | elements[i].style.display="none"; 7 | } 8 | } 9 | 10 | function showVisibleByDefault() { 11 | const elements = document.getElementsByClassName("visiblebydefault"); 12 | for (var i = 0; i < elements.length; i++) { 13 | elements[i].style.display="block"; 14 | } 15 | } 16 | 17 | function showInfoOnMouseOver(element) { 18 | hideVisibleByDefault(); 19 | 20 | const infoid = element.dataset.infoid; 21 | // console.log("pixelOnMouseOver", element, infoid); 22 | const el2 = document.getElementById(infoid); 23 | el2.style.display = "block"; 24 | } 25 | 26 | function hideInfoOnMouseOut(element) { 27 | const infoid = element.dataset.infoid; 28 | // console.log("pixelOnMouseOut", element, infoid); 29 | const el2 = document.getElementById(infoid); 30 | el2.style.display = "none"; 31 | 32 | showVisibleByDefault(); 33 | } 34 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/static/page_reply.css: -------------------------------------------------------------------------------- 1 | #prompt-reply-textarea { 2 | width: 100%; 3 | height: 50%; 4 | font-size: large; 5 | } 6 | 7 | .split-screen { 8 | display: flex; 9 | } 10 | 11 | .split-screen-half { 12 | flex: 1; 13 | } 14 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/templates/arc/info_edge.html: -------------------------------------------------------------------------------- 1 | 15 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/templates/arc/info_pixel.html: -------------------------------------------------------------------------------- 1 | 40 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/templates/arc/inspect_pixel.html: -------------------------------------------------------------------------------- 1 | 2 | {{pixel_upleft|safe}}{{pixel_up|safe}}{{pixel_upright|safe}} 3 | {{edge_center_upleft|safe}}{{edge_center_up|safe}}{{edge_center_upright|safe}} 4 | {{pixel_left|safe}}{{edge_left_center|safe}}{{pixel_center|safe}}{{edge_center_right|safe}}{{pixel_right|safe}} 5 | {{edge_center_downleft|safe}}{{edge_center_down|safe}}{{edge_center_downright|safe}} 6 | {{pixel_downleft|safe}}{{pixel_down|safe}}{{pixel_downright|safe}} 7 |
8 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/templates/arc/page_task_list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Task list 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
13 | 14 |
15 | 16 |
Task list
17 | 18 |
19 | 20 |
21 |
22 | 23 |
24 |
    {{task_list|safe}}
25 |
26 | 27 |
28 | 31 | 34 |
35 | 36 | 37 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/templates/arc/wrap_edge.html: -------------------------------------------------------------------------------- 1 | 2 |
3 |
{{ htmlcharacter|safe }}
13 |
14 | 15 | -------------------------------------------------------------------------------- /rust_project/loda-rust-cli/web/templates/arc/wrap_pixel.html: -------------------------------------------------------------------------------- 1 | 2 | {{ color }} 13 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "loda-rust-core" 3 | version = "0.1.0" 4 | authors = ["Simon Strandgaard "] 5 | description = "Shared code between LODA Rust projects" 6 | repository = "https://github.com/loda-lang/loda-rust" 7 | license = "MIT OR Apache-2.0" 8 | edition = "2021" 9 | 10 | [dependencies] 11 | regex = "1.5.6" 12 | lazy_static = "1.4.0" 13 | num-bigint = "0.4.3" 14 | num-integer = "0.1.45" 15 | num-traits = "0.2.15" 16 | log = "0.4.17" 17 | serde = { version = "1.0.137", features = ["derive"] } 18 | cached = "0.44.0" 19 | anyhow = "1.0.58" 20 | 21 | [dev-dependencies] 22 | tempfile = "3.3.0" 23 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/control/execute_profile.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone, Copy, Debug)] 2 | pub enum ExecuteProfile { 3 | Unlimited, 4 | SmallLimits, 5 | } 6 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/control/mod.rs: -------------------------------------------------------------------------------- 1 | //! Loading of programs, manage dependencies between programs, caching of programs. 2 | mod dependency_manager; 3 | mod execute_profile; 4 | 5 | pub use dependency_manager::{DependencyManager, DependencyManagerError, DependencyManagerFileSystemMode}; 6 | pub use execute_profile::ExecuteProfile; 7 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/node_loop_shared.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone)] 2 | pub enum NodeLoopLimit { 3 | Unlimited, 4 | LimitCount(u32) 5 | } 6 | 7 | /// Prevent extreme values, a loop with more than 256 (2^8) registers is extreme 8 | /// 9 | /// The usual size is 1, which looks like this: 10 | /// `lpb $0` 11 | /// 12 | /// Sometimes the range can be 2 or more. Looking like this: 13 | /// `lpb $0,2` 14 | /// `lpb $0,5` 15 | pub const LOOP_RANGE_MAX_BITS: u64 = 8; 16 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/node_register_limit.rs: -------------------------------------------------------------------------------- 1 | use super::{BoxCheckValue, CheckValueUnlimited, CheckValueLimitBits}; 2 | 3 | #[derive(Clone)] 4 | pub enum NodeRegisterLimit { 5 | Unlimited, 6 | LimitBits(u32) 7 | } 8 | 9 | impl NodeRegisterLimit { 10 | pub fn create_boxed_check_value(&self) -> BoxCheckValue { 11 | match self { 12 | NodeRegisterLimit::Unlimited => 13 | Box::new(CheckValueUnlimited::new()), 14 | NodeRegisterLimit::LimitBits(max_bits) => 15 | Box::new(CheckValueLimitBits::new(*max_bits)), 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/program_id.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | pub enum ProgramId { 3 | ProgramWithoutId, 4 | ProgramOEIS(u64), 5 | } 6 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/program_runner_manager.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::rc::Rc; 3 | use super::ProgramRunner; 4 | 5 | pub struct ProgramRunnerManager { 6 | registered_program_runners: HashMap> 7 | } 8 | 9 | impl ProgramRunnerManager { 10 | pub fn new() -> Self { 11 | Self { 12 | registered_program_runners: HashMap::new(), 13 | } 14 | } 15 | 16 | pub fn register(&mut self, program_id: u64, program_runner: ProgramRunner) { 17 | // TODO: abort if the program is already registered 18 | let program_runner_rc = Rc::new(program_runner); 19 | self.registered_program_runners.insert(program_id, program_runner_rc); 20 | } 21 | 22 | pub fn get(&mut self, program_id: u64) -> Option> { 23 | match self.registered_program_runners.get(&program_id) { 24 | Some(value) => { 25 | return Some(Rc::clone(value)); 26 | }, 27 | None => { 28 | return None; 29 | } 30 | } 31 | } 32 | 33 | pub fn contains(&self, program_id: u64) -> bool { 34 | self.registered_program_runners.contains_key(&program_id) 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/program_serializer_context.rs: -------------------------------------------------------------------------------- 1 | pub trait ProgramSerializerContext { 2 | fn sequence_name_for_oeis_id(&self, oeis_id: u64) -> Option; 3 | } 4 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/register_index.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | /// A `RegisterIndex` can be in the range [0..u64::max]. 4 | /// 5 | /// Most LODA programs use less than 10 registers. 6 | /// 7 | /// Some LODA programs use a variable number of registers, and this can be MANY! 8 | /// Example the A000041 uses double dollar notation (aka. ParameterType::Indirect). 9 | /// Invoking this with n=10000, then it will use around 10000 registers. 10 | #[derive(Clone, Debug, Eq, Hash, PartialEq, PartialOrd)] 11 | pub struct RegisterIndex(pub u64); 12 | 13 | impl fmt::Display for RegisterIndex { 14 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 15 | write!(f, "{}", self.0) 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/register_type.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] 2 | pub enum RegisterType { 3 | Direct, 4 | Indirect 5 | } 6 | 7 | impl RegisterType { 8 | pub fn prefix(&self) -> &str { 9 | match self { 10 | RegisterType::Direct => "$", 11 | RegisterType::Indirect => "$$" 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/register_value.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | use num_bigint::{BigInt, ToBigInt}; 3 | use num_traits::{ToPrimitive, One, Zero}; 4 | 5 | #[derive(Clone, Debug, PartialEq)] 6 | pub struct RegisterValue(pub BigInt); 7 | 8 | impl RegisterValue { 9 | pub fn zero() -> Self { 10 | RegisterValue(BigInt::zero()) 11 | } 12 | 13 | pub fn one() -> Self { 14 | RegisterValue(BigInt::one()) 15 | } 16 | 17 | pub fn minus_one() -> Self { 18 | RegisterValue(-BigInt::one()) 19 | } 20 | 21 | pub fn from_i64(value: i64) -> Self { 22 | let value_bigint: BigInt = value.to_bigint().unwrap(); 23 | RegisterValue(value_bigint) 24 | } 25 | 26 | #[allow(dead_code)] 27 | pub fn to_i64(&self) -> i64 { 28 | self.0.to_i64().unwrap() 29 | } 30 | 31 | pub fn try_to_i64(&self) -> Option { 32 | self.0.to_i64() 33 | } 34 | } 35 | 36 | impl fmt::Display for RegisterValue { 37 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 38 | write!(f, "{}", self.0) 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/execute/run_mode.rs: -------------------------------------------------------------------------------- 1 | #[derive(Copy, Clone, Debug, PartialEq)] 2 | pub enum RunMode { 3 | Silent, 4 | Verbose, 5 | } 6 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/lib.rs: -------------------------------------------------------------------------------- 1 | //! This crate is a Rust port of the [LODA language]. 2 | //! 3 | //! The original C++ implemenation can be found [here]. 4 | //! 5 | //! [LODA language]: https://loda-lang.org/spec/ 6 | //! [here]: https://github.com/loda-lang/loda-cpp 7 | 8 | #[macro_use] 9 | extern crate log; 10 | 11 | pub mod control; 12 | pub mod execute; 13 | pub mod oeis; 14 | pub mod parser; 15 | pub mod unofficial_function; 16 | pub mod util; 17 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/oeis/mod.rs: -------------------------------------------------------------------------------- 1 | //! OEIS code for sequence id's and formatting of A-numbers. 2 | mod oeis_id; 3 | 4 | pub use oeis_id::{OeisId, OeisIdHashSet}; 5 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/parser/instruction_parameter.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | use super::ParameterType; 3 | 4 | #[derive(Clone, Debug, PartialEq)] 5 | pub struct InstructionParameter { 6 | pub parameter_type: ParameterType, 7 | pub parameter_value: i64, 8 | } 9 | 10 | impl InstructionParameter { 11 | pub fn new(parameter_type: ParameterType, parameter_value: i64) -> Self { 12 | Self { 13 | parameter_type: parameter_type, 14 | parameter_value: parameter_value 15 | } 16 | } 17 | } 18 | 19 | impl fmt::Display for InstructionParameter { 20 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 21 | write!(f, "{}{}", self.parameter_type.prefix(), self.parameter_value) 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/parser/mod.rs: -------------------------------------------------------------------------------- 1 | //! Translate from LODA source code to a program instance. 2 | mod create_program; 3 | mod extract_offset; 4 | mod extract_row_re; 5 | mod instruction; 6 | mod instruction_id; 7 | mod instruction_parameter; 8 | mod parameter_type; 9 | mod parse_error; 10 | mod parse_instruction_id; 11 | mod parse_parameters; 12 | mod parse_program; 13 | mod remove_comment; 14 | 15 | pub use create_program::CreateProgram; 16 | pub use extract_offset::{extract_offset, ExtractOffsetError}; 17 | pub use extract_row_re::EXTRACT_ROW_RE; 18 | pub use instruction::Instruction; 19 | pub use instruction_id::InstructionId; 20 | pub use instruction_parameter::InstructionParameter; 21 | pub use parameter_type::ParameterType; 22 | pub use parse_error::ParseError; 23 | pub use parse_instruction_id::{ParseInstructionId, ParseInstructionIdError}; 24 | pub use parse_parameters::{ParseParametersError, parse_parameters}; 25 | pub use parse_program::{ParsedProgram, ParseProgramError}; 26 | pub use remove_comment::remove_comment; 27 | 28 | pub mod extract_parameter_re; 29 | pub mod validate_loops; 30 | pub mod test_parse; 31 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/parser/parameter_type.rs: -------------------------------------------------------------------------------- 1 | use std::str::FromStr; 2 | 3 | #[derive(Clone, Copy, Debug, PartialEq)] 4 | pub enum ParameterType { 5 | Constant, 6 | Direct, 7 | Indirect, 8 | } 9 | 10 | impl ParameterType { 11 | pub fn prefix(&self) -> &str { 12 | match self { 13 | ParameterType::Constant => "", 14 | ParameterType::Direct => "$", 15 | ParameterType::Indirect => "$$", 16 | } 17 | } 18 | } 19 | 20 | impl FromStr for ParameterType { 21 | type Err = (); 22 | 23 | fn from_str(input: &str) -> Result { 24 | match input { 25 | "" => Ok(ParameterType::Constant), 26 | "$" => Ok(ParameterType::Direct), 27 | "$$" => Ok(ParameterType::Indirect), 28 | _ => Err(()), 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/parser/parse_error.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | use super::parse_program::*; 3 | use crate::execute::compiletime_error::*; 4 | 5 | #[derive(Debug)] 6 | pub enum ParseError { 7 | ParseProgram(ParseProgramError), 8 | CreateProgram(CreateProgramError), 9 | } 10 | 11 | impl fmt::Display for ParseError { 12 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 13 | match *self { 14 | Self::ParseProgram(ref err) => 15 | write!(f, "Unable to parse program. {}", err), 16 | Self::CreateProgram(ref err) => 17 | write!(f, "Unable to create program: {}", err), 18 | } 19 | } 20 | } 21 | 22 | impl From for ParseError { 23 | fn from(err: ParseProgramError) -> ParseError { 24 | ParseError::ParseProgram(err) 25 | } 26 | } 27 | 28 | impl From for ParseError { 29 | fn from(err: CreateProgramError) -> ParseError { 30 | ParseError::CreateProgram(err) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/parser/remove_comment.rs: -------------------------------------------------------------------------------- 1 | use regex::Regex; 2 | use lazy_static::lazy_static; 3 | use std::borrow::Cow; 4 | 5 | /// Remove a `; comment` from an instruction row of an assembler program 6 | pub fn remove_comment(input: &str) -> Cow { 7 | lazy_static! { 8 | static ref REMOVE_COMMENT_RE: Regex = Regex::new( 9 | "[;].*$" 10 | ).unwrap(); 11 | } 12 | REMOVE_COMMENT_RE.replace(input, "") 13 | } 14 | 15 | #[cfg(test)] 16 | mod tests { 17 | use super::*; 18 | 19 | static INPUT: &'static [&'static str] = &[ 20 | "; comment", 21 | ";; ; ; comment ;", 22 | " ; comment", 23 | " ", 24 | "a;; comment", 25 | "b ", 26 | " c ", 27 | ]; 28 | 29 | static OUTPUT: &'static [&'static str] = &[ 30 | "", 31 | "", 32 | " ", 33 | " ", 34 | "a", 35 | "b ", 36 | " c ", 37 | ]; 38 | 39 | fn process>(input: S) -> String { 40 | let input = input.as_ref(); 41 | remove_comment(input).to_string() 42 | } 43 | 44 | #[test] 45 | fn it_works() { 46 | for (index, input) in INPUT.iter().enumerate() { 47 | assert_eq!(process(input), OUTPUT[index]); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/unofficial_function/debug.rs: -------------------------------------------------------------------------------- 1 | use super::{UnofficialFunction, UnofficialFunctionId}; 2 | use num_bigint::BigInt; 3 | 4 | pub struct DebugFunction { 5 | id: u32, 6 | } 7 | 8 | impl DebugFunction { 9 | pub fn new(id: u32) -> Self { 10 | Self { 11 | id, 12 | } 13 | } 14 | } 15 | 16 | impl UnofficialFunction for DebugFunction { 17 | fn id(&self) -> UnofficialFunctionId { 18 | UnofficialFunctionId::InputOutput { id: self.id, inputs: 1, outputs: 0 } 19 | } 20 | 21 | fn name(&self) -> String { 22 | "Debug, prints the content of a memory cell".to_string() 23 | } 24 | 25 | fn run(&self, input: Vec) -> anyhow::Result> { 26 | for i in input { 27 | println!("DebugFunction: {:?}", i); 28 | } 29 | Ok(vec!()) 30 | } 31 | } 32 | 33 | #[cfg(test)] 34 | mod tests { 35 | use super::*; 36 | use super::super::perform_run; 37 | 38 | #[test] 39 | fn test_ok() { 40 | let f = DebugFunction::new(0); 41 | let v = perform_run(Box::new(f), vec![1001]).expect("output"); 42 | assert_eq!(v, vec!()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/unofficial_function/mod.rs: -------------------------------------------------------------------------------- 1 | //! Unofficial functions specific for `LODA-RUST`, that may become official in the future. 2 | 3 | mod assert; 4 | mod debug; 5 | mod product; 6 | mod register_common_functions; 7 | mod sort; 8 | mod sum; 9 | mod test_common_functions; 10 | mod test_util; 11 | mod unofficial_function; 12 | mod unofficial_function_id; 13 | mod unofficial_function_registry; 14 | 15 | pub use assert::{AssertFunction, AssertFunctionMode}; 16 | pub use debug::DebugFunction; 17 | pub use product::ProductFunction; 18 | pub use register_common_functions::register_common_functions; 19 | pub use sort::SortFunction; 20 | pub use sum::SumFunction; 21 | pub use test_util::perform_run; 22 | pub use unofficial_function::UnofficialFunction; 23 | pub use unofficial_function_id::UnofficialFunctionId; 24 | pub use unofficial_function_registry::UnofficialFunctionRegistry; 25 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/unofficial_function/test_util.rs: -------------------------------------------------------------------------------- 1 | use super::UnofficialFunction; 2 | use num_bigint::{BigInt, ToBigInt}; 3 | use num_traits::ToPrimitive; 4 | 5 | pub fn perform_run(f: Box, input: Vec) -> anyhow::Result> { 6 | let input_vec: Vec = input.iter().map(|v| v.to_bigint().unwrap() ).collect(); 7 | let output_bigints: Vec = f.run(input_vec)?; 8 | let output: Vec = output_bigints.iter().map(|v| v.to_i32().unwrap() ).collect(); 9 | Ok(output) 10 | } 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/unofficial_function/unofficial_function.rs: -------------------------------------------------------------------------------- 1 | use super::UnofficialFunctionId; 2 | use num_bigint::BigInt; 3 | 4 | pub trait UnofficialFunction: Send + Sync { 5 | fn id(&self) -> UnofficialFunctionId; 6 | fn name(&self) -> String; 7 | fn run(&self, input: Vec) -> anyhow::Result>; 8 | } 9 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/unofficial_function/unofficial_function_id.rs: -------------------------------------------------------------------------------- 1 | #[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)] 2 | pub enum UnofficialFunctionId { 3 | InputOutput { id: u32, inputs: u8, outputs: u8 } 4 | } 5 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/src/util/mod.rs: -------------------------------------------------------------------------------- 1 | //! The `BigIntVec` is used everywhere in LODA-RUST. 2 | mod bigintvec; 3 | 4 | pub use bigintvec::{BigIntVec, BigIntVecFromI64, BigIntVecToString, IsBigIntVecEqual}; 5 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_lpb_with_parametertype_indirect1/000/A000001.asm: -------------------------------------------------------------------------------- 1 | mov $8,100 2 | mov $100,5 3 | lpb $$8 4 | add $1,1 5 | sub $100,1 6 | lpe 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_lpb_with_parametertype_indirect2/000/A000001.asm: -------------------------------------------------------------------------------- 1 | mov $8,100 2 | mov $100,5 3 | mov $101,4 4 | mov $102,3 5 | mov $103,2 6 | mov $104,1 7 | lpb $$8 8 | add $1,1 9 | add $8,1 10 | lpe 11 | mov $0,$1 12 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_lpb_with_range_direct/000/A000001.asm: -------------------------------------------------------------------------------- 1 | mov $12,5 2 | mov $2,3 3 | lpb $10,$2 4 | add $1,1 5 | sub $12,1 6 | lpe 7 | mov $0,$1 8 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_detect_cycle1/000/A000666.asm: -------------------------------------------------------------------------------- 1 | mov $1,$0 2 | seq $1,666 ; This program invokes itself, which is illegal. 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_detect_cycle2/000/A000666.asm: -------------------------------------------------------------------------------- 1 | mov $1,$0 2 | seq $1,667 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_detect_cycle2/000/A000667.asm: -------------------------------------------------------------------------------- 1 | mov $1,$0 2 | seq $1,666 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_detect_cycle3/000/A000666.asm: -------------------------------------------------------------------------------- 1 | mov $1,$0 2 | seq $1,668 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_detect_cycle3/000/A000667.asm: -------------------------------------------------------------------------------- 1 | mov $1,$0 2 | seq $1,666 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_detect_cycle3/000/A000668.asm: -------------------------------------------------------------------------------- 1 | mov $1,$0 2 | seq $1,667 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_detect_missing1/000/A000666.asm: -------------------------------------------------------------------------------- 1 | mov $1,$0 2 | seq $1,667 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_detect_missing1/000/A000667.asm: -------------------------------------------------------------------------------- 1 | mov $1,$0 2 | seq $1,668 ; invoke a program that doesn't exist 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_with_negative_parameter1/000/A000027.asm: -------------------------------------------------------------------------------- 1 | ; A000027: The positive integers. Also called the natural numbers, the whole numbers or the counting numbers, but these terms are ambiguous. 2 | ; 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250 3 | 4 | add $0,1 5 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_with_negative_parameter1/000/A000666.asm: -------------------------------------------------------------------------------- 1 | mov $1,-1 2 | seq $1,27 ; invoking the natural numbers, with a negative parameter. 3 | add $0,$1 4 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_with_negative_parameter2/000/A000027.asm: -------------------------------------------------------------------------------- 1 | ; A000027: The positive integers. Also called the natural numbers, the whole numbers or the counting numbers, but these terms are ambiguous. 2 | ; 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250 3 | 4 | add $0,1 5 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_with_negative_parameter2/000/A000666.asm: -------------------------------------------------------------------------------- 1 | mul $0,-1 2 | sub $0,1 3 | seq $0,27 ; invoking the natural numbers, with a negative parameter. 4 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_with_parametertype_indirect/000/A000001.asm: -------------------------------------------------------------------------------- 1 | mov $1,10 2 | mov $10,$0 ; initialize argument for seq 3 | 4 | ; ACT-BEGIN 5 | seq $$1,27 ; The positive integers. 6 | ; ACT-END 7 | 8 | mov $0,$10 9 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/instruction_seq_with_parametertype_indirect/000/A000027.asm: -------------------------------------------------------------------------------- 1 | ; A000027: The positive integers. Also called the natural numbers, the whole numbers or the counting numbers, but these terms are ambiguous. 2 | ; 1,2,3,4,5,6,7,8,9,10,11 3 | 4 | add $0,1 5 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/load_simple1/000/A000079.asm: -------------------------------------------------------------------------------- 1 | ; A000079: Powers of 2: a(n) = 2^n. 2 | ; 1,2,4,8,16,32,64,128,256,512 3 | 4 | mov $1,2 5 | pow $1,$0 6 | mov $0,$1 7 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/load_simple2/000/A000001.asm: -------------------------------------------------------------------------------- 1 | seq $0,79 2 | mod $0,3 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/load_simple2/000/A000079.asm: -------------------------------------------------------------------------------- 1 | ; A000079: Powers of 2: a(n) = 2^n. 2 | ; 1,2,4,8,16,32,64,128,256,512 3 | 4 | mov $1,2 5 | pow $1,$0 6 | mov $0,$1 7 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/load_simple3/000/A000120.asm: -------------------------------------------------------------------------------- 1 | ; A000120: 1's-counting sequence: number of 1's in binary expansion of n (or the binary weight of n). 2 | ; 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,2,3,3,4 3 | 4 | mov $1,$0 5 | lpb $0 6 | div $1,2 7 | sub $0,$1 8 | lpe 9 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/offset/000/A000203.asm: -------------------------------------------------------------------------------- 1 | ; A000203: a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n). 2 | ; Submitted by Simon Strandgaard 3 | ; 1,3,4,7,6,12,8,15,13,18,12,28,14,24,24,31,18,39,20,42,32,36,24,60,31,42,40,56,30,72,32,63,48,54,48,91,38,60,56,90,42,96,44,84,78,72,48,124,57,93,72,98,54,120,72,120,80,90,60,168,62,96,104,127,84,144,68,126,96,144,72,195,74,114,124,140,96,168,80,186 4 | 5 | #offset 1 6 | 7 | mov $1,1 8 | mov $2,2 9 | lpb $0 10 | mov $3,$0 11 | sub $3,1 12 | lpb $3 13 | mov $4,$0 14 | mod $4,$2 15 | min $4,1 16 | add $2,1 17 | sub $3,$4 18 | lpe 19 | mov $5,1 20 | lpb $0 21 | dif $0,$2 22 | mul $5,$2 23 | add $5,1 24 | lpe 25 | mul $1,$5 26 | lpe 27 | mov $0,$1 28 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/offset/000/A000247.asm: -------------------------------------------------------------------------------- 1 | ; A000247: a(n) = 2^n - n - 2. 2 | ; 0,3,10,25,56,119,246,501,1012,2035,4082,8177,16368,32751,65518,131053,262124,524267,1048554,2097129,4194280,8388583,16777190,33554405,67108836,134217699,268435426,536870881,1073741792,2147483615,4294967262,8589934557,17179869148,34359738331,68719476698,137438953433,274877906904,549755813847,1099511627734,2199023255509,4398046511060,8796093022163,17592186044370,35184372088785,70368744177616,140737488355279,281474976710606,562949953421261,1125899906842572,2251799813685195,4503599627370442 3 | 4 | #offset 2 5 | 6 | mov $1,2 7 | pow $1,$0 8 | add $0,2 9 | sub $1,$0 10 | mov $0,$1 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/offset/009/A009194.asm: -------------------------------------------------------------------------------- 1 | ; A009194: a(n) = gcd(n, sigma(n)). 2 | ; Submitted by Jamie Morken(s1) 3 | ; 1,1,1,1,1,6,1,1,1,2,1,4,1,2,3,1,1,3,1,2,1,2,1,12,1,2,1,28,1,6,1,1,3,2,1,1,1,2,1,10,1,6,1,4,3,2,1,4,1,1,3,2,1,6,1,8,1,2,1,12,1,2,1,1,1,6,1,2,3,2,1,3,1,2,1,4,1,6,1,2 4 | ; Formula: a(n) = gcd(n,A000203(n)) 5 | 6 | #offset 1 7 | 8 | mov $1,$0 9 | seq $1,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n). 10 | gcd $0,$1 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/offset/183/A183634.asm: -------------------------------------------------------------------------------- 1 | ; A183634: Number of (n+1) X 2 0..3 arrays with every 2 x 2 subblock summing to 6. 2 | ; Submitted by Jamie Morken(s4) 3 | ; 44,136,452,1576,5684,21016,79172,302536,1168724,4552696,17848292,70313896,278034164,1102505176,4381191812,17438411656,69494842004,277203478456,1106487293732,4418971411816,17654956552244,70557047312536,282039869338052,1127594551170376,4508683493244884,18029649972887416,72103348159708772,288367637980183336,1153333289018519924,4612921369514923096,18450450122677189892,73798094433151186696,295181259577111897364,1180691683876328779576,4722666672277678165412,18890366499565240756456 4 | ; Formula: a(n) = 4^(n+1)+2*3^(n+1)+2*2^(n+1)+2 5 | 6 | #offset 1 7 | 8 | add $0,1 9 | mov $1,4 10 | pow $1,$0 11 | mov $3,2 12 | pow $3,$0 13 | mov $2,3 14 | pow $2,$0 15 | add $2,$3 16 | mov $0,$2 17 | mul $0,2 18 | add $0,2 19 | add $0,$1 20 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/offset/223/A223069.asm: -------------------------------------------------------------------------------- 1 | ; A223069: Number of n X 2 0..3 arrays with successive rows and columns fitting to straight lines with nondecreasing slope, with a single point array taken as having zero slope. 2 | ; Submitted by Coleslaw 3 | ; 16,150,1080,6627,36552,187000,905440,4206453,18933408,83153850,358250280,1520208679,6373759384,26468569500,109080982800,446806304505,1821267503280,7395000190750,29933239010200,120863093617131,487054223473896,1959657102062400,7874853754399680,31613806764501757,126815552645300032,508394645093717250,2037130271122978440,8159639347358945583,32673301810034530488,130801609522481376100,523544152256294333680,2095227274014876967809,8384173659599897834064,33546826037002377147750,134218711472435638212600 4 | 5 | #offset 1 6 | 7 | sub $0,1 8 | mov $2,1 9 | mov $10,1 10 | add $0,1 11 | lpb $0 12 | sub $0,1 13 | mov $5,0 14 | mov $6,0 15 | mov $4,$2 16 | lpb $4 17 | trn $4,1 18 | mov $7,$4 19 | seq $7,183634 ; Number of (n+1) X 2 0..3 arrays with every 2 x 2 subblock summing to 6. 20 | mov $9,10 21 | add $9,$5 22 | mul $7,$$9 23 | add $5,1 24 | add $6,$7 25 | lpe 26 | div $6,$2 27 | mov $9,10 28 | add $9,$2 29 | mov $3,$6 30 | mov $$9,$3 31 | add $2,1 32 | lpe 33 | mov $0,$3 34 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect1/015/A015736.asm: -------------------------------------------------------------------------------- 1 | ; A015736: Inverse of 1727th cyclotomic polynomial. 2 | ; Submitted by Jamie Morken(s2) 3 | ; 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 4 | 5 | lpb $0 6 | mov $$0,$2 7 | mov $2,1 8 | sub $0,$2 9 | lpe 10 | mov $0,$10 11 | add $0,1 12 | mod $0,2 13 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect2/002/A002212.asm: -------------------------------------------------------------------------------- 1 | ; A002212: Number of restricted hexagonal polyominoes with n cells. 2 | ; Submitted by stoneageman 3 | ; 1,1,3,10,36,137,543,2219,9285,39587,171369,751236,3328218,14878455,67030785,304036170,1387247580,6363044315,29323149825,135700543190,630375241380,2938391049395,13739779184085,64430797069375,302934667061301,1427763630578197,6744284275226223,31923955212096244,151403298421257630,719341002546735393,3423448247477293431,16318330747470877059,77898402246981871197,372377858008925851155,1782405860007914191161,8542101845837929781382,40985370188165773809108,196866532847017546117179,946605211710489963864765 4 | 5 | mov $4,3 6 | mov $1,1 7 | mov $2,1 8 | mov $3,$0 9 | add $3,$0 10 | sub $3,1 11 | lpb $3 12 | sub $3,1 13 | mul $1,$4 14 | mul $1,$3 15 | sub $3,1 16 | add $5,$4 17 | div $1,$5 18 | add $2,$1 19 | add $4,2 20 | lpe 21 | mov $0,$2 22 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect2/025/A025238.asm: -------------------------------------------------------------------------------- 1 | ; A025238: a(n) = a(1)*a(n-1) + a(2)*a(n-2) + ...+ a(n-2)*a(2) for n >= 3. 2 | ; Submitted by BarnardsStern 3 | ; 3,1,3,10,36,137,543,2219,9285,39587,171369,751236,3328218,14878455,67030785,304036170,1387247580,6363044315,29323149825,135700543190,630375241380,2938391049395,13739779184085,64430797069375,302934667061301 4 | 5 | mov $1,2 6 | mov $$0,$1 7 | seq $0,2212 ; Number of restricted hexagonal polyominoes with n cells. 8 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect3/071/A071325.asm: -------------------------------------------------------------------------------- 1 | ; A071325: Number of squares > 1 dividing n. 2 | ; Submitted by Stony666 3 | ; 0,0,0,1,0,0,0,1,1,0,0,1,0,0,0,2,0,1,0,1,0,0,0,1,1,0,1,1,0,0,0,2,0,0,0,3,0,0,0,1,0,0,0,1,1,0,0,2,1,1,0,1,0,1,0,1,0,0,0,1,0,0,1,3,0,0,0,1,0,0,0,3,0,0,1,1,0,0,0,2,2,0,0,1,0,0,0,1,0,1,0,1,0,0,0,2,0,1,1,3 4 | 5 | mov $1,1 6 | mov $2,2 7 | mov $4,-1 8 | add $0,1 9 | lpb $0 10 | mov $3,$0 11 | lpb $3 12 | mov $4,$0 13 | mod $4,$2 14 | add $2,1 15 | sub $3,$4 16 | lpe 17 | mov $5,1 18 | lpb $0 19 | dif $0,$2 20 | cmp $4,0 21 | add $5,$4 22 | lpe 23 | mul $1,$5 24 | lpe 25 | mov $0,$1 26 | sub $0,1 27 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect3/159/A159631.asm: -------------------------------------------------------------------------------- 1 | ; A159631: Dimension of space of modular forms of weight 1/2, level 4*n and trivial character. 2 | ; Submitted by zombie67 [MM] 3 | ; 1,1,1,2,1,1,1,2,2,1,1,2,1,1,1,3,1,2,1,2,1,1,1,2,2,1,2,2,1,1,1,3,1,1,1,4,1,1,1,2,1,1,1,2,2,1,1,3,2,2,1,2,1,2,1,2,1,1,1,2,1,1,2,4,1,1,1,2,1,1,1,4,1,1,2,2,1,1,1,3,3,1,1,2,1,1,1,2,1,2,1,2,1,1,1,3,1,2,2,4 4 | 5 | mov $1,$0 6 | add $$1,2 7 | seq $1,71325 ; Number of squares > 1 dividing n. 8 | mod $1,$0 9 | mov $0,$1 10 | add $0,1 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect4/000/A000041.asm: -------------------------------------------------------------------------------- 1 | ; A000041: a(n) is the number of partitions of n (the partition numbers). 2 | ; Submitted by Christian Krause 3 | ; 1,1,2,3,5,7,11,15,22,30,42,56,77,101,135,176,231,297,385,490,627,792,1002,1255,1575,1958,2436,3010,3718,4565,5604,6842,8349,10143,12310,14883,17977,21637,26015,31185,37338,44583,53174,63261,75175,89134,105558,124754,147273,173525,204226,239943,281589,329931,386155,451276,526823,614154,715220,831820,966467,1121505,1300156,1505499,1741630,2012558,2323520,2679689,3087735,3554345,4087968,4697205,5392783,6185689,7089500,8118264,9289091,10619863,12132164,13848650,15796476,18004327,20506255,23338469 4 | 5 | mov $2,1 6 | mov $10,1 7 | lpb $0 8 | sub $0,1 9 | mov $5,0 10 | mov $6,0 11 | mov $4,$2 12 | lpb $4 13 | trn $4,1 14 | mov $7,$4 15 | seq $7,203 ; a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n). 16 | mov $9,10 17 | add $9,$5 18 | mul $7,$$9 19 | add $5,1 20 | add $6,$7 21 | lpe 22 | div $6,$2 23 | mov $9,10 24 | add $9,$2 25 | mov $3,$6 26 | mov $$9,$3 27 | add $2,1 28 | mov $8,$3 29 | lpe 30 | mov $0,$8 31 | max $0,1 32 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect4/000/A000203.asm: -------------------------------------------------------------------------------- 1 | ; A000203: a(n) = sigma(n), the sum of the divisors of n. Also called sigma_1(n). 2 | ; Submitted by Simon Strandgaard 3 | ; 1,3,4,7,6,12,8,15,13,18,12,28,14,24,24,31,18,39,20,42,32,36,24,60,31,42,40,56,30,72,32,63,48,54,48,91,38,60,56,90,42,96,44,84,78,72,48,124,57,93,72,98,54,120,72,120,80,90,60,168,62,96,104,127,84,144,68,126,96,144,72,195,74,114,124,140,96,168,80,186,121,126,84,224,108,132,120,180,90,234,112,168,128,144,120,252,98,171,156,217 4 | 5 | mov $1,1 6 | mov $2,2 7 | add $0,1 8 | lpb $0 9 | mov $3,$0 10 | sub $3,1 11 | lpb $3 12 | mov $4,$0 13 | mod $4,$2 14 | min $4,1 15 | add $2,1 16 | sub $3,$4 17 | lpe 18 | mov $5,1 19 | lpb $0 20 | dif $0,$2 21 | mul $5,$2 22 | add $5,1 23 | lpe 24 | mul $1,$5 25 | lpe 26 | mov $0,$1 27 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect5/355/A355497.asm: -------------------------------------------------------------------------------- 1 | ; A355497: Numbers k such that x^2 - s*x + p has only integer roots, where s and p denote the sum and product of the digits of k respectively. 2 | ; Submitted by [AF>Le_Pommier>MacBidouille.com]Prof 3 | ; 0,4,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107 4 | 5 | mov $4,1 6 | add $4,$0 7 | mov $5,$0 8 | mov $1,7 9 | add $1,$4 10 | mov $$5,4 11 | sub $$2,$$2 12 | mov $$4,$$2 13 | mov $0,$1 14 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect6/022/A022843.asm: -------------------------------------------------------------------------------- 1 | ; A022843: Beatty sequence for e: a(n) = floor(n*e). 2 | ; Submitted by http://kodeks.karelia.ru/ 3 | ; 0,2,5,8,10,13,16,19,21,24,27,29,32,35,38,40,43,46,48,51,54,57,59,62,65,67,70,73,76,78,81,84,86,89,92,95,97,100,103,106,108,111,114,116,119,122,125,127,130,133,135,138,141,144,146,149,152,154,157,160,163,165,168,171,173,176,179,182,184,187,190,192,195,198,201,203,206,209,212,214,217,220,222,225,228,231,233,236,239,241,244,247,250,252,255,258,260,263,266,269 4 | 5 | mov $3,13 6 | lpb $3 7 | mul $2,$3 8 | sub $3,1 9 | add $2,$3 10 | add $1,$2 11 | lpe 12 | mul $1,$0 13 | div $1,$2 14 | mov $0,$1 15 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect6/344/A344348.asm: -------------------------------------------------------------------------------- 1 | ; A344348: a(n) = floor(frac(e * n) * n). 2 | ; Submitted by PDW 3 | ; 0,0,0,0,3,2,1,0,5,4,1,9,7,4,0,11,7,3,16,12,7,1,17,11,5,23,17,10,3,24,16,8,31,23,14,4,30,21,11,0,29,18,7,38,26,14,1,35,22,9,45,32,18,3,42,27,12,53,38,22,5,49,33,15,62,44,26,8,57,38,19,70 4 | 5 | mov $1,$0 6 | add $$1,2 7 | mul $1,$0 8 | seq $1,22843 ; Beatty sequence for e: a(n) = floor(n*e). 9 | mod $1,$0 10 | mov $0,$1 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-core/tests/parametertype_indirect7/103/A103627.asm: -------------------------------------------------------------------------------- 1 | ; A103627: Let S(n) = {n,1,n}; sequence gives concatenation S(0), S(1), S(2), ... 2 | ; 0,1,0,1,1,1,2,1,2,3,1,3,4,1,4,5,1,5,6,1,6,7,1,7,8,1,8,9,1,9,10,1,10,11,1,11,12,1,12,13,1,13,14,1,14,15,1,15,16,1,16,17,1,17,18,1,18,19,1,19,20,1,20,21,1,21,22,1,22,23,1,23,24,1,24,25,1,25,26,1,26,27,1,27,28,1,28,29,1,29,30,1,30,31,1,31,32,1,32,33 3 | 4 | lpb $0 5 | add $1,1 6 | mov $$0,$0 7 | trn $$2,3 8 | lpe 9 | mov $0,$1 10 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | 3 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "loda-rust-web" 3 | version = "0.1.0" 4 | authors = ["Simon Strandgaard "] 5 | description = "Interactive web interface, so a person new to LODA, can try it in their browser." 6 | repository = "https://github.com/loda-lang/loda-rust" 7 | license = "MIT OR Apache-2.0" 8 | edition = "2021" 9 | 10 | [package.metadata.wasm-pack.profile.release] 11 | wasm-opt = false 12 | 13 | [lib] 14 | crate-type = ["cdylib"] 15 | 16 | [dependencies] 17 | loda-rust-core = { path = "../loda-rust-core" } 18 | wasm-bindgen = "0.2" 19 | js-sys = "0.3.51" 20 | wasm-bindgen-futures = "0.4.25" 21 | console_error_panic_hook = "0.1.6" 22 | log = { version = "0.4.14", features = ["std"] } 23 | 24 | [dependencies.web-sys] 25 | version = "0.3.4" 26 | features = [ 27 | 'Headers', 28 | 'Request', 29 | 'RequestInit', 30 | 'RequestMode', 31 | 'Response', 32 | 'Window', 33 | 'Document', 34 | 'Element', 35 | 'WorkerGlobalScope' 36 | ] 37 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Print debug info before executing commands. 4 | set -ex 5 | 6 | # In the past I used `--target web`, but that only allowed me to run wasm in the main thread, causing the UI to hang. 7 | # 8 | # Now I use the flag `--target no-modules`, so I can run the wasm within a Web Worker. 9 | wasm-pack build --target no-modules 10 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/chart-js/readme.md: -------------------------------------------------------------------------------- 1 | # Chart.js, version 3.7.0 2 | 3 | Simple yet flexible JavaScript charting for designers & developers. 4 | 5 | [Repository](https://github.com/chartjs/Chart.js). 6 | 7 | License: MIT License. 8 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/.gitattributes: -------------------------------------------------------------------------------- 1 | *.txt text eol=lf 2 | *.js text eol=lf 3 | *.html text eol=lf 4 | *.md text eol=lf 5 | *.json text eol=lf 6 | *.yml text eol=lf 7 | *.css text eol=lf 8 | *.svg text eol=lf 9 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/.npmignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /demo 3 | /doc 4 | /test 5 | /test*.html 6 | /index.html 7 | /mode/*/*test.js 8 | /mode/*/*.html 9 | /mode/index.html 10 | .* 11 | /bin/authors.sh 12 | /bin/lint 13 | /bin/release 14 | /bin/upload-release.js 15 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (C) 2017 by Marijn Haverbeke and others 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/addon/dialog/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: inherit; 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: inherit; 9 | } 10 | 11 | .CodeMirror-dialog-top { 12 | border-bottom: 1px solid #eee; 13 | top: 0; 14 | } 15 | 16 | .CodeMirror-dialog-bottom { 17 | border-top: 1px solid #eee; 18 | bottom: 0; 19 | } 20 | 21 | .CodeMirror-dialog input { 22 | border: none; 23 | outline: none; 24 | background: transparent; 25 | width: 20em; 26 | color: inherit; 27 | font-family: monospace; 28 | } 29 | 30 | .CodeMirror-dialog button { 31 | font-size: 70%; 32 | } 33 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function(mod) { 5 | if (typeof exports == "object" && typeof module == "object") // CommonJS 6 | mod(require("../../lib/codemirror")); 7 | else if (typeof define == "function" && define.amd) // AMD 8 | define(["../../lib/codemirror"], mod); 9 | else // Plain browser env 10 | mod(CodeMirror); 11 | })(function(CodeMirror) { 12 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 13 | if (prev == CodeMirror.Init) prev = false; 14 | if (prev && !val) 15 | cm.removeOverlay("trailingspace"); 16 | else if (!prev && val) 17 | cm.addOverlay({ 18 | token: function(stream) { 19 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 20 | if (i > stream.pos) { stream.pos = i; return null; } 21 | stream.pos = l; 22 | return "trailingspace"; 23 | }, 24 | name: "trailingspace" 25 | }); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/addon/fold/foldgutter.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-foldmarker { 2 | color: blue; 3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; 4 | font-family: arial; 5 | line-height: .3; 6 | cursor: pointer; 7 | } 8 | .CodeMirror-foldgutter { 9 | width: .7em; 10 | } 11 | .CodeMirror-foldgutter-open, 12 | .CodeMirror-foldgutter-folded { 13 | cursor: pointer; 14 | } 15 | .CodeMirror-foldgutter-open:after { 16 | content: "\25BE"; 17 | } 18 | .CodeMirror-foldgutter-folded:after { 19 | content: "\25B8"; 20 | } 21 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | white-space: pre; 29 | color: black; 30 | cursor: pointer; 31 | } 32 | 33 | li.CodeMirror-hint-active { 34 | background: #08f; 35 | color: white; 36 | } 37 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/addon/search/matchesonscrollbar.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-search-match { 2 | background: gold; 3 | border-top: 1px solid orange; 4 | border-bottom: 1px solid orange; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | opacity: .5; 8 | } 9 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/bin/authors.sh: -------------------------------------------------------------------------------- 1 | # Combine existing list of authors with everyone known in git, sort, add header. 2 | tail --lines=+3 AUTHORS > AUTHORS.tmp 3 | git log --format='%aN' | grep -v "Piët Delport" >> AUTHORS.tmp 4 | echo -e "List of CodeMirror contributors. Updated before every release.\n" > AUTHORS 5 | sort -u AUTHORS.tmp | sed 's/Google Inc\./Google LLC/' >> AUTHORS 6 | rm -f AUTHORS.tmp 7 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/bin/lint: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | process.exit(require("../test/lint").ok ? 0 : 1); 4 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/bin/upload-release.js: -------------------------------------------------------------------------------- 1 | "use strict" 2 | 3 | let version = process.argv[2] 4 | let auth = process.argv[3] 5 | 6 | if (!auth) { 7 | console.log("Usage: upload-release.js [TAG] [github-user:password]") 8 | process.exit(1) 9 | } 10 | 11 | require('child_process').exec("git --no-pager show -s --format='%s' " + version, (error, stdout) => { 12 | if (error) throw error 13 | let message = stdout.split("\n").slice(2) 14 | message = message.slice(0, message.indexOf("-----BEGIN PGP SIGNATURE-----")).join("\n") 15 | 16 | let req = require("https").request({ 17 | host: "api.github.com", 18 | auth: auth, 19 | headers: {"user-agent": "Release uploader"}, 20 | path: "/repos/codemirror/codemirror/releases", 21 | method: "POST" 22 | }, res => { 23 | if (res.statusCode >= 300) { 24 | console.error(res.statusMessage) 25 | res.on("data", d => console.log(d.toString())) 26 | res.on("end", process.exit(1)) 27 | } 28 | }) 29 | req.write(JSON.stringify({ 30 | tag_name: version, 31 | name: version, 32 | body: message 33 | })) 34 | req.end() 35 | }) 36 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/doc/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/rust_project/loda-rust-web/web/codemirror/doc/logo.png -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/doc/yinyang.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/loda-lang/loda-rust/1677f456fe20dc3769a66fc32692b5d660b935c4/rust_project/loda-rust-web/web/codemirror/doc/yinyang.png -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/mode/css/gss_test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | "use strict"; 6 | 7 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-gss"); 8 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "gss"); } 9 | 10 | MT("atComponent", 11 | "[def @component] {", 12 | "[tag foo] {", 13 | " [property color]: [keyword black];", 14 | "}", 15 | "}"); 16 | 17 | })(); 18 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/mode/d/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "d"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("nested_comments", 9 | "[comment /+]","[comment comment]","[comment +/]","[variable void] [variable main](){}"); 10 | 11 | })(); 12 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/mode/ruby/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); 6 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 7 | 8 | MT("divide_equal_operator", 9 | "[variable bar] [operator /=] [variable foo]"); 10 | 11 | MT("divide_equal_operator_no_spacing", 12 | "[variable foo][operator /=][number 42]"); 13 | 14 | MT("complex_regexp", 15 | "[keyword if] [variable cr] [operator =~] [string-2 /(?: \\( #{][tag RE_NOT][string-2 }\\( | #{][tag RE_NOT_PAR_OR][string-2 }* #{][tag RE_OPA_OR][string-2 } )/][variable x]") 16 | 17 | MT("indented_heredoc", 18 | "[keyword def] [def x]", 19 | " [variable y] [operator =] [string <<-FOO]", 20 | "[string bar]", 21 | "[string FOO]", 22 | "[keyword end]") 23 | })(); 24 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/mode/rust/test.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: https://codemirror.net/LICENSE 3 | 4 | (function() { 5 | var mode = CodeMirror.getMode({indentUnit: 4}, "rust"); 6 | function MT(name) {test.mode(name, mode, Array.prototype.slice.call(arguments, 1));} 7 | 8 | MT('integer_test', 9 | '[number 123i32]', 10 | '[number 123u32]', 11 | '[number 123_u32]', 12 | '[number 0xff_u8]', 13 | '[number 0o70_i16]', 14 | '[number 0b1111_1111_1001_0000_i32]', 15 | '[number 0usize]'); 16 | 17 | MT('float_test', 18 | '[number 123.0f64]', 19 | '[number 0.1f64]', 20 | '[number 0.1f32]', 21 | '[number 12E+99_f64]'); 22 | 23 | MT('string-literals-test', 24 | '[string "foo"]', 25 | '[string r"foo"]', 26 | '[string "\\"foo\\""]', 27 | '[string r#""foo""#]', 28 | '[string "foo #\\"# bar"]', 29 | 30 | '[string b"foo"]', 31 | '[string br"foo"]', 32 | '[string b"\\"foo\\""]', 33 | '[string br#""foo""#]', 34 | '[string br##"foo #" bar"##]', 35 | 36 | "[string-2 'h']", 37 | "[string-2 b'h']"); 38 | 39 | })(); 40 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/mode/tiki/tiki.css: -------------------------------------------------------------------------------- 1 | .cm-tw-syntaxerror { 2 | color: #FFF; 3 | background-color: #900; 4 | } 5 | 6 | .cm-tw-deleted { 7 | text-decoration: line-through; 8 | } 9 | 10 | .cm-tw-header5 { 11 | font-weight: bold; 12 | } 13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ 14 | padding-left: 10px; 15 | } 16 | 17 | .cm-tw-box { 18 | border-top-width: 0px !important; 19 | border-style: solid; 20 | border-width: 1px; 21 | border-color: inherit; 22 | } 23 | 24 | .cm-tw-underline { 25 | text-decoration: underline; 26 | } -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/addon/runmode/codemirror-standalone.js: -------------------------------------------------------------------------------- 1 | import StringStream from "../../util/StringStream.js" 2 | import { countColumn } from "../../util/misc.js" 3 | import * as modeMethods from "../../modes.js" 4 | 5 | // declare global: globalThis, CodeMirror 6 | 7 | // Create a minimal CodeMirror needed to use runMode, and assign to root. 8 | var root = typeof globalThis !== 'undefined' ? globalThis : window 9 | root.CodeMirror = {} 10 | 11 | // Copy StringStream and mode methods into CodeMirror object. 12 | CodeMirror.StringStream = StringStream 13 | for (var exported in modeMethods) CodeMirror[exported] = modeMethods[exported] 14 | 15 | // Minimal default mode. 16 | CodeMirror.defineMode("null", () => ({token: stream => stream.skipToEnd()})) 17 | CodeMirror.defineMIME("text/plain", "null") 18 | 19 | CodeMirror.registerHelper = CodeMirror.registerGlobalHelper = Math.min 20 | CodeMirror.splitLines = function(string) { return string.split(/\r?\n|\r/) } 21 | CodeMirror.countColumn = countColumn 22 | 23 | CodeMirror.defaults = { indentUnit: 2 } 24 | export default CodeMirror 25 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/addon/runmode/codemirror.node.js: -------------------------------------------------------------------------------- 1 | import StringStream from "../../util/StringStream.js" 2 | import * as modeMethods from "../../modes.js" 3 | import {countColumn} from "../../util/misc.js" 4 | 5 | // Copy StringStream and mode methods into exports (CodeMirror) object. 6 | exports.StringStream = StringStream 7 | exports.countColumn = countColumn 8 | for (var exported in modeMethods) exports[exported] = modeMethods[exported] 9 | 10 | // Shim library CodeMirror with the minimal CodeMirror defined above. 11 | require.cache[require.resolve("../../lib/codemirror")] = require.cache[require.resolve("./runmode.node")] 12 | require.cache[require.resolve("../../addon/runmode/runmode")] = require.cache[require.resolve("./runmode.node")] 13 | 14 | // Minimal default mode. 15 | exports.defineMode("null", () => ({token: stream => stream.skipToEnd()})) 16 | exports.defineMIME("text/plain", "null") 17 | 18 | exports.registerHelper = exports.registerGlobalHelper = Math.min 19 | exports.splitLines = function(string) { return string.split(/\r?\n|\r/) } 20 | 21 | exports.defaults = { indentUnit: 2 } 22 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/addon/runmode/runmode-standalone.js: -------------------------------------------------------------------------------- 1 | import "./codemirror-standalone.js" 2 | import "../../../addon/runmode/runmode.js" -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/addon/runmode/runmode.node.js: -------------------------------------------------------------------------------- 1 | import "./codemirror.node.js" 2 | import "../../../addon/runmode/runmode.js" -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/codemirror.js: -------------------------------------------------------------------------------- 1 | import { CodeMirror } from "./edit/main.js" 2 | 3 | export default CodeMirror 4 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/display/mode_state.js: -------------------------------------------------------------------------------- 1 | import { getMode } from "../modes.js" 2 | 3 | import { startWorker } from "./highlight_worker.js" 4 | import { regChange } from "./view_tracking.js" 5 | 6 | // Used to get the editor into a consistent state again when options change. 7 | 8 | export function loadMode(cm) { 9 | cm.doc.mode = getMode(cm.options, cm.doc.modeOption) 10 | resetModeState(cm) 11 | } 12 | 13 | export function resetModeState(cm) { 14 | cm.doc.iter(line => { 15 | if (line.stateAfter) line.stateAfter = null 16 | if (line.styles) line.styles = null 17 | }) 18 | cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first 19 | startWorker(cm, 100) 20 | cm.state.modeGen++ 21 | if (cm.curOp) regChange(cm) 22 | } 23 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/edit/deleteNearSelection.js: -------------------------------------------------------------------------------- 1 | import { runInOp } from "../display/operations.js" 2 | import { ensureCursorVisible } from "../display/scrolling.js" 3 | import { cmp } from "../line/pos.js" 4 | import { replaceRange } from "../model/changes.js" 5 | import { lst } from "../util/misc.js" 6 | 7 | // Helper for deleting text near the selection(s), used to implement 8 | // backspace, delete, and similar functionality. 9 | export function deleteNearSelection(cm, compute) { 10 | let ranges = cm.doc.sel.ranges, kill = [] 11 | // Build up a set of ranges to kill first, merging overlapping 12 | // ranges. 13 | for (let i = 0; i < ranges.length; i++) { 14 | let toKill = compute(ranges[i]) 15 | while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { 16 | let replaced = kill.pop() 17 | if (cmp(replaced.from, toKill.from) < 0) { 18 | toKill.from = replaced.from 19 | break 20 | } 21 | } 22 | kill.push(toKill) 23 | } 24 | // Next, remove those actual ranges. 25 | runInOp(cm, () => { 26 | for (let i = kill.length - 1; i >= 0; i--) 27 | replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete") 28 | ensureCursorVisible(cm) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/edit/utils.js: -------------------------------------------------------------------------------- 1 | import { clearCaches } from "../measurement/position_measurement.js" 2 | 3 | export function themeChanged(cm) { 4 | cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + 5 | cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-") 6 | clearCaches(cm) 7 | } 8 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/input/keynames.js: -------------------------------------------------------------------------------- 1 | export let keyNames = { 2 | 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 3 | 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 4 | 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", 5 | 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", 6 | 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", 7 | 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 8 | 221: "]", 222: "'", 224: "Mod", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", 9 | 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" 10 | } 11 | 12 | // Number keys 13 | for (let i = 0; i < 10; i++) keyNames[i + 48] = keyNames[i + 96] = String(i) 14 | // Alphabetic keys 15 | for (let i = 65; i <= 90; i++) keyNames[i] = String.fromCharCode(i) 16 | // Function keys 17 | for (let i = 1; i <= 12; i++) keyNames[i + 111] = keyNames[i + 63235] = "F" + i 18 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/line/saw_special_spans.js: -------------------------------------------------------------------------------- 1 | // Optimize some code when these features are not used. 2 | export let sawReadOnlySpans = false, sawCollapsedSpans = false 3 | 4 | export function seeReadOnlySpans() { 5 | sawReadOnlySpans = true 6 | } 7 | 8 | export function seeCollapsedSpans() { 9 | sawCollapsedSpans = true 10 | } 11 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/src/measurement/widgets.js: -------------------------------------------------------------------------------- 1 | import { contains, elt, removeChildrenAndAdd } from "../util/dom.js" 2 | import { e_target } from "../util/event.js" 3 | 4 | export function widgetHeight(widget) { 5 | if (widget.height != null) return widget.height 6 | let cm = widget.doc.cm 7 | if (!cm) return 0 8 | if (!contains(document.body, widget.node)) { 9 | let parentStyle = "position: relative;" 10 | if (widget.coverGutter) 11 | parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;" 12 | if (widget.noHScroll) 13 | parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;" 14 | removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)) 15 | } 16 | return widget.height = widget.node.parentNode.offsetHeight 17 | } 18 | 19 | // Return true when the given mouse event happened in a widget 20 | export function eventInWidget(display, e) { 21 | for (let n = e_target(e); n != display.wrapper; n = n.parentNode) { 22 | if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || 23 | (n.parentNode == display.sizer && n != display.mover)) 24 | return true 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/test/lint.js: -------------------------------------------------------------------------------- 1 | var blint = require("blint"); 2 | 3 | ["mode", "lib", "addon", "keymap"].forEach(function(dir) { 4 | blint.checkDir(dir, { 5 | browser: true, 6 | allowedGlobals: ["CodeMirror", "define", "test", "requirejs", "globalThis", "WeakSet"], 7 | ecmaVersion: 5, 8 | tabs: dir == "lib" 9 | }); 10 | }); 11 | 12 | ["src"].forEach(function(dir) { 13 | blint.checkDir(dir, { 14 | browser: true, 15 | allowedGlobals: ["WeakSet"], 16 | ecmaVersion: 6, 17 | semicolons: false 18 | }); 19 | }); 20 | 21 | module.exports = {ok: blint.success()}; 22 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/test/mode_test.css: -------------------------------------------------------------------------------- 1 | .mt-output .mt-token { 2 | border: 1px solid #ddd; 3 | white-space: pre; 4 | font-family: "Consolas", monospace; 5 | text-align: center; 6 | } 7 | 8 | .mt-output .mt-style { 9 | font-size: x-small; 10 | } 11 | 12 | .mt-output .mt-state { 13 | font-size: x-small; 14 | vertical-align: top; 15 | } 16 | 17 | .mt-output .mt-state-row { 18 | display: none; 19 | } 20 | 21 | .mt-state-unhide .mt-output .mt-state-row { 22 | display: table-row; 23 | } 24 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/theme/ambiance-mobile.css: -------------------------------------------------------------------------------- 1 | .cm-s-ambiance.CodeMirror { 2 | -webkit-box-shadow: none; 3 | -moz-box-shadow: none; 4 | box-shadow: none; 5 | } 6 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/theme/elegant.css: -------------------------------------------------------------------------------- 1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom { color: #762; } 2 | .cm-s-elegant span.cm-comment { color: #262; font-style: italic; line-height: 1em; } 3 | .cm-s-elegant span.cm-meta { color: #555; font-style: italic; line-height: 1em; } 4 | .cm-s-elegant span.cm-variable { color: black; } 5 | .cm-s-elegant span.cm-variable-2 { color: #b11; } 6 | .cm-s-elegant span.cm-qualifier { color: #555; } 7 | .cm-s-elegant span.cm-keyword { color: #730; } 8 | .cm-s-elegant span.cm-builtin { color: #30a; } 9 | .cm-s-elegant span.cm-link { color: #762; } 10 | .cm-s-elegant span.cm-error { background-color: #fdd; } 11 | 12 | .cm-s-elegant .CodeMirror-activeline-background { background: #e8f2ff; } 13 | .cm-s-elegant .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } 14 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/theme/juejin.css: -------------------------------------------------------------------------------- 1 | .cm-s-juejin.CodeMirror { 2 | background: #f8f9fa; 3 | } 4 | .cm-s-juejin .cm-header, 5 | .cm-s-juejin .cm-def { 6 | color: #1ba2f0; 7 | } 8 | .cm-s-juejin .cm-comment { 9 | color: #009e9d; 10 | } 11 | .cm-s-juejin .cm-quote, 12 | .cm-s-juejin .cm-link, 13 | .cm-s-juejin .cm-strong, 14 | .cm-s-juejin .cm-attribute { 15 | color: #fd7741; 16 | } 17 | .cm-s-juejin .cm-url, 18 | .cm-s-juejin .cm-keyword, 19 | .cm-s-juejin .cm-builtin { 20 | color: #bb51b8; 21 | } 22 | .cm-s-juejin .cm-hr { 23 | color: #909090; 24 | } 25 | .cm-s-juejin .cm-tag { 26 | color: #107000; 27 | } 28 | .cm-s-juejin .cm-variable-2 { 29 | color: #0050a0; 30 | } 31 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/theme/neat.css: -------------------------------------------------------------------------------- 1 | .cm-s-neat span.cm-comment { color: #a86; } 2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } 3 | .cm-s-neat span.cm-string { color: #a22; } 4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } 5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } 6 | .cm-s-neat span.cm-variable { color: black; } 7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } 8 | .cm-s-neat span.cm-meta { color: #555; } 9 | .cm-s-neat span.cm-link { color: #3a3; } 10 | 11 | .cm-s-neat .CodeMirror-activeline-background { background: #e8f2ff; } 12 | .cm-s-neat .CodeMirror-matchingbracket { outline:1px solid grey; color:black !important; } 13 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/theme/neo.css: -------------------------------------------------------------------------------- 1 | /* neo theme for codemirror */ 2 | 3 | /* Color scheme */ 4 | 5 | .cm-s-neo.CodeMirror { 6 | background-color:#ffffff; 7 | color:#2e383c; 8 | line-height:1.4375; 9 | } 10 | .cm-s-neo .cm-comment { color:#75787b; } 11 | .cm-s-neo .cm-keyword, .cm-s-neo .cm-property { color:#1d75b3; } 12 | .cm-s-neo .cm-atom,.cm-s-neo .cm-number { color:#75438a; } 13 | .cm-s-neo .cm-node,.cm-s-neo .cm-tag { color:#9c3328; } 14 | .cm-s-neo .cm-string { color:#b35e14; } 15 | .cm-s-neo .cm-variable,.cm-s-neo .cm-qualifier { color:#047d65; } 16 | 17 | 18 | /* Editor styling */ 19 | 20 | .cm-s-neo pre { 21 | padding:0; 22 | } 23 | 24 | .cm-s-neo .CodeMirror-gutters { 25 | border:none; 26 | border-right:10px solid transparent; 27 | background-color:transparent; 28 | } 29 | 30 | .cm-s-neo .CodeMirror-linenumber { 31 | padding:0; 32 | color:#e0e2e5; 33 | } 34 | 35 | .cm-s-neo .CodeMirror-guttermarker { color: #1d75b3; } 36 | .cm-s-neo .CodeMirror-guttermarker-subtle { color: #e0e2e5; } 37 | 38 | .cm-s-neo .CodeMirror-cursor { 39 | width: auto; 40 | border: 0; 41 | background: rgba(155,157,162,0.37); 42 | z-index: 1; 43 | } 44 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror/theme/ssms.css: -------------------------------------------------------------------------------- 1 | .cm-s-ssms span.cm-keyword { color: blue; } 2 | .cm-s-ssms span.cm-comment { color: darkgreen; } 3 | .cm-s-ssms span.cm-string { color: red; } 4 | .cm-s-ssms span.cm-def { color: black; } 5 | .cm-s-ssms span.cm-variable { color: black; } 6 | .cm-s-ssms span.cm-variable-2 { color: black; } 7 | .cm-s-ssms span.cm-atom { color: darkgray; } 8 | .cm-s-ssms .CodeMirror-linenumber { color: teal; } 9 | .cm-s-ssms .CodeMirror-activeline-background { background: #ffffff; } 10 | .cm-s-ssms span.cm-string-2 { color: #FF00FF; } 11 | .cm-s-ssms span.cm-operator, 12 | .cm-s-ssms span.cm-bracket, 13 | .cm-s-ssms span.cm-punctuation { color: darkgray; } 14 | .cm-s-ssms .CodeMirror-gutters { border-right: 3px solid #ffee62; background-color: #ffffff; } 15 | .cm-s-ssms div.CodeMirror-selected { background: #ADD6FF; } 16 | 17 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/codemirror_mode_loda.js: -------------------------------------------------------------------------------- 1 | // Syntax coloring for LODA assembly language 2 | // https://github.com/loda-lang/loda-lang 3 | (function(mod) { 4 | if (typeof exports == "object" && typeof module == "object") // CommonJS 5 | mod(require("../../lib/codemirror"), require("../../addon/mode/simple")); 6 | else if (typeof define == "function" && define.amd) // AMD 7 | define(["../../lib/codemirror", "../../addon/mode/simple"], mod); 8 | else // Plain browser env 9 | mod(CodeMirror); 10 | })(function(CodeMirror) { 11 | "use strict"; 12 | 13 | CodeMirror.defineSimpleMode("loda", { 14 | start: [ 15 | {regex: /[$][$]\d+/, token: "number"}, 16 | {regex: /[$]\d+/, token: "number"}, 17 | {regex: /-?\d+/, token: "number"}, 18 | {regex: /\s*(?:mov|add|sub|trn|mul|div|dif|dir|mod|pow|gcd|bin|cmp|min|max|log|lpb|lpe|nrt|dgs|dgr|lex|equ|neq|leq|geq|ban|bor|bxo|seq|lps|f\d\d)\b/, 19 | token: "keyword", sol: true }, 20 | {regex: /#offset\s+(0|-?[1-9]\d*)$/, token: "keyword", sol: true}, 21 | {regex: /;.*/, token: "comment"}, 22 | ], 23 | }); 24 | 25 | CodeMirror.defineMIME("text/x-loda", "loda"); 26 | }); 27 | -------------------------------------------------------------------------------- /rust_project/loda-rust-web/web/promise-worker/readme.md: -------------------------------------------------------------------------------- 1 | # promise-worker, version 2.0.1 2 | 3 | A small and performant library for communicating with Web Workers or Service Workers, using Promises. Post a message to the worker, get a message back. 4 | 5 | [Repository](https://github.com/nolanlawson/promise-worker). 6 | 7 | License: Apache-2.0 License. 8 | -------------------------------------------------------------------------------- /script/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem "toml", "~> 0.3.0" 4 | -------------------------------------------------------------------------------- /script/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | parslet (2.0.0) 5 | toml (0.3.0) 6 | parslet (>= 1.8.0, < 3.0.0) 7 | 8 | PLATFORMS 9 | ruby 10 | 11 | DEPENDENCIES 12 | toml (~> 0.3.0) 13 | 14 | BUNDLED WITH 15 | 2.2.26 16 | -------------------------------------------------------------------------------- /script/data/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything 2 | * 3 | 4 | # But not these files 5 | !.gitignore 6 | !readme.md 7 | -------------------------------------------------------------------------------- /script/data/readme.md: -------------------------------------------------------------------------------- 1 | # Output dir used by scripts 2 | 3 | This dir contains temporary files. 4 | 5 | Mostly CSV files. 6 | -------------------------------------------------------------------------------- /script/miner_sync_debug.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | # For debugging of the "sync" code 4 | # Intended for LODA developers. 5 | # 6 | # This appends a timestamp to a logfile. 7 | # And it's possible to tweak what is being returned "changed" or "nochange". 8 | 9 | require 'time' 10 | require_relative 'config' 11 | 12 | timestamp = Time.now.utc.iso8601 13 | 14 | log_file_path = File.join(Config.instance.dot_loda_rust, "miner_sync_debug_log.txt") 15 | File.open(log_file_path, "a") do |f| 16 | f << "Sync: #{timestamp}\n" 17 | end 18 | 19 | #puts "status: nochange" 20 | puts "status: changed" 21 | -------------------------------------------------------------------------------- /script/readme.md: -------------------------------------------------------------------------------- 1 | # Automation 2 | 3 | These scripts for automation uses the [Ruby programming_language](https://www.ruby-lang.org/en/). 4 | 5 | Run `bundle install` to install the dependencies listed in the `Gemfile`. 6 | 7 | 8 | # Usage - Basics 9 | 10 | ### Show help 11 | 12 | ``` 13 | PROMPT> rake 14 | rake clean_mineevent_dir # Remove already processed programs with suffix .keep.asm and .reject.asm 15 | rake data/compare_loda_cpp_vs_loda_rust.csv # compare terms between "loda-cpp" and "loda-rust" 16 | rake data/program_creation_dates.csv # extract creation date for all programs 17 | rake data/program_ids.csv # obtain all the program ids 18 | rake data/terms_loda_cpp.csv # compute terms with "loda-cpp" 19 | rake data/terms_loda_rust.csv # compute terms with "loda-rust" 20 | rake data/top100.md # create a markdown document with the 100 most popular LODA programs 21 | rake process_mined_programs # Process the mined programs 22 | PROMPT> 23 | ``` 24 | 25 | -------------------------------------------------------------------------------- /script/task_cleanup_processed_files_from_mineevent_dir.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | =begin 4 | This script removes ".reject.asm" and ".keep.asm" files. 5 | 6 | After analyzing the mined programs, the "mine-event" dir is left with files like these: 7 | 20220522-182722-410927334.reject.asm 8 | 20220522-183346-423905535.keep.asm 9 | =end 10 | 11 | require_relative 'config' 12 | 13 | MINE_EVENT_DIR = Config.instance.dot_loda_rust_mine_event 14 | unless Dir.exist?(MINE_EVENT_DIR) 15 | raise "No such dir #{MINE_EVENT_DIR}, cannot run script" 16 | end 17 | 18 | def absolute_paths_for_all_processed_programs(rootdir) 19 | relative_paths = Dir.glob(File.join("**", "*.asm"), base: rootdir) 20 | count_all = relative_paths.count 21 | relative_paths.filter! { |filename| filename =~ /[.](keep|reject)[.]asm$/ } 22 | relative_paths.sort! 23 | absolute_paths = relative_paths.map { |relative_path| File.join(rootdir, relative_path) } 24 | absolute_paths 25 | end 26 | 27 | # Identify all the files that are to be deleted 28 | files_to_be_deleted = absolute_paths_for_all_processed_programs(MINE_EVENT_DIR) 29 | puts "Number of files to be deleted from mine-event dir: #{files_to_be_deleted.count}" 30 | 31 | files_to_be_deleted.each do |path| 32 | File.delete(path) 33 | end 34 | -------------------------------------------------------------------------------- /script/task_maintenance_of_outlier_programs_repo.rb: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | 3 | =begin 4 | Run "maintenance" job inside the "loda-outlier-programs" repository. 5 | =end 6 | 7 | require_relative 'config' 8 | 9 | LODA_OUTLIER_PROGRAMS_DIR = Config.instance.loda_outlier_programs_repository 10 | unless Dir.exist?(LODA_OUTLIER_PROGRAMS_DIR) 11 | raise "No such dir #{LODA_OUTLIER_PROGRAMS_DIR}, cannot run script" 12 | end 13 | 14 | script_path = File.join(LODA_OUTLIER_PROGRAMS_DIR, "script") 15 | unless Dir.exist?(script_path) 16 | raise "No such dir #{script_path}, cannot run script" 17 | end 18 | 19 | Dir.chdir(script_path) do 20 | system("rake maintenance") 21 | end 22 | -------------------------------------------------------------------------------- /script/task_remove_similarity_lsh_files.rb: -------------------------------------------------------------------------------- 1 | # Delete all files with the suffix: `similarity_lsh.csv` 2 | Dir.chdir('data/instructions') do 3 | `find . -type f -name '*similarity_lsh.csv' -delete` 4 | end 5 | -------------------------------------------------------------------------------- /script/upload_program_files_to_server_from_commit.rb: -------------------------------------------------------------------------------- 1 | # Identifies the added/changed programs in latest commit within the loda-programs repo, and submits these programs to loda-lang.org. 2 | 3 | require_relative 'config' 4 | require_relative 'upload_program_files_to_server' 5 | 6 | LODA_PROGRAMS_REPO = Config.instance.loda_programs_repository 7 | unless File.exist?(LODA_PROGRAMS_REPO) 8 | raise "No such dir #{LODA_PROGRAMS_REPO}, cannot run script" 9 | end 10 | 11 | LODA_PROGRAMS_OEIS = Config.instance.loda_programs_oeis 12 | unless File.exist?(LODA_PROGRAMS_OEIS) 13 | raise "No such dir #{LODA_PROGRAMS_OEIS}, cannot run script" 14 | end 15 | 16 | def absolute_paths_for_files_to_be_uploaded(dir_inside_repo) 17 | paths1 = [] 18 | Dir.chdir(dir_inside_repo) do 19 | result = `git diff-tree --no-commit-id --name-only -r HEAD` 20 | paths1 = result.split(/\n/) 21 | end 22 | paths2 = paths1.map do |path| 23 | File.join(dir_inside_repo, path) 24 | end 25 | paths2 26 | end 27 | 28 | file_paths = absolute_paths_for_files_to_be_uploaded(LODA_PROGRAMS_REPO) 29 | upload_program_files_to_server(file_paths) 30 | --------------------------------------------------------------------------------