From 2b91a8989687e152f7120aa6c907ffeba8495bab Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Tue, 22 Sep 2020 10:44:51 +0200 Subject: Deprecate the non-qualified equality functions on kerpairs. This allows to quickly spot the parts of the code that rely on the canonical ordering. When possible we directly introduce the quotient-aware versions. --- engine/eConstr.ml | 4 ++-- engine/termops.ml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'engine') diff --git a/engine/eConstr.ml b/engine/eConstr.ml index 36297fe243..28d23cc67e 100644 --- a/engine/eConstr.ml +++ b/engine/eConstr.ml @@ -127,7 +127,7 @@ let isRef sigma c = match kind sigma c with let isRefX sigma x c = let open GlobRef in match x, kind sigma c with - | ConstRef c, Const (c', _) -> Constant.equal c c' + | ConstRef c, Const (c', _) -> Constant.CanOrd.equal c c' | IndRef i, Ind (i', _) -> eq_ind i i' | ConstructRef i, Construct (i', _) -> eq_constructor i i' | VarRef id, Var id' -> Id.equal id id' @@ -514,7 +514,7 @@ let compare_head_gen_proj env sigma equ eqs eqc' nargs m n = | Proj (p, c), App (f, args) | App (f, args), Proj (p, c) -> (match kind f with - | Const (p', u) when Constant.equal (Projection.constant p) p' -> + | Const (p', u) when Environ.QConstant.equal env (Projection.constant p) p' -> let npars = Projection.npars p in if Array.length args == npars + 1 then eqc' 0 c args.(npars) diff --git a/engine/termops.ml b/engine/termops.ml index 467b269e37..3116b03c4f 100644 --- a/engine/termops.ml +++ b/engine/termops.ml @@ -1145,7 +1145,7 @@ let compare_constr_univ sigma f cv_pb t1 t2 = Sort s1, Sort s2 -> base_sort_cmp cv_pb (ESorts.kind sigma s1) (ESorts.kind sigma s2) | Prod (_,t1,c1), Prod (_,t2,c2) -> f Reduction.CONV t1 t2 && f cv_pb c1 c2 - | Const (c, u), Const (c', u') -> Constant.equal c c' + | Const (c, u), Const (c', u') -> Constant.CanOrd.equal c c' | Ind (i, _), Ind (i', _) -> eq_ind i i' | Construct (i, _), Construct (i', _) -> eq_constructor i i' | _ -> EConstr.compare_constr sigma (fun t1 t2 -> f Reduction.CONV t1 t2) t1 t2 -- cgit v1.2.3 From bc108fdf6cf42f3ce550f2f258adf7de5fa5bfdc Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Wed, 23 Sep 2020 12:42:21 +0200 Subject: Introduce an Ind module in the Names API. This is similar to Constant and MutInd but for some reason this was was never done. Such a patch makes the whole API more regular. We also deprecate the legacy aliases. --- engine/eConstr.ml | 2 +- engine/termops.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/eConstr.ml b/engine/eConstr.ml index 28d23cc67e..1ac658f123 100644 --- a/engine/eConstr.ml +++ b/engine/eConstr.ml @@ -128,7 +128,7 @@ let isRefX sigma x c = let open GlobRef in match x, kind sigma c with | ConstRef c, Const (c', _) -> Constant.CanOrd.equal c c' - | IndRef i, Ind (i', _) -> eq_ind i i' + | IndRef i, Ind (i', _) -> Ind.CanOrd.equal i i' | ConstructRef i, Construct (i', _) -> eq_constructor i i' | VarRef id, Var id' -> Id.equal id id' | _ -> false diff --git a/engine/termops.ml b/engine/termops.ml index 3116b03c4f..031a505ce2 100644 --- a/engine/termops.ml +++ b/engine/termops.ml @@ -1146,7 +1146,7 @@ let compare_constr_univ sigma f cv_pb t1 t2 = | Prod (_,t1,c1), Prod (_,t2,c2) -> f Reduction.CONV t1 t2 && f cv_pb c1 c2 | Const (c, u), Const (c', u') -> Constant.CanOrd.equal c c' - | Ind (i, _), Ind (i', _) -> eq_ind i i' + | Ind (i, _), Ind (i', _) -> Ind.CanOrd.equal i i' | Construct (i, _), Construct (i', _) -> eq_constructor i i' | _ -> EConstr.compare_constr sigma (fun t1 t2 -> f Reduction.CONV t1 t2) t1 t2 -- cgit v1.2.3 From aa3d78fefde6897a50273c83f944b6617963a9bc Mon Sep 17 00:00:00 2001 From: Pierre-Marie Pédrot Date: Wed, 23 Sep 2020 13:58:13 +0200 Subject: Similar introduction of a Construct module in the Names API. --- engine/eConstr.ml | 2 +- engine/termops.ml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engine') diff --git a/engine/eConstr.ml b/engine/eConstr.ml index 1ac658f123..374cb72753 100644 --- a/engine/eConstr.ml +++ b/engine/eConstr.ml @@ -129,7 +129,7 @@ let isRefX sigma x c = match x, kind sigma c with | ConstRef c, Const (c', _) -> Constant.CanOrd.equal c c' | IndRef i, Ind (i', _) -> Ind.CanOrd.equal i i' - | ConstructRef i, Construct (i', _) -> eq_constructor i i' + | ConstructRef i, Construct (i', _) -> Construct.CanOrd.equal i i' | VarRef id, Var id' -> Id.equal id id' | _ -> false diff --git a/engine/termops.ml b/engine/termops.ml index 031a505ce2..693945d5ac 100644 --- a/engine/termops.ml +++ b/engine/termops.ml @@ -1147,7 +1147,7 @@ let compare_constr_univ sigma f cv_pb t1 t2 = f Reduction.CONV t1 t2 && f cv_pb c1 c2 | Const (c, u), Const (c', u') -> Constant.CanOrd.equal c c' | Ind (i, _), Ind (i', _) -> Ind.CanOrd.equal i i' - | Construct (i, _), Construct (i', _) -> eq_constructor i i' + | Construct (i, _), Construct (i', _) -> Construct.CanOrd.equal i i' | _ -> EConstr.compare_constr sigma (fun t1 t2 -> f Reduction.CONV t1 t2) t1 t2 let constr_cmp sigma cv_pb t1 t2 = -- cgit v1.2.3