]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/acic_procedural/proceduralOptimizer.ml
- Coq/preamble: missing alias added
[helm.git] / helm / software / components / acic_procedural / proceduralOptimizer.ml
index f1840cf7c95c75cf37877712fdfa70fdb66caa34..a05bbd26d8df836d422b6fee82dd838b44840281 100644 (file)
@@ -209,8 +209,14 @@ and opt_mutcase_critical g st es c uri tyno outty arg cases =
    opt_proof g (info st "Optimizer: remove 3") es c x
 
 and opt_mutcase_plain g st es c uri tyno outty arg cases =
-   let g st v ts = g st (C.MutCase (uri, tyno, outty, v, ts)) in
-   g st arg cases
+   let g st v =
+      let g (st, ts) = g st (C.MutCase (uri, tyno, outty, v, ts)) in
+      let map h v (st, vs) =
+         let h st vv = h (st, vv :: vs) in opt_proof h st es c v
+      in
+      if es then H.list_fold_right_cps g map cases (st, []) else g (st, cases)
+   in
+   if es then opt_proof g st es c arg else g st arg
 
 and opt_mutcase g =
    if !critical then opt_mutcase_critical g else opt_mutcase_plain g