Closed remysucre closed 1 month ago
That documentation is very stale. It was true when there were no separate solver objects. All assertions were associated with a context. With multiple solver objects there is no association between ast life time and solver objects. You could have two solver objects pushing and popping independently and at the same time create expressions used in one or both solvers. I will fix the documentation. If you need life time behavior then mk_context_rc() is your "friend" at the cost of lots of inc/dec ref on your own. You can also use C++ (or Rust?) which has awesome lexical scope.
The docs for
Z3_mk_context()
says the following:However it appears an AST object is still reachable after popping the scope. To reproduce, add the following to examples/c/test_capi.c: