X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Facic_procedural%2FproceduralOptimizer.ml;h=9d04c2f91f89d0c78667c50f1c5076c56e333065;hb=105e895dd735c2f1ceed588026346e168908ce3a;hp=93cb165452d1996d5d375c9d274f1679e4b6e956;hpb=cf4301b669442bdd78984d3a3a1e38660db1f2ea;p=helm.git diff --git a/helm/software/components/acic_procedural/proceduralOptimizer.ml b/helm/software/components/acic_procedural/proceduralOptimizer.ml index 93cb16545..9d04c2f91 100644 --- a/helm/software/components/acic_procedural/proceduralOptimizer.ml +++ b/helm/software/components/acic_procedural/proceduralOptimizer.ml @@ -72,7 +72,10 @@ let rec opt1_letin g es c name v t = | C.LetIn (nname, vv, tt) when H.is_proof c v -> let x = C.LetIn (nname, vv, C.LetIn (name, tt, S.lift_from 2 1 t)) in HLog.warn "Optimizer: swap 1"; opt1_proof g true c x - | v -> + | v when H.is_proof c v && H.is_atomic v -> + let x = S.subst v t in + HLog.warn "Optimizer: remove 5"; opt1_proof g true c x + | v -> g (C.LetIn (name, v, t)) in if es then opt1_term g es c v else g v @@ -261,12 +264,13 @@ and opt2_term g c t = let optimize_obj = function | C.Constant (name, Some bo, ty, pars, attrs) -> let g bo = - Printf.eprintf "Optimized: %s\nNodes : %u" + Printf.eprintf "Optimized : %s\nPost Nodes: %u\n" (Pp.ppterm bo) (I.count_nodes 0 bo); let _ = H.get_type [] (C.Cast (bo, ty)) in C.Constant (name, Some bo, ty, pars, attrs) in - Printf.eprintf "BEGIN: %s\n" name; + Printf.eprintf "BEGIN: %s\nPre Nodes : %u\n" + name (I.count_nodes 0 bo); begin try opt1_term g (* (opt2_term g []) *) true [] bo with e -> failwith ("PPP: " ^ Printexc.to_string e) end | obj -> obj