Skip to content

Commit

Permalink
Explore failed assert first
Browse files Browse the repository at this point in the history
  • Loading branch information
krtab authored and zapashcanon committed Jun 18, 2024
1 parent be1b0de commit 25510a2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/symbolic/symbolic_choice.ml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ let get_model_or_stop symbol =
| Some v -> return v
end

let select (cond : Symbolic_value.vbool) =
let select_inner ~explore_first (cond : Symbolic_value.vbool) =
let v = Smtml.Expr.simplify cond in
match Smtml.Expr.view v with
| Val True -> return true
Expand All @@ -389,7 +389,11 @@ let select (cond : Symbolic_value.vbool) =
let+ () = check_reachability in
false
in
choose true_branch false_branch
if explore_first then choose true_branch false_branch
else choose false_branch true_branch
[@@inline]

let select (cond : Symbolic_value.vbool) = select_inner cond ~explore_first:true
[@@inline]

let summary_symbol (e : Smtml.Expr.t) =
Expand Down Expand Up @@ -446,7 +450,7 @@ let select_i32 (i : Symbolic_value.int32) =
generator ()

let assertion c =
let* assertion_true = select c in
let* assertion_true = select_inner c ~explore_first:false in
if assertion_true then return ()
else
let* thread in
Expand Down

0 comments on commit 25510a2

Please sign in to comment.