Created
January 20, 2013 11:47
-
-
Save gdsfh/4578089 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Require Import String. | |
Definition named_goal (A : Type) (s : string) := A. | |
Notation _as s := (_ : named_goal _ s). | |
Tactic Notation "proving" "goal" constr(name) := | |
match goal with | |
| |- named_goal _ name => unfold named_goal | |
| _ => fail 1 "current goal is not '" name "'" | |
end | |
. | |
(* example: *) | |
Goal (nat * nat). | |
refine ( (_as "a", _as "b") ). | |
(* proving goal "b"%string. <-- error *) | |
proving goal "a"%string. | |
exact 1. | |
proving goal "b"%string. | |
exact 2. | |
Defined. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment