diff options
Diffstat (limited to 'test/fivesix.adb')
| -rw-r--r-- | test/fivesix.adb | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/test/fivesix.adb b/test/fivesix.adb new file mode 100644 index 0000000..3eabf6a --- /dev/null +++ b/test/fivesix.adb @@ -0,0 +1,48 @@ + + +-- Programmed by Jedidiah Barber +-- Licensed under the Sunset License v1.0 + +-- See license.txt for further details + + +with + + Ada.Text_IO, + Kompsos.Pretty_Print; + + +procedure FiveSix is + + package TIO renames Ada.Text_IO; + + + package InKomp is new Kompsos (Integer); + use InKomp; + + package InPrin is new InKomp.Pretty_Print (Integer'Image); + use InPrin; + + Fives, Sixes : World := Empty_World; + Result : World; + +begin + + TIO.Put_Line ("Test program for fives-and-sixes example from 2013 microKanren paper."); + TIO.Put_Line ("Since the result is infinite, only the first five states will be shown."); + + TIO.New_Line; + + Fives.Unify (Fives.Fresh, 5); + Fives.Recurse; + + Sixes.Unify (Sixes.Fresh, 6); + Sixes.Recurse; + + Result := Disjunct (Fives, Sixes).Take (5); + + TIO.Put_Line (Image (Result)); + +end FiveSix; + + |
