diff options
| author | Hugo Herbelin | 2016-09-28 15:29:58 +0200 |
|---|---|---|
| committer | Hugo Herbelin | 2016-09-28 16:14:11 +0200 |
| commit | dfadb394640b3d09eb6134b73d0f3e931bd70af1 (patch) | |
| tree | b7f0bba04890b0c905f06829d97d98642168b38f /interp/notation.ml | |
| parent | 8e0f29cb69f06b64d74b18b09fb6a717034f1140 (diff) | |
Warning about similar notations now up to alpha-conversion.
This allows to define on purpose the very same notation in different
files, as currently the notations for *, +, - in Nat.v and Peano.v
(with the first one using variables n and m and the second one using
the default variables used by Infix, namely x and y).
This makes also the "notation-overridden" warning less enigmatic
facing two notations which are the same up to the choice of names.
Diffstat (limited to 'interp/notation.ml')
| -rw-r--r-- | interp/notation.ml | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/interp/notation.ml b/interp/notation.ml index 0798d385d4..d301ed21db 100644 --- a/interp/notation.ml +++ b/interp/notation.ml @@ -553,15 +553,13 @@ let ntpe_eq t1 t2 = match t1, t2 with | NtnTypeBinderList, NtnTypeBinderList -> true | (NtnTypeConstr | NtnTypeOnlyBinder | NtnTypeConstrList | NtnTypeBinderList), _ -> false - -let vars_eq (id1, (sc1, tp1)) (id2, (sc2, tp2)) = - Id.equal id1 id2 && +let var_attributes_eq (_, (sc1, tp1)) (_, (sc2, tp2)) = pair_eq (Option.equal String.equal) (List.equal String.equal) sc1 sc2 && ntpe_eq tp1 tp2 let interpretation_eq (vars1, t1) (vars2, t2) = - List.equal vars_eq vars1 vars2 && - Notation_ops.eq_notation_constr t1 t2 + List.equal var_attributes_eq vars1 vars2 && + Notation_ops.eq_notation_constr (List.map fst vars1, List.map fst vars2) t1 t2 let exists_notation_in_scope scopt ntn r = let scope = match scopt with Some s -> s | None -> default_scope in |
