From 0188dfb4d373cc8570222496f7d04cd3ae2774f3 Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Fri, 19 Dec 2025 21:51:48 +1300 Subject: Worlds separated into Goals that run on a State, improvement to unification efficiency --- test/fivesix.adb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/fivesix.adb') diff --git a/test/fivesix.adb b/test/fivesix.adb index 5876c44..9620c60 100644 --- a/test/fivesix.adb +++ b/test/fivesix.adb @@ -26,10 +26,10 @@ procedure FiveSix is -- It is possible to create a recursion using functions like this... function Fives - (This : in World) - return World + (This : in Goal) + return Goal is - One, Two : World := This; + One, Two : Goal := This; begin One.Unify (One.Fresh, 5); Two.Conjunct (Fives'Access); @@ -37,8 +37,8 @@ procedure FiveSix is end Fives; - Sixes : World := Empty_World; - Result : World; + Sixes : Goal := Empty_Goal; + Result : Goal; begin @@ -51,10 +51,10 @@ begin Sixes.Unify (Sixes.Fresh, 6); Sixes.Recurse; - Result := Disjunct (Fives (Empty_World), Sixes); + Result := Disjunct (Fives (Empty_Goal), Sixes); -- Note how the States from Fives keep creating new Variables instead of looping. - TIO.Put_Line (Image (Result.Take (5))); + TIO.Put_Line (Image (Result.Run (5))); end FiveSix; -- cgit