aboutsummaryrefslogtreecommitdiffhomepage
path: root/tactics
diff options
context:
space:
mode:
authorGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>2002-09-16 08:42:17 +0000
committerGravatar filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7>2002-09-16 08:42:17 +0000
commitdc5169d0e4bdf6569c3776aff819bfcb383379a9 (patch)
tree6841134c530b143de7cb9fdb84457762438c5c26 /tactics
parent71e33ac1aea6cff72245ea4725a70d251441a7a5 (diff)
Subst (tout court)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3007 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tactics')
-rw-r--r--tactics/equality.ml10
-rw-r--r--tactics/equality.mli2
-rw-r--r--tactics/extratactics.ml41
3 files changed, 13 insertions, 0 deletions
diff --git a/tactics/equality.ml b/tactics/equality.ml
index 801c9c85f..da35ef0d1 100644
--- a/tactics/equality.ml
+++ b/tactics/equality.ml
@@ -1237,3 +1237,13 @@ let rec subst = function
| [] -> tclIDTAC
| x :: r -> tclTHEN (subst_one x) (subst r)
+let subst_all gl =
+ let eqpat = build_coq_eq_pattern () in
+ let test (_,c) =
+ if not (is_matching eqpat c) then failwith "caught";
+ let (_,x,_) = match_eq eqpat c in
+ match kind_of_term x with Var x -> x | _ -> failwith "caught"
+ in
+ let ids = map_succeed test (pf_hyps_types gl) in
+ let ids = list_uniquize ids in
+ subst ids gl
diff --git a/tactics/equality.mli b/tactics/equality.mli
index 57715afdc..871444c21 100644
--- a/tactics/equality.mli
+++ b/tactics/equality.mli
@@ -92,3 +92,5 @@ val discriminable : env -> evar_map -> constr -> constr -> bool
(* Subst *)
val subst : identifier list -> tactic
+val subst_all : tactic
+
diff --git a/tactics/extratactics.ml4 b/tactics/extratactics.ml4
index b1aa23179..6907acd35 100644
--- a/tactics/extratactics.ml4
+++ b/tactics/extratactics.ml4
@@ -219,5 +219,6 @@ END
TACTIC EXTEND Subst
| [ "Subst" ne_ident_list(l) ] -> [ subst l ]
+| [ "Subst" ] -> [ subst_all ]
END