Skip to content

Commit

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

let select (cond : Symbolic_value.vbool) =
let select_inner ?(explore_first = true) (cond : Symbolic_value.vbool) =
let v = Smtml.Expr.simplify cond in
match Smtml.Expr.view v with
| Val True -> return true
Expand All @@ -385,9 +385,12 @@ 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

let summary_symbol (e : Smtml.Expr.t) =
let* thread in
match Smtml.Expr.view e with
Expand Down Expand Up @@ -440,7 +443,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 7dea337

Please sign in to comment.