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

Unbound function symbol DeepModel8.deep_model #910

Open
adpaco-aws opened this issue Nov 14, 2023 · 1 comment
Open

Unbound function symbol DeepModel8.deep_model #910

adpaco-aws opened this issue Nov 14, 2023 · 1 comment

Comments

@adpaco-aws
Copy link

I updated locally creusot after #908 and used the DeepModel derive for a recursively-defined type Expr. But when I generate the mlcfg file and load it in Why3, I get this error:

Session initialized successfully
File "../interpreter-rlib.mlcfg", line 1077, characters 37-58: unbound function symbol 'DeepModel8.deep_model'

I've put the code in the creusot-issue-910 branch. To reproduce, simply run cargo creusot using the latest version and open with creusot/ide target/debug/interpreter-rlib.mlcfg. Please let me know if those steps don't show you the error.

@adpaco-aws adpaco-aws changed the title Unbound function symbol 'DeepModel8.deep_model' Unbound function symbol DeepModel8.deep_model Nov 14, 2023
@xldenis
Copy link
Collaborator

xldenis commented Nov 15, 2023

I've confirmed locally this issue is actually caused by a mutual recursion between the deep model instance of Box and Expr I don't see an easy solution, apart from properly supporting mutually recursive definitions.

However, we should improve the mutual recursion check to handle this kind of nested inductive based recursion.

As to working around the error, I think the best possible proposal right now is to manually provide instances. You could use cargo expand to recover the currently emitted code and edit it to avoid going through the box deep model instance.

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

2 participants