A Truth Maintenance System is a knowledge representation for maintaining beliefs and their dependencies. A truth maintenance system updates its knowledge base and maintains consistency through revision.
- main.py: Contains the driver code
- propositional.py : Contains the Propositional logic to maintain the TMS, the TMS class and the Knowledge Base
- logic.txt: Contains a series of assertions int the following form:
-1 ASSERT (a)
This statements updates the KB with the truth of statement a. Similarly,
-2 RETRACT(1)
This statement is meant to update the KB by retracting statement 1. Doing this would also impact the statements that contain statment 1 as a truth, such as a^b (where ^ represents conjunction). This in turn would need to update the KB by removing statements that contain a^b, and so on, for it's dependents.
1.Check your python version by opening up a terminal environment (terminal on mac OS X, cmd on windows, etc) and using
$ python --version
This should generate something like this, if python is installed on the system.
- If Python is not installed, use a package manager like pip and commands such as:
$ pip install python
Visit:Python's Official Download Page for information on how to download and install python.
- cd to your directory that contains the project. (cd command is short for change directory, read cd, for example, for the TMS folder on user's desktop:
$cd .~/Desktop/TMS
4.Run the command python main.py from any python environment or terminal in IDE,
$ python main.py
This would invoke the driver code. This would in turn call all the associated files and update the KB, as per incoming knowledge or beliefs from the logic.txt file.
