-
Notifications
You must be signed in to change notification settings - Fork 21
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
Flux (ultimately z3) hangs on trivial constraint. #949
Comments
@nilehmann the issue here is this: there is a flux constraint of the form
The trouble is Now, So, I think its worth exploring leaving all the unfolding just to i.e. pass the definitions of the functions into fixpoint, which will then pass it into z3, which can chose to unfold or not. Does that make sense? |
How are functions definitions translated into z3? My understanding is that |
TBH I don’t know the answer - and I wanted to first do a “hand translation”
into z3 to see if it could handle the vc with explicit function definitions…
…On Mon, Dec 16, 2024 at 6:45 PM Nico Lehmann ***@***.***> wrote:
How are functions definitions translated into z3? My understanding is that
define-fun is treated as a macro and eagerly expanded but define-fun-rec
is not.
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/flux-rs/flux/issues/949*issuecomment-2547385121__;Iw!!Mih3wA!B8npOeVi-vX7A8DtNibPv9RFluuodfXdFfEb2O6eqsKDleOdyuPO8ZcvBwCA-ntqObIZOGg5AxeNBnU9wIvKM_Jf$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OBSQCF4KIZKKXZARFL2F6F27AVCNFSM6AAAAABTXKKNZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBXGM4DKMJSGE__;!!Mih3wA!B8npOeVi-vX7A8DtNibPv9RFluuodfXdFfEb2O6eqsKDleOdyuPO8ZcvBwCA-ntqObIZOGg5AxeNBnU9wMUacEFJ$>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Actually, it occurs to me that one relatively simple thing that could be done either in (a) flux, (b) fixpoint or (c) the SMT solver, is our "refinement reflection" trick which is, given a formula This way you have your cake and eat it too. If you can trivially prove the formula with just uninterpreted functions, then great. If instead you need the definitions, then those are also available via the equalities. What I don't know is whether Z3 and friends do something like this already (in which case we should just pass the folded-up function applications directly) or whether they aggressively inline). At any rate, maybe the easiest option is to implement this equality-based method in flux to see if it works? |
My understanding from z3's docs is that https://microsoft.github.io/z3guide/docs/logic/Recursive%20Functions/ I know this is standard smtlib, but I don't know how other solvers handle it. Ultimately, it's a matter of who is in better position to do the unfolding. |
@ranjitjhala @nilehmann I have two other annotations that cause z3 to hang. The constraints are not trivial unfortunately. Would it be helpful to add the |
Lets just keep them here to track them for now? |
Ok i'll edit the issue with their description. |
Btw bit of a Hail Mary but can you try running fixpoint with CVC as the
backend to see if that does any better?
- Ranjit.
…On Tue, Dec 17, 2024 at 9:19 AM Vivien Rindisbacher < ***@***.***> wrote:
Ok i'll edit the issue with their description.
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/flux-rs/flux/issues/949*issuecomment-2549089712__;Iw!!Mih3wA!AZX8NMqbqEO0PpTIe_YQKq1mi1Ms9X5PiEpY8u2yD6LNgPVEqTtX90hfPyGCflZ201gto3ej2UQu1oxOUTmUUS3J$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OHFPNIAXCW2AFNENR32GBMI5AVCNFSM6AAAAABTXKKNZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBZGA4DSNZRGI__;!!Mih3wA!AZX8NMqbqEO0PpTIe_YQKq1mi1Ms9X5PiEpY8u2yD6LNgPVEqTtX90hfPyGCflZ201gto3ej2UQu1oxOUTwsYHaK$>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
ahh interesting... I ran |
Ya, CVC5 seems to be able to check all assertions that z3 hangs on very quickly. |
Wow including the “trivial” one?
- Ranjit.
…On Tue, Dec 17, 2024 at 9:55 AM Vivien Rindisbacher < ***@***.***> wrote:
Ya, CVC5 seems to be able to check all assertions that z3 hangs on very
quickly.
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/flux-rs/flux/issues/949*issuecomment-2549197082__;Iw!!Mih3wA!CQKQTE1RXQoExt0pT0rWSmKW36mvZeL9cN2m4x5XcpCSc1_XO3uiYSyD-tv-btO5Fy5_3_r0wbblBg9ZCF16lzbc$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OEPBJ42QBB74DTYGE32GBQR5AVCNFSM6AAAAABTXKKNZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBZGE4TOMBYGI__;!!Mih3wA!CQKQTE1RXQoExt0pT0rWSmKW36mvZeL9cN2m4x5XcpCSc1_XO3uiYSyD-tv-btO5Fy5_3_r0wbblBg9ZCBLp6crx$>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Ya - it smashes the whole smt2 file in less than a second... |
Wow. Ok maybe we should post it as is to the z3 people :-)
- Ranjit.
…On Tue, Dec 17, 2024 at 10:08 AM Vivien Rindisbacher < ***@***.***> wrote:
Ya - it smashes the whole smt2 file in less than a second...
—
Reply to this email directly, view it on GitHub
<https://urldefense.com/v3/__https://github.com/flux-rs/flux/issues/949*issuecomment-2549224869__;Iw!!Mih3wA!EC8TiHJNVC75KImFAcp6SWqxk_ncRKFsTjpGiWkowmdMro0-byb5tVMUkEDa76G6gAHaRCOwy8ERE7gwSEd7tmEs$>,
or unsubscribe
<https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OA4MBY6X6YF3VZDGKD2GBSBVAVCNFSM6AAAAABTXKKNZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBZGIZDIOBWHE__;!!Mih3wA!EC8TiHJNVC75KImFAcp6SWqxk_ncRKFsTjpGiWkowmdMro0-byb5tVMUkEDa76G6gAHaRCOwy8ERE7gwSEHH0Tqw$>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
So the only one we’re really blocked on is the one where fixpoint hangs?
(For the others maybe the fastest thing for now is to add a flag specifying
extra fixpoint flags — eg SMT solver — to use when checking the function?)
- Ranjit.
…On Tue, Dec 17, 2024 at 10:12 AM Ranjit Jhala ***@***.***> wrote:
Wow. Ok maybe we should post it as is to the z3 people :-)
- Ranjit.
On Tue, Dec 17, 2024 at 10:08 AM Vivien Rindisbacher <
***@***.***> wrote:
> Ya - it smashes the whole smt2 file in less than a second...
>
> —
> Reply to this email directly, view it on GitHub
> <https://urldefense.com/v3/__https://github.com/flux-rs/flux/issues/949*issuecomment-2549224869__;Iw!!Mih3wA!EC8TiHJNVC75KImFAcp6SWqxk_ncRKFsTjpGiWkowmdMro0-byb5tVMUkEDa76G6gAHaRCOwy8ERE7gwSEd7tmEs$>,
> or unsubscribe
> <https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AAMS4OA4MBY6X6YF3VZDGKD2GBSBVAVCNFSM6AAAAABTXKKNZSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNBZGIZDIOBWHE__;!!Mih3wA!EC8TiHJNVC75KImFAcp6SWqxk_ncRKFsTjpGiWkowmdMro0-byb5tVMUkEDa76G6gAHaRCOwy8ERE7gwSEHH0Tqw$>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
I'll work on adding a flag for cvc5 |
@ranjitjhala, I patched up liquid fixpoint so that I could run it like so |
Have posted an issue here Z3Prover/z3#7484 |
@ranjitjhala, here's the constraint from
exception_entry
that hangs in z3.l.smt2.txt
The text was updated successfully, but these errors were encountered: