A little propositional formula satisfiability solver using the propositional tableaux method, written in the Rust programming language!
See http://www.dis.uniroma1.it/liberato/planning/tableau/tableau.html.
The input to the solver must be a well-formed propositional formula.
It can be described by the following BNF grammar:
<formula> ::= <propositional-variable>
| ( - <formula> ) # negation
| ( <formula> ^ <formula> ) # conjunction
| ( <formula> | <formula> ) # disjunction
| ( <formula> -> <formula> ) # implication
| ( <formula> <-> <formula> ) # bi-implication
Whitespaces are stripped and ignored, and a <propositional-variable> can be
any sequence of alphanumeric characters [a-zA-Z][a-zA-Z0-9]* that begin with
a alphabet character. Cases are respected and aaa is a different
propositional variable from AAA.
The CLI supports both satisfiability mode and validity mode checking for a
given propositional formula.
Use the -m mode switch:
- Validity mode:
-m v. - Satisfiability mode (default):
-m s.
Two ways to supply the propositional formula exist, with the -c switch method
taking precedence:
- CLI argument switch
-c <input_string> - IO redirection
Using the -c <input_string>
$ cargo run -c "(a^b)"Alternatively, redirect the standard input stdin to the solver to supply the
propositional formula.
$ cat input.txt > cargo run