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

Unreachable List Loop #270

Open
Thanhson89 opened this issue Jun 27, 2024 · 0 comments
Open

Unreachable List Loop #270

Thanhson89 opened this issue Jun 27, 2024 · 0 comments

Comments

@Thanhson89
Copy link

Thanhson89 commented Jun 27, 2024

use std::borrow::Borrow;

pub enum List<T> {
    Cons(T, Box<List<T>>),
    Nil,
}

fn foo(v: &List<List<u8>>) -> Option<List<u8>> {
    if let List::Cons(h, t) = v {
        let mut t = t.borrow();
        let mut last = h;
        while let List::Cons(ht, tt) = t
        {
            last = ht;
            t = tt.borrow();
        }
        None
    }
    else {
        None
    }
}

Trigger

$ aeneas -backend lean list_cons.llbc
[Info ] Imported: list_cons.llbc
[Info ] Generated the partial file (because of errors): ./ListCons.lean
[Error] Unreachable
Source: 'src/main.rs', lines 11:8-18:5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant