diff options
author | msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-01-30 04:21:51 +0000 |
---|---|---|
committer | msozeau <msozeau@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2008-01-30 04:21:51 +0000 |
commit | 2b9f73c7e86ac718c0ce4c47d6a24ffc2d01499d (patch) | |
tree | 4036fe3c992e406c790d165b17424c3530653277 /theories/Program/Tactics.v | |
parent | 90b063be6b3c23a54e1d59974e09ee14f2941338 (diff) |
Work on dependent induction tactic and friends, finish the test-suite example
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10487 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'theories/Program/Tactics.v')
-rw-r--r-- | theories/Program/Tactics.v | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/theories/Program/Tactics.v b/theories/Program/Tactics.v index ad03de2f4..bb06f37b5 100644 --- a/theories/Program/Tactics.v +++ b/theories/Program/Tactics.v @@ -8,7 +8,8 @@ (*i $Id$ i*) -(** This module implements various tactics used to simplify the goals produced by Program. *) +(** This module implements various tactics used to simplify the goals produced by Program, + which are also generally useful. *) (** Destructs one pair, without care regarding naming. *) @@ -166,6 +167,23 @@ Ltac add_hypothesis H' p := end end. +Tactic Notation "pose" constr(c) "as" ident(H) := assert(H:=c). + +(** A tactic to refine an hypothesis by supplying some of its arguments. *) + +Ltac refine_hyp c := + let H' := fresh "H" in + let tac H := assert(H' := c) ; clear H ; rename H' into H in + match c with + | ?H _ => tac H + | ?H _ _ => tac H + | ?H _ _ _ => tac H + | ?H _ _ _ _ => tac H + | ?H _ _ _ _ _ => tac H + | ?H _ _ _ _ _ _ => tac H + | ?H _ _ _ _ _ _ _ => tac H + | ?H _ _ _ _ _ _ _ _ => tac H + end. (** The default simplification tactic used by Program is defined by [program_simpl], sometimes [auto with *] is overkill and slows things down, better rebind using [Obligations Tactic := tac] in this case, @@ -175,6 +193,6 @@ Ltac program_simplify := simpl ; intros ; destruct_conjs ; simpl proj1_sig in * ; subst* ; try autoinjection ; try discriminates ; try (solve [ red ; intros ; destruct_conjs ; try autoinjection ; discriminates ]). -Ltac default_program_simpl := program_simplify ; auto with *. +Ltac program_simpl := program_simplify ; auto with *. -Ltac program_simpl := default_program_simpl. +Ltac obligations_tactic := program_simpl. |