prove: refute mutated program models and prove portable replay
- bounded witness candidates are now also tried when the proposition contains program-model calls that Rust cannot evaluate; Lean's decide is the authority, so a mutated model refutes only with a kernel-verified negation (M07) - e2e: model mutation refuted; bundle replayed from a different checkout path - full acceptance run: 11 passed, 0 failed, 271.39 s - STATUS updated with the final evidence
This commit is contained in:
1 parent
47e46320cc
commit
add8ccada1
3 files changed
+80
-16
No files matched your search
+20
-14
@@ -1405,23 +1405,28 @@ fn build_hint_terms(
|
||||
terms
|
||||
}
|
||||
|
||||
/// Bounded counterexample candidates, in a deterministic order.
|
||||
///
|
||||
/// A candidate is kept when the proposition is *not known true* at that
|
||||
/// assignment. `evaluate` cannot see through program-model calls (it returns
|
||||
/// `None`), so those assignments are kept as candidates too and Lean's `decide`
|
||||
/// is the authority that accepts or rejects the negation. This is why a
|
||||
/// modified program model can still be refuted, without executing it in Rust.
|
||||
fn counterexample_candidates(goal: Option<&Goal>) -> Vec<Vec<BigInt>> {
|
||||
let Some(goal) = goal else {
|
||||
return Vec::new();
|
||||
};
|
||||
const VALUES: [i64; 10] = [0, 1, -1, 2, -2, 3, -3, 5, -5, 10];
|
||||
let mut candidates = Vec::new();
|
||||
if goal.vars.is_empty() {
|
||||
if let Some(value) = goal.evaluate(&[]) {
|
||||
if !value {
|
||||
candidates.push(Vec::new());
|
||||
}
|
||||
}
|
||||
return candidates;
|
||||
return match goal.evaluate(&[]) {
|
||||
Some(true) => Vec::new(),
|
||||
_ => vec![Vec::new()],
|
||||
};
|
||||
}
|
||||
if goal.vars.len() > 2 {
|
||||
return candidates;
|
||||
return Vec::new();
|
||||
}
|
||||
let mut candidates = Vec::new();
|
||||
let mut budget = 16usize;
|
||||
for first in VALUES {
|
||||
for second in VALUES {
|
||||
@@ -1433,13 +1438,14 @@ fn counterexample_candidates(goal: Option<&Goal>) -> Vec<Vec<BigInt>> {
|
||||
} else {
|
||||
vec![BigInt::from(first), BigInt::from(second)]
|
||||
};
|
||||
if goal.vars.len() == 2 && first != 0 && second != 0 {
|
||||
// Still evaluate; combinations are bounded by the budget.
|
||||
}
|
||||
if let Some(false) = goal.evaluate(&values) {
|
||||
candidates.push(values);
|
||||
budget -= 1;
|
||||
if goal.evaluate(&values) == Some(true) {
|
||||
if goal.vars.len() == 1 {
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
candidates.push(values);
|
||||
budget -= 1;
|
||||
if goal.vars.len() == 1 {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user