| Copyright | (c) Levent Erkok |
|---|---|
| License | BSD3 |
| Maintainer | erkokl@gmail.com |
| Stability | experimental |
| Safe Haskell | None |
| Language | Haskell2010 |
Documentation.SBV.Examples.ADT.Expr
Description
A basic expression ADT example.
Synopsis
- data Expr
- cv2Expr :: String -> [CV] -> Expr
- _undefiner_Expr :: a
- type SExpr = SBV Expr
- sVal :: SBV Integer -> SBV Expr
- sVar :: SBV [Char] -> SBV Expr
- sAdd :: SBV Expr -> SBV Expr -> SBV Expr
- sMul :: SBV Expr -> SBV Expr -> SBV Expr
- sLet :: SBV [Char] -> SBV Expr -> SBV Expr -> SBV Expr
- isVal :: SBV Expr -> SBool
- isVar :: SBV Expr -> SBool
- isAdd :: SBV Expr -> SBool
- isMul :: SBV Expr -> SBool
- isLet :: SBV Expr -> SBool
- getVal_1 :: SBV Expr -> SBV Integer
- getVar_1 :: SBV Expr -> SBV [Char]
- getAdd_1 :: SBV Expr -> SBV Expr
- getAdd_2 :: SBV Expr -> SBV Expr
- getMul_1 :: SBV Expr -> SBV Expr
- getMul_2 :: SBV Expr -> SBV Expr
- getLet_1 :: SBV Expr -> SBV [Char]
- getLet_2 :: SBV Expr -> SBV Expr
- getLet_3 :: SBV Expr -> SBV Expr
- sCaseExpr :: Mergeable result => SBV Expr -> (SBV Integer -> result) -> (SBV [Char] -> result) -> (SBV Expr -> SBV Expr -> result) -> (SBV Expr -> SBV Expr -> result) -> (SBV [Char] -> SBV Expr -> SBV Expr -> result) -> result
- isValid :: SExpr -> SBool
- eval :: SExpr -> SInteger
- evalPlus5 :: IO ThmResult
- evalSat :: IO SatResult
- genE :: IO SatResult
- queryE :: IO ()
Documentation
A basic arithmetic expression type.
Instances
_undefiner_Expr :: a Source #
Autogenerated definition to avoid unused-variable warnings from GHC.
sLet :: SBV [Char] -> SBV Expr -> SBV Expr -> SBV Expr Source #
Symbolic version of the constructor Let.
sCaseExpr :: Mergeable result => SBV Expr -> (SBV Integer -> result) -> (SBV [Char] -> result) -> (SBV Expr -> SBV Expr -> result) -> (SBV Expr -> SBV Expr -> result) -> (SBV [Char] -> SBV Expr -> SBV Expr -> result) -> result Source #
Case analyzer for the type Expr.
isValid :: SExpr -> SBool Source #
Validity: We require each variable appearing to be an identifier (lowercase letter followed by any number of upper-lower case letters and digits), and all expressions are closed; i.e., any variable referenced is introduced by an enclosing let expression.
evalSat :: IO SatResult Source #
A simple sat result example.
>>>evalSatSatisfiable. Model: e = Let "k" (Val 1) (Var "k") :: Expr a = 9 :: Integer b = 10 :: Integer
Another test, generating some (mildly) interesting examples.
>>>genESatisfiable. Model: e1 = Let "p" (Val 5) (Val 3) :: Expr e2 = Val (-2) :: Expr