3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-26 13:53:33 +00:00

nseq: port ZIPT regex pre-check to fix benchmark discrepancy on regex-only problems (#8994)

* Initial plan

* Port ZIPT regex pre-check and DFS node budget to address nseq benchmark discrepancy

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Copilot 2026-03-15 10:10:53 -07:00 committed by GitHub
parent 2212f59704
commit d53846d501
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 140 additions and 0 deletions

View file

@ -54,7 +54,9 @@ void smt_params::updt_local_params(params_ref const & _p) {
m_logic = _p.get_sym("logic", m_logic);
m_string_solver = p.string_solver();
m_nseq_max_depth = p.nseq_max_depth();
m_nseq_max_nodes = p.nseq_max_nodes();
m_nseq_parikh = p.nseq_parikh();
m_nseq_regex_precheck = p.nseq_regex_precheck();
m_up_persist_clauses = p.up_persist_clauses();
validate_string_solver(m_string_solver);
if (_p.get_bool("arith.greatest_error_pivot", false))

View file

@ -249,7 +249,9 @@ struct smt_params : public preprocessor_params,
// -----------------------------------
symbol m_string_solver;
unsigned m_nseq_max_depth = 0;
unsigned m_nseq_max_nodes = 0;
bool m_nseq_parikh = true;
bool m_nseq_regex_precheck = true;
smt_params(params_ref const & p = params_ref()):
m_string_solver(symbol("auto")){

View file

@ -124,7 +124,9 @@ def_module_params(module_name='smt',
('theory_case_split', BOOL, False, 'Allow the context to use heuristics involving theory case splits, which are a set of literals of which exactly one can be assigned True. If this option is false, the context will generate extra axioms to enforce this instead.'),
('string_solver', SYMBOL, 'seq', 'solver for string/sequence theories. options are: \'z3str3\' (specialized string solver), \'seq\' (sequence solver), \'auto\' (use static features to choose best solver), \'empty\' (a no-op solver that forces an answer unknown if strings were used), \'none\' (no solver), \'nseq\' (Nielsen-based string solver)'),
('nseq.max_depth', UINT, 0, 'maximum Nielsen search depth for theory_nseq (0 = unlimited)'),
('nseq.max_nodes', UINT, 0, 'maximum number of DFS nodes explored by theory_nseq per solve() call (0 = unlimited)'),
('nseq.parikh', BOOL, True, 'enable Parikh image checks in nseq solver'),
('nseq.regex_precheck', BOOL, True, 'enable regex membership pre-check before DFS in theory_nseq: checks intersection emptiness per-variable and short-circuits SAT/UNSAT for regex-only problems'),
('core.validate', BOOL, False, '[internal] validate unsat core produced by SMT context. This option is intended for debugging'),
('seq.split_w_len', BOOL, True, 'enable splitting guided by length constraints'),
('seq.validate', BOOL, False, 'enable self-validation of theory axioms created by seq theory'),