aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel/typeops.ml
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-09-04 21:36:17 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2011-09-04 21:36:17 +0000
commit82406b12adc9f59a186a38f863b0180855314b50 (patch)
tree4308eb8ae1202d5b211eaaf9007601e2e2993a6e /kernel/typeops.ml
parentb08076bc71c7813038f2cefedff9c5b678d225a8 (diff)
Having added a special Cast for remembering the use of conversion
tactic steps (r14407) increased the size of proof-terms, leading in some cases (e.g. in Nijmegen/Algebra) to calls to simpl becoming extremely costly on such terms built with tactics. We try as a workaround to remove the newly introduced Cast after it has been used by the type-checking algorithm. We incidentally fixed eq_constr which was not fully transparent wrt casts. We also removed useless code in judge_of_apply (has_revert). Note: checker still to be updated to reflect a possible use of this new kind of cast. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14448 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/typeops.ml')
-rw-r--r--kernel/typeops.ml21
1 files changed, 12 insertions, 9 deletions
diff --git a/kernel/typeops.ml b/kernel/typeops.ml
index 9173ab8cd..6e0e098c0 100644
--- a/kernel/typeops.ml
+++ b/kernel/typeops.ml
@@ -191,8 +191,6 @@ let judge_of_letin env name defj typj j =
(* Type of an application. *)
-let has_revert c = match kind_of_term c with Cast (c,REVERTcast,_) -> true | _ -> false
-
let judge_of_apply env funj argjv =
let rec apply_rec n typ cst = function
| [] ->
@@ -203,8 +201,7 @@ let judge_of_apply env funj argjv =
(match kind_of_term (whd_betadeltaiota env typ) with
| Prod (_,c1,c2) ->
(try
- let l2r = has_revert hj.uj_val in
- let c = conv_leq l2r env hj.uj_type c1 in
+ let c = conv_leq false env hj.uj_type c1 in
let cst' = union_constraints cst c in
apply_rec (n+1) (subst1 hj.uj_val c2) cst' restjl
with NotConvertible ->
@@ -268,12 +265,18 @@ let judge_of_product env name t1 t2 =
let judge_of_cast env cj k tj =
let expected_type = tj.utj_val in
try
- let cst =
+ let c, cst =
match k with
- | VMcast -> vm_conv CUMUL env cj.uj_type expected_type
- | DEFAULTcast -> conv_leq false env cj.uj_type expected_type
- | REVERTcast -> conv_leq true env cj.uj_type expected_type in
- { uj_val = mkCast (cj.uj_val, k, expected_type);
+ | VMcast ->
+ mkCast (cj.uj_val, k, expected_type),
+ vm_conv CUMUL env cj.uj_type expected_type
+ | DEFAULTcast ->
+ mkCast (cj.uj_val, k, expected_type),
+ conv_leq false env cj.uj_type expected_type
+ | REVERTcast ->
+ cj.uj_val,
+ conv_leq true env cj.uj_type expected_type in
+ { uj_val = c;
uj_type = expected_type },
cst
with NotConvertible ->