1 unstable release
0.1.0 | Apr 24, 2020 |
---|
#7 in #propositional
66KB
1K
SLoC
Propositional Tableaux Solver
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.
Syntax of Propositional Formula
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
.
Running via Cargo
Mode
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
.
Input
Two ways to supply the propositional formula exist, with the -c
switch method
taking precedence:
- CLI argument switch
-c <input_string>
- IO redirection
Command-line String
Using the -c <input_string>
$ cargo run -c "(a^b)"
IO Redirection
Alternatively, redirect the standard input stdin
to the solver to supply the
propositional formula.
$ cat input.txt > cargo run
Dependencies
~7–15MB
~187K SLoC