Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- data Rule a = Rule {}
- data Theorem a = Theorem {}
- data TheoremProver a = TheoremProver {
- axioms :: [Theorem a]
- rulesThmProver :: [Rule a]
- mkAxiom :: a -> Theorem a
- thmApplyRule :: Theorem a -> Rule a -> Theorem a
- thmApplyRules :: TheoremProver a -> [Theorem a] -> [Theorem a]
- mergeProofs :: Eq a => [Theorem a] -> [Theorem a] -> [Theorem a]
- findProofIter :: (Ord a, Eq a) => TheoremProver a -> a -> Int -> [Theorem a] -> Maybe (Theorem a)
- findProof :: Ord a => TheoremProver a -> a -> Int -> Maybe (Theorem a)
Documentation
Based on https://bor0.wordpress.com/2018/08/07/simple-theorem-prover-in-racket/.
A rule is a way to change a theorem.
A theorem is consisted of an initial axiom and rules (ordered set) applied
data TheoremProver a Source #
A prover system is consisted of a bunch of axioms and rules to apply between them
TheoremProver | |
|
Instances
Show a => Show (TheoremProver a) Source # | |
Defined in SimpleTheoremProver showsPrec :: Int -> TheoremProver a -> ShowS # show :: TheoremProver a -> String # showList :: [TheoremProver a] -> ShowS # |
thmApplyRules :: TheoremProver a -> [Theorem a] -> [Theorem a] Source #
Applies all prover's rules to a list of theorems
mergeProofs :: Eq a => [Theorem a] -> [Theorem a] -> [Theorem a] Source #
Merge two list of proofs but skip duplicate proofs, giving the first argument priority This is used to avoid circular results in the search tree E.g. application of rules resulting in an earlier theorem/axiom
findProofIter :: (Ord a, Eq a) => TheoremProver a -> a -> Int -> [Theorem a] -> Maybe (Theorem a) Source #
Finds a proof by constructing a proof tree by iteratively applying theorem rules