From 2b9f73c7e86ac718c0ce4c47d6a24ffc2d01499d Mon Sep 17 00:00:00 2001 From: msozeau Date: Wed, 30 Jan 2008 04:21:51 +0000 Subject: 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 --- theories/Program/Tactics.v | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'theories/Program/Tactics.v') 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. -- cgit v1.2.3