-- Programmed by Jedidiah Barber -- Licensed under the Sunset License v1.0 -- See license.txt for further details with Ada.Characters.Latin_1, Ada.Text_IO, Kompsos.Pretty_Print; procedure Rembero is package Latin renames Ada.Characters.Latin_1; package TIO renames Ada.Text_IO; package InKomp is new Kompsos (Integer); use InKomp; 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."); TIO.New_Line; TIO.Put_Line ("It will call rembero with variables as all arguments."); TIO.Put_Line ("The first 5 results will be displayed."); TIO.New_Line; Relation.Remove (Item_Term & List_Term & Out_Term); declare First_Five : constant State_Array := Relation.Run (5); begin TIO.Put_Line ("Raw results:"); TIO.Put_Line (Printer.Image (First_Five)); TIO.New_Line; TIO.Put_Line ("Reified results:"); for Index in First_Five'Range loop TIO.Put_Line ("#" & Printer.Image (Index) & ":"); TIO.Put_Line (Latin.HT & "item: " & Printer.Image (Item_Term.Resolve (First_Five (Index)))); TIO.Put_Line (Latin.HT & "list: " & Printer.Image (List_Term.Resolve (First_Five (Index)))); TIO.Put_Line (Latin.HT & "out: " & Printer.Image (Out_Term.Resolve (First_Five (Index)))); end loop; end; end Rembero;