{"id":22859908,"url":"https://github.com/harmim/vut-flp-project2","last_synced_at":"2026-03-19T23:50:43.306Z","repository":{"id":74891462,"uuid":"255896059","full_name":"harmim/vut-flp-project2","owner":"harmim","description":"Functional and Logic Programming - Logic Project - Turing Machine","archived":false,"fork":false,"pushed_at":"2020-04-17T05:25:34.000Z","size":556,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T12:48:09.329Z","etag":null,"topics":["flp","logic-programming","prolog","swi-prolog","theoretical-computer-science","turing-machine","turing-machine-simulator","vut","vut-fit"],"latest_commit_sha":null,"homepage":"","language":"Prolog","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/harmim.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-04-15T11:30:17.000Z","updated_at":"2021-09-06T15:43:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"d0cee17d-81d6-487c-a45c-70be9b68b84e","html_url":"https://github.com/harmim/vut-flp-project2","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/harmim%2Fvut-flp-project2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmim%2Fvut-flp-project2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmim%2Fvut-flp-project2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harmim%2Fvut-flp-project2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harmim","download_url":"https://codeload.github.com/harmim/vut-flp-project2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246436783,"owners_count":20777085,"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":["flp","logic-programming","prolog","swi-prolog","theoretical-computer-science","turing-machine","turing-machine-simulator","vut","vut-fit"],"created_at":"2024-12-13T09:08:25.243Z","updated_at":"2026-01-08T20:07:44.817Z","avatar_url":"https://github.com/harmim.png","language":"Prolog","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Functional and Logic Programming - Logic Project\n## Turing Machine\n\n##### Author: Dominik Harmim \u003cxharmi00@stud.fit.vutbr.cz\u003e\n\n## Build\nUsing the command `make`, the project is compiled using the `swipl` compiler\nand a program `flp20-log` is created.\n\n## Run\nAfter the compilation (see the section above), it can be run as follows:\n```bash\n$ ./flp20-log \u003c input-file \u003e output-file\n```\n`input-file` is the name of an input file with a Turing machine and with an\ninitial tape in a specified format. `output-file` is the name of the output\nfile where a sequence of tapes used during the computation is going to be\nstored.\n\n## Description\nThe program simulates a given nondeterministic Turing machine. An input\nspecification of the machine and an initial tape are first parsed and their\nformat is validated. In case the format is invalid, an error message is\nprinted to the standard output and the program is terminated. Otherwise,\nall the given rules are added to the program as dynamic predicates and the\nsimulation with the initial tape is started. Prolog tries to find a sequence\nof tapes that leads to the final state according to the stored rules. The\nsimulation fails if there is no such sequence that leads to the final state. If\nthe simulation succeeds, the sequence of tapes used during the computation is\nprinted to the standard output.\n\n## Tests\nIn the directory `tests`, there are some testing input files (`.in` extension)\nand corresponding outputs (`.out` extension). There is a description\nof these files (`#` denotes the blank symbol):\n- `invalid-format` - invalid format of an input file (there are some illegal\n  characters). Running time: 0.014s.\n- `abnormal-termination` - abnormal termination of a Turing machine (there is\n  no final state). Running time: 0.020s.\n- `ref` - a reference example. Running time: 0.013s.\n- `ab` - accepts the following language `(a|b)^n###...`. Running time: 0.116s.\n- `an-bn` - modifies the tape from the format `#a^n###...` to the format\n  `#b^n###...`. Running time: 3.863s.\n- `a2n-abn` - modifies the tape from the format `#a^(2n)###...` to the format\n  `#(ab)^n###...`. Running time: 1.039s.\n- `anbncn` - accepts the following language `#a^nb^nc^n###...` (the global stack\n  limit likely needs to be increase). Running time: 29.203s.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmim%2Fvut-flp-project2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharmim%2Fvut-flp-project2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharmim%2Fvut-flp-project2/lists"}