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

missed case in recursive type-checking #343

Closed
tjhance opened this issue Jan 3, 2023 · 0 comments
Closed

missed case in recursive type-checking #343

tjhance opened this issue Jan 3, 2023 · 0 comments
Assignees

Comments

@tjhance
Copy link
Collaborator

tjhance commented Jan 3, 2023

This ought to fail the type well-founded-recursion-checking, but it doesn't:

struct Qux<T> {
    t: T,
}

struct Bar<T> {
    s: Box<Set<Qux<T>>>,
}

struct Foo {
    bar: Bar<Foo>,
}

e.g. you can do the usual russell's paradox set-of-sets-that-do-not-contain themselves:

proof fn prove_false()
    ensures false
{
    let s = Set::<Qux<Foo>>::new(
        |qux: Qux<Foo>| !qux.t.bar.s.contains(qux)
    );
    let qux = Qux{ t: Foo { bar: Bar { s: box s } } };
    assert(qux.t.bar.s.contains(qux));
    assert(!qux.t.bar.s.contains(qux));
    assert(false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants