I'm running into a situation where I'd really love a copy feature for the Z3 Solver. By this I mean, I have a solver instantiated with some constraints. I now want to copy it so that I have two independent solvers. At the moment, I'm doing this by creating a new solver and just iterating over s.assertions and adding them back in. For small solvers this is fine. For larger solvers, this can severely impact the time make a copy as Z3 is re-creating work it has already done.
While this isn't a show stopper, it would be very beneficial to be able to copy the solver directly. The normal deepcopy method throws an error about not being able to deepcopy ctypes (which makes sense), so I'm guessing any better solution would have to be implemented by z3 or z3py proper.
Anyone know of a more efficient way to copy the solver as stated and not incur the overhead of Z3 re-solving what it already knows?