let maxwidth = ref 3;;
type new_proof =
- Equality.goal_proof * Equality.proof * Subst.substitution * Cic.metasenv
+ Equality.goal_proof * Equality.proof * int * Subst.substitution * Cic.metasenv
type result =
| ParamodulationFailure of string
| ParamodulationSuccess of new_proof
;;
let check_if_goal_is_subsumed ((_,ctx,_) as env) table (goalproof,menv,ty) =
-(* let names = names_of_context ctx in*)
-(* Printf.eprintf "check_goal_subsumed: %s\n" (CicPp.pp ty names);*)
+ let names = names_of_context ctx in
+ Printf.eprintf "check_goal_subsumed: %s\n" (CicPp.pp ty names);
match ty with
| Cic.Appl[Cic.MutInd(uri,_,_);eq_ty;left;right]
when UriManager.eq uri (LibraryObjects.eq_URI ()) ->
(* match Indexing.subsumption env table goal_equation with*)
match Indexing.unification env table goal_equation with
| Some (subst, equality ) ->
+ prerr_endline
+ ("GOAL SUBSUMED BY: " ^ Equality.string_of_equality equality);
+ prerr_endline ("SUBST:" ^ Subst.ppsubst subst);
let (_,p,(ty,l,r,_),m,id) = Equality.open_equality equality in
let cicmenv = Subst.apply_subst_metasenv subst (m @ menv) in
- Some (goalproof, p, subst, cicmenv)
+ Some (goalproof, p, id, subst, cicmenv)
| None -> None)
| _ -> None
;;
| (goalproof,m,Cic.Appl[Cic.MutInd(uri,_,ens);eq_ty;left;right])::_
when left = right && iseq uri ->
let reflproof = Equality.Exact (Equality.refl_proof eq_ty left) in
- true, Some (goalproof, reflproof, Subst.empty_subst,m)
+ true, Some (goalproof, reflproof, 0, Subst.empty_subst,m)
| goal::_ ->
(match check_if_goal_is_subsumed env (snd active) goal with
| None -> false,None
| (goalproof,m,Cic.Appl[Cic.MutInd(uri,_,ens);eq_ty;left;right])
when left = right && iseq uri ->
let reflproof = Equality.Exact (Equality.refl_proof eq_ty left) in
- Some (goalproof, reflproof,Subst.empty_subst,m)
+ Some (goalproof, reflproof, 0, Subst.empty_subst,m)
| _ -> None
;;
*)
let goals = make_goal_set goal in
let max_iterations = 1000 in
- let max_time = Unix.gettimeofday () +. 120. (* minutes *) in
+ let max_time = Unix.gettimeofday () +. 300. (* minutes *) in
given_clause env goals theorems passive active max_iterations max_time
in
let finish = Unix.gettimeofday () in
| ParamodulationFailure s ->
raise (ProofEngineTypes.Fail (lazy ("NO proof found: " ^ s)))
| ParamodulationSuccess
- (goalproof,newproof,subsumption_subst, proof_menv) ->
+ (goalproof,newproof,subsumption_id,subsumption_subst, proof_menv) ->
prerr_endline "OK, found a proof!";
- prerr_endline (Equality.pp_proof names goalproof newproof);
+ prerr_endline
+ (Equality.pp_proof names goalproof newproof subsumption_subst
+ subsumption_id type_of_goal);
prerr_endline (CicMetaSubst.ppmetasenv [] proof_menv);
prerr_endline "ENDOFPROOFS";
(* generation of the CIC proof *)
(Cic.Meta(i,irl)) ::acc3,Some (Cic.Meta(i,irl)))
([],[],[],None) proof_menv
in
-prerr_endline ("RIMPIAZZATO CON " ^ match free_meta with None -> "?" | Some m -> CicPp.ppterm m);
-
let replace where =
+ (* we need this fake equality since the metas of the hypothesis may be
+ * with a real local context *)
ProofEngineReduction.replace_lifting
- ~equality:(=) ~what ~with_what ~where
+ ~equality:(fun x y ->
+ match x,y with Cic.Meta(i,_),Cic.Meta(j,_) -> i=j | _-> false)
+ ~what ~with_what ~where
in
let goal_proof = replace goal_proof in
(* ok per le meta libere... ma per quelle che c'erano e sono rimaste?
| CicTypeChecker.AssertFailure _
| Invalid_argument "list_fold_left2" as exn ->
prerr_endline "THE PROOF DOES NOT TYPECHECK!";
-(* prerr_endline (CicPp.pp goal_proof names); *)
+ prerr_endline (CicPp.pp goal_proof names);
+ prerr_endline "THE PROOF DOES NOT TYPECHECK!";
raise exn
in
let proof, real_metasenv =