The project consists of an interpreter and an accompanying editor built with tkinter.
- Install dependencies
pip install -r requirements.txt
- To start the editor
python editor.py
- To run the tests
pytest tests
The programming language is a subset of pure prolog.
-
The prolog interpreter implements an SLD resolution scheme(unification + backtracking).
-
Negation as failure is also supported.
Sample programs can be found in the sample folder.
Given the clauses in the family_relations.pl
program in the sample folder, here are some sample queries:
ancestor(X, Y).
ancestor(hamish, anne).
ancestor(hamish, 'anne').
ancestor(hamish, 'rosie').
sibling(X, Y).
not(ancestor(hamish, jack)).
Includes the standard operations new
,open
, save
, save as
, exit
.
-
Font
The user can set the font family and size -
Mode
There are 3 modes to choose from:- Dark
- Light
- Swish Bish
- Line-number bar
- Key-bindings
- for saving
<Control-s>
- for running the current program, with respect to the current query
<Control-Return>
- for saving
- list support
- more informative error messages
- arithmetics
- unification over infinite trees