Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data BinOp
- data UnOp
- data RoundingMode
- data E
- data ESafe
- = EStrict E
- | ENonStrict E
- data Comp
- data Conn
- data F
- lengthF :: F -> Integer
- lengthE :: E -> Integer
- newtype Name = Name String
- flipStrictness :: ESafe -> ESafe
- negateSafeE :: ESafe -> ESafe
- extractSafeE :: ESafe -> E
- fmapESafe :: (E -> E) -> ESafe -> ESafe
- fToECNF :: F -> [[ESafe]]
- fToEDNF :: F -> [[ESafe]]
- fToFDNF :: F -> [[F]]
- eSafeToF :: ESafe -> F
- eSafeDisjToF :: [ESafe] -> F
- eSafeCNFToF :: [[ESafe]] -> F
- eSafeCNFToDNF :: [[ESafe]] -> [[ESafe]]
- simplifyE :: E -> E
- simplifyF :: F -> F
- simplifyEDoubleList :: [[E]] -> [[E]]
- simplifyFDNF :: [[F]] -> [[F]]
- fDNFToFDNFWithoutEq :: [[F]] -> [[F]] -> [[F]]
- fDNFToEDNF :: [[F]] -> [[ESafe]]
- simplifyFDoubleList :: [[F]] -> [[F]]
- simplifyESafeDoubleList :: [[ESafe]] -> [[ESafe]]
- computeE :: E -> [(String, Rational)] -> CN Double
- computeQualifiedEs :: [([E], E)] -> [(String, Rational)] -> [CN Double]
- computeEDisjunction :: [E] -> [(String, Rational)] -> [CN Double]
- computeECNF :: [[E]] -> [(String, Rational)] -> [[CN Double]]
- prettyShowESafeCNF :: [[ESafe]] -> String
- prettyShowESafeDNF :: [[ESafe]] -> String
- prettyShowFSafeDNF :: [[F]] -> String
- prettyShowVC :: F -> TypedVarMap -> String
- latexShowE :: E -> String
- latexShowF :: F -> Integer -> String
- latexShowComp :: Comp -> String
- latexShowConn :: Conn -> String
- prettyShowE :: E -> String
- prettyShowECNF :: [[E]] -> String
- prettyShowF :: F -> Integer -> String
- prettyShowComp :: Comp -> String
- prettyShowConn :: Conn -> String
- extractVariablesE :: E -> [String]
- extractVariablesF :: F -> [String]
- extractVariablesECNF :: [[E]] -> [String]
- hasVarsE :: E -> Bool
- hasVarsF :: F -> Bool
- hasFloatE :: E -> Bool
- hasFloatF :: F -> Bool
- substVarEWithLit :: E -> String -> Rational -> E
- substVarFWithLit :: F -> String -> Rational -> F
- substVarEWithE :: String -> E -> E -> E
- substVarFWithE :: String -> F -> E -> F
- transformImplications :: F -> F
- removeVariableFreeComparisons :: F -> F
- hasMinMaxAbsE :: E -> Bool
- hasMinMaxAbsF :: F -> Bool
- replaceEInE :: E -> E -> E -> E
- replaceEInF :: F -> E -> E -> F
- normalizeBoolean :: F -> F
Documentation
data RoundingMode Source #
Instances
Arbitrary RoundingMode Source # | |
Defined in PropaFP.Expression arbitrary :: Gen RoundingMode # shrink :: RoundingMode -> [RoundingMode] # | |
Show RoundingMode Source # | |
Defined in PropaFP.Expression showsPrec :: Int -> RoundingMode -> ShowS # show :: RoundingMode -> String # showList :: [RoundingMode] -> ShowS # | |
Eq RoundingMode Source # | |
Defined in PropaFP.Expression (==) :: RoundingMode -> RoundingMode -> Bool # (/=) :: RoundingMode -> RoundingMode -> Bool # | |
Ord RoundingMode Source # | |
Defined in PropaFP.Expression compare :: RoundingMode -> RoundingMode -> Ordering # (<) :: RoundingMode -> RoundingMode -> Bool # (<=) :: RoundingMode -> RoundingMode -> Bool # (>) :: RoundingMode -> RoundingMode -> Bool # (>=) :: RoundingMode -> RoundingMode -> Bool # max :: RoundingMode -> RoundingMode -> RoundingMode # min :: RoundingMode -> RoundingMode -> RoundingMode # |
The E type represents the inequality: expression :: E >= 0 TODO: Add rounding operator with certain epsilon/floating-point type
EBinOp BinOp E E | |
EUnOp UnOp E | |
Lit Rational | |
Var String | |
PowI E Integer | |
Float32 RoundingMode E | |
Float64 RoundingMode E | |
Float RoundingMode E | |
Pi | |
RoundToInteger RoundingMode E |
The F type is used to specify comparisons between E types and logical connectives between F types
flipStrictness :: ESafe -> ESafe Source #
negateSafeE :: ESafe -> ESafe Source #
Equivalent to E * -1 Example: ENonStrict e == e >= 0. negateSafeE (ENonStrict e) == e == -e 0 == (EStrict (EUnOp Negate e))
extractSafeE :: ESafe -> E Source #
eSafeDisjToF :: [ESafe] -> F Source #
eSafeCNFToF :: [[ESafe]] -> F Source #
eSafeCNFToDNF :: [[ESafe]] -> [[ESafe]] Source #
Add bounds for any Float expressions addRoundingBounds :: E -> [[E]] addRoundingBounds (Float e significand) = [[exactExpression - machineEpsilon], [exactExpression + machineEpsilon]] where exactExpression = addRoundingBounds e machineEpsilon = 2^(-23) addRoundingBounds e = e
Various rules to simplify expressions
simplifyEDoubleList :: [[E]] -> [[E]] Source #
simplifyFDNF :: [[F]] -> [[F]] Source #
fDNFToEDNF :: [[F]] -> [[ESafe]] Source #
simplifyFDoubleList :: [[F]] -> [[F]] Source #
simplifyESafeDoubleList :: [[ESafe]] -> [[ESafe]] Source #
computeE :: E -> [(String, Rational)] -> CN Double Source #
compute the value of E with Vars at specified points
computeQualifiedEs :: [([E], E)] -> [(String, Rational)] -> [CN Double] Source #
Given a list of qualified Es and points for all Vars, compute a list of valid values.
A value is the computed result of the second element of the tuple and is valid if all the expressions in the list at the first element of the tuple compute to be above 0.
prettyShowESafeCNF :: [[ESafe]] -> String Source #
prettyShowESafeDNF :: [[ESafe]] -> String Source #
prettyShowFSafeDNF :: [[F]] -> String Source #
prettyShowVC :: F -> TypedVarMap -> String Source #
latexShowE :: E -> String Source #
latexShowComp :: Comp -> String Source #
latexShowConn :: Conn -> String Source #
prettyShowE :: E -> String Source #
Show an expression in a human-readable format Rationals are converted into doubles
prettyShowECNF :: [[E]] -> String Source #
Show a conjunction of expressions in a human-readable format This is shown as an AND with each disjunction tabbed in with an OR If there is only one term in a disjunction, the expression is shown without an OR
prettyShowComp :: Comp -> String Source #
prettyShowConn :: Conn -> String Source #
extractVariablesE :: E -> [String] Source #
Extract all variables in an expression Will not return duplicationes
extractVariablesF :: F -> [String] Source #
Extract all variables in an expression Will not return duplicationes
extractVariablesECNF :: [[E]] -> [String] Source #
transformImplications :: F -> F Source #
removeVariableFreeComparisons :: F -> F Source #
hasMinMaxAbsE :: E -> Bool Source #
hasMinMaxAbsF :: F -> Bool Source #
normalizeBoolean :: F -> F Source #
Normalize to and/or aggressively apply elimination rules