- 1. Introduction
- 2. Installation
- 3. Running the Program
- 4. Language Syntax
- 5. Usage Examples
- 6. Installing system-wide (Linux systems)
- 7. Importante Notes
- 8. Suggested Test Cases
Implemented in Rust — with Full Step-by-Step Proof Output
This project implements the Semantic Tableaux Method for:
- Propositional Logic
- First-Order Logic (FOL) with:
- Predicates
- Terms (variables and constants)
- Quantifiers (forall, exists)
- Automatic fresh-constant generation (c1, c2, …)
The program takes a formula as input, builds two tableaux:
- T(φ) — to test satisfiability
- F(φ) — to test validity
and prints the entire proof tree, including every applied rule.
Note
Please visit the official Rust website, the information below is a brief.
Installing Rust is very simple on macOS and Linux. Go to the official Rust website:
There, they simply ask you to run the following command in your terminal:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Follow the on-screen instructions — the download will begin, and within a few seconds Rust will be installed for your user.
Close the terminal and open it again.
This ensures that your shell now knows where Rust is installed.
git clone https://github.com/cthadeusantos/tableaux.git
cd tableaux
cargo build --release
The binary will located in:
target/release/tableaux
./target/release/tableaux 'FORMULA'
Warning
Always use single quotes '...', otherwise the shell may misinterpret characters (especially !).
Example:
./target/release/tableaux 'p | !q'
The system supports:
| Connective | Logical symbol | Syntax in program |
|---|---|---|
| Negation | ¬A | !A or ~A |
| Conjunction | A ∧ B | A & B or A /\ B |
| Disjunction | A ∨ B | A | B or A \/ B |
| Implication | A → B | A -> B |
Examples:
(p -> q) & p
p \/ q
!(p & !q)
Predicates:
P(x)
Q(a,b)
R(x,y,z)
S
Terms:
- Variables: x, y, z
- Constants: a, b, c1, c2, …
The tableaux engine will automatically create fresh constants when needed.
Use:
forall x FORMULA
Meaning: ∀x FORMULA
Example:
forall x (P(x) -> Q(x))
exists x FORMULA
Meaning: ∃x FORMULA
Example:
exists y P(y)
Suppose you have an argument with:
Premises: A, B, C
Conclusion: D
The argument is valid if and only if:
A ∧ B ∧ C ⊨ D
Translate the argument:
A, B, C ⊢ D
into the formula:
(A & B & C) -> D
Then run the program:
./target/release/tableaux '(A & B & C) -> D'
Unsatisfiable formula:
(p -> q) & p & !q
Run:
./target/release/tableaux '(p -> q) & p & !q'
The tableau should close all branches.
forall x (P(x) -> P(x))
Run:
./target/release/tableaux 'forall x (P(x) -> P(x))'
Expected:
- T(φ) is satisfiable
- F(φ) is unsatisfiable → φ is valid
forall x P(x) -> exists x P(x)
Run:
./target/release/tableaux 'forall x P(x) -> exists x P(x)'
forall x exists y R(x,y) -> exists y forall x R(x,y)
Run:
./target/release/tableaux 'forall x exists y R(x,y) -> exists y forall x R(x,y)'
To make the command available globally:
sudo cp target/release/tableaux /usr/local/bin/
Run:
tableaux 'forall x P(x)'
Correct
'forall x (P(x) -> Q(x))'
Incorrect:
"forall x (P(x) -> Q(x))" # may break due to ! or shell parsing
Correct
'!p | q'
Incorrect:
!p | q # ERROR
Parser accepts:
forall x (P(x) -> Q(x))
Valid:
forall x P(x) -> exists x P(x)
Not valid:
exists x P(x) -> forall x P(x)
Satisfiable but not valid:
exists x (P(x) & !Q(x))