- first-order-logic.rkt: The language defnition of classical first-order logic(KF)
- propositional-logic.rkt: The language definition of classical propositional logic(K)
- subformula.rkt: Compute subformula for any valid logic for propositional logic
The second part is about conversion, in this case propositional logic is just a kind of surface of first-order logic, internal conversion will go through same way.
- KF-clausal.rkt: convert KF to clausal form
- convert to prenex form
- remove implication
- skolemize to remove existential quantifier
- remove universal quantifier
- apply distribute laws to get clausal form
- KF-canonical.rkt: convert KF clausal to canonical form
- fuse
A and (B and C)
toA and B and C
, in nanopass corresponding is(∧ A (∧ B C))
to(∧ A B C)
, so we need to update language definition - reduce to minimal form, like
(∨ (¬ A) A B)
toB
, this is why it called canonical form
- fuse
- KF-cnf.rkt: convert KF canonical to conjunction normal form
- check it's canonical form
- produce internal representation of CNF
- main.rkt: resolution and unification