-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
SMT internalize doesn't respect timeout #4192
Comments
|
@wintersteiger - seems most of time is within bit-blasting and then internalization for theory_fpa (within quantifier instantiation). |
Well, I have no clue how to fix this.. I've near zero knowledge about internalization. About FPA bit blasting I've no clue. The example has a few FPA operations, but not that many (< 40). |
Maybe related issue: #3864 |
I investigated this thing a bit. It seems to be that there's an issue in SMT internalizer when dealing with formulas combining multiple theories. In the example I posted, some expressions combine BVs, arrays & FPs. The behavior for the SMT internalizer is to do a top-sort of the expression to be internalized, and then iterate the sub-expressions top-down and internalize them one-by-one. The problem is that if the children also have multiple theories, the same top-sort & deep internalization behavior quicks in. |
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
The code is supposed to internalize expressions bottom-up. The top-sort is only applied to non-internalized expressions, so once they are internalized they wouldn't participate. |
You're very right, I misunderstood the code. It looks good. So a dense representation makes sense for QF formulas I guess, while a sparse one is good for quantifier instantiations as AST ids are high then and zeroing out the vector becomes expensive. |
An example:
What if the internalizer had an API to process multiple arguments at once? At least we could batch all arguments of functions in one go. Would reduce calls to internalizer by half at least. |
quantifier instantiation causes FP internalization which creates side constraints that are then internalized. |
I run with Nevertheless, my profiler still blames memset() in internalizer's set_color. Almost half of the time is spent there. |
Yeah, there are lots of You can get rid of the floats up front, e.g. via Re: limits: Yeah, I think we should add resource checks to the internalizer, sometimes it can take a significant amount of time and users may have very tight limits. |
This doesn't come back after several minutes and memory goes up to GBs:
$ z3 -t:1000 timeout.smt2
I see
smt::context::internalize_rec(expr*, bool) ()
getting called thousands of times, and see it frequently insmt::context::top_sort_expr
.AFAICT, the internalizer never checks the resource limits. I'm also wondering why it's taking so long with such a small formula.. The expressions have a lot of sharing, so if the internalizer traverses the expression like a tree, I can see why it would never finish. But does it need to? (I'm clueless about this code; just speculating)
timeout.zip
(this is the root cause of a crash in Alive2: https://web.ist.utl.pt/nuno.lopes/alive2/index.php?hash=1ede71ade7988ad1&test=Transforms%2FLoopVectorize%2FX86%2Funroll_selection.ll)
The text was updated successfully, but these errors were encountered: