Copyright | (c) 2016-2019 Rudy Matela |
---|---|
License | 3-Clause BSD (see the file LICENSE) |
Maintainer | Rudy Matela <rudy@matela.com.br> |
Safe Haskell | None |
Language | Haskell2010 |
This module is part of Speculate.
Equational reasoning for Expr
s based on term rewriting.
Synopsis
- data Thy = Thy {}
- emptyThy :: Thy
- normalize :: Thy -> Expr -> Expr
- normalizeE :: Thy -> Expr -> Expr
- isNormal :: Thy -> Expr -> Bool
- isRootNormal :: Thy -> Expr -> Bool
- isRootNormalE :: Thy -> Expr -> Bool
- complete :: Thy -> Thy
- equivalent :: Thy -> Expr -> Expr -> Bool
- equivalentInstance :: Thy -> Expr -> Expr -> Bool
- insert :: Equation -> Thy -> Thy
- showThy :: Thy -> String
- printThy :: Thy -> IO ()
- keepUpToLength :: Int -> Expr -> Bool
- keepMaxOf :: [Equation] -> Expr -> Bool
- (|==|) :: Thy -> Thy -> Bool
- theorize :: [Equation] -> Thy
- theorizeBy :: (Expr -> Expr -> Bool) -> [Equation] -> Thy
- finalEquations :: (Equation -> Bool) -> Instances -> Thy -> [Equation]
- criticalPairs :: Thy -> [(Expr, Expr)]
- normalizedCriticalPairs :: Thy -> [(Expr, Expr)]
- append :: Thy -> [Equation] -> Thy
- okThy :: Thy -> Bool
- canonicalEqn :: Thy -> Equation -> Bool
- canonicalRule :: Rule -> Bool
- canonicalizeEqn :: Thy -> Equation -> Equation
- deduce :: Thy -> Thy
- simplify :: Thy -> Thy
- delete :: Thy -> Thy
- orient :: Thy -> Thy
- compose :: Thy -> Thy
- collapse :: Thy -> Thy
- updateRulesBy :: ([Rule] -> [Rule]) -> Thy -> Thy
- updateEquationsBy :: ([Equation] -> [Equation]) -> Thy -> Thy
- discardRedundantEquations :: Thy -> Thy
- finalize :: Thy -> Thy
- initialize :: Int -> (Expr -> Expr -> Bool) -> [Equation] -> Thy
- defaultKeep :: Thy -> Thy
- doubleCheck :: (Expr -> Expr -> Bool) -> Thy -> Thy
- reductions1 :: Expr -> Rule -> [Expr]
- dwoBy :: (Expr -> Expr -> Bool) -> Expr -> Expr -> Bool
- (|>) :: Expr -> Expr -> Bool
Documentation
Thy | |
|
canonicalEqn :: Thy -> Equation -> Bool Source #
canonicalRule :: Rule -> Bool Source #
canonicalizeEqn :: Thy -> Equation -> Equation Source #
updateRulesBy :: ([Rule] -> [Rule]) -> Thy -> Thy Source #
updateEquationsBy :: ([Equation] -> [Equation]) -> Thy -> Thy Source #
discardRedundantEquations :: Thy -> Thy Source #
finalize :: Thy -> Thy Source #
Finalize a theory by discarding redundant equations. If after finalizing
you complete
, redundant equations might pop-up again.
defaultKeep :: Thy -> Thy Source #
doubleCheck :: (Expr -> Expr -> Bool) -> Thy -> Thy Source #
Double-checks a resulting theory moving untrue rules and equations to the invalid list.
As a side-effect of using testing to conjecturing equations, we may get smaller equations that are obviously incorrect when we consider a bigger (harder-to-test) equation that is incorrect.
For example, given an incorrect large equation, it may follow that False=True.
This function can be used to double-check the generated theory. If any equation or rule is discarded, that means the number of tests should probably be increased.
reductions1 :: Expr -> Rule -> [Expr] Source #