3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-23 00:55:31 +00:00

notes on gc

This commit is contained in:
Jakob Rath 2023-07-24 10:53:57 +02:00
parent a369c1b810
commit 2226f508e8
2 changed files with 23 additions and 0 deletions

View file

@ -14,6 +14,21 @@ Author:
Nikolaj Bjorner (nbjorner) 2021-03-19
Jakob Rath 2021-04-06
Notes:
TODO: at some point we should add proper garbage collection
- currently solver::del_var is disabled because we may introduce helper variables during conflict resolution
- each non-polynomial term (extract/concat/pseudo-inverse/...) is represented by a pvar ("special variable")
- garbage collection:
- could go over trail to discover active variables/constraints
- could do reference counting, e.g., by counting the occurrences of special variables in constraints and clauses
- alternatively, reinit clauses after backtracking:
- note all 'special' variables that have been used
- recreate them after backtracking
- replace the old variables by the newly created ones
- here, we would track clauses by the level they're created on, and reinit brings the clause to a lower level
--*/
#include "math/polysat/solver.h"

View file

@ -40,6 +40,14 @@ namespace polysat {
using pvar_vector = unsigned_vector;
inline const pvar null_var = UINT_MAX;
enum class pvar_kind : std::uint8_t {
external, // regular variables (from the input formula)
name, // name for a polynomial term
op, // result of an op_constraint
extract, // result of an extract operation
concat, // result of a concat operation
};
class dependency {
unsigned m_val;
public: