{"id":20266590,"url":"https://github.com/gurbaaz27/typeless","last_synced_at":"2025-10-25T06:40:55.019Z","repository":{"id":67114853,"uuid":"560486299","full_name":"gurbaaz27/typeless","owner":"gurbaaz27","description":"an interpreter for λ-calculus implemented in ruby","archived":false,"fork":false,"pushed_at":"2024-06-08T08:22:00.000Z","size":231,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-25T01:03:13.849Z","etag":null,"topics":["abstract-syntax-tree","beta-reduction","compiler","interpreter","lambda-calculus","lexer-parser","ll1-grammar","ll1-parser","parser","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/gurbaaz27.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":"2022-11-01T15:54:37.000Z","updated_at":"2024-06-08T08:22:03.000Z","dependencies_parsed_at":"2023-06-09T20:45:21.859Z","dependency_job_id":null,"html_url":"https://github.com/gurbaaz27/typeless","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/gurbaaz27%2Ftypeless","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gurbaaz27%2Ftypeless/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gurbaaz27%2Ftypeless/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gurbaaz27%2Ftypeless/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gurbaaz27","download_url":"https://codeload.github.com/gurbaaz27/typeless/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248334039,"owners_count":21086304,"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":["abstract-syntax-tree","beta-reduction","compiler","interpreter","lambda-calculus","lexer-parser","ll1-grammar","ll1-parser","parser","ruby"],"created_at":"2024-11-14T12:10:23.948Z","updated_at":"2025-10-25T06:40:49.964Z","avatar_url":"https://github.com/gurbaaz27.png","language":"Ruby","readme":"# Typeless \n## λ-calculus interpreter\n\n### Table of Contents\n\n- [Description](#description)\n  - [Features](#features)\n  - [Code Structure](#code-structure)\n\n- [Usage](#usage)\n  - [Demo Example](#demo-example)\n\n- [Team Members](#team-members)\n\n## Description\n\nAn interpreter for λ-calculus implemented in `ruby`, as part of our course project CS350A: Principles of Programming Languages under Prof. Satyadev Nandakumar, in Fall Semester 2022-23, IIT Kanpur.\n\nThe grammar specification is:\n```\nλ − term ::= variable |\n            (\\variable · λ − term) |\n            [λ − term][λ − term]\n\nThe allowed variables are single lowercase English letters - a, b, c etc.\n```\n\n### Features\n\nIt supports the following features:\n\n- [x] Lexer and grammar checker for lambda term expression using LL(1) parser\n- [x] Determine free variables in given lambda term\n- [x] Free variables substitution\n- [x] Alpha Renaming and Beta Reduction\n\n### Code Structure\n\n```bash\n.\n├── assets/\n├── lexer.rb\n├── LICENSE\n├── main.rb\n├── parser.rb\n├── README.md\n├── reducer.rb\n├── tests/\n└── utils.rb\n\n2 directories, 14 files\n```\n\n## Usage\n\nKeep your λ-expression in a file and pass its filepath as an argument to `main.rb`.\n\n```bash\nLambda Calculus Interpreter\n===========================\nUsage: main.rb [options]\n    -i, --input FILE                 Input file containing λ-expression\n    -o, --output FILE                (Optional) Output file to store reduced λ-expression. Default: out.txt\n```\n\n### Demo Example\n\n**Note** that we use the notation of `v{i}`, where `i := [1,2,3,...]` for our bound variables after the processing of alpha-renaming and beta-reduction. This helps in easily identifying the bound variables and keep their count in the final reduced form.\n\n![](assets/demo.gif)\n\n```bash\n$ ruby main.rb -i tests/9.lc ## or\n$ ruby main.rb --input=tests/9.lc\n\n================\nCourse Project\nLambda Calculus Interpreter\nCreated by: Ayush, Gurbaaz and Kritin\n================\nGrammar checker :- \n[ ( \\ x . x ) ] [ y ] is a valid lambda term\n================\nFree variables :- y \n================\nα-renaming :- [ ( \\ v0 . v0 ) ] [ y ]\n================\n\u003e Please provide the free variable name along with its substitution. e.g. x:=M denotes replacing free occurences of x with lambda term M\n\u003e or press ENTER to finish\ny:=(\\x.x)\nFree variable substitution :- [ ( \\ v1 . v1 ) ] [ ( \\ v2 . v2 ) ]\n================\n\u003e All free variables have been substituted successfully! (Closed Form)\nExiting...\n================\nβ-reduction :- \nStep 1. ( \\ v2 . v2 )\nNo further reduction possible!\n================\nFinal β-reduced form '( \\ v2 . v2 )' saved to 'out.txt'\n================\n```\n\nYou may find some of the lambda expression files in `tests/` directory.\n\n## Team Members\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/kumayu0108\"\u003e\u003cimg src=\"https://github.com/kumayu0108.png\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eAyush Kumar\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n   \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/gurbaaz27\"\u003e\u003cimg src=\"https://github.com/gurbaaz27.png\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eGurbaaz Singh Nandra\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n    \u003ctd align=\"center\"\u003e\u003ca href=\"https://github.com/kritinsharma\"\u003e\u003cimg src=\"\"https://github.com/kritinsharma.png\"\" width=\"100px;\" alt=\"\"/\u003e\u003cbr /\u003e\u003csub\u003e\u003cb\u003e\u003ci\u003eKritin Sharma\u003c/i\u003e\u003c/b\u003e\u003c/sub\u003e\u003c/a\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n## Star History\n\n[![Star History Chart](https://api.star-history.com/svg?repos=gurbaaz27/typeless\u0026type=Date)](https://star-history.com/#gurbaaz27/typeless\u0026Date)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgurbaaz27%2Ftypeless","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgurbaaz27%2Ftypeless","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgurbaaz27%2Ftypeless/lists"}