{"id":19227793,"url":"https://github.com/aleksac/urm","last_synced_at":"2025-04-21T01:31:42.775Z","repository":{"id":115397423,"uuid":"262894644","full_name":"AleksaC/urm","owner":"AleksaC","description":"URM simulator written in C","archived":true,"fork":false,"pushed_at":"2020-10-11T14:17:06.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T08:33:38.086Z","etag":null,"topics":["c","simulator","urm"],"latest_commit_sha":null,"homepage":"","language":"C","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/AleksaC.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":"2020-05-10T23:32:36.000Z","updated_at":"2024-07-18T22:38:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"7acf50df-e30a-40b8-a454-b10af34885c2","html_url":"https://github.com/AleksaC/urm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AleksaC%2Furm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AleksaC%2Furm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AleksaC%2Furm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AleksaC%2Furm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AleksaC","download_url":"https://codeload.github.com/AleksaC/urm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249982525,"owners_count":21355709,"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":["c","simulator","urm"],"created_at":"2024-11-09T15:25:23.289Z","updated_at":"2025-04-21T01:31:42.768Z","avatar_url":"https://github.com/AleksaC.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# URM Simulator\n\nThis repositroy contains [URM](https://proofwiki.org/wiki/Definition:Unlimited_Register_Machine)\nsimulator written in C along with some example URM programs. This was built as a\nhomework for the computability theory class at my university.\n\n## About 📖\nURM (Unlimited Register Machine) is an abstraction of computing device.\nAs its name suggests the machine has unlimited registers whose values are natural\nnumbers. The machine executes instructions one after another in sequential order\nunless jump instruction is encountered and its condition is satisfied. URM can\nexecute 4 types of instructions:\n- Zero instruction `Z(i)` - sets *i-th* register to zero\n- Successor `S(i)` - sets the value of *i-th* register to its successor\n(increments it by one)\n- Transfer `T(i, j)` - sets the value of *i-th* register to the value of *j-th* register\n- Jump `J(i, j, k)` - jumps to *k-th* instruction if contents of the *i-th* and *j-th*\nregister match, otherwise it proceeds to the next instruction\n\nThe program terminates when reaches the instruction outside of the range of instructions\nin the program. The result of the computation should be stored in the first register.\n\nThe simulator can execute arbitrary URM programs. In addition you can add comments beginning\nwith `#` and add labels indicating instruction number (e.g. `1: S(3)`). These labels are not\nconsidered during the execution of the program, so if an instruction is mislabeled it will\nnot affect how the program is executed but you will be warned that the label number doesn't\nmatch the instruction number.\n\nWhen running a simulator you need to provide the path to your program as the first argument\nand the initial register configuration as subsequent arguments. The rest of the registers\nare considered to contain 0, but they will not be allocated until a write operation is\nperformed on them.\n\n## Getting started ⚙️\n```shell script\ngit clone https://github.com/AleksaC/urm\ncd urm\nmake\n./bin/release/simulator examples/min.txt 7 5 12\n```\nThis will clone the repo, generate `simulator` binary in `bin/release` and run a\nprogram that finds the minimum of 3 natural numbers (in this case 7, 3 and 12).\n\nTo compile the project in `debug` mode run:\n```shell script\nmake debug\n```\nYou can also build and run the program with the following command:\n```shell script\nmake run ARGS=\"path/to/your_program.txt initial_register_configuration\"\n```\n\nIf you're on windows and want to use `make` you'll need to use `git bash`,\n`msys` or `wsl`. Alternatively you can compile the entire project with the\nfollowing command:\n```shell script\ngcc -I ./include -O3 -std=c99 src/urm_simulator.c src/main.c -o bin/simulator\n```\nTo get `debug` build replace `-O3` with `-g`.\n\nWe've used `gcc` to compile the project, but you can use `clang` as a drop-in\nreplacement by setting `CC = clang` in the `Makefile` or replacing `gcc` with\n`clang` in the command above.\n\nOnce you've compiled the program you can run your own programs or the ones\nprovided in the [examples directory](https://github.com/AleksaC/urm/tree/master/examples).\n\n## LICENSE️ ⚖️\n[![license](https://img.shields.io/badge/License-MIT-green.svg)](https://github.com/AleksaC/urm/blob/master/LICENSE)\n\n## Contact 🙋‍♂️\n- [Personal website](https://aleksac.me)\n- \u003ca target=\"_blank\" href=\"http://twitter.com/aleksa_c_\"\u003e\u003cimg alt='Twitter followers' src=\"https://img.shields.io/twitter/follow/aleksa_c_.svg?style=social\"\u003e\u003c/a\u003e\n- aleksacukovic1@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksac%2Furm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleksac%2Furm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksac%2Furm/lists"}