Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marcinbrojek/log-fo-prover

A tool for automatically verifying whether a given first-order logic formula is a tautology, based on Herbrand's theory and the Davis-Putnam SAT solver. Implemented in C++.
https://github.com/marcinbrojek/log-fo-prover

automated-theorem-proving cpp first-order-logic

Last synced: about 1 month ago
JSON representation

A tool for automatically verifying whether a given first-order logic formula is a tautology, based on Herbrand's theory and the Davis-Putnam SAT solver. Implemented in C++.

Awesome Lists containing this project

README

        

# FO-prover

The objective of this assignment is to build a prover for tautologies of first-order
logic based on Herbrand’s theorem and the Davis-Putnam SAT solver. The solution program must read the standard input stdin. The input consists of a single line encoding a formula of first-order logic according to the following Backus-Naur grammar:

```haskell
formula ::=
| "T"
| "F"
| "Rel" string [t]*
| "Not(" formula ")"
| "And(" formula ")(" formula ")"
| "Or(" formula ")(" formula ")"
| "Implies(" formula ")(" formula ")"
| "Iff(" formula ")(" formula ")"
| "Exists" string "(" formula ")"
| "Forall" string "(" formula ")"

t ::= "Var" string | "Fun" string [t]*
```

string is any sequence of alphanumeric characters.

---

FO-prover should output:

- timeout - when formula contains free variables and infinite Herbrand universe
(non-tautology)

otherwise:

- 1 - tautology,

- 0 - non-tautology.

---

## Example run

```bash
> make
> echo 'Or(Rel "r" [Var "a"])(Not(Rel "r" [Var "a"]))' | ./FO-prover
```

returns 1 (known tautology $p \vee \neg p$)

---

## File structure

- `README.md` (this)
- `parser.h`, `parser.cpp`
- `combination.h`, `combination.cpp`
- `skolem.h`, `skolem.cpp`
- `fdpll.h`, `fdpll.cpp`
- `main.cpp`
- `makefile`