Skip to content

Commit

Permalink
add regression test for hypothetical incompleteness issue while inves…
Browse files Browse the repository at this point in the history
…tigating a surprising proof failure
  • Loading branch information
utaal committed Nov 2, 2023
1 parent 3223fa5 commit f8bbd5e
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions source/rust_verify_test/tests/regression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1055,3 +1055,55 @@ test_verify_one_file! {
temp!{}
} => Ok(())
}

test_verify_one_file! {
#[test] trait_proof_using_own_lemma verus_code! {
mod m1 {
use builtin_macros::*;
verus! {
#[verifier::external_body]
pub struct S { p: core::marker::PhantomData<()> }

pub spec fn p1(s: S) -> bool;
pub spec fn p2(s: S) -> bool;

pub proof fn p(s: S)
requires p1(s),
ensures p2(s) {

assume(false);
}

pub trait A {
proof fn two(s: S)
requires p1(s),
ensures p2(s);

proof fn one()
ensures forall|s: S| p1(s) ==> p2(s);
}
}
}

mod m2 {
use builtin_macros::*;
verus! {
use crate::m1::*;

struct X;

impl A for X {
proof fn two(s: S) {
Self::one();
}

proof fn one() {
assert forall|s: S| p1(s) implies p2(s) by {
p(s);
}
}
}
}
}
} => Ok(())
}

0 comments on commit f8bbd5e

Please sign in to comment.