diff options
| author | Hugo Herbelin | 2015-01-01 09:32:02 +0100 |
|---|---|---|
| committer | Hugo Herbelin | 2015-01-01 09:35:58 +0100 |
| commit | 3bd9cb26be01d0791fdf2dc56d3aacaa1379e50c (patch) | |
| tree | 6771bc930f8ec5eb67f7eb388f7b16c6a74faa8f | |
| parent | 47b8109321446ebf153807fe8a26151c7c0b003a (diff) | |
An optimization in the use of unification candidates so as to get the
following working:
Definition test {A B:Type} {H:A=B} (a:A) : B := rew H in a.
| -rw-r--r-- | pretyping/evarconv.ml | 9 | ||||
| -rw-r--r-- | test-suite/success/evars.v | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/pretyping/evarconv.ml b/pretyping/evarconv.ml index c20235f539..e906629508 100644 --- a/pretyping/evarconv.ml +++ b/pretyping/evarconv.ml @@ -480,8 +480,15 @@ and evar_eqappr_x ?(rhs_is_already_stuck = false) ts env evd pbty [eta;(* Postpone the use of an heuristic *) (fun i -> if not (occur_rigidly (fst ev) i tR) then + let i,tF = + if isRel tR || isVar tR then + (* Optimization so as to generate candidates *) + let i,ev = evar_absorb_arguments env i ev lF in + i,mkEvar ev + else + i,Stack.zip apprF in switch (fun x y -> Success (add_conv_pb (pbty,env,x,y) i)) - (Stack.zip apprF) tR + tF tR else UnifFailure (evd,OccurCheck (fst ev,tR)))]) ev lF tR evd diff --git a/test-suite/success/evars.v b/test-suite/success/evars.v index f42c6a036e..4e2bf45118 100644 --- a/test-suite/success/evars.v +++ b/test-suite/success/evars.v @@ -408,3 +408,10 @@ Check match Some _ with None => _ | _ => _ end. (* Used to fail for a couple of days in Nov 2014 *) Axiom test : forall P1 P2, P1 = P2 -> P1 -> P2. + +(* Check use of candidates *) + +Import EqNotations. +Definition test2 {A B:Type} {H:A=B} (a:A) : B := rew H in a. + + |
