aboutsummaryrefslogtreecommitdiffhomepage
path: root/tactics/inv.ml
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-04-13 21:41:54 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2008-04-13 21:41:54 +0000
commitbd0219b62a60cfc58c3c25858b41a005727c68be (patch)
treed718b8cca8d3e1f9c5c75a4be8e90dcd0f2f009c /tactics/inv.ml
parentdb49598f897eec7482e2c26a311f77a52201416e (diff)
Bugs, nettoyage, et améliorations diverses
- vérification de la cohérence des ident pour éviter une option -R avec des noms non parsables (la vérification est faite dans id_of_string ce qui est très exigeant; faudrait-il une solution plus souple ?) - correction message d'erreur inapproprié dans le apply qui descend dans les conjonctions - nettoyage autour de l'échec en présence de métas dans le prim_refiner - nouveau message d'erreur quand des variables ne peuvent être instanciées - quelques simplifications et davantage de robustesse dans inversion - factorisation du code de constructor and co avec celui de econstructor and co Documentation des tactiques - edestruct/einduction/ecase/eelim et nouveautés apply - nouvelle sémantique des intropatterns disjonctifs et documentation des pattern -> et <- - relecture de certaines parties du chapitre tactique git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10785 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'tactics/inv.ml')
-rw-r--r--tactics/inv.ml15
1 files changed, 7 insertions, 8 deletions
diff --git a/tactics/inv.ml b/tactics/inv.ml
index 55b8d08c6..03eaf2d4d 100644
--- a/tactics/inv.ml
+++ b/tactics/inv.ml
@@ -449,16 +449,15 @@ let rewrite_equations_tac (gene, othin) id neqns names ba =
let raw_inversion inv_kind id status names gl =
let env = pf_env gl and sigma = project gl in
let c = mkVar id in
- let t = strong_prodspine (pf_whd_betadeltaiota gl) (pf_type_of gl c) in
+ let (ind,t) =
+ try pf_reduce_to_quantified_ind gl (pf_type_of gl c)
+ with UserError _ ->
+ errorlabstrm "raw_inversion"
+ (str ("The type of "^(string_of_id id)^" is not inductive")) in
let indclause = mk_clenv_from gl (c,t) in
- let newc = clenv_value indclause in
let ccl = clenv_type indclause in
check_no_metas indclause ccl;
- let IndType (indf,realargs) =
- try find_rectype env sigma ccl
- with Not_found ->
- errorlabstrm "raw_inversion"
- (str ("The type of "^(string_of_id id)^" is not inductive")) in
+ let IndType (indf,realargs) = find_rectype env sigma ccl in
let (elim_predicate,neqns) =
make_inv_predicate env sigma indf realargs id status (pf_concl gl) in
let (cut_concl,case_tac) =
@@ -473,7 +472,7 @@ let raw_inversion inv_kind id status names gl =
(true_cut Anonymous cut_concl)
[case_tac names
(introCaseAssumsThen (rewrite_equations_tac inv_kind id neqns))
- (Some elim_predicate) ([],[]) newc;
+ (Some elim_predicate) ([],[]) ind indclause;
onLastHyp
(fun id ->
(tclTHEN