According to http://research.microsoft.com/en-us/um/people/leonardo/z3_doc/parallel.html I can set CC_NUM_THREADS=4 from the z3 command line if I'm using a .smt file.
How do I do this if I'm using the z3py api?
According to http://research.microsoft.com/en-us/um/people/leonardo/z3_doc/parallel.html I can set CC_NUM_THREADS=4 from the z3 command line if I'm using a .smt file.
How do I do this if I'm using the z3py api?
The portfolio solver that supports lemma sharing is not part of the latest version of Z3. These parameters are therefore not supported, and the parameter format that allows multiple values for each parameter is not supported either (on the commandline or via python).
That said, there is still a way to utilize multiple cores, which is the par-or tactic; see e.g., the Z3 Strategy Tutorial (search for par-or). The example shows how to run multiple tactics in parallel (in this example with different random seeds) via the SMT2 input language; in z3py we would use the ParOr function to create such a parallel tactic.