Skip to content

Commit 6c92a85

Browse files
authored
Merge pull request #694 from viperproject/meilers_z3_update
Z3 option update
2 parents 1c4bedf + 3ab2d79 commit 6c92a85

2 files changed

Lines changed: 16 additions & 64 deletions

File tree

src/main/resources/z3config.smt2

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; License, v. 2.0. If a copy of the MPL was not distributed with this
33
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
44

5-
; Requires Z3 >= 4.3.2
5+
; Tested with Z3 4.8.7 and 4.12.1
66

77
; ATTENTION: Continuing multi-line statements must be indented with at least
88
; one tab or two spaces. All other lines must not start with tabs
@@ -12,53 +12,19 @@
1212
; setting options, is answered by a success (or error) reply from Z3. Silicon currently relies on
1313
; these replies when it interacts with Z3 via stdio.
1414
(set-option :print-success true) ; Boogie: false
15+
(set-option :global-decls true) ; Necessary for push pop mode
1516

16-
(set-option :global-decls true) ; Boogie: default
17-
(set-option :auto_config false) ; Usually a good idea
18-
19-
(set-option :smt.restart_strategy 0)
20-
(set-option :smt.restart_factor |1.5|)
17+
; These options are taken from Dafny 4.0.0 and proven to work decently well with up-to-date Z3 (currently 4.12.1),
18+
; unlike the options used previously.
19+
(set-option :auto_config false)
2120
(set-option :smt.case_split 3)
2221
(set-option :smt.delay_units true)
23-
(set-option :smt.delay_units_threshold 16)
24-
(set-option :nnf.sk_hack true)
2522
(set-option :type_check true)
26-
(set-option :smt.bv.reflect true)
27-
2823
(set-option :smt.mbqi false)
24+
(set-option :pp.bv_literals false)
2925
(set-option :smt.qi.eager_threshold 100)
30-
; (set-option :smt.qi.lazy_threshold 1000000000)
31-
(set-option :smt.qi.cost "(+ weight generation)")
32-
(set-option :smt.qi.max_multi_patterns 1000)
33-
; (set-option :smt.qi.profile true)
34-
; (set-option :smt.qi.profile_freq 100000)
35-
36-
;; [2019-07-31 Malte] The next block of options are all randomness-related options that I could
37-
;; find in the description Z3 -pd emits. If not stated otherwise, the options are merely explicitly
38-
;; set to their default values.
39-
(set-option :smt.phase_selection 0) ; default: 3, Boogie: 0
40-
(set-option :sat.phase caching)
41-
(set-option :sat.random_seed 0)
42-
(set-option :nlsat.randomize true)
43-
(set-option :nlsat.seed 0)
44-
(set-option :nlsat.shuffle_vars false)
45-
(set-option :fp.spacer.order_children 0) ; Not available with Z3 4.5
46-
(set-option :fp.spacer.random_seed 0) ; Not available with Z3 4.5
47-
(set-option :smt.arith.random_initial_value true) ; Boogie: true
48-
(set-option :smt.random_seed 0)
49-
(set-option :sls.random_offset true)
50-
(set-option :sls.random_seed 0)
51-
(set-option :sls.restart_init false)
52-
(set-option :sls.walksat_ucb true)
53-
54-
; (set-option :smt.macro_finder true)
55-
; (set-option :combined_solver.solver2_timeout 500)
56-
; (set-option :combined_solver.solver2_unknown 2)
57-
; (set-option :smt.arith.nl false)
58-
; (set-option :smt.arith.nl.gb false)
59-
; See http://stackoverflow.com/questions/28210673
60-
61-
; (set-option :produce-models true)
62-
; (set-option :model false)
26+
(set-option :smt.arith.solver 2)
6327
(set-option :model.v2 true)
64-
; (set-option :model.compact true)
28+
29+
; We want unlimited multipatterns
30+
(set-option :smt.qi.max_multi_patterns 1000)

src/main/scala/decider/Z3ProverAPI.scala

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,37 +47,23 @@ object Z3ProverAPI {
4747
val boolParams = Map(
4848
"smt.delay_units" -> true,
4949
"delay_units" -> true,
50-
"nnf.sk_hack" -> true,
5150
"smt.mbqi" -> false,
5251
"mbqi" -> false,
53-
"nlsat.randomize" -> true,
54-
"nlsat.shuffle_vars" -> false,
55-
"smt.arith.random_initial_value" -> true,
56-
"arith.random_initial_value" -> true,
57-
"bv.reflect" -> true,
52+
//"pp.bv_literals" -> false, // This is part of z3config.smt2 but Z3 won't accept it via API.
53+
"model.v2" -> true
5854
)
5955
val intParams = Map(
60-
"smt.restart_strategy" -> 0,
61-
"restart_strategy" -> 0,
6256
"smt.case_split" -> 3,
6357
"case_split" -> 3,
64-
"smt.delay_units_threshold" -> 16,
65-
"delay_units_threshold" -> 16,
6658
"smt.qi.max_multi_patterns" -> 1000,
6759
"qi.max_multi_patterns" -> 1000,
68-
"smt.phase_selection" -> 0,
69-
"phase_selection" -> 0,
70-
"sat.random_seed" -> 0,
71-
"nlsat.seed" -> 0,
72-
"random_seed" -> 0,
60+
"smt.arith.solver" -> 2,
61+
"arith.solver" -> 2
7362
)
74-
val stringParams = Map(
75-
//"smt.qi.cost" -> "(+ weight generation)", // cannot set this for some reason, but this is the default value anyway.
76-
"sat.phase" -> "caching"
63+
val stringParams: Map[String, String] = Map(
64+
// currently none
7765
)
7866
val doubleParams = Map(
79-
"smt.restart_factor" -> 1.5,
80-
"restart_factor" -> 1.5,
8167
"smt.qi.eager_threshold" -> 100.0,
8268
"qi.eager_threshold" -> 100.0,
8369
)

0 commit comments

Comments
 (0)