-
Notifications
You must be signed in to change notification settings - Fork 17
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
Too restrictive well foundness criteria #222
Comments
That's actually a known limitation of the SMT-LIB specification of well-foundedness for recursive datatypes, which I'd argue dolmen currently implements faithfully. Here is the relevant part of the specification:
This specification is relatively unclear about what happens in polymorphic situations (which is not that much of a surprise considering the recent and partial appearance of polymorphism in SMT-LIB2), where the notion of "does something contain a type" is not precise enough; currently it is interpreted by dolmen as any occurrence of the type, even as parameter of some other polymorphic type (e.g. One problem here is that to check well-foundedness of such a declaration, one would have to expand the definition of list (because if one replaces list by another type, e.g. |
Besides, we got the same issue while working on tests from Décysif project. I opened an issue on Why3 repository: |
With |
Do you have a description of the exact criterion that is used by why3 so that I can try and implement it ? |
@bobot I posted the issue on the SMT-LIB repo. I think that one thing that could help move things a lot would be to have a description of a well-founded criterion that could replace/improve the current one. |
I agree. I think the checked done by why3 are in this two places: |
As discussed previously, I believe a (the?) good criterion is to extend the well-founded criterion to also include non-mutually-recursive parametric datatypes, because the well-foundedness of a parametric datatype can in general depend on the well-foundedness of its arguments. I think this is more or less what Why3 does — note the absence of a check for the mutually recursive definition here. The following "counter-example" must be rejected:
|
Sorry, I got confused — I was thinking of this part of the SMT-LIB criterion:
But this is not actually the one that causes the issue here — rather it is this one, which I believe is also the one that deals with positivity: "τj is a sort term that contains no occurrences of δ1, . . . , δn below its top symbol.". The following definition is forbidden by that criterion (interestingly it also makes Z3 segfault):
|
Oh, I missed that part. For what it's worth, this specific criterion is not enforced by dolmen at the moment, and if polymorphism is to be fully supported by the SMT-LIB, this is - in my opinion - an extremely limiting criterion that should be removed. @bclement-ocp , @bobot do not hesitate to also comment on the issue that I opened on the SMT-LIB repo : SMT-LIB/SMT-LIB-2#32 |
Then I'm confused. The above example (with mutually recursive |
Because of the criterion I quoted at the beginning of the thread:
Since As I mentioned in the issue on the SMT-LIb repo, this may be due to how one interprets the notion of "contain" in the criterion. Currently, dolmen interprets "contain" as any occurrence (even under type constructors). |
Ah, yes. |
From a file generated from an mlw by why3, the fact that list is well-founded is not taken into account:
The text was updated successfully, but these errors were encountered: