herbrand 2

This commit is contained in:
Felix Dilke 2026-02-03 18:29:38 +00:00
parent 4a9782c9c1
commit 593da2abb5

View File

@ -52,7 +52,11 @@ computeHerbrand db =
if changed then Just newFacts else Nothing where
(newFacts, changed) = foldr amalgamateRelation (facts, False) allRelationNames
amalgamateRelation :: Text -> NewFacts -> NewFacts
amalgamateRelation relationName newFacts = newFacts
amalgamateRelation relationName newFacts =
maybe newFacts (amalgamateRelationSub newFacts) $ lookupRelation db relationName
amalgamateRelationSub :: NewFacts -> Relation -> NewFacts
amalgamateRelationSub newFacts relation =
newFacts
computeHerbrandSub :: Map Text Relation -> Map Text Relation
computeHerbrandSub facts =
maybe facts computeHerbrandSub (updateFacts facts)