pushed the problem of Herbrand construction down 1 layer

This commit is contained in:
Felix Dilke 2026-02-10 12:05:55 +00:00
parent ae2f4d7552
commit 97c9e2d34b

View File

@ -57,7 +57,10 @@ computeHerbrand db =
maybe newFacts (amalgamateRelationSub newFacts) $ lookupRelation db relationName maybe newFacts (amalgamateRelationSub newFacts) $ lookupRelation db relationName
amalgamateRelationSub :: NewFacts -> Relation -> NewFacts amalgamateRelationSub :: NewFacts -> Relation -> NewFacts
amalgamateRelationSub newFacts relation = amalgamateRelationSub newFacts relation =
newFacts foldr amalgamateRule newFacts (_rules relation) where
amalgamateRule :: RelationRule -> NewFacts -> NewFacts
amalgamateRule rule newFacts =
newFacts
computeHerbrandSub :: Map Text Relation -> Map Text Relation computeHerbrandSub :: Map Text Relation -> Map Text Relation
computeHerbrandSub facts = computeHerbrandSub facts =
maybe facts computeHerbrandSub (updateFacts facts) maybe facts computeHerbrandSub (updateFacts facts)