{"id":17442563,"url":"https://github.com/jez/tsim","last_synced_at":"2026-01-24T05:38:32.039Z","repository":{"id":73798919,"uuid":"58162898","full_name":"jez/tsim","owner":"jez","description":"A Turing machine simulator in SML","archived":false,"fork":false,"pushed_at":"2016-05-05T21:55:29.000Z","size":11,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-21T01:13:50.134Z","etag":null,"topics":["plt","programming-languages","sml"],"latest_commit_sha":null,"homepage":null,"language":"Standard ML","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/jez.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":"2016-05-05T21:53:22.000Z","updated_at":"2022-08-15T06:40:36.000Z","dependencies_parsed_at":"2023-03-25T11:18:38.918Z","dependency_job_id":null,"html_url":"https://github.com/jez/tsim","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jez/tsim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Ftsim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Ftsim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Ftsim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Ftsim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jez","download_url":"https://codeload.github.com/jez/tsim/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jez%2Ftsim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28713721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T05:28:26.568Z","status":"ssl_error","status_checked_at":"2026-01-24T05:28:10.840Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["plt","programming-languages","sml"],"created_at":"2024-10-17T16:17:49.300Z","updated_at":"2026-01-24T05:38:32.011Z","avatar_url":"https://github.com/jez.png","language":"Standard ML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Turing Machine Simulator\n\nThis project implements a Turing machine simulator, and includes a number of\nTuring machines to demonstrate how it works.\n\n## Turing Machine Conventions\n\nWe choose to represent a Turing machine using the `TURING` signature. This is the\nbest place to start to gain an understanding of the complete system.\n\nFor a quick summary, our `TURING` signature sets up the following conventions:\n\n- a tape alphabet that includes a blank symbol\n- a two-way infinite tape, represented as a two-way unbounded array\n- a state transition function that allows (but does not require) writing and\n  moving in the same operation\n- a single initial and a single final state\n\nAgain, you are encouraged to read the `TURING` signature for more details.\n\n## Building and Running\n\nThis code complies cleanly under both SML/NJ and MLton. If possible, we strongly\nrecommend compiling it using MLton, as it is *orders of magnitude* faster.\n\n### MLton\n\nOnce you've installed MLton, building is just one simple command.\n\nYou can get usage information by running the command with no arguments.\n\n```console\n$ make mlton\n\n$ ./tsim\nusage: ./tsim (add|mult|exp) \u003cn\u003e \u003cm\u003e\n\n$ ./tsim add 1 1\n[Q0]  11 11\n     ^\n[Q1]  11 11\n      ^\n[Q1]  11 11\n       ^\n[Q1]  11 11\n        ^\n[Q2]  11111\n         ^\n[Q2]  11111\n          ^\n[Q2]  11111\n           ^\n[Q3]  11111\n          ^\n[Q4]  1111\n         ^\n[Q5]  111\n        ^\n[Q5]  111\n       ^\n[Q5]  111\n      ^\n[Q5]  111\n     ^\n[Q6]  111\n     ^\nAnswer: 2\n```\n\n\n### SML/NJ\n\nThe build system isn't quite as polished, but it still works well enough.\n\n```console\n$ make smlnj\n\n$ sml -m sources.cm app/call-main.sml\n... stuff ...\nusage: ./tsim (add|mult|exp) \u003cn\u003e \u003cm\u003e\n\n$ sml -m sources.cm app/call-main.sml add 1 1\n... stuff ...\n[Q0]  11 11\n     ^\n[Q1]  11 11\n      ^\n[Q1]  11 11\n       ^\n[Q1]  11 11\n        ^\n[Q2]  11111\n         ^\n[Q2]  11111\n          ^\n[Q2]  11111\n           ^\n[Q3]  11111\n          ^\n[Q4]  1111\n         ^\n[Q5]  111\n        ^\n[Q5]  111\n       ^\n[Q5]  111\n      ^\n[Q5]  111\n     ^\n[Q6]  111\n     ^\nAnswer: 2\n```\n\n## Supported Turing Machines\n\nWe implement three Turing machines: addition, multiplication, and\nexponentiation. The attributions for these machines can be found in\n[Credits](#credits). Each has been implemented ascribing to the `TURING`\nsignature, and resides in `lib/turing/`.\n\n\n## Credits\n\n- [Addition Machine][adder]. 15453-s16 FLAC, \"Lecture: Turing Machines\"\n- [Multiplication Machine][multiplier]. Turing machine for multiplication.\n  YouTube.\n- [Exponentiation Machine][exponentiator]. A Turing Machine for Exponential\n  Function.\n\n[adder]: http://www.cs.cmu.edu/~flac/PDFs/20-turing.pdf\n[multiplier]: https://www.youtube.com/watch?v=fUXYL_hywMo\n[exponentiator]: http://philpapers.org/archive/LEMATM\n\n## License\n\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://jez.io/MIT-LICENSE.txt)\n\nCopyright Jacob Zimmerman. See badge link above for license information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjez%2Ftsim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjez%2Ftsim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjez%2Ftsim/lists"}