https://github.com/brunokim/prol Skip to content Sign up * Why GitHub? Features - + Mobile - + Actions - + Codespaces - + Packages - + Security - + Code review - + Issues - + Integrations - + GitHub Sponsors - + Customer stories- * Team * Enterprise * Explore + Explore GitHub - Learn and contribute + Topics - + Collections - + Trending - + Learning Lab - + Open source guides - Connect with others + The ReadME Project - + Events - + Community forum - + GitHub Education - + GitHub Stars program - * Marketplace * Pricing Plans - + Compare plans - + Contact Sales - + Education - [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up {{ message }} brunokim / prol Public * Notifications * Star 21 * Fork 0 Demo of a WAM Prolog implementation in Python 21 stars 0 forks Star Notifications * Code * Issues 0 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights main Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags 1 branch 0 tags Code Latest commit @brunokim brunokim Add command to test grammar ... d358522 Oct 1, 2021 Add command to test grammar d358522 Git stats * 82 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time docs.pt-BR Fix link to Ait-Kaci's tutorial Oct 1, 2021 docs Fix link to Ait-Kaci's tutorial Oct 1, 2021 .gitignore Initial commit from github.com/brunokim/logic-engine Jul 19, 2021 README.md Add command to test grammar Oct 1, 2021 README.pt-BR.md Add command to test grammar Oct 1, 2021 compiler.py Make put_term iterative instead of recursive. Sep 19, 2021 grammar.py Some docs for grammar Sep 21, 2021 interpreter.py Compiling a lot of the grammar! Sep 19, 2021 model.py Implement knowledge base parsing Sep 19, 2021 test_compiler.py Make put_term iterative instead of recursive. Sep 19, 2021 test_grammar.py Compiling a lot of the grammar! Sep 19, 2021 test_interpreter.py mypy, pytest, autopep8 Sep 16, 2021 test_model.py autopep8 Aug 23, 2021 View code Prol: WAM demo Code organization Documentation README.md Prol: WAM demo This is a simplified Warren Abstract Machine (WAM) implementation for Prolog, that showcases the main instructions, compiling, register allocation and machine functions. Code organization * model.py: Data objects representing terms, programs, and machine entities. * compiler.py: Compiling of a list of rules into a list of instructions. * interpreter.py: Interpreter that execute the instruction listing for a given query. * grammar.py: Sample application of interpreter, with a grammar that can parse itself. Try it out with python -m grammar and compare with the text in the file! Documentation 1. About Prolog: a hurried primer if you don't know what it is about. 2. Resolution strategy: how a query is actually solved in Prolog. 3. Warren Abstract Machine: details about the implementation attempted here. 4. Indexing: indexing implementation to fast-track some call patterns. 5. Parsing: explaining basic structures for parsing 6. Grammar: documentation for the sample application of grammar parsing. 7. Stuff left out: what this implementation has simplified from the WAM, and references. About Demo of a WAM Prolog implementation in Python Resources Readme Releases No releases published Packages 0 No packages published Languages * Python 100.0% * (c) 2021 GitHub, Inc. * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time. You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.