This program provide a simple way to manipulate and interact with propositional logic expressions.
Logik is an educationnal project. It is not designed to be powerful and robust. But it can be used as a tool to solve logic exercices at a Bachelor level.
If you want to take part in the developpement of Logik in any way you want, feel free to pull request !
Logik provides 3 main features :
- Evaluating expressions from the propositional logic
- Building truth tables from parametrized expressions
- Extracting the syntax tree of an expression
Logik is designed to be use in a terminal. You can install it by executing the following command directly inside the main folder. (you need to git clone https://github.com/64bit-lab/Logik
first)
$ python3 setup.py install
This will install Logik directly on your machine. You can then start logik by typing :
$ logik
This will start the interactive command line interface :
$ logik
[ command ] @ # type a command here
tree
: inputs a formula and display its syntax treetable
: inputs a formula and display its truth tablesolve
: WIP, will apply resolution algorithm to a set of clausescnf
: convert a formula into conjunctive normal formclauses
: inputs a formula and display it as a set of clauses
The syntax of the expressions in Logik is really simple :
True | Top
1
False | Bottom
0
Implications
a -> b
Conjunction
a et b
Disjunction
a ou b
Negation
non a
You can use parenthesis to write some more complex expressions :
(a ou b) -> (a et c) or ((a et d) or (b -> (c and e)))
There is still a lot of things which can be added to improve this project. Here is a list of cool features to add in the future :
- SAT Solver
- Predicate logic
- API to manipulate formulas directly in any python project
- and more ... (feel free to propose your own suggestions)