Fitch is a small command-line editor for writing natural deduction
(propositional logic) proofs. However, the program hasn't been extensively tested and was just written to get a chance to play around with propositional logic and the wonderful chumsky
parser combinator library. But it can be rather helpful for generating LaTeX and avoid having to manually typeset proofs.
See the video for a short demo:
demo.webm
Assuming you have Rust installed. Clone the repo and run:
cd fitch_cli
cargo run
You can then start using fitch by typing a command followed by a series of arguments:
premise <formula>
- Add a new premisecopy <step index>
- Copy a previously proven formulaassume <formula>
- Create a new proof box (sub-proof) with some assumptiondischarge
- Close a proof boxrule <rule name> <rule arguments...>
- Apply a rule given some step indices. See a list of rules below.undo
- Undo the latest stepquit
- Quit the programhelp
- Print a help messagelatex
- Generate LaTeX code to typeset your proof
The rules are the same as those presented in Huth and Ryan Logic in Computer Science. (With the expection that
Name | Arguments | Explanation |
---|---|---|
and_i | StepIndex StepIndex |
phi psi ----------- phi ^ psi |
and_e_lhs | StepIndex |
phi ^ psi ----------- phi |
and_e_rhs | StepIndex |
phi ^ psi ----------- psi |
or_i_lhs | StepIndex Prop |
phi ------------ phi \/ psi |
or_i_rhs | Prop StepIndex |
psi ------------ phi \/ psi |
or_e | StepIndex StepIndex StepIndex |
phi \/ psi [phi]...chi [psi]...chi ------------------------------------- chi |
neg_i | StepIndex |
[phi]...bottom ---------------- neg phi |
neg_e | StepIndex StepIndex |
phi neg phi ---------------- bottom |
imply_i | StepIndex |
[phi]...psi ------------- psi |
imply_e | StepIndex StepIndex |
phi phi -> psi --------------------- psi |
bottom-e | StepIndex Prop |
bottom ------------ phi |
neg_neg_e | StepIndex |
neg (neg phi) --------------- phi |
mt | StepIndex StepIndex |
phi -> psi neg psi ------------------------ neg phi |
neg_neg_i | StepIndex |
phi --------------- neg (neg phi) |
PBC | StepIndex |
[not phi]...bottom -------------------- phi |
LEM | Prop |
---------------- phi \/ neg phi |