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

Failure when extracting a loop with a shared borrow #134

Open
RaitoBezarius opened this issue Apr 16, 2024 · 1 comment
Open

Failure when extracting a loop with a shared borrow #134

RaitoBezarius opened this issue Apr 16, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@RaitoBezarius
Copy link

RaitoBezarius/avl-verification@117cd1c fails extraction with Aeneas:

❯ nix run github:aeneasverif/aeneas -L -- -backend lean avl_verification.llbc
[Info ] Imported: avl_verification.llbc
[Info ] Generated the partial file (because of errors): ./AvlVerification.lean
[Error] There should be no bottoms in the value
Source: 'src/main.rs', lines 33:52-39:9

related to the find function.

@sonmarcho
Copy link
Member

Slightly minimized example:

struct AVLNode {
    child: Option<Box<AVLNode>>,
}

struct AVLTreeSet {
    root: Option<Box<AVLNode>>,
}

impl AVLNode {
    pub fn find(self) -> bool {
        let mut current_tree = &self.child; // This is the root of the problem in the computation of the fixed point

        while let Some(current_node) = current_tree {
            current_tree = &current_node.child;
        }

        false
    }
}

@sonmarcho sonmarcho added the bug Something isn't working label Apr 22, 2024
@sonmarcho sonmarcho changed the title Unclear error on bottoms Failure when extracting a loop with a shared borrow Apr 22, 2024
@sonmarcho sonmarcho self-assigned this May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants