diff options
author | 2008-03-01 01:59:59 +0000 | |
---|---|---|
committer | 2008-03-01 01:59:59 +0000 | |
commit | 0d62e3344d7f69c0296c347c7aeddabd09bbab60 (patch) | |
tree | 38032050565becc6868e462956caeca0367c3a0a /proofs/tacexpr.ml | |
parent | 50d4df2da89461f280c302d032422856f8e77991 (diff) |
Rework on rich forms of rewrite
1) changed the semantics of rewrite H,H' : the earlier semantics
(rewrite H,H' == rewrite H; rewrite H') was poorly suited for
situations where first rewrite H generates side-conditions.
New semantics is tclTHENFIRST instead of tclTHEN, that is
side-conditions are left untouched.
Note to myself: check if side-effect-come-first bug of
setoid rewrite is still alive, and do something if yes
2) new syntax for rewriting something many times. This syntax is
shamelessly taken from ssreflect:
rewrite ?H means "H as many times as possible"
(i.e. almost repeat rewrite H, except that
possible side-conditions are left apart as in 1)
rewrite !H means "at least once" (i.e. rewrite H; repeat rewrite H)
rewrite 3?H means "up to 3 times", maybe less
(i.e. something like: do 3 (try rewrite H)).
rewrite 3!H means "exactly 3 times" (i.e. almost do 3 rewrite H).
For instance: rewrite 3?foo, <-2!bar in H1,H2|-*
3) By the way, for a try, I've enabled the syntax +/- as synonyms for
->/<- in the orientation of rewrite.
Comments welcome ...
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@10612 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'proofs/tacexpr.ml')
-rw-r--r-- | proofs/tacexpr.ml | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/proofs/tacexpr.ml b/proofs/tacexpr.ml index 09d5c0516..a63fd1aeb 100644 --- a/proofs/tacexpr.ml +++ b/proofs/tacexpr.ml @@ -99,6 +99,12 @@ let simple_clause_of = function | { onhyps = Some []; onconcl = true; concl_occs=[] } -> None | _ -> error "not a simple clause (one hypothesis or conclusion)" +type multi = + | Precisely of int + | UpTo of int + | RepeatStar + | RepeatPlus + type pattern_expr = constr_expr (* Type of patterns *) @@ -187,7 +193,8 @@ type ('constr,'pat,'cst,'ind,'ref,'id,'tac) gen_atomic_tactic_expr = | TacTransitivity of 'constr (* Equality and inversion *) - | TacRewrite of evars_flag * (bool * 'constr with_bindings) list * 'id gclause + | TacRewrite of + evars_flag * (bool * multi * 'constr with_bindings) list * 'id gclause | TacInversion of ('constr,'id) inversion_strength * quantified_hypothesis (* For ML extensions *) |