Skip to content

Commit 6070b07

Browse files
authored
Merge branch 'main' into cut-tables
2 parents f42db2d + d1f4868 commit 6070b07

47 files changed

Lines changed: 1620 additions & 138 deletions

Some content is hidden

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

Cargo.lock

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ datatest-stable = "0.3.2"
8181
sha2 = "0.10.9"
8282
dir-test = "0.4.1"
8383

84-
move-stdlib = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
85-
move-docgen = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
86-
move-package = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
87-
move-compiler = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
88-
move-ir-types = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
89-
move-core-types = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
90-
move-symbol-pool = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
91-
move-disassembler = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
92-
move-binary-format = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
93-
move-bytecode-source-map = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
94-
move-command-line-common = { git = "https://github.com/asymptotic-code/sui", branch = "next" }
84+
move-stdlib = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
85+
move-docgen = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
86+
move-package = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
87+
move-compiler = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
88+
move-ir-types = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
89+
move-core-types = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
90+
move-symbol-pool = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
91+
move-disassembler = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
92+
move-binary-format = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
93+
move-bytecode-source-map = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }
94+
move-command-line-common = { git = "https://github.com/asymptotic-code/sui", branch = "spec_only_loop_inv" }

crates/lambda-boogie-handler/handler.rs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const DEFAULT_BOOGIE_FLAGS: &[&str] = &[
2121
"-printModel:1",
2222
"-enhancedErrorMessages:1",
2323
"-useArrayAxioms",
24-
"-proverOpt:O:smt.QI.EAGER_THRESHOLD=100",
24+
"-proverOpt:O:smt.QI.EAGER_THRESHOLD=10",
2525
"-proverOpt:O:smt.QI.LAZY_THRESHOLD=100",
2626
"-proverOpt:O:model_validate=true",
2727
"-vcsCores:4",
@@ -118,6 +118,23 @@ impl ProverHandler {
118118
Ok(())
119119
}
120120

121+
fn get_option_key(option: &str) -> &str {
122+
if let Some(eq_pos) = option.find('=') {
123+
&option[..eq_pos]
124+
} else if let Some(colon_pos) = option.rfind(':') {
125+
let after_colon = &option[colon_pos + 1..];
126+
if after_colon.chars().next().map_or(false, |c| {
127+
c.is_ascii_digit() || after_colon.starts_with('/') || after_colon.starts_with('.')
128+
}) {
129+
&option[..colon_pos]
130+
} else {
131+
option
132+
}
133+
} else {
134+
option
135+
}
136+
}
137+
121138
fn get_boogie_command(
122139
&self,
123140
boogie_file_name: &str,
@@ -131,7 +148,11 @@ impl ProverHandler {
131148
result.extend(DEFAULT_BOOGIE_FLAGS.iter().map(|s| s.to_string()));
132149

133150
if let Some(options) = individual_options {
134-
result.extend(options.split_whitespace().map(|s| s.to_string()));
151+
for option in options.split_whitespace().map(|s| format!("-{}", s)) {
152+
let key = Self::get_option_key(&option);
153+
result.retain(|existing: &String| Self::get_option_key(existing) != key);
154+
result.push(option);
155+
}
135156
}
136157

137158
result.push(format!("-proverOpt:PROVER_PATH={z3_exe}"));

crates/move-prover-boogie-backend/src/boogie_backend/bytecode_translator.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ impl<'env> BoogieTranslator<'env> {
340340
if self.options.func_abort_check_only
341341
&& self.targets.is_spec(&fun_env.get_qualified_id())
342342
{
343+
self.translate_function_style(fun_env, FunctionTranslationStyle::Aborts);
343344
self.translate_function_style(fun_env, FunctionTranslationStyle::Opaque);
344345
continue;
345346
}

crates/move-prover-boogie-backend/src/boogie_backend/options.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ impl Default for BoogieOptions {
216216
proc_cores: 4,
217217
vc_timeout: 40,
218218
keep_artifacts: true,
219-
eager_threshold: 100,
219+
eager_threshold: 10,
220220
lazy_threshold: 100,
221221
stable_test_output: false,
222222
num_instances: 1,
@@ -250,6 +250,26 @@ impl BoogieOptions {
250250
}
251251
}
252252

253+
/// Extracts the key part of a boogie option (everything except the value).
254+
/// For "-proverOpt:O:smt.QI.EAGER_THRESHOLD=100", returns "-proverOpt:O:smt.QI.EAGER_THRESHOLD"
255+
/// For "-vcsCores:4", returns "-vcsCores"
256+
fn get_option_key(option: &str) -> &str {
257+
if let Some(eq_pos) = option.find('=') {
258+
&option[..eq_pos]
259+
} else if let Some(colon_pos) = option.rfind(':') {
260+
let after_colon = &option[colon_pos + 1..];
261+
if after_colon.chars().next().map_or(false, |c| {
262+
c.is_ascii_digit() || after_colon.starts_with('/') || after_colon.starts_with('.')
263+
}) {
264+
&option[..colon_pos]
265+
} else {
266+
option
267+
}
268+
} else {
269+
option
270+
}
271+
}
272+
253273
/// Returns command line to call boogie.
254274
pub fn get_boogie_command(
255275
&self,
@@ -272,6 +292,8 @@ impl BoogieOptions {
272292
let mut seen_options = HashSet::new();
273293
let mut add = |sl: &[&str]| {
274294
for s in sl {
295+
let key = Self::get_option_key(s);
296+
seen_options.retain(|existing: &String| Self::get_option_key(existing) != key);
275297
seen_options.insert(s.to_string());
276298
}
277299
};

0 commit comments

Comments
 (0)