Skip to content

Commit

Permalink
Try disabling function unfolding triggers.
Browse files Browse the repository at this point in the history
  • Loading branch information
vakaras committed Nov 18, 2022
1 parent eec13c3 commit 071fd28
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 1 deletion.
3 changes: 3 additions & 0 deletions prusti-server/src/verification_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ impl ViperBackendConfig {
if config::use_more_complete_exhale() {
verifier_args.push("--enableMoreCompleteExhale".to_string());
}
if config::disable_function_unfold_trigger() {
verifier_args.push("--disableFunctionUnfoldTrigger".to_string());
}
if config::counterexample() {
verifier_args.push("--counterexample".to_string());
verifier_args.push("mapped".to_string());
Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/fail/demos/append-sorted-error-3.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

#![feature(box_patterns, box_syntax)]
use prusti_contracts::*;

Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/fail/pure-fn/wrong-quantifiers.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

#![feature(nll)]
#![feature(box_patterns)]
#![feature(box_syntax)]
Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/pass/gitlab-issues/issue-39.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

//! Issue #39 "Suspicious `_old_old_1` variable name"

#![feature(nll)]
Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/pass/larger/first-final.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

#![feature(box_patterns)]

//! An adaptation of the example from
Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/pass/magic-wands/from_nth.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

#![feature(box_patterns)]

use prusti_contracts::*;
Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/pass/paper-examples/routes.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

#![feature(box_syntax, box_patterns)]

use prusti_contracts::*;
Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/pass/pure-fn/len-lookup.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

#![feature(nll)]
#![feature(box_patterns)]
#![feature(box_syntax)]
Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/pass/pure-fn/quantifiers.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

#![feature(nll)]
#![feature(box_patterns)]
#![feature(box_syntax)]
Expand Down
2 changes: 2 additions & 0 deletions prusti-tests/tests/verify/pass/quick/routes.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// compile-flags: -Pdisable_function_unfold_trigger=false

#![feature(box_syntax, box_patterns)]

use prusti_contracts::*;
Expand Down
8 changes: 8 additions & 0 deletions prusti-utils/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ lazy_static::lazy_static! {
settings.set_default("assert_timeout", 10_000).unwrap();
settings.set_default("smt_qi_eager_threshold", 1000).unwrap();
settings.set_default("use_more_complete_exhale", true).unwrap();
settings.set_default("disable_function_unfold_trigger", true).unwrap();
settings.set_default("skip_unsupported_features", false).unwrap();
settings.set_default("internal_errors_as_warnings", false).unwrap();
settings.set_default("allow_unreachable_unsupported_code", false).unwrap();
Expand Down Expand Up @@ -510,6 +511,13 @@ pub fn use_more_complete_exhale() -> bool {
read_setting("use_more_complete_exhale")
}

/// When enabled, disables unfolding of functions together with unfolding
/// predicates. Equivalent to the verifier command-line argument
/// `--disableFunctionUnfoldTrigger`.
pub fn disable_function_unfold_trigger() -> bool {
read_setting("disable_function_unfold_trigger")
}

/// When enabled, prints the items collected for verification.
pub fn print_collected_verification_items() -> bool {
read_setting("print_collected_verification_items")
Expand Down
2 changes: 1 addition & 1 deletion viper-toolchain
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v-2022-10-31-1114
v-2022-11-04-0724

0 comments on commit 071fd28

Please sign in to comment.