Maintainer | bastiaan.heeren@ou.nl |
---|---|
Stability | provisional |
Portability | portable (depends on ghc) |
Safe Haskell | None |
Language | Haskell98 |
This module defines commonly used functions within the subexpression recognizer.
Synopsis
- isBuggySymbol :: Symbol -> Bool
- isBuggy :: Expr -> Bool
- isOrSymbol :: Symbol -> Bool
- isOr :: Expr -> Bool
- isAndSymbol :: Symbol -> Bool
- isAnd :: Expr -> Bool
- isVarSymbol :: Symbol -> Bool
- isVar :: Expr -> Bool
- hasVar :: Expr -> Bool
- isLtSymbol :: Symbol -> Bool
- isLt :: Expr -> Bool
- isMatchSymbol :: Symbol -> Bool
- isMatch :: Expr -> Bool
- isMatched :: Expr -> Bool
- hasMatch :: Expr -> Bool
- extractMatched :: Expr -> Expr
- getMatched :: Expr -> Maybe Expr
- subMatched :: Expr -> Expr
- isMagicVarSymbol :: Symbol -> Bool
- isMagicVar :: Expr -> Bool
- hasMagicVar :: Expr -> Bool
- isMagicNatSymbol :: Symbol -> Bool
- isMagicNat :: Expr -> Bool
- hasMagicNat :: Expr -> Bool
- isMagicNumberSymbol :: Symbol -> Bool
- isMagicNumber :: Expr -> Bool
- hasMagicNumber :: Expr -> Bool
- isLabelSymbol :: Symbol -> Bool
- isLabel :: Expr -> Bool
- isStopSymbol :: Symbol -> Bool
- isStop :: Expr -> Bool
- isSimSymbol :: Symbol -> Bool
- isSim :: Expr -> Bool
- isSimplified :: Expr -> Bool
- isNoSimSymbol :: Symbol -> Bool
- isNoSim :: Expr -> Bool
- isSubSymbol :: Symbol -> Bool
- isSub :: Expr -> Bool
- substituteAllIf :: (Expr -> Bool) -> Map String Expr -> Expr -> Maybe Expr
- hasSub :: Expr -> Bool
- cleanExpr :: Expr -> Expr
- underSubst :: (Expr -> (Expr, [Attribute])) -> Expr -> Maybe (Expr, [Attribute])
- subExprsCombs :: [Expr] -> [([Expr], [Attribute])]
- alternativesExpr :: Expr -> [(Expr, [Attribute])]
- isSubExprOf :: Expr -> Expr -> Bool
Functions on Symbols
isBuggySymbol :: Symbol -> Bool Source #
isOrSymbol :: Symbol -> Bool Source #
isAndSymbol :: Symbol -> Bool Source #
isVarSymbol :: Symbol -> Bool Source #
isLtSymbol :: Symbol -> Bool Source #
isMatchSymbol :: Symbol -> Bool Source #
extractMatched :: Expr -> Expr Source #
If this expression has been matched, then extracted the matched expression
subMatched :: Expr -> Expr Source #
Substitue any matching with its matched expression
isMagicVarSymbol :: Symbol -> Bool Source #
isMagicVar :: Expr -> Bool Source #
hasMagicVar :: Expr -> Bool Source #
isMagicNatSymbol :: Symbol -> Bool Source #
isMagicNat :: Expr -> Bool Source #
hasMagicNat :: Expr -> Bool Source #
isMagicNumberSymbol :: Symbol -> Bool Source #
isMagicNumber :: Expr -> Bool Source #
hasMagicNumber :: Expr -> Bool Source #
isLabelSymbol :: Symbol -> Bool Source #
isStopSymbol :: Symbol -> Bool Source #
isSimSymbol :: Symbol -> Bool Source #
isSimplified :: Expr -> Bool Source #
isNoSimSymbol :: Symbol -> Bool Source #
isSubSymbol :: Symbol -> Bool Source #
Auxillary functions
cleanExpr :: Expr -> Expr Source #
Remove all custom symbols from the expression
Useful/necessary for comandisons.
Note that it is not possible to remove all symbols (and
,or,magicNat,magicVar)
underSubst :: (Expr -> (Expr, [Attribute])) -> Expr -> Maybe (Expr, [Attribute]) Source #
Substitutes all special vars with a unique regular Var then applies some function after which the substitution is reversed