-- Programmed by Jedidiah Barber -- Licensed under the Sunset License v1.0 -- See license.txt for further details private with Ada.Containers.Ordered_Maps, Ada.Containers.Vectors, Ada.Finalization; generic Relation : in Goal; Within : in State; package Kompsos.Collector is State_Not_Found_Error : exception; function Has_Next return Boolean; function Next return State; function Next (Default : in State) return State; procedure Reset; private type Goal_Access is access all Goal; type Constant_Goal_Access is access constant Goal; type State_Access is access State; type Eval_Kind is (Unify_Data, Disjunct_Data, Conjunct_Data, Recurse_Data); type Eval_Data (Kind : Eval_Kind := Unify_Data) is record case Kind is when Unify_Data => Uni_Offset : Long_Natural := 0; when Disjunct_Data => Dis_Flag : Boolean := True; Dis_Next1 : Long_Positive := 1; Dis_Next2 : Long_Positive := 1; Dis_Gone1 : Boolean := False; Dis_Gone2 : Boolean := False; when Conjunct_Data => Con_From : Long_Positive := 2; -- Number one will be obtained by Get_Next already Con_Base : State_Access := null; Con_Part : Goal_Access := null; Con_Next : Long_Positive := 1; Con_Gone : Boolean := False; when Recurse_Data => Rec_Next : Long_Positive := 1; Rec_Gone : Boolean := False; end case; end record; package Eval_Maps is new Ada.Containers.Ordered_Maps (Key_Type => Goal_Component_Access, Element_Type => Eval_Data); type Managed_Map is new Ada.Finalization.Controlled with record Actual : Eval_Maps.Map; end record; overriding procedure Finalize (This : in out Managed_Map); package Cache_Maps is new Ada.Containers.Ordered_Maps (Key_Type => Goal_Component_Access, Element_Type => State_Vectors.Vector, "=" => State_Vectors."="); end Kompsos.Collector;