diff options
| author | Pierre-Marie Pédrot | 2020-09-22 10:44:51 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2020-10-21 12:19:02 +0200 |
| commit | 2b91a8989687e152f7120aa6c907ffeba8495bab (patch) | |
| tree | 0fd0362eccc5c894b08c65147f0229fcdc8d2814 /pretyping | |
| parent | 8f16b1c5b97411b7ea88279699f0f410f1c77723 (diff) | |
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.
Diffstat (limited to 'pretyping')
| -rw-r--r-- | pretyping/constr_matching.ml | 6 | ||||
| -rw-r--r-- | pretyping/evarconv.ml | 6 | ||||
| -rw-r--r-- | pretyping/evardefine.ml | 2 | ||||
| -rw-r--r-- | pretyping/indrec.ml | 2 | ||||
| -rw-r--r-- | pretyping/tacred.ml | 6 | ||||
| -rw-r--r-- | pretyping/unification.ml | 8 |
6 files changed, 15 insertions, 15 deletions
diff --git a/pretyping/constr_matching.ml b/pretyping/constr_matching.ml index 419eeaa92a..71ef166ff0 100644 --- a/pretyping/constr_matching.ml +++ b/pretyping/constr_matching.ml @@ -244,7 +244,7 @@ let matches_core env sigma allow_bound_rels let open GlobRef in match ref, EConstr.kind sigma c with | VarRef id, Var id' -> Names.Id.equal id id' - | ConstRef c, Const (c',_) -> Constant.equal c c' + | ConstRef c, Const (c',_) -> Environ.QConstant.equal env c c' | IndRef i, Ind (i', _) -> Names.eq_ind i i' | ConstructRef c, Construct (c',u) -> Names.eq_constructor c c' | _, _ -> false @@ -307,7 +307,7 @@ let matches_core env sigma allow_bound_rels | PApp (c1,arg1), App (c2,arg2) -> (match c1, EConstr.kind sigma c2 with - | PRef (GlobRef.ConstRef r), Proj (pr,c) when not (Constant.equal r (Projection.constant pr)) + | PRef (GlobRef.ConstRef r), Proj (pr,c) when not (Environ.QConstant.equal env r (Projection.constant pr)) || Projection.unfolded pr -> raise PatternMatchingFailure | PProj (pr1,c1), Proj (pr,c) -> @@ -324,7 +324,7 @@ let matches_core env sigma allow_bound_rels with Invalid_argument _ -> raise PatternMatchingFailure) | PApp (PRef (GlobRef.ConstRef c1), _), Proj (pr, c2) - when Projection.unfolded pr || not (Constant.equal c1 (Projection.constant pr)) -> + when Projection.unfolded pr || not (Environ.QConstant.equal env c1 (Projection.constant pr)) -> raise PatternMatchingFailure | PApp (c, args), Proj (pr, c2) -> diff --git a/pretyping/evarconv.ml b/pretyping/evarconv.ml index a5311e162d..6a668e79e8 100644 --- a/pretyping/evarconv.ml +++ b/pretyping/evarconv.ml @@ -566,7 +566,7 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) flags env evd pbty in let compare_heads evd = match EConstr.kind evd term, EConstr.kind evd term' with - | Const (c, u), Const (c', u') when Constant.equal c c' -> + | Const (c, u), Const (c', u') when QConstant.equal env c c' -> let u = EInstance.kind evd u and u' = EInstance.kind evd u' in check_strict evd u u' | Const _, Const _ -> UnifFailure (evd, NotSameHead) @@ -844,7 +844,7 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) flags env evd pbty ise_try evd [f1; f2] (* Catch the p.c ~= p c' cases *) - | Proj (p,c), Const (p',u) when Constant.equal (Projection.constant p) p' -> + | Proj (p,c), Const (p',u) when QConstant.equal env (Projection.constant p) p' -> let res = try Some (destApp evd (Retyping.expand_projection env evd p c [])) with Retyping.RetypeError _ -> None @@ -855,7 +855,7 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) flags env evd pbty appr2 | None -> UnifFailure (evd,NotSameHead)) - | Const (p,u), Proj (p',c') when Constant.equal p (Projection.constant p') -> + | Const (p,u), Proj (p',c') when QConstant.equal env p (Projection.constant p') -> let res = try Some (destApp evd (Retyping.expand_projection env evd p' c' [])) with Retyping.RetypeError _ -> None diff --git a/pretyping/evardefine.ml b/pretyping/evardefine.ml index eaf8c65811..13abf47413 100644 --- a/pretyping/evardefine.ml +++ b/pretyping/evardefine.ml @@ -206,7 +206,7 @@ let is_array_const env sigma c = | Const (cst,_) -> (match env.Environ.retroknowledge.Retroknowledge.retro_array with | None -> false - | Some cst' -> Constant.equal cst cst') + | Some cst' -> Environ.QConstant.equal env cst cst') | _ -> false let split_as_array env sigma0 = function diff --git a/pretyping/indrec.ml b/pretyping/indrec.ml index 5be8f9f83c..5ffd919312 100644 --- a/pretyping/indrec.ml +++ b/pretyping/indrec.ml @@ -584,7 +584,7 @@ let build_mutual_induction_scheme env sigma ?(force_mutual=false) = function (List.map (function ((mind',u'),dep',s') -> let (sp',_) = mind' in - if MutInd.equal sp sp' then + if QMutInd.equal env sp sp' then let (mibi',mipi') = lookup_mind_specif env mind' in ((mind',u'),mibi',mipi',dep',s') else diff --git a/pretyping/tacred.ml b/pretyping/tacred.ml index 9d15e98373..d94cae75bd 100644 --- a/pretyping/tacred.ml +++ b/pretyping/tacred.ml @@ -82,7 +82,7 @@ type evaluable_reference = | EvalEvar of EConstr.existential let evaluable_reference_eq sigma r1 r2 = match r1, r2 with -| EvalConst c1, EvalConst c2 -> Constant.equal c1 c2 +| EvalConst c1, EvalConst c2 -> Constant.CanOrd.equal c1 c2 | EvalVar id1, EvalVar id2 -> Id.equal id1 id2 | EvalRel i1, EvalRel i2 -> Int.equal i1 i2 | EvalEvar (e1, ctx1), EvalEvar (e2, ctx2) -> @@ -995,7 +995,7 @@ let whd_simpl_orelse_delta_but_fix env sigma c = | CoFix _ | Fix _ -> s' | Proj (p,t) when (match EConstr.kind sigma constr with - | Const (c', _) -> Constant.equal (Projection.constant p) c' + | Const (c', _) -> Constant.CanOrd.equal (Projection.constant p) c' | _ -> false) -> let npars = Projection.npars p in if List.length stack <= npars then @@ -1101,7 +1101,7 @@ let contextually byhead occs f env sigma t = let match_constr_evaluable_ref sigma c evref = match EConstr.kind sigma c, evref with - | Const (c,u), EvalConstRef c' when Constant.equal c c' -> Some u + | Const (c,u), EvalConstRef c' when Constant.CanOrd.equal c c' -> Some u | Var id, EvalVarRef id' when Id.equal id id' -> Some EInstance.empty | _, _ -> None diff --git a/pretyping/unification.ml b/pretyping/unification.ml index ccfb508964..08303c80d6 100644 --- a/pretyping/unification.ml +++ b/pretyping/unification.ml @@ -547,10 +547,10 @@ let oracle_order env cf1 cf2 = | Some k2 -> match k1, k2 with | IsProj (p, _), IsKey (ConstKey (p',_)) - when Constant.equal (Projection.constant p) p' -> + when Environ.QConstant.equal env (Projection.constant p) p' -> Some (not (Projection.unfolded p)) | IsKey (ConstKey (p,_)), IsProj (p', _) - when Constant.equal p (Projection.constant p') -> + when Environ.QConstant.equal env p (Projection.constant p') -> Some (Projection.unfolded p') | _ -> Some (Conv_oracle.oracle_order (fun x -> x) @@ -796,7 +796,7 @@ let rec unify_0_with_initial_metas (sigma,ms,es as subst : subst0) conv_at_top e | _, LetIn (_,a,_,c) -> unirec_rec curenvnb pb opt substn cM (subst1 a c) (* Fast path for projections. *) - | Proj (p1,c1), Proj (p2,c2) when Constant.equal + | Proj (p1,c1), Proj (p2,c2) when Environ.QConstant.equal env (Projection.constant p1) (Projection.constant p2) -> (try unify_same_proj curenvnb cv_pb {opt with at_top = true} substn c1 c2 @@ -914,7 +914,7 @@ let rec unify_0_with_initial_metas (sigma,ms,es as subst : subst0) conv_at_top e match EConstr.kind sigma c' with | Meta _ -> true | Evar _ -> true - | Const (c, u) -> Constant.equal c (Projection.constant p) + | Const (c, u) -> Environ.QConstant.equal env c (Projection.constant p) | _ -> false in let expand_proj c c' l = |
