diff options
| author | Pierre-Marie Pédrot | 2017-08-02 17:01:17 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2017-08-02 17:01:17 +0200 |
| commit | dbbefa2ed1f858c1a6de77672e3e1733ef4c28bf (patch) | |
| tree | 101f2a30fbde42da7e821dec9a2f16026a28473b | |
| parent | 9088f6db4f56d906d8a18eeaf09c9adbae4a5fd4 (diff) | |
Code factorization in elim notation.
| -rw-r--r-- | theories/Notations.v | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/theories/Notations.v b/theories/Notations.v index 0487e324ca..2d7b4c8a8b 100644 --- a/theories/Notations.v +++ b/theories/Notations.v @@ -36,28 +36,20 @@ Ltac2 Notation "econstructor" := Std.constructor true. Ltac2 Notation "econstructor" n(tactic) bnd(bindings) := Std.constructor_n true n bnd. -Ltac2 eelim c bnd use := +Ltac2 elim0 ev c bnd use := let use := match use with | None => None | Some u => let ((_, c, wth)) := u in Some (c, wth) end in - Std.elim true (c, bnd) use. + Std.elim ev (c, bnd) use. -Ltac2 elim c bnd use := +Ltac2 Notation "elim" c(thunk(constr)) bnd(thunk(bindings)) + use(thunk(opt(seq("using", constr, bindings)))) := Control.with_holes (fun () => c (), bnd (), use ()) - (fun ((c, bnd, use)) => - let use := match use with - | None => None - | Some u => - let ((_, c, wth)) := u in Some (c, wth) - end in - Std.elim false (c, bnd) use). - -Ltac2 Notation "elim" c(thunk(constr)) bnd(thunk(bindings)) - use(thunk(opt(seq("using", constr, bindings)))) := elim c bnd use. + (fun ((c, bnd, use)) => elim0 false c bnd use). Ltac2 Notation "eelim" c(constr) bnd(bindings) use(opt(seq("using", constr, bindings))) := - eelim c bnd use. + elim0 true c bnd use. |
