diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/ab.adb | 17 | ||||
| -rw-r--r-- | test/membero.adb | 5 | ||||
| -rw-r--r-- | test/pprint.adb | 2 | ||||
| -rw-r--r-- | test/rembero.adb | 13 |
4 files changed, 22 insertions, 15 deletions
diff --git a/test/ab.adb b/test/ab.adb index de89207..314b0dc 100644 --- a/test/ab.adb +++ b/test/ab.adb @@ -20,11 +20,12 @@ procedure AB is package InKomp is new Kompsos (Integer); use InKomp; - package InPrin is new InKomp.Pretty_Print (Integer'Image); - use InPrin; + package Printer is new InKomp.Pretty_Print (Integer'Image); + Relation : Goal := Empty_Goal; - Item : Term; + + A, B : Term; begin @@ -32,12 +33,12 @@ begin TIO.New_Line; - Item := Relation.Fresh ("a"); - Relation.Unify (Item, 7); - Item := Relation.Fresh ("b"); - Relation := Disjunct (Relation.Unify (Item, 5), Relation.Unify (Item, 6)); + A := Relation.Fresh; + Relation.Unify (A, 7); + B := Relation.Fresh; + Relation := Disjunct (Relation.Unify (B, 5), Relation.Unify (B, 6)); - TIO.Put_Line (Image (Relation)); + TIO.Put_Line (Printer.Image (Relation)); end AB; diff --git a/test/membero.adb b/test/membero.adb index 057843f..c111444 100644 --- a/test/membero.adb +++ b/test/membero.adb @@ -29,6 +29,7 @@ procedure Membero is package Printer is new SKomp.Pretty_Print (SU.To_String); + Relation : Goal := Empty_Goal; Test_Item : constant Term := T (T (+"one") & T (+"two") & T (+"three") & T (+"four")); @@ -42,7 +43,7 @@ begin TIO.New_Line; - Relation.Member (Relation.Fresh ("result") & Test_Item); + Relation.Member (Relation.Fresh & Test_Item); TIO.Put_Line ("Raw results:"); TIO.Put_Line (Printer.Image (Relation)); @@ -51,7 +52,7 @@ begin TIO.Put_Line ("Reified results:"); for Subst of Relation.Run_All loop - TIO.Put_Line (Printer.Image (Resolve_First (Subst, "result"))); + TIO.Put_Line (Printer.Image (Resolve_First (Subst))); end loop; end Membero; diff --git a/test/pprint.adb b/test/pprint.adb index e2fe3d4..89697bf 100644 --- a/test/pprint.adb +++ b/test/pprint.adb @@ -38,7 +38,7 @@ procedure PPrint is begin - TIO.Put_Line ("Test program to output String representation of some Terms and an empty World."); + TIO.Put_Line ("Test program to output String representation of some Terms and an empty Goal."); TIO.New_Line; diff --git a/test/rembero.adb b/test/rembero.adb index e64314e..301c85c 100644 --- a/test/rembero.adb +++ b/test/rembero.adb @@ -24,8 +24,13 @@ procedure Rembero is package Printer is new InKomp.Pretty_Print (Integer'Image); + Relation : Goal := Empty_Goal; + Item_Term : constant Term := Relation.Fresh; + List_Term : constant Term := Relation.Fresh; + Out_Term : constant Term := Relation.Fresh; + begin TIO.Put_Line ("Test program to check if calculating an infinite number of results works."); @@ -35,7 +40,7 @@ begin TIO.New_Line; - Relation.Remove (Relation.Fresh ("item") & Relation.Fresh ("list") & Relation.Fresh ("out")); + Relation.Remove (Item_Term & List_Term & Out_Term); declare First_Five : constant State_Array := Relation.Run (5); @@ -49,11 +54,11 @@ begin for Index in First_Five'Range loop TIO.Put_Line ("#" & Printer.Image (Index) & ":"); TIO.Put_Line (Latin.HT & "item: " & - Printer.Image (Resolve_First (First_Five (Index), "item"))); + Printer.Image (Item_Term.Resolve (First_Five (Index)))); TIO.Put_Line (Latin.HT & "list: " & - Printer.Image (Resolve_First (First_Five (Index), "list"))); + Printer.Image (List_Term.Resolve (First_Five (Index)))); TIO.Put_Line (Latin.HT & "out: " & - Printer.Image (Resolve_First (First_Five (Index), "out"))); + Printer.Image (Out_Term.Resolve (First_Five (Index)))); end loop; end; |
