Skip to content

Commit bb88fc0

Browse files
authored
Merge branch 'master' into caching-doc
2 parents 2be56c0 + 3f4f0f8 commit bb88fc0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1782
-785
lines changed

bors.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
status = ["test-crates", "clippy-check", "fmt-check", "purification-tests", "all-tests (ubuntu-latest)", "all-tests (windows-latest)", "all-tests (macos-latest)"]
22
timeout_sec = 21600
3+
use_squash_merge = true

docs/dev-guide/src/config/flags.md

Lines changed: 91 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
| Name | Rust type | Default value |
44
| --- | --- | --- |
5+
| [`ALLOW_UNREACHABLE_UNSUPPORTED_CODE`](#allow_unreachable_unsupported_code) | `bool` | `false` |
56
| [`ASSERT_TIMEOUT`](#assert_timeout) | `u64` | `10_000` |
67
| [`BE_RUSTC`](#be_rustc) | `bool` | `false` |
78
| [`CACHE_PATH`](#cache_path) | `String` | `""` |
8-
| [`CHECK_OVERFLOWS`](#check_overflows) | `bool` | `true` |
99
| [`CHECK_FOLDUNFOLD_STATE`](#check_foldunfold_state) | `bool` | `false` |
10+
| [`CHECK_OVERFLOWS`](#check_overflows) | `bool` | `true` |
1011
| [`CHECK_PANICS`](#check_panics) | `bool` | `true` |
1112
| [`CONTRACTS_LIB`](#contracts_lib) | `String` | `""` |
1213
| [`COUNTEREXAMPLE`](#counterexample) | `bool` | `false` |
@@ -19,20 +20,28 @@
1920
| [`DUMP_REBORROWING_DAG_IN_DEBUG_INFO`](#dump_reborrowing_dag_in_debug_info) | `bool` | `false` |
2021
| [`DUMP_VIPER_PROGRAM`](#dump_viper_program) | `bool` | `false` |
2122
| [`ENABLE_CACHE`](#enable_cache) | `bool` | `true` |
23+
| [`ENABLE_PURIFICATION_OPTIMIZATION`](#enable_purification_optimization) | `bool` | `false` |
2224
| [`ENABLE_GHOST_CONSTRAINTS`](#enable_ghost_constraints) | `bool` | `false` |
2325
| [`ENABLE_VERIFY_ONLY_BASIC_BLOCK_PATH`](#enable_verify_only_basic_block_path) | `bool` | `false` |
26+
| [`ENCODE_BITVECTORS`](#encode_bitvectors) | `bool` | `false` |
2427
| [`ENCODE_UNSIGNED_NUM_CONSTRAINT`](#encode_unsigned_num_constraint) | `bool` | `false` |
2528
| [`EXTRA_JVM_ARGS`](#extra_jvm_args) | `Vec<String>` | `vec![]` |
2629
| [`EXTRA_VERIFIER_ARGS`](#extra_verifier_args) | `Vec<String>` | `vec![]` |
2730
| [`FOLDUNFOLD_STATE_FILTER`](#foldunfold_state_filter) | `String` | `""` |
2831
| [`FULL_COMPILATION`](#full_compilation) | `bool` | `false` |
2932
| [`HIDE_UUIDS`](#hide_uuids) | `bool` | `false` |
33+
| [`IGNORE_REGIONS`](#ignore_regions) | `bool` | `false` |
34+
| [`INTERN_NAMES`](#intern_names) | `bool` | `true` |
3035
| [`JSON_COMMUNICATION`](#json_communication) | `bool` | `false` |
3136
| [`LOG`](#log) | `Option<String>` | `None` |
3237
| [`LOG_DIR`](#log_dir) | `String` | `"log"` |
3338
| [`LOG_STYLE`](#log_style) | `String` | `"auto"` |
39+
| [`MAX_LOG_FILE_NAME_LENGTH`](#max_log_file_name_length) | `usize` | `60` |
3440
| [`NO_VERIFY`](#no_verify) | `bool` | `false` |
35-
| [`PRINT_COLLECTED_VERFICATION_ITEMS`](#print_collected_verfication_items) | `bool` | `false` |
41+
| [`NO_VERIFY_DEPS`](#no_verify_deps) | `bool` | `false` |
42+
| [`ONLY_MEMORY_SAFETY`](#only_memory_safety) | `bool` | `false` |
43+
| [`OPTIMIZATIONS`](#optimizations) | `Vec<String>` | "all" |
44+
| [`PRINT_COLLECTED_VERIFICATION_ITEMS`](#print_collected_verification_items) | `bool` | `false` |
3645
| [`PRINT_DESUGARED_SPECS`](#print_desugared_specs) | `bool` | `false` |
3746
| [`PRINT_HASH`](#print_hash) | `bool` | `false` |
3847
| [`PRINT_TYPECKD_SPECS`](#print_typeckd_specs) | `bool` | `false` | `bool` | `false` |
@@ -42,11 +51,17 @@
4251
| [`SERVER_MAX_STORED_VERIFIERS`](#server_max_stored_verifiers) | `Option<usize>` | `None` |
4352
| [`SIMPLIFY_ENCODING`](#simplify_encoding) | `bool` | `true` |
4453
| [`SKIP_UNSUPPORTED_FEATURES`](#skip_unsupported_features) | `bool` | `false` |
54+
| [`UNSAFE_CORE_PROOF`](#unsafe_core_proof) | `bool` | `false` |
4555
| [`USE_MORE_COMPLETE_EXHALE`](#use_more_complete_exhale) | `bool` | `true` |
56+
| [`VERIFICATION_DEADLINE`](#verification_deadline) | `Option<u64>` | `None` |
4657
| [`VERIFY_ONLY_BASIC_BLOCK_PATH`](#verify_only_basic_block_path) | `Vec<String>` | `vec![]` |
4758
| [`VERIFY_ONLY_PREAMBLE`](#verify_only_preamble) | `bool` | `false` |
4859
| [`VIPER_BACKEND`](#viper_backend) | `String` | `"Silicon"` |
4960

61+
## `ALLOW_UNREACHABLE_UNSUPPORTED_CODE`
62+
63+
When enabled, unsupported code is encoded as `assert false`. This way error messages are reported only for unsupported code that is actually reachable.
64+
5065
## `ASSERT_TIMEOUT`
5166

5267
Maximum time (in milliseconds) for the verifier to spend on a single assertion. Set to `0` to disable timeout. Maps to the verifier command-line argument `--assertTimeout`.
@@ -59,14 +74,14 @@ When enabled, Prusti will behave like `rustc`.
5974

6075
Path to a cache file, where verification cache will be loaded from and saved to. The default empty string disables saving any cache to disk. A path to a file which does not yet exist will result in using an empty cache, but then creating and saving to that location on exit.
6176

62-
## `CHECK_OVERFLOWS`
63-
64-
When enabled, binary operations and numeric casts will be checked for overflows. See [integer type encoding](../encoding/types-heap.md#i-u-char).
65-
6677
## `CHECK_FOLDUNFOLD_STATE`
6778

6879
When enabled, additional, *slow*, checks for the `fold`/`unfold` algorithm will be generated.
6980

81+
## `CHECK_OVERFLOWS`
82+
83+
When enabled, binary operations and numeric casts will be checked for overflows. See [integer type encoding](../encoding/types-heap.md#i-u-char).
84+
7085
## `CHECK_PANICS`
7186

7287
When enabled, Prusti will check for an absence of `panic!`s.
@@ -113,10 +128,22 @@ When enabled, reborrowing DAGs will be output in debug files.
113128

114129
When enabled, the encoded Viper program will be output.
115130

131+
## `ENCODE_BITVECTORS`
132+
133+
When enabled, bitwise integer operations are encoded using bitvectors.
134+
135+
**Note:** This option is highly experimental.
136+
116137
## `ENABLE_CACHE`
117138

118139
When enabled, verification requests (to verify individual `fn`s) are cached to improve future verification. By default the cache is only saved in memory (of the `prusti-server` if enabled). For long-running verification projects use [`CACHE_PATH`](#cache_path) to save to disk.
119140

141+
## `ENABLE_PURIFICATION_OPTIMIZATION`
142+
143+
When enabled, impure methods are optimized using the purification optimization, which tries to convert heap operations to pure (snapshot-based) operations.
144+
145+
**Note:** This option is highly experimental.
146+
120147
## `ENABLE_GHOST_CONSTRAINTS`
121148

122149
Enables ghost constraints in Prusti specifications.
@@ -156,9 +183,17 @@ When enabled, compilation will continue and a binary will be generated after Pru
156183

157184
When enabled, UUIDs of expressions and specifications printed with [`PRINT_TYPECKD_SPECS`](#print_typeckd_specs) are hidden.
158185

186+
## `IGNORE_REGIONS`
187+
188+
When enabled, debug files dumped by `rustc` will not contain lifetime regions.
189+
190+
## `INTERN_NAMES`
191+
192+
When enabled, Viper identifiers are interned to shorten them when possible.
193+
159194
## `JSON_COMMUNICATION`
160195

161-
When enabled, communication with the server will be encoded as JSON instead of bincode.
196+
When enabled, communication with the server will be encoded as JSON instead of the default bincode.
162197

163198
## `LOG`
164199

@@ -172,29 +207,58 @@ Path to directory in which log files and dumped output will be stored.
172207

173208
Log style. See [`env_logger` documentation](https://docs.rs/env_logger/0.7.1/env_logger/index.html#disabling-colors).
174209

210+
## `MAX_LOG_FILE_NAME_LENGTH`
211+
212+
Maximum allowed length of a log file name. If this is exceeded, the file name is truncated.
213+
175214
## `NO_VERIFY`
176215

177216
When enabled, verification is skipped altogether.
178217

218+
## `NO_VERIFY_DEPS`
219+
220+
When enabled, verification is skipped for dependencies.
221+
222+
## `ONLY_MEMORY_SAFETY`
223+
224+
When enabled, only the core proof is verified.
225+
226+
**Note:** This should be used only when `UNSAFE_CORE_PROOF` is enabled.
227+
228+
## `OPTIMIZATIONS`
229+
230+
Comma-separated list of optimizations to enable, or `"all"` to enable all. Possible values in the list are:
231+
232+
- `"inline_constant_functions"`
233+
- `"delete_unused_predicates"`
234+
- `"optimize_folding"`
235+
- `"remove_empty_if"`
236+
- `"purify_vars"`
237+
- `"fix_quantifiers"`
238+
- `"fix_unfoldings"`
239+
- `"remove_unused_vars"`
240+
- `"remove_trivial_assertions"`
241+
- `"clean_cfg"`
242+
243+
## `PRINT_COLLECTED_VERIFICATION_ITEMS`
244+
245+
When enabled, prints the items collected for verification.
246+
179247
## `PRINT_DESUGARED_SPECS`
180248

181249
When enabled, prints the AST with desugared specifications.
182250

183251
## `PRINT_HASH`
184252

185-
When enabled, prints the hash of a verification request (the hash is used for caching). This is a debugging option which does not perform verification &mdash; it is similar to `NO_VERIFY`, except that this flag stops the verification process at a later stage.
253+
When enabled, prints the hash of a verification request (the hash is used for caching). This is a debugging option which does not perform verification &mdash; it is similar to [`NO_VERIFY`](#no_verify), except that this flag stops the verification process at a later stage.
186254

187255
## `PRINT_TYPECKD_SPECS`
188256

189257
When enabled, prints the type-checked specifications.
190258

191-
## `PRINT_COLLECTED_VERFICATION_ITEMS`
192-
193-
When enabled, prints the items collected for verification.
194-
195259
## `QUIET`
196260

197-
When enabled, user messages are not printed. Otherwise, `message` outputs into `stderr`.
261+
When enabled, user messages are not printed. Otherwise, messages output into `stderr`.
198262

199263
## `SERVER_ADDRESS`
200264

@@ -204,11 +268,11 @@ When set to `"MOCK"`, the server is run off-thread, effectively mocking connecti
204268

205269
## `SERVER_MAX_CONCURRENCY`
206270

207-
The maximum amount of verification requests the server will work on concurrently. If not set, defaults to the number of (logical) cores on the system.
271+
Maximum amount of verification requests the server will work on concurrently. If not set, defaults to the number of (logical) cores on the system.
208272

209273
## `SERVER_MAX_STORED_VERIFIERS`
210274

211-
The maximum amount of instantiated Viper verifiers the server will keep around for reuse. If not set, defaults to `SERVER_MAX_CONCURRENT_VERIFICATION_OPERATIONS`. It also doesn't make much sense to set this option to less than that, since then the server will likely have to keep creating new verifiers, reducing the performance gained from reuse.
275+
Maximum amount of instantiated Viper verifiers the server will keep around for reuse. If not set, defaults to `SERVER_MAX_CONCURRENT_VERIFICATION_OPERATIONS`. It also doesn't make much sense to set this option to less than that, since then the server will likely have to keep creating new verifiers, reducing the performance gained from reuse.
212276

213277
**Note:** This does _not_ limit how many verification requests the server handles concurrently, only the size of what is essentially its verifier cache.
214278

@@ -220,10 +284,22 @@ When enabled, the encoded program is simplified before it is passed to the Viper
220284

221285
When enabled, features not supported by Prusti will be reported as warnings rather than errors.
222286

287+
## `UNSAFE_CORE_PROOF`
288+
289+
When enabled, the new core proof is used, suitable for unsafe code
290+
291+
**Note:** This option is currently very incomplete.
292+
223293
## `USE_MORE_COMPLETE_EXHALE`
224294

225295
When enabled, a more complete `exhale` version is used in the verifier. See [`consolidate`](https://github.com/viperproject/silicon/blob/f48de7f6e2d90d9020812869c713a5d3e2035995/src/main/scala/rules/StateConsolidator.scala#L29-L46). Equivalent to the verifier command-line argument `--enableMoreCompleteExhale`.
226296

297+
## `VERIFICATION_DEADLINE`
298+
299+
Deadline (in seconds) within which Prusti should encode and verify the program.
300+
301+
Prusti panics if it fails to meet this deadline. This flag is intended to be used for tests that aim to catch performance regressions.
302+
227303
## `VERIFY_ONLY_BASIC_BLOCK_PATH`
228304

229305
Verify only the single execution path goes through the given basic blocks. All basic blocks not on this execution path are replaced with `assume false`. Must be enabled using the [`ENABLE_VERIFY_ONLY_BASIC_BLOCK_PATH`](#enable_verify_only_basic_block_path) flag.

0 commit comments

Comments
 (0)