Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell98 |
In this module we have defined several functions that produce some kind of normal form for an expression Not all functions are used and they also often do not normalize as far as we would like. Note that not all normalization functions defined in this project are defined in this module. Sometimes specific normalizing functions are defined for a tool.
Synopsis
- nf :: Expr -> Expr
- nf4 :: Int -> Expr -> Expr
- nfComAssoc :: Expr -> Expr
- nfCom :: Expr -> Expr
- rewriteSqrt :: Expr -> Expr
- distributeExponent :: Expr -> Expr
- ceilingExpr :: Expr -> Expr
- floorExpr :: Expr -> Expr
- roundDouble :: Int -> Double -> Double
- doubleRoundedView :: (Double -> Double) -> View Expr Double
- (===) :: Expr -> Expr -> Bool
Documentation
Note that the Ord instance for Expr is derived. Because of this: 1:+:1 < 1:-:1 Therefore, comparison of Expr is not reliable when performed after nf. since 3/2 cannot be normalized any further (but is bigger then 2)
nf4 :: Int -> Expr -> Expr Source #
Simplified with a certain precision if no variable present otherwise calls nf
nfComAssoc :: Expr -> Expr Source #
Normalform for associativity
rewriteSqrt :: Expr -> Expr Source #
distributeExponent :: Expr -> Expr Source #
ceilingExpr :: Expr -> Expr Source #