diff options
| author | Jedidiah Barber <contact@jedbarber.id.au> | 2026-02-09 11:54:31 +1300 |
|---|---|---|
| committer | Jedidiah Barber <contact@jedbarber.id.au> | 2026-02-09 11:54:31 +1300 |
| commit | ab78413a044900e421d2e0144f3c170bdc3f0b18 (patch) | |
| tree | 13e65770246b82b1ca030cf5ec173669700d53a1 /test | |
| parent | 32eea08483afb754c7da5663f33cd022d4a2723c (diff) | |
More complete IDDFS that resets counter when backtracking
Diffstat (limited to 'test')
| -rw-r--r-- | test/complete.adb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/complete.adb b/test/complete.adb index 0890e8b..75aadf5 100644 --- a/test/complete.adb +++ b/test/complete.adb @@ -35,6 +35,14 @@ procedure Complete is return Disjunct (One, Two); end Fives; + function Simple + (This : in Goal; + Item : in Term'Class) + return Goal is + begin + return This.Unify (Item, 1); + end Simple; + begin TIO.Put_Line ("This program will loop forever unless the implementation is using"); @@ -65,6 +73,19 @@ begin TIO.New_Line; + declare + Relation : Goal := Empty_Goal; + Value : constant Term := Relation.Fresh; + begin + Relation.Unify (Value, 9); + Relation := Fives (Relation, Value); + Relation.Disjunct (Empty_Goal.Conjunct (Simple'Access, Value)); + TIO.Put_Line ("Value is " & Printer.Image (Value.Resolve (Relation.Run)) & + " after escaping Conjunct trap."); + end; + + TIO.New_Line; + TIO.Put_Line ("Test complete."); end Complete; |
