Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try disabling function unfolding triggers. #1231

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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