mk_eq_ind (Utils.eq_ind_r_URI ()) ty what pred p1 other p2
;;
-let parametrize_proof p ty =
- let parameters = CicUtil.metas_of_term p in (* ?if they are under a lambda? *)
+let parametrize_proof p l r ty =
+ let parameters = CicUtil.metas_of_term p
+@ CicUtil.metas_of_term l
+@ CicUtil.metas_of_term r
+in (* ?if they are under a lambda? *)
let parameters =
HExtlib.list_uniq (List.sort Pervasives.compare parameters)
in
let p = CicSubstitution.lift (lift_no-1) p in
let p =
ProofEngineReduction.replace_lifting
- ~equality:(=) ~what ~with_what ~where:p
+ ~equality:(fun t1 t2 -> match t1,t2 with Cic.Meta (i,_),Cic.Meta(j,_) -> i=j | _ -> false) ~what ~with_what ~where:p
in
let ty_of_m _ = ty (*function
| Cic.Meta (i,_) -> List.assoc i menv
let add i n =
let p,_,_ = proof_of_id i in
match p with
- | Exact _ -> ()
+ | Exact _ -> true
| _ ->
- try let (pos,no) = Hashtbl.find h i in Hashtbl.replace h i (pos,no+1)
- with Not_found -> Hashtbl.add h i (n,1)
+ try let (pos,no) = Hashtbl.find h i in Hashtbl.replace h i (pos,no+1);false
+ with Not_found -> Hashtbl.add h i (n,1);true
in
let rec aux n = function
| Exact _ -> n
| Step (_,(_,i1,(_,i2),_)) ->
- add i1 n;add i2 n;
- max (aux (n+1) (let p,_,_ = proof_of_id i1 in p))
- (aux (n+1) (let p,_,_ = proof_of_id i2 in p))
+ let go_on_1 = add i1 n in
+ let go_on_2 = add i2 n in
+ max
+ (if go_on_1 then aux (n+1) (let p,_,_ = proof_of_id i1 in p) else n+1)
+ (if go_on_2 then aux (n+1) (let p,_,_ = proof_of_id i2 in p) else n+1)
in
let i = aux 0 p in
let _ =
let rec aux = function
| Exact term -> CicSubstitution.lift lift term
| Step (subst,(_, id1, (pos,id2), pred)) ->
- if Subst.is_in_subst 9 subst then
- prerr_endline (Printf.sprintf "ID %d-%d has: %s\n" id1 id2 (Subst.ppsubst
- subst));
let p1,_,_ = proof_of_id aux id1 in
let p2,l,r = proof_of_id aux id2 in
build_proof_step lift subst p1 p2 pos l r pred
let lets,_,h =
List.fold_left
(fun (acc,n,h) id ->
- let p,_,_ = proof_of_id id in
+ let p,l,r = proof_of_id id in
let cic = build_proof_term h n p in
let real_cic,instance =
- parametrize_proof cic (CicSubstitution.lift n mty)
+ parametrize_proof cic l r (CicSubstitution.lift n mty)
in
let h = (id, instance)::lift_list h in
acc@[id,real_cic],n+1,h)