Hinting to Z3 #7694
-
I believe this has been discussed a bunch of times, but I haven't seen an answer that I can recognize and apply to my understanding of Z3. Let's say we have thirty highly constrained Ints domain with solution values somewhere 0..99 each. The changes along each domain are non-linear and have a specific but unmathematical(?) pattern. I have an implementation of this, and I can get sensible answers within a minute when I tell it to honor the constraints on only, say. 10 of the domain constants. Letting it loose on more than that seems to grow the problem like crazy such that I can run it at full speed for 24 hours with no result. My human mind is too feeble to find the solution alone, but my Z3-based implementation is possibly reduced still to brute force guessing and testing, I imagine. If my human mind suspects that each domain has an answer that is close to 24 or 67 or whatever for each one, is there a way to weight something for Z3 so that it begins its search from those epicenters instead of starting at 0, as I imagine it might be doing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Yes, it is likely lemma learning produces nothing of value. Could you try local search options? |
Beta Was this translation helpful? Give feedback.
-
It starts with a candidate solution to variables and updates one variable at a time in order to find a global satisfying assignment. It uses lookahead to select a most promising update. Local search solvers can sometimes find solutions where complete solvers (with lemma learning) struggle. You can use it stand-alone as a tactic or as an option when using the main solver (in parallel or periodic). |
Beta Was this translation helpful? Give feedback.
It starts with a candidate solution to variables and updates one variable at a time in order to find a global satisfying assignment. It uses lookahead to select a most promising update. Local search solvers can sometimes find solutions where complete solvers (with lemma learning) struggle. You can use it stand-alone as a tactic or as an option when using the main solver (in parallel or periodic).
Z3 doesn't contain brute force CP with forward pruning, which could also be a candidate for the style of problems you describe.