Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell98 |
This module defines comparison functions used in the subexpression recognizer.
Documentation
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.