minor tidyings
This commit is contained in:
parent
7126f0e75b
commit
b982072281
@ -100,17 +100,12 @@ data BodyConstraint = BodyConstraint {
|
|||||||
|
|
||||||
data RuleContext = RuleContext {
|
data RuleContext = RuleContext {
|
||||||
__relation :: Relation,
|
__relation :: Relation,
|
||||||
|
-- _variableNames :: [Text],
|
||||||
_headVariables :: [RuleElement],
|
_headVariables :: [RuleElement],
|
||||||
_bodyConstraints :: [BodyConstraint],
|
_bodyConstraints :: [BodyConstraint],
|
||||||
_db :: NaiveDatabase
|
_db :: NaiveDatabase
|
||||||
}
|
}
|
||||||
|
|
||||||
toElement :: Term -> RuleElement
|
|
||||||
-- toElement constant@(Var _) = RuleElementConstant constant
|
|
||||||
-- toElement constant@(Num _) = RuleElementConstant constant
|
|
||||||
toElement (Var name) = RuleElementVariable name
|
|
||||||
toElement constant = RuleElementConstant constant
|
|
||||||
|
|
||||||
maybeConstant :: RuleElement -> Maybe Constant
|
maybeConstant :: RuleElement -> Maybe Constant
|
||||||
maybeConstant (RuleElementConstant constant) = Just constant
|
maybeConstant (RuleElementConstant constant) = Just constant
|
||||||
maybeConstant _ = Nothing
|
maybeConstant _ = Nothing
|
||||||
@ -202,6 +197,9 @@ withFactsAndRules facts rules =
|
|||||||
}
|
}
|
||||||
newRelationMap = Map.insert relationName relation' relationMap
|
newRelationMap = Map.insert relationName relation' relationMap
|
||||||
constants' = constants db'
|
constants' = constants db'
|
||||||
|
toElement :: Term -> RuleElement
|
||||||
|
toElement (Var name) = RuleElementVariable name
|
||||||
|
toElement constant = RuleElementConstant constant
|
||||||
|
|
||||||
query :: NaiveDatabase -> Text -> Text
|
query :: NaiveDatabase -> Text -> Text
|
||||||
query db qText =
|
query db qText =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user