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
of weight, age and goal-similarity
*)
-let rec select env (goals,_) passive =
+let rec select env g passive =
processed_clauses := !processed_clauses + 1;
+(*
let goal =
match (List.rev goals) with goal::_ -> goal | _ -> assert false
in
+*)
let pos_list, pos_set = passive in
let remove eq l = List.filter (fun e -> Equality.compare e eq <> 0) l in
if !weight_age_ratio > 0 then
match !weight_age_counter with
| 0 -> (
weight_age_counter := !weight_age_ratio;
+ let skip_giant pos_list pos_set =
+ match pos_list with
+ | (hd:EqualitySet.elt)::tl ->
+ let w,_,_,_,_ = Equality.open_equality hd in
+ if w < 30 then
+ hd, (tl, EqualitySet.remove hd pos_set)
+ else
+ (prerr_endline
+ ("+++ skipping giant of size "^string_of_int w^" +++");
+ select env g (tl@[hd],pos_set))
+ | _ -> assert false
+ in
+ skip_giant pos_list pos_set)
+
+(*
let rec skip_giant pos_list pos_set =
match pos_list with
| (hd:EqualitySet.elt)::tl ->
let w,_,_,_,_ = Equality.open_equality hd in
let pos_set = EqualitySet.remove hd pos_set in
- if w < 500 then
+ if w < 30 then
hd, (tl, pos_set)
else
(prerr_endline
("+++ skipping giant of size "^string_of_int w^" +++");
skip_giant tl pos_set)
| _ -> assert false
- in
- skip_giant pos_list pos_set)
+ in
+ skip_giant pos_list pos_set)
+
+*)
+(*
| _ when (!symbols_counter > 0) ->
(symbols_counter := !symbols_counter - 1;
let cardinality map =
let _, current = EqualitySet.fold f pos_set initial in
current,
(remove current pos_list, EqualitySet.remove current pos_set))
+*)
| _ ->
symbols_counter := !symbols_ratio;
let my_min e1 e2 =
let find (_,_,g) where =
List.exists (fun (_,_,g1) -> Equality.meta_convertibility g g1) where
in
+ (* prova:tengo le passive semplificate
+ let passive_goals =
+ List.map (fun g -> snd (simplify_goal env g active)) passive_goals
+ in *)
List.fold_left
(fun (acc_a,acc_p) goal ->
match simplify_goal env goal active with
check goal [
check_if_goal_is_identity env;
check_if_goal_is_subsumed env (snd active)])
+(* provare active and passive?*)
None active_goals
;;
int_of_float iterations_left
in
let rec step goals theorems passive active iterno =
- pp_goals "xxx" goals context;
if iterno > max_iterations then
(ParamodulationFailure "No more iterations to spend")
else if Unix.gettimeofday () > max_time then
passive
in
kept_clauses := (size_of_passive passive) + (size_of_active active);
- let goals = infer_goal_set env active goals in
+ let goals = infer_goal_set env active goals
+ in
match check_if_goals_set_is_solved env active goals with
| Some p ->
prerr_endline
prerr_endline
(Equality.pp_proof names goalproof newproof subsumption_subst
subsumption_id type_of_goal);
- prerr_endline "ENDOFPROOFS";
+ prerr_endline "ENDOFPROOFS___";
+ prerr_endline ("max weight: " ^
+ (string_of_int (Equality.max_weight goalproof newproof)));
(* generation of the CIC proof *)
let side_effects =
List.filter (fun i -> i <> goalno)