Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude pruned witness lifter prevs from ARG construction #1027

Merged
merged 1 commit into from
Apr 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/witness/argTools.ml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,26 @@ struct

let create entrystates: (module BiArg with type Node.t = MyCFG.node * Spec.C.t * int) =
let (witness_prev_map, witness_prev, witness_next) =
(* Get all existing vars *)
let vars = NHT.create 100 in
LHT.iter (fun lvar local ->
ask_local lvar ~local (IterVars (fun i ->
let lvar' = (fst lvar, snd lvar, i) in
NHT.replace vars lvar' ()
))
) lh;

let prev = NHT.create 100 in
let next = NHT.create 100 in
LHT.iter (fun lvar local ->
ignore (ask_local lvar ~local (Queries.IterPrevVars (fun i (prev_node, prev_c_obj, j) edge ->
let lvar' = (fst lvar, snd lvar, i) in
let prev_lvar: NHT.key = (prev_node, Obj.obj prev_c_obj, j) in
NHT.modify_def [] lvar' (fun prevs -> (edge, prev_lvar) :: prevs) prev;
NHT.modify_def [] prev_lvar (fun nexts -> (edge, lvar') :: nexts) next
(* Exclude accumulated prevs, which were pruned *)
if NHT.mem vars prev_lvar then (
let lvar' = (fst lvar, snd lvar, i) in
NHT.modify_def [] lvar' (fun prevs -> (edge, prev_lvar) :: prevs) prev;
NHT.modify_def [] prev_lvar (fun nexts -> (edge, lvar') :: nexts) next
)
)))
) lh;

Expand Down