diff options
Diffstat (limited to 'src/kompsos-collector.adb')
| -rw-r--r-- | src/kompsos-collector.adb | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/kompsos-collector.adb b/src/kompsos-collector.adb index b076679..792c2b2 100644 --- a/src/kompsos-collector.adb +++ b/src/kompsos-collector.adb @@ -67,7 +67,7 @@ package body Kompsos.Collector is when Null_Term | Atom_Term => return True; when Var_Term => - return This.Ident.Contains (Item.Var.Ident); + return This.LVars.Contains (Item.Var); when Pair_Term => return Fully_Contains (This, Item.Left) and then Fully_Contains (This, Item.Right); end case; @@ -79,10 +79,8 @@ package body Kompsos.Collector is Item : in Term'Class) return Term'Class is begin - if Item.Kind = Var_Term and then - This.Subst.Contains (This.Ident.Element (Item.Var.Ident)) - then - return Walk (This, This.Subst.Constant_Reference (This.Ident.Element (Item.Var.Ident))); + if Item.Kind = Var_Term and then This.Subst.Contains (Item.Var) then + return Walk (This, This.Subst.Element (Item.Var)); else return Item; end if; @@ -126,12 +124,12 @@ package body Kompsos.Collector is -- Unify Variable and other Terms by introducing a new substitution if Real_Left.Kind = Var_Term then Extended := Potential; - Extended.Subst.Insert (Extended.Ident.Element (Real_Left.Var.Ident), Term (Real_Right)); + Extended.Subst.Insert (Real_Left.Var, Term (Real_Right)); return True; end if; if Real_Right.Kind = Var_Term then Extended := Potential; - Extended.Subst.Insert (Extended.Ident.Element (Real_Right.Var.Ident), Term (Real_Left)); + Extended.Subst.Insert (Real_Right.Var, Term (Real_Left)); return True; end if; @@ -233,8 +231,7 @@ package body Kompsos.Collector is when Fresh_Node => if Get_Next (Ptr.Frs_Goal'Unchecked_Access, Base, Index, Result) then - Result.LVars.Append (Ptr.Frs_Var.Name); - Result.Ident.Insert (Ptr.Frs_Var.Ident, Result.LVars.Last_Index); + Result.LVars.Append (Ptr.Frs_Var); return True; else return False; @@ -510,8 +507,7 @@ package body Kompsos.Collector is end Next; - procedure Reset - is + procedure Reset is Ptr : constant Constant_Goal_Access := Relation'Access; begin Reset (Ptr); |
