Stability | experimental |
---|---|
Maintainer | developer@flocc.net |
Safe Haskell | None |
For more information please see http://www.flocc.net/
- type ExpId = Idx
- type RuleId = String
- data Ruleset = Ruleset {}
- loadRules :: [(String, Idx)] -> String -> IO Ruleset
- appRule :: Monad m => IdxTree -> Expr -> Expr -> IdxMonad m Expr
- appRulesM :: Monad m => () -> Expr -> StateT (Ruleset, SolId) (IdxMonad m) Expr
- applyRules :: Monad m => Ruleset -> SolId -> Expr -> IdxMonad m Expr
- accumRuleApps :: Monad m => Ruleset -> Expr -> StateT [(ExpId, RuleId, [Int])] m Expr
- getRuleApps :: Ruleset -> Expr -> [(ExpId, RuleId, [Int])]
- getRuleNames :: Ruleset -> Expr -> [(ExpId, RuleId, [Int])] -> [Int] -> [String]
- getAllRuleNames :: Ruleset -> Expr -> [(ExpId, RuleId, [Int])] -> [Int] -> [([Int], [String])]
Documentation
data Ruleset
loadRules :: [(String, Idx)] -> String -> IO Ruleset
loadRules varIds fileName. Loads ruleset from a file.
appRule :: Monad m => IdxTree -> Expr -> Expr -> IdxMonad m Expr
ruleit ruleExp exp. Instantiates rule applying it to argExp, by binding args in |a let, and then doing the rule exp (fun app).
applyRules :: Monad m => Ruleset -> SolId -> Expr -> IdxMonad m Expr
applyRules rules solId ast. Applies the rules identified by the |solution id, to ast.
getRuleApps :: Ruleset -> Expr -> [(ExpId, RuleId, [Int])]
getRuleApps rules ast. Returns a list of all the fun apps in ast |for which rules exist.