Skip to content

Commit

Permalink
Make get_value sound by not returning a formula is false when it is a…
Browse files Browse the repository at this point in the history
…bsent from the environment (#942)
  • Loading branch information
Stevendeo authored Nov 16, 2023
1 parent 551300f commit 007e26d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/lib/reasoners/fun_sat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,12 @@ module Make (Th : Theory.S) : Sat_solver_sig.S = struct
| Ty.Tbool ->
begin
match ME.find_opt t env.gamma with
| None -> Some E.faux
| None ->
begin
match ME.find_opt (E.neg t) env.gamma with
| None -> None
| Some _ -> Some E.faux
end
| Some _ -> Some E.vrai
end
| _ -> None
Expand Down
7 changes: 6 additions & 1 deletion src/lib/reasoners/satml_frontend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1389,7 +1389,12 @@ module Make (Th : Theory.S) : Sat_solver_sig.S = struct
| Ty.Tbool ->
begin
match ME.find_opt t env.gamma with
| None -> Some E.faux
| None ->
begin
match ME.find_opt (E.neg t) env.gamma with
| None -> None
| Some _ -> Some E.faux
end
| Some _ -> Some E.vrai
end
| _ -> None
Expand Down
2 changes: 1 addition & 1 deletion tests/models/bool/bool1.models.expected
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ unknown
(
(define-fun q () Bool false)
)
((notp false)
((notp unknown)
(notnq true))


Expand Down
2 changes: 1 addition & 1 deletion tests/models/bool/bool2.models.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
unknown
(
)
((notx false))
((notx unknown))

2 changes: 1 addition & 1 deletion tests/models/bool/bool3.models.expected
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ unknown
(define-fun y () Bool true)
)
((foo true)
(bar false))
(bar unknown))

0 comments on commit 007e26d

Please sign in to comment.