X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fng_tactics%2FnCicTacReduction.ml;fp=helm%2Fsoftware%2Fcomponents%2Fng_tactics%2FnCicTacReduction.ml;h=bc756a9ffffdb9b56b9b03937b7e22e028eb48b4;hb=073654937929574a9448ed01b340a2928d77dbec;hp=3236956fd26e1c92dcbc36f6bb90fa1ab39b28cc;hpb=4e251fb6d7fab1c489c5141759bb896f116b1b91;p=helm.git diff --git a/helm/software/components/ng_tactics/nCicTacReduction.ml b/helm/software/components/ng_tactics/nCicTacReduction.ml index 3236956fd..bc756a9ff 100644 --- a/helm/software/components/ng_tactics/nCicTacReduction.ml +++ b/helm/software/components/ng_tactics/nCicTacReduction.ml @@ -12,13 +12,28 @@ (* $Id: nCic.ml 9058 2008-10-13 17:42:30Z tassi $ *) let rec normalize ?(delta=0) ~subst ctx t = - let aux = normalize ~delta ~subst in - match NCicReduction.whd ~delta ~subst ctx t with + normalize_machine ~delta ~subst ctx + (fst (NCicReduction.reduce_machine ~delta ~subst ctx (0,[],t,[]))) +and normalize_machine ?(delta=0) ~subst ctx (k,e,t,s) = + assert (delta=0); + let t = + if k = 0 then t + else + NCicSubstitution.psubst ~avoid_beta_redexes:true + (fun e -> normalize_machine ~delta ~subst ctx (NCicReduction.from_env ~delta e)) e t in + let t = + match t with NCic.Meta (n,(s,lc)) -> let l = NCicUtils.expand_local_context lc in - let l' = List.map (aux ctx) l in + let l' = List.map (normalize ~delta ~subst ctx) l in if l = l' then t else NCic.Meta (n,(s,NCic.Ctx l)) - | t -> NCicUtils.map (fun h ctx -> h::ctx) ctx aux t + | t -> NCicUtils.map (fun h ctx -> h::ctx) ctx (normalize ~delta ~subst) t + in + if s = [] then t + else + NCic.Appl + (t:: + (List.map (fun i -> normalize_machine ~delta ~subst ctx (NCicReduction.from_stack ~delta i)) s)) ;;