{"id":21484117,"url":"https://github.com/dylex/conwayrats","last_synced_at":"2025-10-26T14:31:46.117Z","repository":{"id":177748795,"uuid":"658506568","full_name":"dylex/conwayrats","owner":"dylex","description":"exploration for conway's RATS","archived":false,"fork":false,"pushed_at":"2023-10-24T02:50:15.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-23T19:14:34.839Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dylex.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2023-06-25T23:56:25.000Z","updated_at":"2023-06-25T23:57:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"6e91ed59-cf46-43c2-9fc9-328383c89897","html_url":"https://github.com/dylex/conwayrats","commit_stats":null,"previous_names":["dylex/conwayrats"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylex%2Fconwayrats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylex%2Fconwayrats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylex%2Fconwayrats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylex%2Fconwayrats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylex","download_url":"https://codeload.github.com/dylex/conwayrats/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244010927,"owners_count":20383333,"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","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":[],"created_at":"2024-11-23T12:50:13.465Z","updated_at":"2025-10-26T14:31:46.009Z","avatar_url":"https://github.com/dylex.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conway's RATS exploration tool \n\n## Installation\n\n- Clone this repo\n- Install glpk (e.g., `apt-get install libglpk-dev`)\n- Install [Haskell Stack](https://www.fpcomplete.com/haskell/get-started/) (e.g., `wget -qO- https://get.haskellstack.org/ | sh`)\n- Run `stack build`\n\n## Running\n\nEither:\n- `stack run -- --help`, or\n- `stack install`, `rats --help`\n\n```\nrats [OPTIONS] CASEPATH|NUMBER\nRun Conway's RATS, base 4.\nIf given a simple number, follow it forever.\nIf given a list of cases by letter (as specified in the case4 file),\n  evaluate the conditions on the initial digit counts (a=1s,b=2s,...)\n  that would lead to this path of cases, and compute the minimum initial\n  digit counts necessary.\n\n  -i         --ilp           Find minimum integral solution to constraints (rather than just simplex)\n  -t[DEPTH]  --tree[=DEPTH]  Explore a tree of possibilites after specified case path\n  -d         --decrease      Allow exploring cases that decrease count\n```\n\n## Example\n\n```\n\u003e rats -t3 -i HECJ\na, b, c\tif \t[] 0\ta+b+c \u003e= 0 (0,0,0)\n2+b-c, -1+2c, 0\tif b-c\u003e=0,c\u003e=1,-a\u003e=0\t[H] 1\t1+b+c \u003e= 2 (0,1,1)\n0, 3+b-3c, -2+4c\tif 2c\u003e=2,b-3c\u003e=-3,-a\u003e=0,b-c\u003e=0\t[HE] 1\t1+b+c \u003e= 2 (0,1,1)\n1, 1, -3+4c\tif 4c\u003e=3,-b+3c\u003e=3,b-c\u003e=0,-a\u003e=0,b-3c\u003e=-3\t[HEC] 2\t-1+4c \u003e= 5 (0,3,2)\n2, 2, -5+4c\tif b-3c\u003e=-3,-a\u003e=0,b-c\u003e=0,-b+3c\u003e=3\t[HECJ] 2\t-1+4c \u003e= 5 (0,3,2)\n 4, 4, -9+4c\tif 4c\u003e=9,-b+3c\u003e=3,-a\u003e=0,b-3c\u003e=-3\t[HECJJ] 2\t-1+4c \u003e= 9 (0,6,3)\n  0, 0, 8\tif -4c\u003e=-9,b-3c\u003e=-3,-a\u003e=0,-b+3c\u003e=3,4c\u003e=9\t[HECJJE] 2\t8\n  8, 8, -17+4c\tif 4c\u003e=17,b-3c\u003e=-3,-a\u003e=0,-b+3c\u003e=3\t[HECJJJ] 2\t-1+4c \u003e= 17 (0,12,5)\n   0, 0, 16\tif -4c\u003e=-17,-b+3c\u003e=3,-a\u003e=0,b-3c\u003e=-3,4c\u003e=17\t[HECJJJE] 2\t16\n   16, 16, -33+4c\tif 4c\u003e=33,-b+3c\u003e=3,-a\u003e=0,b-3c\u003e=-3\t[HECJJJJ] 2\t-1+4c \u003e= 33 (0,24,9)\n   49-4c, -50+8c, 0\tif 4c\u003e=25,-4c\u003e=-32,-b+3c\u003e=3,-a\u003e=0,b-3c\u003e=-3\t[HECJJJK] 2\t-1+4c \u003e= 25 (0,18,7)\n   -51+12c, 0, 0\tif -4c\u003e=-24,4c\u003e=18,-b+3c\u003e=3,-a\u003e=0,b-3c\u003e=-3\t[HECJJJL] -48+8c\t-51+12c \u003e= 17 (0,12,5)\n  25-4c, -26+8c, 0\tif 4c\u003e=13,-4c\u003e=-16,b-3c\u003e=-3,-a\u003e=0,-b+3c\u003e=3\t[HECJJK] 2\t-1+4c bounded\n  -27+12c, 0, 0\tif -4c\u003e=-12,4c\u003e=10,b-3c\u003e=-3,-a\u003e=0,-b+3c\u003e=3\t[HECJJL] -24+8c\t-27+12c bounded\n 13-4c, -14+8c, 0\tif 4c\u003e=7,-4c\u003e=-8,-b+3c\u003e=3,-a\u003e=0,b-3c\u003e=-3\t[HECJK] 2\t-1+4c \u003e= 5 (0,3,2)\n  0, 13-4c, 0\tif -8c\u003e=-14,8c\u003e=14,b-3c\u003e=-3,-a\u003e=0,-b+3c\u003e=3,4c\u003e=7\t[HECJKA] 2\t13-4c bounded\n  0, 27-12c, -28+16c\tif 8c\u003e=15,b-3c\u003e=-3,-a\u003e=0,-b+3c\u003e=3,-4c\u003e=-8\t[HECJKE] 2\t-1+4c bounded\n -15+12c, 0, 0\tif -4c\u003e=-6,4c\u003e=5,4c\u003e=6,-b+3c\u003e=3,b-c\u003e=0,-a\u003e=0\t[HECJL] -12+8c\t-15+12c bounded\n```\n\n- We ask what initial conditions can follow the sequence of cases H,E,C,J:\n   - Starting with a 1s, b 2s, and c 3s\n   - this can expand (using case H) to 2+b-c 1s, 2c-1 2s, 0 cs if b\u003e=c,c\u003e=1,a=0\n      - for a total of 1+b+c initial digits\n      - and requires at least 2 total initial digits (0 1s, 1 2, 1 3)\n   - which can expand (using case E) to 0 1s, 3+b-3c 2s, 4c-2 3s if ...\n   - ... which can expand (using case C and the J) to 2 1s, 2 2s, 4c-5 3s if ...\n      - and we now have a total of 4c-1 digits\n      - which must be at least 5\n- And then ask for a tree of all possible cases (that don't decrease, `-d`):\n  - cases J, K, and L are possible (HECJJ, HECJK, HECJL)...\n  - case HECJL requires a set of initial conditions that are bounded above (an upper bound on the number of possible digits), so the search terminates\n\n## Base 4\n\nCurrently everything is hard-coded for base 4, but this can (partially) be changed by editing `Param.hs` and creating the appropriate `caseN` file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylex%2Fconwayrats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylex%2Fconwayrats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylex%2Fconwayrats/lists"}