stp-0.1.0.1: Simple Theorem Prover

Safe HaskellSafe
LanguageHaskell2010

SimpleTheoremProver

Synopsis

Documentation

data Rule a Source #

Constructors

Rule 

Fields

Instances
Show (Rule a) Source # 
Instance details

Defined in SimpleTheoremProver

Methods

showsPrec :: Int -> Rule a -> ShowS #

show :: Rule a -> String #

showList :: [Rule a] -> ShowS #

data Theorem a Source #

A theorem is consisted of an initial axiom and rules (ordered set) applied

Constructors

Theorem 

Fields

Instances
Show a => Show (Theorem a) Source # 
Instance details

Defined in SimpleTheoremProver

Methods

showsPrec :: Int -> Theorem a -> ShowS #

show :: Theorem a -> String #

showList :: [Theorem a] -> ShowS #

data TheoremProver a Source #

A prover system is consisted of a bunch of axioms and rules to apply between them

Constructors

TheoremProver 

Fields

Instances
Show a => Show (TheoremProver a) Source # 
Instance details

Defined in SimpleTheoremProver

mkAxiom :: a -> Theorem a Source #

An axiom is just a theorem already proven

thmApplyRule :: Theorem a -> Rule a -> Theorem a Source #

Applies a single rule to a theorem

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

findProof :: Ord a => TheoremProver a -> a -> Int -> Maybe (Theorem a) Source #

Find proof helper