-- Programmed by Jedidiah Barber -- Licensed under the Sunset License v1.0 -- See license.txt for further details private with Ada.Containers.Hashed_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; private -- Interleaved Graph Inversion -- package Positive_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Positive); subtype Disjuncts_Chosen is Positive_Vectors.Vector; function "<" (Left, Right : in Disjuncts_Chosen) return Boolean; type Parent_Arrow is record Node : Graph_Component_Access; Order : Disjuncts_Chosen; end record; function "<" (Left, Right : in Parent_Arrow) return Boolean; package Parent_Arrow_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Parent_Arrow); subtype Disjuncts_Passed is Natural; type Node_Upwards is record Depth : Disjuncts_Passed; Parents : Parent_Arrow_Vectors.Vector; end record; package Upwards_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Node_Upwards); function Graph_Component_Access_Hash (Key : in Graph_Component_Access) return Ada.Containers.Hash_Type; package Upwards_Maps is new Ada.Containers.Hashed_Maps (Key_Type => Graph_Component_Access, Element_Type => Positive, Hash => Graph_Component_Access_Hash, Equivalent_Keys => "="); -- Conjunct Expansion -- type Goal_Access is access all Goal; package Goal_Access_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Goal_Access); -- Upwards Depth First Search -- type Breadcrumb is record Choice_Node : Graph_Component_Access; Option : Positive; State_Size : Long_Natural; end record; package Breadcrumb_Vectors is new Ada.Containers.Vectors (Index_Type => Positive, Element_Type => Breadcrumb); -- Cleanup -- type Collector_Final_Controller is new Ada.Finalization.Limited_Controlled with null record; overriding procedure Finalize (This : in out Collector_Final_Controller); Cleanup : Collector_Final_Controller; end Kompsos.Collector;