{"id":31689526,"url":"https://github.com/4ster-light/f-logic","last_synced_at":"2025-10-08T11:49:18.326Z","repository":{"id":316548725,"uuid":"1032625531","full_name":"4ster-light/f-logic","owner":"4ster-light","description":"Implementation of a logic formula parser and truth table generator in F#","archived":false,"fork":false,"pushed_at":"2025-09-25T07:40:51.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T09:25:48.982Z","etag":null,"topics":["fsharp","interpreter","lexer","parser"],"latest_commit_sha":null,"homepage":"https://aster.deno.dev/posts/introduction-to-interpreters-part-2","language":"F#","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/4ster-light.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"4ster","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"thanks_dev":null,"custom":null}},"created_at":"2025-08-05T15:20:55.000Z","updated_at":"2025-09-25T07:40:54.000Z","dependencies_parsed_at":"2025-09-25T09:25:51.310Z","dependency_job_id":null,"html_url":"https://github.com/4ster-light/f-logic","commit_stats":null,"previous_names":["4ster-light/f-logic"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/4ster-light/f-logic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ster-light%2Ff-logic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ster-light%2Ff-logic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ster-light%2Ff-logic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ster-light%2Ff-logic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4ster-light","download_url":"https://codeload.github.com/4ster-light/f-logic/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4ster-light%2Ff-logic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278938947,"owners_count":26072275,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fsharp","interpreter","lexer","parser"],"created_at":"2025-10-08T11:49:15.023Z","updated_at":"2025-10-08T11:49:18.310Z","avatar_url":"https://github.com/4ster-light.png","language":"F#","funding_links":["https://ko-fi.com/4ster","https://ko-fi.com/B0B41HVJUR"],"categories":[],"sub_categories":[],"readme":"# 🧑‍💻 f-logic\n\nImplementation of a logic formula parser and truth table generator in Python.\n\n## 📚 Table of Contents\n\n- [📜 Overview](#-overview)\n- [🛠 Usage](#-usage)\n- [📋 Requirements](#-requirements)\n- [📄 License](#-license)\n- [💝 Sponsor](#-sponsor)\n\n## 📜 Overview\n\nThis project is meant as educational material in order to learn about basic\ninterpreters and the process of lexing and parsing a language as well as the\nconcept of AST (Abstract Syntax Tree), therefore why it supports only basic\nlogic symbols.\n\nThe choice of interpreting logic formulas was made due to its relative\nsimplicity and the fact that it is related to computer science.\n\nThis second tutorial is\nwritten in F# in order to learn about the language and showcase why functional\nprogramming is a good choice for this kind of project, due to its strong\nalgebraic data types and common patterns like recursion and pattern matching.\nYou can find the Python version (easier and more readable for beginners) of this\nproject [here](https://github.com/4ster-light/py-logic) with the corresponding\ntutorial\n[here](https://aster.deno.dev/posts/introduction-to-interpreters/).\n\n## 🛠 Usage\n\n- Run `dotnet run` to generate a truth table for the given formula:\n\n```bash\n$ dotnet run\n\nEnter a logical formula (e.g., P \u0026 Q -\u003e R, !A | B):\n\nP \u0026 Q -\u003e R\n\nP | Q | R | P \u0026 Q -\u003e R\n----------+-----------\nT | T | T | T\nT | T | F | F\nT | F | T | T\nT | F | F | T\nF | T | T | T\nF | T | F | T\nF | F | T | T\nF | F | F | T\n```\n\n- Run `dotnet run -- --debug` to see the tokens and AST generated by the parser:\n\n```bash\n$ dotnet run -- --debug\n\nEnter a logical formula (e.g., P \u0026 Q -\u003e R, !A | B):\n\nP \u0026 Q -\u003e R\n\n- Formula:\n  - P \u0026 Q -\u003e R\n- Tokens:\n  - Variable \"P\"\n  - AndOp\n  - Variable \"Q\"\n  - ImpliesOp\n  - Variable \"R\"\n  - Eof\n- Expression:\n  - Implies (And (Var \"P\", Var \"Q\"), Var \"R\")\n```\n\n## 📋 Requirements\n\nOnly .NET 9.0 is required.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file\nfor details.\n\n## 💝 Sponsor\n\nIf you like this project, consider supporting me by buying me a coffee.\n\n[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/B0B41HVJUR)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4ster-light%2Ff-logic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4ster-light%2Ff-logic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4ster-light%2Ff-logic/lists"}