A Mini Prolog interpreter written in OCaml
A README file serves as an introductory document for your project, providing essential information to users, contributors, and other stakeholders. Here's a template for a README.md file for a Prolog interpreter project:
Prolog is a logic programming language that excels in applications involving symbolic reasoning and complex data relationships. This project aims to bring the power of Prolog to developers and researchers through an intuitive interpreter.
- Standard Prolog Syntax: Supports most of the common Prolog syntax and predicates.
- Querying and Reasoning: Perform queries and logical reasoning in a user-friendly REPL (Read-Eval-Print Loop).
- Built-in Predicates: A selection of built-in predicates to facilitate coding in Prolog.
- Error Handling: Provides helpful error messages and guidance when syntax or semantic issues arise.
- Extensibility: Easily extend the interpreter with custom predicates and features.
To install the Prolog interpreter, follow these steps:
-
Clone the repository:
git clone https://github.com/RISHIT7/Prolog-Interpreter.git
-
Run the interpreter:
make
Will run the default prolog file Test.pl
To run a custom file, write the prolog file into the Test folder, assuming the name is prolog.plmake test_file=Test/prolog.pl
After running the interpreter, you can start typing Prolog queries directly into the REPL. The interpreter will evaluate your queries and provide results.
Example queries:
-
To find a solution to a query:
?- member(X, [1, 2, 3]).
-
To assert a fact or rule:
?- hastype(gt(intT(3), intT(4)), X).
-
Special identifiers:
?- integer(3).
You can find example Prolog scripts in the Test
directory. These scripts demonstrate how to use the interpreter for various tasks.
This project is licensed under the MIT License. Please see the LICENSE file for more details.