-
Notifications
You must be signed in to change notification settings - Fork 18
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
Support Alt-Ergo's cut
and check
#178
Comments
I'm a bit confused on the exact semantics of |
You are right, I was not clear. By "on the left of an an implication" I mean that it must be one of the hypotheses (note that More formally, I believe that the valid positions for
So in particular something like My understanding is that Alt-Ergo then essentially saturates the following rewriting (top-down) from expr to lists of exprs (but again I don't know if it should be done in Dolmen):
So for the examples: For
For
An example with nesting:
|
In other words, |
Actually although the nesting is "syntactically" supported by Alt-Ergo I don't think it is intended to be supported and Alt-Ergo has inconsistent behavior on that case; we should probably ignore that possibility, so the context grammar should just be:
and not be nested inside The way all of this is implemented by Alt-Ergo is that an implication
I think this is similar to If there are cut/check in the goal, then they are processed in the same way using a second-level of local sequents, so
where Edit: now that I have written the above, the best way to deal with this at the Dolmen level would probably be to implement the goal flattening and introduce appropriate push/pop statements. I don't know if we are equipped to deal with that on the Alt-Ergo side though. |
I think we indeed need to handle that in Dolmen, if only so that users of dolmen (other than alt-ergo) do not need to handle those. From what I can tell, we have two options:
|
Yeah, that is my concern as well :(
My only issue with that approach is that this would mean that the shared hypotheses have to be duplicated, where they are not currently (although I don't think that Alt-Ergo exploits this sharing currently, so maybe it is fine). |
If want to avoid duplication we could make it so that the shared formulas are defined before the new goals. |
I don't think that works because the hypotheses must themselves only be local to the goal (in Alt-Ergo the
which alt-ergo translates as:
has the same semantics as the smt-lib script:
|
Right, but taking your example
We could translate it as
and further if we want to avoid duplication, we could have
Note here that we did not try and de-duplicate |
I don't think binding them really solves the issue; with this encoding it is harder to reuse internal solver state. If a solver proves Another issue (but this is specific to Alt-Ergo and might be able to fix it) is that Alt-Ergo will not look inside the definition of |
I'm not sure I see why and how it would make re-using internal solver state harder (or at least significantly harder): if a solver does keep and re-use its (or parts of its) internal state across push/pop/check-sat-assuming, then I expect that there shouldn't be much difference (except if one only does extremely naive things). Considering that this only occurs in problems in alt-ergo's native language, that I expect not a lot of things actually generate problems that use |
I was thinking about hanging the behavior of Alt-Ergo on goals that don't use |
@bclement-ocp is this still needed ? |
I think that with Why3 migrating to SMT-LIB input for Alt-Ergo it will not be needed. I don't think we need to do anything unless someone complains that this obscure functionality is broken. |
Ok, I'll close this issue then. If anyone encounters this error and needs this fixed, please feel free to re-open this issue. |
Alt-Ergo has
cut
andcheck
primitives that are not supported by dolmen:These should have type
bool -> bool
and are used as markers by Alt-Ergo to introduce auxiliary goals.should be understood as
and
should be understood as
I am not sure if Dolmen should implement the invariant "check and cut can only appear on the left of an implication in a goal" (including the left of an implication inside another
check
orcut
), but it should at least exposecheck
andcut
asbool -> bool
primitives so that Alt-Ergo can pick them up.The text was updated successfully, but these errors were encountered: