[Question] Is it possible to add randomness to generated solutions? #7595
Replies: 4 comments 1 reply
-
use options smt.random_seed=NNN and sat.random_seed=NNN to ensure either SMT or SAT core uses randomization. |
Beta Was this translation helpful? Give feedback.
-
Amazing! Thanks Nikolaj! We'll give it a shot. |
Beta Was this translation helpful? Give feedback.
-
@NikolajBjorner, we gave it a shot and it appears that the solver produces the same result after several iterations. For more context, our constraint is on an IPv4 address. The constraints are: The solver keeps producing 224.0.0.0, even after changing the seed repeatedly. That is a valid solutions, was just hoping to generate other valid solutions as well Why does this happen? Is the constraint just too simple that randomness does not impact the result? |
Beta Was this translation helpful? Give feedback.
-
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently (at least in my use of Z3), if I pass Z3 the same formula, it will generate the same solution deterministically every time, which is generally great.
However, I have a use-case (as part of a Fuzzer) where it would be amazing if I could somehow tell Z3 to randomize the solutions more (ideally w.r.t. a seed). Is there any setting that allows for this or do I need to perturb the formula externally to achieve my goal?
Beta Was this translation helpful? Give feedback.
All reactions