-
Notifications
You must be signed in to change notification settings - Fork 640
-
Notifications
You must be signed in to change notification settings - Fork 640
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
VM confused by let bindings in fixpoints #3282
Comments
Comment author: @maximedenes Fixpoint f (m : nat) (o := true) (n : nat) {struct n} := n. Eval vm_compute in f. (* returns fix Ffix (x x0 : nat) {struct x} : nat := x0 (* the struct argument is the wrong one, and so are the reductions ) |
Comment author: @JasonGross Probably related: Definition foo := fix f (m : nat) (o := true) (n : nat) {struct n} := match n with 0 => 0 | S n' => f 0 n' end. |
Comment author: @herbelin Both problems are different. Jason's problem is actually the trace of two easy bugs which are now fixed in trunk (1894f56), 8.4 and 8.3. Maxime's problem is a problem of the vm. I attach a patch but I don't think this is the correct one. Compilation of fix in vm is not taking care of let-in's, and I believe that the unsafe_rec_arg in vm.ml is really doing unsafe things, looking in a block which is not the expected one when the fix has let-ins. The patch I attach simply expands let-ins instead of compiling them. Unless Benjamin G. is around to look at this, I think, Maxime, that you are the most knowledgeable to know what to do exactly. Hugo |
Comment author: @herbelin Created attachment 483
|
Comment author: @maximedenes I can take the VM part of this problem, although I will probably not have time to fix it before the POPL deadline. Expanding let-ins may cause performance issues by loosing sharing, so I'll try to see if we can still support them. |
Comment author: @maximedenes Fixed in trunk. |
Yet other occurrences of the bug:
or, specifically in the 8.11 branch:
I'm going to submit a short patch. Also for |
Note: the issue was created automatically with bugzilla2github tool
Original bug ID: BZ#3282
From: @maximedenes
Reported version: 8.5
CC: @herbelin, @JasonGross
The text was updated successfully, but these errors were encountered: