{"id":35015614,"url":"https://github.com/mdda/arc-dsl-llm","last_synced_at":"2026-05-22T10:39:38.225Z","repository":{"id":262142853,"uuid":"870631624","full_name":"mdda/arc-dsl-llm","owner":"mdda","description":"LLM-legible version of Michael Hodel's arc-dsl","archived":false,"fork":false,"pushed_at":"2025-01-13T10:21:15.000Z","size":1464,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-13T11:33:13.565Z","etag":null,"topics":["arc-prize"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-10T11:47:46.000Z","updated_at":"2025-01-13T10:21:19.000Z","dependencies_parsed_at":"2024-11-10T20:18:48.914Z","dependency_job_id":"c8d49b17-d247-4efb-992f-062347fa2831","html_url":"https://github.com/mdda/arc-dsl-llm","commit_stats":null,"previous_names":["mdda/arc-dsl-llm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mdda/arc-dsl-llm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Farc-dsl-llm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Farc-dsl-llm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Farc-dsl-llm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Farc-dsl-llm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdda","download_url":"https://codeload.github.com/mdda/arc-dsl-llm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdda%2Farc-dsl-llm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28072870,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-27T02:00:05.897Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arc-prize"],"created_at":"2025-12-27T05:19:24.905Z","updated_at":"2025-12-27T05:19:28.603Z","avatar_url":"https://github.com/mdda.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Domain Specific Language for the Abstraction and Reasoning Corpus (ARC-DSL-LLM)\n## Updated (from [`arc-dsl`](https://github.com/michaelhodel/arc-dsl/)) to be LLM-legible\n\nThe original DSL (released as `arc-dsl`) was created with the aim of \nbeing expressive enough to allow programs solving arbitrary ARC tasks, \nand generic, i.e. consisting of only few primitives, each useful for many tasks (see [`dsl.py`](dsl.py)). \nAs a proof of concept, solver programs for the training tasks were written (see [`solvers.py`](solvers.py)). \nSee Hodel's [`arc_dsl_writeup.pdf`](https://github.com/michaelhodel/arc-dsl/blob/main/arc_dsl_writeup.pdf) \nfor a more detailed description of the original work.\n\n\n## `arc-dsl-llm` and LLM-legibility\n\nThere were several kinds of changes made to the original `arc-dsl` to make it more LLM-legible (and, frankly, more human-legible).  \n\nThe following are the most significant updates made:\n\n* Significantly updating the DSL function names to be more LLM-friendly (see below for a list)\n  + A motivating example : `fork(outer,a,b)` is more 'legible' when named `combine_two_function_results(outer,f1,f2)`\n* Rectifying the use of `COLOR_X` constants: \n  + Remove implicit assumptions that `COLOR_BLACK==0` or `COLOR_BLACK\u003cCOLOR_RED` (for instance)\n  + Add additional `COLOR_BELOW` (defined to be numerically smaller than other colors) that allows for `sort` to behave in the way expected by several solutions\n  + Remove usage of `COLOR_X` to represent small integers (i.e. non-colors).  This was frustrating.\n  + Remove calculation of `COLOR_X` values by (for instance) doubling other `COLOR_Y` values (!)\n* Ensuring that `python -m arc_dsl.main` runs cleanly (running the DSL tests and proving the solutions on the test examples)\n  + NB: the code is up-to-date (with all 400 training-set solutions passing)\n* Adding correct type-hinting so that `pyright solvers.py` executes cleanly\n* Allowing the code to run as an imported module (without moving the files around - the change history is preserved)\n\n\n## Example solver program for task `00d62c1b` written in the DSL\n\n![Task 00d62c1b](00d62c1b.png)\n\n### Taken from the current `arc-dsl` repo\n\n```python\ndef solve_00d62c1b(I):\n    x1 = objects(I, T, F, F)\n    x2 = colorfilter(x1, ZERO)\n    x3 = rbind(bordering, I)\n    x4 = compose(flip, x3)\n    x5 = mfilter(x2, x4)\n    O = fill(I, FOUR, x5)    \n    return O\n```\n\n### The `arc-dsl-llm` version\n\nAs given in `solvers.py`:\n```python\ndef solve_00d62c1b(I):\n    x1 = as_objects(I, True, False, False)\n    x2 = color_filter(x1, COLOR_ZERO)\n    x3 = fix_last_argument(bordering, I)\n    x4 = compose(logical_not, x3)\n    x5 = keep_if_condition_and_flatten(x2, x4)\n    O = fill(I, COLOR_FOUR, x5)\n```\nNB: parameter name annotations can be added (as in the original Hodel repo) automatically, \nsince the format of the function definition / documentation is now uniform.\n\n\n## Another solver example: `5521c0d9`\n\n![Task 5521c0d9](5521c0d9.png)\n\n### Taken from the current `arc-dsl` repo\n```python\ndef solve_5521c0d9(I):\n    x1 = objects(I, T, F, T)\n    x2 = merge(x1)\n    x3 = cover(I, x2)\n    x4 = chain(toivec, invert, height)\n    x5 = fork(shift, identity, x4)\n    x6 = mapply(x5, x1)\n    O = paint(x3, x6)\n    return O\n```\n\n### The `arc-dsl-llm` version\n\nAs given in `solvers.py`:\n```python\ndef solve_5521c0d9(I):\n    x1 = as_objects(I, True, False, True)\n    x2 = flatten(x1)\n    x3 = erase_patch(I, x2)\n    x4 = chain(to_vertical_vec, negate, get_height)\n    x5 = combine_two_function_results(shift_by_vector, identity, x4)\n    x6 = transform_and_flatten(x5, x1)\n    O = paint_onto_grid(x3, x6)\n    return O\n```\n\n\n## Installation\n\nThere are very minimal requirements :\n```bash\nuv pip install tqdm\n```\n\n\n## DSL function name changes (`arc-dsl` \u0026rarr; `arc-dsl-llm`)\n\nHopefully, it will be clear to the reader that the RHS replacements should be much more 'LLM-legible' than the original LHS.\n\n| `arc-dsl` original | `arc-dsl-llm` new |\n| ------ | ------ | \n| invert | negate |\n| combine | union |\n| dedupe | remove_duplicates |\n| order | sort |\n|  |  |\n| even | is_even |\n| positive | is_positive |\n| equality | is_equal |\n| greater | is_greater |\n| portrait | is_portrait |\n| square | is_square |\n| vfrontier | is_vertical_line |\n| hfrontier | is_horizontal_line |\n|  |  |\n| color | get_color |\n| width | get_width |\n| height | get_height |\n| shape | get_shape |\n|  |  |\n| first | get_first |\n| last | get_last |\n| other | get_other |\n|  |  |\n| both | logical_and |\n| either | logical_or |\n| flip | logical_not |\n|  |  |\n| hmirror | horizontal_mirror |\n| vmirror | vertical_mirror |\n| dmirror | diagonal_mirror |\n| cmirror | counterdiagonal_mirror |\n|  |  |\n| hupscale | horizontal_upscale |\n| vupscale | vertical_upscale |\n|  |  |\n| hconcat | horizontal_concat |\n| vconcat | vertical_concat |\n|  |  |\n| hsplit | horizontal_split |\n| vsplit | vertical_split |\n|  |  |\n| location | color_at_location |\n| connect | line_between |\n|  |  |\n| subgrid | smallest_subgrid_containing |\n| extract | extract_first_matching |\n|  |  |\n| colorcount | color_count |\n| colorfilter | color_filter |\n| sizefilter | size_filter |\n|  |  |\n| ulcorner | upper_left_corner |\n| urcorner | upper_right_corner |\n| llcorner | lower_left_corner |\n| lrcorner | lower_right_corner |\n|  |  |\n| product | cartesian_product |\n|  |  |\n| sfilter | keep_if_condition |\n| mfilter | keep_if_condition_and_merge |\n|  |  |\n| apply | transform |\n| mapply | transform_and_flatten |\n| papply | transform_both |\n| mpapply | transform_both_and_flatten |\n| rapply | apply_each_function |\n| prapply | apply_function_on_cartesian_product |\n|  |  |\n| extract | extract_first_matching |\n| branch | condition_if_else |\n| fork | combine_two_function_results |\n|  |  |\n| matcher | equals |\n|  |  |\n| hvec | to_horizontal_vec |\n| vvec | to_vertical_vec |\n|  |  |\n| shift | shift_by_vector |\n| normalize | shift_to_origin |\n| gravitate | move_until_touching |\n|  |  |\n| neighbors | direct_neighbors |\n| dneighbors | diagonal_neighbors |\n|  |  |\n| vfrontier | vertical_frontier |\n| hfrontier | horizontal_frontier |\n|  |  |\n| vmatching | vertical_matching |\n| hmatching | horizontal_matching |\n|  |  |\n| fgpartition | partition_only_foreground |\n|  |  |\n| mostcolor | most_common_color |\n| leastcolor | least_common_color |\n|  |  |\n| manhattan | manhattan_distance |\n| *new* | as_generic_tuple |\n| *new* | make_cell |\n|  |  |\n| backdrop | bounding_box_indices |\n| delta | bounding_box_delta |\n|  |  |\n| paint | paint_onto_grid |\n| underpaint | paint_onto_grid_background |\n|  |  |\n| canvas | create_grid |\n| cover | erase_patch |\n| trim | trim_border |\n| move | move_object |\n|  |  |\n| frontiers | solid_color_strips_in_grid |\n| compress | remove_solid_color_strips_from_grid |\n|  |  |\n| T | True |\n| F | False |\n\n\n\n## Citing this work\n\nThe following paper includes a more detailed description of the updates made from `arc-dsl` to `arc-dsl-llm` in Appendix A:\n\n```bibtex\n@misc{andrews2024capturingsparksabstractionarc,\n      title={Capturing Sparks of Abstraction for the ARC Challenge}, \n      author={Martin Andrews},\n      year={2024},\n      eprint={2411.11206},\n      archivePrefix={arXiv},\n      primaryClass={cs.CL},\n      url={https://arxiv.org/abs/2411.11206}, \n}\n```\n\n### Acknowledgements\n\nSupport for this research was provided by the Google AI/ML Developer Programs team,\nincluding access to the Gemini models and GPUs on Google Cloud Platform. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdda%2Farc-dsl-llm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdda%2Farc-dsl-llm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdda%2Farc-dsl-llm/lists"}