X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_kernel%2FnCicUntrusted.ml;h=4dcf01c53b1a43f2793cf29ca374e456cbdba62c;hb=ffdd3ddd6ce10a5fa0729ab407647bd46c44b9d8;hp=d7635fe8860ef409efa5534aa255d3ba263562dc;hpb=62f476a05884d451bfb90d845ea2b1c0a1c77f96;p=helm.git diff --git a/helm/software/components/ng_kernel/nCicUntrusted.ml b/helm/software/components/ng_kernel/nCicUntrusted.ml index d7635fe88..4dcf01c53 100644 --- a/helm/software/components/ng_kernel/nCicUntrusted.ml +++ b/helm/software/components/ng_kernel/nCicUntrusted.ml @@ -22,15 +22,23 @@ let map_term_fold_a g k f a = function | C.Rel _ as t -> a,t | C.Appl [] | C.Appl [_] -> assert false | C.Appl l as orig -> + let fire_beta, upto = + match l with C.Meta _ :: _ -> true, List.length l - 1 | _ -> false, 0 + in let a,l1 = (* sharing fold? *) List.fold_right (fun t (a,l) -> let a,t = f k a t in a, t :: l) l (a,[]) in - a, if l1 == l then orig else (match l1 with - | C.Appl l :: tl -> C.Appl (l@tl) - | _ -> C.Appl l1) + a, if l1 == l then orig else + let t = + match l1 with + | C.Appl l :: tl -> C.Appl (l@tl) + | _ -> C.Appl l1 + in + if fire_beta then NCicReduction.head_beta_reduce ~upto t + else t | C.Prod (n,s,t) as orig -> let a,s1 = f k a s in let a,t1 = f (g (n,C.Decl s) k) a t in a, if t1 == t && s1 == s then orig else C.Prod (n,s1,t1)