Skip to content

Instantly share code, notes, and snippets.

@gdsfh
Created January 20, 2013 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gdsfh/4578089 to your computer and use it in GitHub Desktop.
Save gdsfh/4578089 to your computer and use it in GitHub Desktop.
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