This update includes an experimental feature to access a congruence closure data-structure after search.
It comes with several caveats as pre-processing is free to eliminate terms. It is therefore necessary to use a solver that does not eliminate the terms you want to track for congruence of. This is partially addressed by using SimpleSolver or incremental mode solving.
```python
from z3 import *
s = SimpleSolver()
x, y, z = Ints('x y z')
s.add(x == y)
s.add(y == z)
s.check()
print(s.root(x), s.root(y), s.root(z))
print(s.next(x), s.next(y), s.next(z))
```
this is to enable use cases like:
```
from z3 import *
s = Solver()
OnClause(s, print)
s.set("solver.proof.check", False)
s.from_file("../satproof.smt2")
```
instead of setting global parameters before the proof replay is initialized.
* Allow reseting the stream of smt2::scanner
* Put the parser of parse_smt2_commands in the cmd_context
* Move parser streams to cmd_context
* Move parser fields from cmd_context to api::context
* Move forward declarations from cmd_context.h to api_context.h
* Change parse_smt2_commands_with_parser to use *& instead of **
* Add tests for Z3_eval_smtlib2_string
* Don't reuse the streams in Z3_eval_smtlib2_string
* Fix indentation
* Add back unnecessary deleted line
Co-authored-by: Nuno Lopes <nuno.lopes@tecnico.ulisboa.pt>
* feat: basic array support
Still need deeper type support for Arrays
* fixed broken format rules
* spaces inside curly
* feat: range sort type inference
* feat: better type inference in model eval
* doc: fixed some incorrect documentation
* feat: domain type inference
* feat: addressed suggestions
* feat: addressed suggestions
* chore: moved ts-expect from deps to dev-deps
* test: added z3guide examples
* fix: removed ts-expect from dependencies again
* docs: fixed some documentation
The user-propagator object has to be manually disposed (IDisposable), otherwise it stays in memory forever, as it cannot be garbage collected automatically
* Dotnet Api: suppress GC finalization of dotnet context in favor of re-registering finalization
* Dotnet Api: enable concurrent dec-ref even if context is created without parameters.
* Dotnet Api: removed dead code.
The notion of reference counted contexts never worked.
The reference count to a context only ends up being 0 if the GC kicks in and disposes the various z3 objects. A call to Dispose on Context should free up all resources associated with that context. In exchange none of the resources are allowed any other operation than DecRef. The invocations of DecRef are protected by a lock and test on the context that the native pointer associated with the context is non-zero. Dispose sets the native pointer to zero.
Z3_enable_concurrent_dec_ref ensures that:
- calls to decref are thread safe. Other threads can operate on the context without interference.
The Z3_context ensures that
- z3objects allocated, but not disposed during the lifetime of Z3_context are freed when Z3_context is deleted (it triggers a debug warning, but this is now benign).