-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Unexpected performance difference between define-fun and define-funcs-rec in smt #2601
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
Comments
For this case problem is indeed solved. |
@c-cube: what do you think? the bottleneck is the unfolding of ite expressions as they are assumed (pessimistically) to be guards for recursive function definitions. The ite expressions occur deeply nested and the unfolding multiplies. |
I imagine there are two possible workarounds here:
|
The parser issues the main calls to setting definitions after each body is parsed. I only unfold a term if it contains an if, which contains a potentially recursive function. Note that the normalization to cases doesn't do well with shared subterms eitther. |
Run our unit tests with the latest nightly build today. All data types in this example have multiple constructors, which invalidate my hypotheses that it might be related to data types with a single constructor. |
It is hitting the same bottleneck that causes the recursive function compiler to create large ite unfoldings. It would require a re-do of how recursive functions are pre-processed to make this scalable. |
See duplicate #2985 |
When I run z3 with the following model in smt2.5
I almost immediately get
sat
(as expected).When I use the define-funcs-rec instead of define-fun, hence
I don't get an answer within 20 minutes and z3 consumes over 10 Gigabytes of data.
I understand the concepts are slightly different, yet f3 isn't used and is not recursive so I didn't expect such a hugh change in performance.
Can you please look at it to investigate this unexpected change in performance?
The text was updated successfully, but these errors were encountered: