]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/acic_procedural/proceduralOptimizer.ml
Fix : wrong exception was catch in apply_subst
[helm.git] / helm / software / components / acic_procedural / proceduralOptimizer.ml
index 8a7e5bea5047cd0e3bcdddc9b9d50e130834751d..2faade402402068c51a1137976cd2c91facd5dd9 100644 (file)
@@ -42,7 +42,7 @@ module Cl   = ProceduralClassify
 
 (* debugging ****************************************************************)
 
-let debug = ref false
+let debug = ref true
 
 (* term optimization ********************************************************)
 
@@ -192,6 +192,10 @@ and opt_mutcase_critical g st es c uri tyno outty arg cases =
       opt_mutcase_plain g st es c uri tyno outty arg cases
    else
    let predicate = clear_absts rpsno (1 - sort_disp) outty in   
+   if H.occurs c ~what:(C.Rel 0) ~where:predicate then
+(* FG: the transformation is not possible, we fall back into the plain case *)
+      opt_mutcase_plain g st es c uri tyno outty arg cases
+   else
    let is_recursive t =
       I.S.mem tyno (I.get_mutinds_of_uri uri t) 
    in