@@ -682,12 +682,12 @@ package body Langkit_Support.Adalog.Solver is
682
682
-- if ``Visiting (I) and not Appended (I)``, then we have found a
683
683
-- dependency cycle.
684
684
685
- function Id (S : Var_Or_Null ) return Natural
686
- is (if S.Exists then Id (S.Logic_Var) else 0 );
687
- -- Return the Id for the ``S `` variable, or 0 if there is no variable
685
+ function Id_Or_Null (Var : Logic_Var ) return Natural
686
+ is (if Var = null then 0 else Id (Var) );
687
+ -- Return the Id for the ``Var `` variable, or 0 if there is no variable
688
688
689
689
function Defined (S : Atomic_Relation_Type) return Natural
690
- is (Id (Defined_Var (S)));
690
+ is (Id_Or_Null (Defined_Var (S)));
691
691
-- Return the Id for the variable that ``S`` defines, or 0 if it
692
692
-- contains no definition.
693
693
@@ -968,31 +968,31 @@ package body Langkit_Support.Adalog.Solver is
968
968
-- Used_Var --
969
969
-- ------------
970
970
971
- function Used_Var (Self : Atomic_Relation_Type) return Var_Or_Null
971
+ function Used_Var (Self : Atomic_Relation_Type) return Logic_Var
972
972
is
973
973
-- We handle Unify here, even though it is not strictly treated in the
974
974
-- dependency graph, so that the Unify_From variable is registered in
975
975
-- the list of variables of the equation. TODO??? Might be cleaner to
976
976
-- have a separate function to return all variables a relation uses?
977
977
(case Self.Kind is
978
- when Assign | True | False | N_Predicate => Null_Var ,
979
- when Propagate => (True, Self.From) ,
980
- when Predicate => (True, Self.Target) ,
981
- when Unify => (True, Self.Unify_From) );
978
+ when Assign | True | False | N_Predicate => null ,
979
+ when Propagate => Self.From,
980
+ when Predicate => Self.Target,
981
+ when Unify => Self.Unify_From);
982
982
983
983
-- ---------------
984
984
-- Defined_Var --
985
985
-- ---------------
986
986
987
- function Defined_Var (Self : Atomic_Relation_Type) return Var_Or_Null
987
+ function Defined_Var (Self : Atomic_Relation_Type) return Logic_Var
988
988
is
989
989
-- We handle Unify here, even though it is not strictly treated in the
990
990
-- dependency graph, so that the Target variable is registered in
991
991
-- the list of variables of the equation. TODO??? Might be cleaner to
992
992
-- have a separate function to return all variables a relation defines?
993
993
(case Self.Kind is
994
- when Assign | Propagate | Unify => (True, Self.Target) ,
995
- when Predicate | True | False | N_Predicate => Null_Var );
994
+ when Assign | Propagate | Unify => Self.Target,
995
+ when Predicate | True | False | N_Predicate => null );
996
996
997
997
-- ---------------
998
998
-- To_Relation --
0 commit comments