aboutsummaryrefslogtreecommitdiff
path: root/src/kompsos.ads
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2026-01-24 20:17:20 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2026-01-24 20:17:20 +1300
commit00886e535241a994b71ca1ce62f24f5f11ec9255 (patch)
tree123480e33d446e96f581aeb8e329916d9dcbc9ae /src/kompsos.ads
parent7b201fc0587e8012189f7b1f245734e117e4975c (diff)
Minor tidyup and some more comments
Diffstat (limited to 'src/kompsos.ads')
-rw-r--r--src/kompsos.ads23
1 files changed, 15 insertions, 8 deletions
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;