Advise-me-0.1: Assessment services for the Advise-Me project
Portabilityportable (depends on ghc)
Safe HaskellNone



This module defines comparison functions used in the subexpression recognizer.



pCompareBySimplify :: Expr -> Expr -> SEParser (Expr, Expr, [Attribute]) Source #

Simplifies both expressions using the strategy module and then compares them.

We return (simplified expression 2, rewrites 2)

pCompareByNormalize :: Expr -> Expr -> SEParser (Expr, [Attribute]) Source #

Normalizes both expressions and compares them for equality.

Normalizing here entails sorting on commutativity and associativity, simplifying fractions and applying distributivity.

We return the first expression and rewrites (simpler fractions, distribution) of the first expression minus the rewrites of the second expression.

pCompare :: Expr -> Expr -> SEParser Bool Source #

Compare two expressions

Takes into account subexpression variables and magic types.

pSubstituteVars :: Expr -> SEParser Expr Source #

Map all subexpression variables to the values they refer to