rearranging code
This commit is contained in:
parent
97c9e2d34b
commit
f4cd68a76e
@ -48,6 +48,10 @@ computeHerbrand db =
|
||||
relation <- lookupRelation db relationName
|
||||
pure (relationName, relation)
|
||||
) allRelationNames
|
||||
allRelationNames :: [Text] = relationNames db
|
||||
computeHerbrandSub :: Map Text Relation -> Map Text Relation
|
||||
computeHerbrandSub facts =
|
||||
maybe facts computeHerbrandSub (updateFacts facts)
|
||||
updateFacts :: Facts -> Maybe Facts
|
||||
updateFacts facts =
|
||||
if changed then Just newFacts else Nothing where
|
||||
@ -59,10 +63,6 @@ computeHerbrand db =
|
||||
amalgamateRelationSub newFacts relation =
|
||||
foldr amalgamateRule newFacts (_rules relation) where
|
||||
amalgamateRule :: RelationRule -> NewFacts -> NewFacts
|
||||
amalgamateRule rule newFacts =
|
||||
amalgamateRule (RelationRule headVars body) newFacts =
|
||||
newFacts
|
||||
computeHerbrandSub :: Map Text Relation -> Map Text Relation
|
||||
computeHerbrandSub facts =
|
||||
maybe facts computeHerbrandSub (updateFacts facts)
|
||||
allRelationNames :: [Text] = relationNames db
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user