X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Focaml%2Ftactics%2FreductionTactics.ml;h=5a567b84aa75e6056814d845ea1a35e6d81a6120;hb=d651bf2e3d560e194fbe948dd950dd600a40eab6;hp=b29873a1fceae31c4521c231bfd503ce29b65585;hpb=bac72fcaa876137ab7a5630e0c1badc2a627dce8;p=helm.git diff --git a/helm/ocaml/tactics/reductionTactics.ml b/helm/ocaml/tactics/reductionTactics.ml index b29873a1f..5a567b84a 100644 --- a/helm/ocaml/tactics/reductionTactics.ml +++ b/helm/ocaml/tactics/reductionTactics.ml @@ -26,7 +26,7 @@ (* let reduction_tac ~reduction ~status:(proof,goal) = let curi,metasenv,pbo,pty = proof in - let metano,context,ty = List.find (function (m,_,_) -> m=goal) metasenv in + let metano,context,ty = CicUtil.lookup_meta goal metasenv in let new_ty = reduction context ty in let new_metasenv = List.map @@ -42,7 +42,7 @@ let reduction_tac ~reduction ~status:(proof,goal) = (* The default of term is the thesis of the goal to be prooved *) let reduction_tac ~also_in_hypotheses ~reduction ~terms ~status:(proof,goal) = let curi,metasenv,pbo,pty = proof in - let metano,context,ty = List.find (function (m,_,_) -> m=goal) metasenv in + let metano,context,ty = CicUtil.lookup_meta goal metasenv in let terms = match terms with None -> [ty] | Some l -> l in @@ -69,11 +69,12 @@ let reduction_tac ~also_in_hypotheses ~reduction ~terms ~status:(proof,goal) = List.fold_right (fun entry context -> match entry with - Some (name,Cic.Def t) -> - (Some (name,Cic.Def (replace context t)))::context + Some (name,Cic.Def (t,None)) -> + (Some (name,Cic.Def ((replace context t),None)))::context | Some (name,Cic.Decl t) -> (Some (name,Cic.Decl (replace context t)))::context | None -> None::context + | Some (_,Cic.Def (_,Some _)) -> assert false ) context [] else context @@ -94,7 +95,7 @@ let whd_tac = reduction_tac ~reduction:CicReduction.whd ;; let fold_tac ~reduction ~also_in_hypotheses ~term ~status:(proof,goal) = let curi,metasenv,pbo,pty = proof in - let metano,context,ty = List.find (function (m,_,_) -> m=goal) metasenv in + let metano,context,ty = CicUtil.lookup_meta goal metasenv in let term' = reduction context term in (* We don't know if [term] is a subterm of [ty] or a subterm of *) (* the type of one metavariable. So we replace it everywhere. *) @@ -110,8 +111,9 @@ let fold_tac ~reduction ~also_in_hypotheses ~term ~status:(proof,goal) = List.map (function Some (n,Cic.Decl t) -> Some (n,Cic.Decl (replace t)) - | Some (n,Cic.Def t) -> Some (n,Cic.Def (replace t)) + | Some (n,Cic.Def (t,None)) -> Some (n,Cic.Def ((replace t),None)) | None -> None + | Some (_,Cic.Def (_,Some _)) -> assert false ) context else context