From 00886e535241a994b71ca1ce62f24f5f11ec9255 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Sat, 24 Jan 2026 20:17:20 +1300 Subject: Minor tidyup and some more comments --- src/kompsos.ads | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/kompsos.ads') diff --git a/src/kompsos.ads b/src/kompsos.ads index b8629fb..dc9341f 100644 --- a/src/kompsos.ads +++ b/src/kompsos.ads @@ -34,21 +34,24 @@ package Kompsos is (Left, Right : in Term) return Boolean; + function Kind + (This : in Term) + return Term_Kind; + function T (Item : in Element_Type) - return Term; + return Term + with Post => T'Result.Kind = Atom_Term; function T (Item1, Item2 : in Term'Class) - return Term; + return Term + with Post => T'Result.Kind = Pair_Term; function T (Items : in Term_Array) - return Term; - - function Kind - (This : in Term) - return Term_Kind; + return Term + with Post => T'Result.Kind = Pair_Term or else T'Result.Kind = Null_Term; function Atom (This : in Term) @@ -405,13 +408,15 @@ package Kompsos is private - -- around 2^31 possible Variables should be enough for anybody, right? + -- Variables -- + -- Around 2^31 possible Variables per Goal should be enough for anybody, right? subtype Long_Natural is Long_Integer range 0 .. Long_Integer'Last; subtype Long_Positive is Long_Integer range 1 .. Long_Integer'Last; type Variable is new Long_Natural; + -- Terms -- subtype Not_Null_Term_Kind is Term_Kind range Atom_Term .. Pair_Term; @@ -458,6 +463,7 @@ private package Term_Array_Holders is new Ada.Containers.Indefinite_Holders (Term_Array); + -- States -- type Binding is record Key : Variable; @@ -508,6 +514,7 @@ private Empty_State : constant State := (Ctrl => (Ada.Finalization.Controlled with Actual => null)); + -- Goals -- type Graph_Component; -- cgit