Skip to content

Commit 43a7604

Browse files
committed
Revert "Merge pull request #364 from goblint/td3-solve-tf-abort"
This reverts commit 8cb50d4, reversing changes made to b72dfe4.
1 parent b58b89c commit 43a7604

File tree

18 files changed

+51
-542
lines changed

18 files changed

+51
-542
lines changed

scripts/creduce-abort-verify.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/framework/constraints.ml

Lines changed: 20 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ module FromSpec (S:Spec) (Cfg:CfgBackward) (I: Increment)
458458
and module GVar = GVarF (S.V)
459459
and module D = S.D
460460
and module G = GVarG (S.G) (S.C)
461-
val tf : MyCFG.node * S.C.t -> (Cil.location * MyCFG.edge) list * MyCFG.node -> D.t -> ((MyCFG.node * S.C.t) -> S.D.t) -> (MyCFG.node * S.C.t -> S.D.t -> unit) -> (GVar.t -> G.t) -> (GVar.t -> G.t -> unit) -> D.t
461+
val tf : MyCFG.node * S.C.t -> (Cil.location * MyCFG.edge) list * MyCFG.node -> ((MyCFG.node * S.C.t) -> S.D.t) -> (MyCFG.node * S.C.t -> S.D.t -> unit) -> (GVar.t -> G.t) -> (GVar.t -> G.t -> unit) -> D.t
462462
end
463463
=
464464
struct
@@ -695,64 +695,53 @@ struct
695695
let tf var getl sidel getg sideg prev_node (_,edge) d (f,t) =
696696
let old_loc = !Tracing.current_loc in
697697
let old_loc2 = !Tracing.next_loc in
698-
Tracing.current_loc := f;
699-
Tracing.next_loc := t;
700-
Fun.protect ~finally:(fun () ->
701-
Tracing.current_loc := old_loc;
702-
Tracing.next_loc := old_loc2
703-
) (fun () ->
704-
let d = tf var getl sidel getg sideg prev_node edge d in
705-
d
706-
)
707-
708-
let tf (v,c) (edges, u) pval getl sidel getg sideg =
709-
(* let pval = getl (u,c) in *)
698+
let _ = Tracing.current_loc := f in
699+
let _ = Tracing.next_loc := t in
700+
let d = tf var getl sidel getg sideg prev_node edge d in
701+
let _ = Tracing.current_loc := old_loc in
702+
let _ = Tracing.next_loc := old_loc2 in
703+
d
704+
705+
let tf (v,c) (edges, u) getl sidel getg sideg =
706+
let pval = getl (u,c) in
710707
let _, locs = List.fold_right (fun (f,e) (t,xs) -> f, (f,t)::xs) edges (Node.location v,[]) in
711708
List.fold_left2 (|>) pval (List.map (tf (v,Obj.repr (fun () -> c)) getl sidel getg sideg u) edges) locs
712709

713-
let tf (v,c) (e,u) pval getl sidel getg sideg =
710+
let tf (v,c) (e,u) getl sidel getg sideg =
714711
let old_node = !current_node in
715712
let old_context = !M.current_context in
716-
current_node := Some u;
713+
let _ = current_node := Some u in
717714
M.current_context := Some (Obj.repr c);
718-
Fun.protect ~finally:(fun () ->
719-
current_node := old_node;
720-
M.current_context := old_context
721-
) (fun () ->
722-
let d = tf (v,c) (e,u) pval getl sidel getg sideg in
723-
d
724-
)
715+
let d = tf (v,c) (e,u) getl sidel getg sideg in
716+
let _ = current_node := old_node in
717+
M.current_context := old_context;
718+
d
725719

726720
let system (v,c) =
727721
match v with
728722
| FunctionEntry _ ->
729723
None
730724
| _ ->
731725
let tf getl sidel getg sideg =
732-
let get_pval (_, u) = getl (u, c) in
733-
let tf' eu pval = tf (v,c) eu pval getl sidel getg sideg in
726+
let tf' eu = tf (v,c) eu getl sidel getg sideg in
734727

735728
match NodeH.find_option CfgTools.node_scc_global v with
736729
| Some scc when NodeH.mem scc.prev v && NodeH.length scc.prev = 1 ->
737730
(* Limited to loops with only one entry node. Otherwise unsound as is. *)
738731
(* TODO: Is it possible to do soundly for multi-entry loops? *)
739732
let stricts = NodeH.find_default scc.prev v [] in
740-
let pvals_stricts = List.map get_pval stricts in (* get pvals before executing any tf to maximize abort *)
741-
let xs_stricts = List.map2 tf' stricts pvals_stricts in
733+
let xs_stricts = List.map tf' stricts in
742734
if List.for_all S.D.is_bot xs_stricts then
743735
S.D.bot ()
744736
else
745737
let xs_strict = List.fold_left S.D.join (S.D.bot ()) xs_stricts in
746738
let equal = [%eq: (CilType.Location.t * Edge.t) list * Node.t] in
747739
let is_strict eu = List.exists (equal eu) stricts in
748740
let non_stricts = List.filter (neg is_strict) (Cfg.prev v) in
749-
let pvals_non_stricts = List.map get_pval non_stricts in (* get pvals before executing any tf to maximize abort *)
750-
let xs_non_stricts = List.map2 tf' non_stricts pvals_non_stricts in
741+
let xs_non_stricts = List.map tf' non_stricts in
751742
List.fold_left S.D.join xs_strict xs_non_stricts
752743
| _ ->
753-
let prevs = Cfg.prev v in
754-
let pvals = List.map get_pval prevs in (* get pvals before executing any tf to maximize abort *)
755-
let xs = List.map2 tf' prevs pvals in
744+
let xs = List.map tf' (Cfg.prev v) in
756745
List.fold_left S.D.join (S.D.bot ()) xs
757746
in
758747
Some tf

src/maingoblint.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ let preprocess_and_merge () = preprocess_files () |> merge_preprocessed
388388
let do_stats () =
389389
if get_bool "printstats" then (
390390
print_newline ();
391-
ignore (Pretty.printf "vars = %d evals = %d narrow_reuses = %d aborts = %d\n" !Goblintutil.vars !Goblintutil.evals !Goblintutil.narrow_reuses !Goblintutil.aborts);
391+
ignore (Pretty.printf "vars = %d evals = %d narrow_reuses = %d\n" !Goblintutil.vars !Goblintutil.evals !Goblintutil.narrow_reuses);
392392
print_newline ();
393393
Stats.print (Messages.get_out "timing" Legacy.stderr) "Timings:\n";
394394
flush_all ()
@@ -398,7 +398,6 @@ let reset_stats () =
398398
Goblintutil.vars := 0;
399399
Goblintutil.evals := 0;
400400
Goblintutil.narrow_reuses := 0;
401-
Goblintutil.aborts := 0;
402401
Stats.reset SoftwareTimer
403402

404403
(** Perform the analysis over the merged AST. *)

src/solvers/generic.ml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ struct
7878
incr Goblintutil.evals;
7979
if (get_bool "dbg.solver-progress") then (incr stack_d; print_int !stack_d; flush stdout)
8080

81-
let abort_rhs_event x =
82-
incr Goblintutil.aborts
83-
8481
let update_var_event x o n =
8582
if tracing then increase x;
8683
if full_trace || ((not (Dom.is_bot o)) && Option.is_some !max_var && Var.equal (Option.get !max_var) x) then begin

0 commit comments

Comments
 (0)