let id = freshid () in
let eq = (uncomparable,weight,p,(ty,l,r,o),m,id) in
Hashtbl.add id_to_eq id eq;
+
eq
;;
Pervasives.compare s1 s2
;;
+let rec max_weight_in_proof current =
+ function
+ | Exact _ -> current
+ | Step (_, (_,id1,(_,id2),_)) ->
+ let eq1 = Hashtbl.find id_to_eq id1 in
+ let eq2 = Hashtbl.find id_to_eq id2 in
+ let (w1,p1,(_,_,_,_),_,_) = open_equality eq1 in
+ let (w2,p2,(_,_,_,_),_,_) = open_equality eq2 in
+ let current = max current w1 in
+ let current = max_weight_in_proof current p1 in
+ let current = max current w2 in
+ max_weight_in_proof current p2
+
+let max_weight_in_goal_proof =
+ List.fold_left
+ (fun current (_,_,id,_,_) ->
+ let eq = Hashtbl.find id_to_eq id in
+ let (w,p,(_,_,_,_),_,_) = open_equality eq in
+ let current = max current w in
+ max_weight_in_proof current p)
+
+let max_weight goal_proof proof =
+ let current = max_weight_in_proof 0 proof in
+ max_weight_in_goal_proof current goal_proof
+
let proof_of_id id =
try
let (_,p,(_,l,r,_),_,_) = open_equality (Hashtbl.find id_to_eq id) in
let parametrize_proof p l r ty =
let uniq l = HExtlib.list_uniq (List.sort Pervasives.compare l) in
let mot = CicUtil.metas_of_term_set in
- let parameters = uniq (mot p @ mot l @ mot r) in
+ let parameters = uniq ((*mot p @*) mot l @ mot r) in
(* ?if they are under a lambda? *)
let parameters =
HExtlib.list_uniq (List.sort Pervasives.compare parameters)