active, passive, newa, newp *)
;;
-
let close env new' given =
let new_pos, new_table, min_weight =
List.fold_left
when left = right && iseq uri ->
let reflproof = Equality.Exact (Equality.refl_proof eq_ty left) in
Some (goalproof, reflproof, 0, Subst.empty_subst,m)
+ | (goalproof,m,Cic.Appl[Cic.MutInd(uri,_,ens);eq_ty;left;right])
+ when iseq uri ->
+ (let _,context,_ = env in
+ try
+ let s,m,_ =
+ Inference.unification m m context left right CicUniv.empty_ugraph
+ in
+ let reflproof = Equality.Exact (Equality.refl_proof eq_ty left) in
+ let m = Subst.apply_subst_metasenv s m in
+ Some (goalproof, reflproof, 0, s,m)
+ with _ -> None)
| _ -> None
;;
let infer_goal_set_with_current env current goals =
let active_goals, passive_goals = goals in
let _,table,_ = build_table [current] in
+ let _,_,_,_,id = Equality.open_equality current in
active_goals,
List.fold_left
(fun acc g ->
let new' = Indexing.superposition_left env table g in
+ if id = 2 then
+ begin
+ prerr_endline "XXXXXXX";
+ List.iter (fun _,_,e -> prerr_endline (CicPp.ppterm e)) new' ;
+ end;
acc @ new')
passive_goals active_goals
;;
let given_clause
((_,context,_) as env) goals theorems passive active max_iterations max_time
=
+ let names = names_of_context context in
let initial_time = Unix.gettimeofday () in
let iterations_left iterno =
let now = Unix.gettimeofday () in
ParamodulationFailure "No more passive"(*maybe this is a success! *)
else
begin
+ let goals = infer_goal_set env active goals in
+ let goals = infer_goal_set env active goals in
let goals = infer_goal_set env active goals in
let current, passive = select env goals passive in
+ let _,_,goaltype = List.hd (fst goals) in
+ prerr_endline (Printf.sprintf "Current goal = %s\n"
+ (CicPp.pp goaltype names));
prerr_endline (Printf.sprintf "Selected = %s\n"
(Equality.string_of_equality ~env current));
(* SIMPLIFICATION OF CURRENT *)
let res =
- forward_simplify env (Positive, current) ~passive active
+ forward_simplify env (Positive, current) (*~passive*) active
in
match res with
| None -> step goals theorems passive active (iterno+1)
| Some p, Some rp -> simplify (new' @ p @ rp) active passive
in
let active, passive, new' = simplify new' active passive in
+ if iterno = 36 || iterno = 654 then
+ begin
+ prerr_endline "...................";
+ List.iter
+ (fun x -> prerr_endline (Equality.string_of_equality
+~env:env x)) new';
+ prerr_endline "FINE...................";
+ end;
prerr_endline "simpl goal with new";
let goals =
let a,b,_ = build_table new' in
let initial = Equality.add_subst subsumption_subst newproof in
Equality.build_goal_proof goalproof initial type_of_goal side_effects
in
+ let goal_proof = Subst.apply_subst subsumption_subst goal_proof in
+ let metas_still_open_in_proof = Utils.metas_of_term goal_proof in
(*prerr_endline (CicPp.pp goal_proof names);*)
(* ?? *)
let goal_proof = (* Subst.apply_subst subsumption_subst *) goal_proof in
| None ->
[i,context,ty], (Cic.Meta(i,[]))::acc2,
(Cic.Meta(i,irl)) ::acc3,Some (Cic.Meta(i,irl)))
- ([],[],[],None) proof_menv
+ ([],[],[],None)
+ (List.filter
+ (fun (i,_,_) -> List.mem i metas_still_open_in_proof)
+ proof_menv)
in
let replace where =
(* we need this fake equality since the metas of the hypothesis may be