Skip to content

statusfailed/metacat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

metacat

A theorem prover inspired by metamath zero using open-hypergraphs for syntax.

usage

Check all definitions in a file:

metacat check <filename> 

for example:

> metacat check fol.hex [✓] p1 : wff -> {[ph . ] ([ . ph ph] -> [id . ]) ([ . id ph] -> [x . ph x] -> |-)} [✓] p2 : wff -> ([ph . ph ph] -> [i . ph i] -> |-) [✓] win : {wff wff} -> (-> -. wff) [✓] p3 : wff -> {[ph . ] ([ . ph ph] -> [id . ]) ([ . id ph] -> [x . ph x] -> [lhs . ]) ([ . ph id] -> [y . y id] -> [rhs . ]) ([ . lhs rhs] -> |-)} [✓] p4 : wff -> {[ph . ] ([ . ph ph] -> [id . ph id] -> [x . x id] -> |-)} [✓] id : wff -> ([x . x x] -> |-) 

language

A metacat file is a list of hexprs, each one of three kinds:

  • object declarations (object <name> : <arity> -> <coarity>) declares a generating object
  • arrow declarations (arrow <name> : <src_hexpr> -> <tgt_hexpr>) declares a generating arrow (an axiom or inference rule)
  • arrow definitions (def-arrow <name> : <src_hexpr> -> <tgt_hexpr> = <proof_hexpr>) declares an arrow and gives a proof

For example, fol.hex declares the following objects:

# well-formedness (object wff : 1 -> 1) # provability (object |- : 1 -> 1) # the "not" relation (object -. : 1 -> 1) # implication (object -> : 2 -> 1) 

we can then make some axiomatic declarations that implication and negation are well-formed:

# The negation of a wff is a wff (arrow wn : wff -> (-. wff)) # implication of two wffs is a wff (arrow wi : {wff wff} -> (-> wff)) 

We can then write a simple proof that negation of implication is also well-formed:

# ¬ (φ → ψ) is well-formed (def-arrow win : { wff wff } -> (-> -. wff) = (wi wn)) 

See ./fol.hex for an example of declaring axioms of propositional logic, and using them to prove the identity theorem |- (φ → φ).

tooling

See metacat.nvim for a simple nvim plugin that will render proofs as SVGs.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages