Advise-me-0.1: Assessment services for the Advise-Me project

Maintainerbastiaan.heeren@ou.nl
Stabilityprovisional
Portabilityportable (depends on ghc)
Safe HaskellNone
LanguageHaskell98

Recognize.Expr.Normalform

Description

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

Documentation

nf :: Expr -> Expr Source #

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

nfCom :: Expr -> Expr Source #

normal form for commutativity +/*

roundDouble :: Int -> Double -> Double Source #

Round a double with a specified precision

Unlike the round function in prelude, this function will round up if the decimal is >=5 and otherwise down