-
- let time2 = Unix.gettimeofday () in
- passive_maintainance_time := !passive_maintainance_time +. (time2 -. time1);
-
- kept_clauses := (size_of_passive passive) + (size_of_active active);
- match passive_is_empty passive with
- | true -> (* ParamodulationFailure *)
- given_clause_fullred dbd env goals theorems passive active
- | false ->
- let (sign, current), passive = select env (fst goals) passive active in
- (* let names =
- List.map (HExtlib.map_option (fun (name,_) -> name)) context in *)
- prerr_endline ("Selected = " ^ (string_of_sign sign) ^ " " ^
- string_of_equality ~env current);
- (* (CicPp.pp (Inference.term_of_equality current) names));*)
- let time1 = Unix.gettimeofday () in
- let res = forward_simplify env (sign, current) ~passive active in
- let time2 = Unix.gettimeofday () in
- forward_simpl_time := !forward_simpl_time +. (time2 -. time1);
- match res with
- | None ->
- (* weight_age_counter := !weight_age_counter + 1; *)
- given_clause_fullred dbd env goals theorems passive active
- | Some (sign, current) ->
- if (sign = Negative) && (is_identity env current) then (
- debug_print
- (lazy (Printf.sprintf "OK!!! %s %s" (string_of_sign sign)
- (string_of_equality ~env current)));
- let _, proof, _, _ = current in
- ParamodulationSuccess (Some proof, env)
- ) else (
- debug_print
- (lazy "\n================================================");
- debug_print (lazy (Printf.sprintf "selected: %s %s"
- (string_of_sign sign)
- (string_of_equality ~env current)));
-
- let t1 = Unix.gettimeofday () in
- let new' = infer env sign current active in
- let _ =
- match new' with
- | neg, pos ->
- debug_print
- (lazy
- (Printf.sprintf "new' (senza semplificare):\n%s\n"
- (String.concat "\n"
- ((List.map
- (fun e -> "Negative " ^
- (string_of_equality ~env e)) neg) @
- (List.map
- (fun e -> "Positive " ^
- (string_of_equality ~env e)) pos)))))
- in
- let t2 = Unix.gettimeofday () in
- infer_time := !infer_time +. (t2 -. t1);
- let active =
- if is_identity env current then active
- else
- let al, tbl = active in
- match sign with
- | Negative -> (sign, current)::al, tbl
- | Positive ->
- al @ [(sign, current)], Indexing.index tbl current
- in
- let rec simplify new' active passive =
- let t1 = Unix.gettimeofday () in
- let new' = forward_simplify_new env new' ~passive active in
- let t2 = Unix.gettimeofday () in
- forward_simpl_new_time :=
- !forward_simpl_new_time +. (t2 -. t1);
- let t1 = Unix.gettimeofday () in
- let active, passive, newa, retained =
- backward_simplify env new' ~passive active in
- let t2 = Unix.gettimeofday () in
- backward_simpl_time := !backward_simpl_time +. (t2 -. t1);
- match newa, retained with
- | None, None -> active, passive, new'
- | Some (n, p), None
- | None, Some (n, p) ->
- let nn, np = new' in
- if Utils.debug_metas then
- (List.iter
- (fun x -> ignore
- (Indexing.check_target context x "simplify1"))
- n;
- List.iter
- (fun x -> ignore
- (Indexing.check_target context x "simplify2"))
- p);
- simplify (nn @ n, np @ p) active passive
- | Some (n, p), Some (rn, rp) ->
- let nn, np = new' in
- simplify (nn @ n @ rn, np @ p @ rp) active passive
- in
- let active, passive, new' = simplify new' active passive in
-(* pessima prova
- let new1 = prova env new' active in
- let new' = (fst new') @ (fst new1), (snd new') @ (snd new1) in
- let _ =
- match new1 with
- | neg, pos ->
- debug_print
- (lazy
- (Printf.sprintf "new1:\n%s\n"
- (String.concat "\n"
- ((List.map
- (fun e -> "Negative " ^
- (string_of_equality ~env e)) neg) @
- (List.map
- (fun e -> "Positive " ^
- (string_of_equality ~env e)) pos)))))
- in
-end prova *)
- let k = size_of_passive passive in
- if k < (kept - 1) then
- processed_clauses := !processed_clauses + (kept - 1 - k);
-
- let _ =
- debug_print
- (lazy
- (Printf.sprintf "active:\n%s\n"
- (String.concat "\n"
- ((List.map
- (fun (s, e) -> (string_of_sign s) ^ " " ^
- (string_of_equality ~env e))
- (fst active))))))
- in
- let _ =
- match new' with
- | neg, pos ->
- debug_print
- (lazy
- (Printf.sprintf "new':\n%s\n"
- (String.concat "\n"
- ((List.map
- (fun e -> "Negative " ^
- (string_of_equality ~env e)) neg) @
- (List.map
- (fun e -> "Positive " ^
- (string_of_equality ~env e)) pos)))))
- in
- match contains_empty env new' with
- | false, _ ->
- let passive = add_to_passive passive new' in
- given_clause_fullred dbd env goals theorems passive active
- | true, goal ->
- let proof =
- match goal with
- | Some goal -> let _, proof, _, _ = goal in Some proof
- | None -> None
- in
- ParamodulationSuccess (proof, env)
- )
-