Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
The representation of rules, which should allow an implementation of:
"A Flexible Search Framework for CHR", Leslie De Koninck, Tom Schrijvers, and Bart Demoen. http:/link.springer.com10.1007/978-3-540-92243-8_2
Synopsis
- data RuleBodyAlt cnstr bprio = RuleBodyAlt {
- rbodyaltBacktrackPrio :: !(Maybe bprio)
- rbodyaltBody :: ![cnstr]
- data Rule cnstr guard bprio prio = Rule {
- ruleHead :: ![cnstr]
- ruleSimpSz :: !Int
- ruleGuard :: ![guard]
- ruleBodyAlts :: ![RuleBodyAlt cnstr bprio]
- ruleBacktrackPrio :: !(Maybe bprio)
- rulePrio :: !(Maybe prio)
- ruleName :: Maybe String
- ruleBody :: Rule c g bp p -> [c]
- ruleBody' :: Rule c g bp p -> ([c], [c])
- ruleSz :: Rule c g bp p -> Int
- (/\) :: [c] -> [c] -> RuleBodyAlt c p
- (\/) :: [RuleBodyAlt c p] -> [RuleBodyAlt c p] -> [RuleBodyAlt c p]
- (\!) :: RuleBodyAlt c p -> p -> RuleBodyAlt c p
- (<=>>) :: [a] -> ([a], p) -> Rule a guard bprio prio
- (==>>) :: [cnstr] -> ([cnstr], p) -> Rule cnstr guard bprio prio
- (<\>>) :: ([a], [a]) -> ([a], p) -> Rule a guard bprio prio
- (<==>) :: [a] -> [a] -> Rule a guard bprio prio
- (<=>) :: [a] -> [a] -> Rule a guard bprio prio
- (==>) :: [cnstr] -> [cnstr] -> Rule cnstr guard bprio prio
- (<\>) :: ([a], [a]) -> [a] -> Rule a guard bprio prio
- (|>) :: Rule cnstr guard bprio prio -> [guard] -> Rule cnstr guard bprio prio
- (=|) :: Rule cnstr guard bprio prio -> [guard] -> Rule cnstr guard bprio prio
- (=!) :: Rule cnstr guard bprio prio -> bprio -> Rule cnstr guard bprio prio
- (=!!) :: Rule cnstr guard bprio prio -> prio -> Rule cnstr guard bprio prio
- (=@) :: Rule cnstr guard bprio prio -> String -> Rule cnstr guard bprio prio
- (@=) :: String -> Rule cnstr guard bprio prio -> Rule cnstr guard bprio prio
Documentation
data RuleBodyAlt cnstr bprio Source #
RuleBodyAlt | |
|
Instances
Show (RuleBodyAlt c bp) Source # | |
Defined in CHR.Types.Rule showsPrec :: Int -> RuleBodyAlt c bp -> ShowS # show :: RuleBodyAlt c bp -> String # showList :: [RuleBodyAlt c bp] -> ShowS # | |
VarExtractable c => VarExtractable (RuleBodyAlt c p) Source # | |
Defined in CHR.Types.Rule varFree :: RuleBodyAlt c p -> [ExtrValVarKey (RuleBodyAlt c p)] # varFreeSet :: RuleBodyAlt c p -> Set (ExtrValVarKey (RuleBodyAlt c p)) # | |
(PP bp, PP c) => PP (RuleBodyAlt c bp) Source # | |
Defined in CHR.Types.Rule pp :: RuleBodyAlt c bp -> PP_Doc # ppList :: [RuleBodyAlt c bp] -> PP_Doc # | |
(VarUpdatable c s, VarUpdatable p s) => VarUpdatable (RuleBodyAlt c p) s Source # | |
Defined in CHR.Types.Rule varUpd :: s -> RuleBodyAlt c p -> RuleBodyAlt c p # varUpdCyc :: s -> RuleBodyAlt c p -> (RuleBodyAlt c p, VarMp' (VarLookupKey s) (VarLookupVal s)) # | |
type ExtrValVarKey (RuleBodyAlt c p) Source # | |
Defined in CHR.Types.Rule |
data Rule cnstr guard bprio prio Source #
A CHR (rule) consist of head (simplification + propagation, boundary indicated by an Int), guard, and a body. All may be empty, but not all at the same time.
Rule | |
|
Instances
Show (Rule c g bp p) Source # | |
(VarExtractable c, VarExtractable g, ExtrValVarKey c ~ ExtrValVarKey g) => VarExtractable (Rule c g bp p) Source # | |
Defined in CHR.Types.Rule varFree :: Rule c g bp p -> [ExtrValVarKey (Rule c g bp p)] # varFreeSet :: Rule c g bp p -> Set (ExtrValVarKey (Rule c g bp p)) # | |
TreeTrieKeyable cnstr => TreeTrieKeyable (Rule cnstr guard bprio prio) Source # | |
Defined in CHR.Types.Rule toTreeTriePreKey1 :: Rule cnstr guard bprio prio -> PreKey1 (Rule cnstr guard bprio prio) # | |
(PP c, PP g, PP p, PP bp) => PP (Rule c g bp p) Source # | |
(VarUpdatable c s, VarUpdatable g s, VarUpdatable bp s, VarUpdatable p s) => VarUpdatable (Rule c g bp p) s Source # | |
Defined in CHR.Types.Rule | |
type ExtrValVarKey (Rule c g bp p) Source # | |
Defined in CHR.Types.Rule | |
type TrTrKey (Rule cnstr guard bprio prio) Source # | |
Defined in CHR.Types.Rule |
ruleBody :: Rule c g bp p -> [c] Source #
Backwards compatibility: if only one alternative, extract it, ignore other alts
ruleBody' :: Rule c g bp p -> ([c], [c]) Source #
Backwards compatibility: if only one alternative, extract it, ignore other alts
(/\) :: [c] -> [c] -> RuleBodyAlt c p infixl 6 Source #
Rule body backtracking alternative
(\/) :: [RuleBodyAlt c p] -> [RuleBodyAlt c p] -> [RuleBodyAlt c p] infixr 4 Source #
Rule body backtracking alternatives
(\!) :: RuleBodyAlt c p -> p -> RuleBodyAlt c p infixl 5 Source #
Add backtrack priority to body alternative
(<=>>) :: [a] -> ([a], p) -> Rule a guard bprio prio Source #
Construct simplification rule out of head, body, and builtin constraints
(==>>) :: [cnstr] -> ([cnstr], p) -> Rule cnstr guard bprio prio Source #
Construct propagation rule out of head, body, and builtin constraints
(<\>>) :: ([a], [a]) -> ([a], p) -> Rule a guard bprio prio Source #
Construct simpagation rule out of head, body, and builtin constraints
(<==>) :: [a] -> [a] -> Rule a guard bprio prio infix 3 Source #
Construct simplification rule out of head and body constraints
(==>) :: [cnstr] -> [cnstr] -> Rule cnstr guard bprio prio infix 3 Source #
Construct propagation rule out of head and body constraints
(<\>) :: ([a], [a]) -> [a] -> Rule a guard bprio prio infix 3 Source #
Construct simpagation rule out of head and body constraints
(|>) :: Rule cnstr guard bprio prio -> [guard] -> Rule cnstr guard bprio prio infixl 2 Source #
Deprecated: Use (=|)
Add guards to rule
(=!) :: Rule cnstr guard bprio prio -> bprio -> Rule cnstr guard bprio prio infixl 2 Source #
Add backtrack priority to rule
(=!!) :: Rule cnstr guard bprio prio -> prio -> Rule cnstr guard bprio prio infixl 2 Source #
Add priority to rule