https://github.com/uben0/prove
A formal proof system in the terminal
https://github.com/uben0/prove
formal-proofs rust-lang
Last synced: about 1 year ago
JSON representation
A formal proof system in the terminal
- Host: GitHub
- URL: https://github.com/uben0/prove
- Owner: uben0
- Created: 2023-10-19T18:22:15.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-01-24T20:12:46.000Z (over 2 years ago)
- Last Synced: 2025-02-12T23:31:27.942Z (over 1 year ago)
- Topics: formal-proofs, rust-lang
- Language: Rust
- Homepage:
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A formal proof assistant for first order logic in the terminal
```
──────────────h
~(P∨~P), P ⊢ P
────────────────────h ─────────────────∨i,l
~(P∨~P), P ⊢ ~(P∨~P) ~(P∨~P), P ⊢ P∨~P
──────────────────────────────────────────mp
~(P∨~P), P ⊢ ⊥
──────────────➔i
~(P∨~P) ⊢ ~P
─────────────────h ──────────────∨i,r
~(P∨~P) ⊢ ~(P∨~P) ~(P∨~P) ⊢ P∨~P
──────────────────────────────────────────────────mp
~(P∨~P) ⊢ ⊥
───────────➔i
⊢ ~~(P∨~P)
```
This is a read-eval-print-loop to prove a formula in first order logic.
It reads the formulas from the `sequents.txt` file, one by line. It uses a custom notation to write formulas. For instance:
```
P \/ Q -> ~P -> Q
```
Which is a succinct notation for the more verbose s-expression:
```
(imply (and "P" "Q") (imply (not "P") "Q"))
```
In the REPL, the following commands are accepted.
```
COMMANDS:
:b back one step, undo the last action
:r reset all steps, undo all actions
:h print this help message
:q quit the program
APPLICABLE RULES:
h hypothesis
i introduction of the conclusion (automatic: it choses introduction rule base on conclusion type)
xf exflaso
e elimination of the Nth hypothesis (automatic: it choses elimination rule base on hypothesis type)
ii implication introduction
iis implications introduction (for chaining implications)
dil disjonction introduction left
dir disjonction introduction right
mp modus ponens on F (a logical property formula like: ~P/\Q)
de , disjonction elimination of left formula and right formula
ce , conjonction elimination of left formula and right formula
```