X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fcomponents%2Fng_tactics%2FnCicTacReduction.ml;h=96a795c3472e8c4ee1a767edd92bc133af331b82;hb=3f57ed2589601e79478c85d74708d8ebdec2cf20;hp=bc756a9ffffdb9b56b9b03937b7e22e028eb48b4;hpb=751af6075f28fb2abe052de73630ce114e761dee;p=helm.git diff --git a/matita/components/ng_tactics/nCicTacReduction.ml b/matita/components/ng_tactics/nCicTacReduction.ml index bc756a9ff..96a795c34 100644 --- a/matita/components/ng_tactics/nCicTacReduction.ml +++ b/matita/components/ng_tactics/nCicTacReduction.ml @@ -11,29 +11,28 @@ (* $Id: nCic.ml 9058 2008-10-13 17:42:30Z tassi $ *) -let rec normalize ?(delta=0) ~subst ctx t = - 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 rec normalize status ?(delta=0) ~subst ctx t = + normalize_machine status ~delta ~subst ctx + (fst (NCicReduction.reduce_machine status ~delta ~subst ctx (0,[],t,[]))) +and normalize_machine status ?(delta=0) ~subst ctx (k,e,t,s) = 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 + NCicSubstitution.psubst status ~avoid_beta_redexes:true + (fun e -> normalize_machine status ~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 (normalize ~delta ~subst ctx) l in + let l' = List.map (normalize status ~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 (normalize ~delta ~subst) t + | t -> NCicUtils.map status (fun h ctx -> h::ctx) ctx (normalize status ~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)) + (List.map (fun i -> normalize_machine status ~delta ~subst ctx (NCicReduction.from_stack ~delta i)) s)) ;;