This repository holds the code and report written to fulfil the coursework requirements for the unit Computational Logic for Artificial Intelligence at the University of Bristol. It is based on the repository simply-logical/ComputationalLogic. We introduced several features:
- The modus tollens inference rule
- (Exclusive) disjunction
- Default rules
- Existential quantification
- Negative, conjunctive, and disjunctive facts
These are demonstrated by the Jupyter Notebook demo.ipynb and unit tests cli_test.py.
SWI-Prolog must be installed. For example, on macOS, you can SWI-Prolog with Homebrew:
brew install swi-prologIn this case, the executable path for the arthurwang.vsc-prolog extension should be set to /opt/homebrew/bin/swipl:
{
"prolog.executablePath": "/opt/homebrew/bin/swipl"
}Python must be installed.
Create a virtual environment, install the dependencies in requirements.txt, and execute:
cd prolog
swipl --goal=cli -o cli -c cli.pl
pytest