(* $Id$ *)
-open ProofEngineHelpers
open ProofEngineTypes
exception TheTypeOfTheCurrentGoalIsAMetaICannotChooseTheRightElimiantionPrinciple
let new_metasenv_and_unify_and_t newmeta' metasenv' context term' ty termty goal_arity =
let (consthead,newmetasenv,arguments,_) =
- saturate_term newmeta' metasenv' context termty goal_arity in
+ ProofEngineHelpers.saturate_term newmeta' metasenv' context termty
+ goal_arity in
let subst,newmetasenv',_ =
CicUnification.fo_unif newmetasenv context consthead ty CicUniv.empty_ugraph
in
CicMetaSubst.apply_subst ((metano,(context,bo',Cic.Implicit None))::subst)
in
let (newproof, newmetasenv''') =
- subst_meta_and_metasenv_in_proof proof metano subst_in newmetasenv''
+ ProofEngineHelpers.subst_meta_and_metasenv_in_proof proof metano subst_in
+ newmetasenv''
in
(((metano,(context,bo',Cic.Implicit None))::subst)(* subst_in *), (* ALB *)
(newproof,
let module R = CicReduction in
let (_,metasenv,_,_) = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
- let newmeta = new_meta_of_proof ~proof in
+ let newmeta = ProofEngineHelpers.new_meta_of_proof ~proof in
let (context',ty',bo') =
lambda_abstract ?howmany metasenv context newmeta ty mk_fresh_name_callback
in
let (newproof, _) =
- subst_meta_in_proof proof metano bo' [newmeta,context',ty']
+ ProofEngineHelpers.subst_meta_in_proof proof metano bo'
+ [newmeta,context',ty']
in
(newproof, [newmeta])
in
let module C = Cic in
let curi,metasenv,pbo,pty = proof in
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
- let newmeta1 = new_meta_of_proof ~proof in
+ let newmeta1 = ProofEngineHelpers.new_meta_of_proof ~proof in
let newmeta2 = newmeta1 + 1 in
let fresh_name =
mk_fresh_name_callback metasenv context (Cic.Name "Hcut") ~typ:term in
C.Meta (newmeta2,irl2)]
in
let (newproof, _) =
- subst_meta_in_proof proof metano bo'
+ ProofEngineHelpers.subst_meta_in_proof proof metano bo'
[newmeta2,context,term; newmeta1,context_for_newmeta1,newmeta1ty];
in
(newproof, [newmeta1 ; newmeta2])
"You can't letin a term containing the current goal"));
let _,_ =
CicTypeChecker.type_of_aux' metasenv context term CicUniv.empty_ugraph in
- let newmeta = new_meta_of_proof ~proof in
+ let newmeta = ProofEngineHelpers.new_meta_of_proof ~proof in
let fresh_name =
mk_fresh_name_callback metasenv context (Cic.Name "Hletin") ~typ:term in
let context_for_newmeta =
let newmetaty = CicSubstitution.lift 1 ty in
let bo' = C.LetIn (fresh_name,term,C.Meta (newmeta,irl)) in
let (newproof, _) =
- subst_meta_in_proof
+ ProofEngineHelpers.subst_meta_in_proof
proof metano bo'[newmeta,context_for_newmeta,newmetaty]
in
(newproof, [newmeta])
if b then
begin
let (newproof, metasenv') =
- subst_meta_in_proof proof metano term [] in
+ ProofEngineHelpers.subst_meta_in_proof proof metano term [] in
(newproof, [])
end
else
let letout_tac (proof, goal) =
let curi, metasenv, pbo, pty = proof in
let metano, context, ty = CicUtil.lookup_meta goal metasenv in
- let newmeta = new_meta_of_proof ~proof in
+ let newmeta = ProofEngineHelpers.new_meta_of_proof ~proof in
let fresh_name = mk_fresh_name_callback metasenv context (Cic.Name "hole") ~typ:term in
let context_for_newmeta = None :: context in
let irl = CicMkImplicit.identity_relocation_list_for_metavariable context_for_newmeta in
let newmetaty = CicSubstitution.lift 1 ty in
let bo' = C.LetIn (fresh_name, term, C.Meta (newmeta,irl)) in
- let newproof, _ = subst_meta_in_proof proof metano bo'[newmeta,context_for_newmeta,newmetaty] in
+ let newproof, _ = ProofEngineHelpers.subst_meta_in_proof proof metano bo'[newmeta,context_for_newmeta,newmetaty] in
newproof, [newmeta]
in
mk_tactic letout_tac