mirror of
https://github.com/Z3Prover/z3
synced 2026-06-23 00:50:29 +00:00
Implement ZIPT string solver skeleton (theory_nseq)
Add theory_nseq, a Nielsen-graph-based string solver plugin for Z3. ## New files - src/smt/nseq_state.h/.cpp: constraint store bridging SMT context to Nielsen graph with manual push/pop backtracking - src/smt/nseq_regex.h/.cpp: regex membership handling via Brzozowski derivatives (stub delegates to sgraph::brzozowski_deriv) - src/smt/nseq_model.h/.cpp: model generation stub - src/smt/theory_nseq.h/.cpp: main theory class implementing smt::theory with its own private egraph/sgraph, returns FC_GIVEUP as skeleton - src/test/nseq_basic.cpp: unit tests covering instantiation, parameter validation, trivial-equality SAT, and node simplification ## Extensions to seq_nielsen.h/.cpp - Add search_result enum and solve() iterative-deepening DFS entry point - Add search_dfs() recursive DFS driver - Add simplify_node(), generate_extensions(), collect_conflict_deps() - Add nielsen_node::simplify_and_init(): trivial removal, empty propagation, prefix matching, symbol clash detection - Add nielsen_node::is_satisfied(), is_subsumed_by() - Implement Det, Const Nielsen, and Eq-split modifiers in generate_extensions() ## Integration - smt_params.cpp: accept 'nseq' as valid string_solver value - smt_params_helper.pyg: document 'nseq' option - smt_setup.h/.cpp: add setup_nseq(), wire into setup_QF_S() and setup_seq_str() - smt/CMakeLists.txt: add new sources and smt_seq dependency Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
a7084de5a8
commit
0bdec633d7
18 changed files with 997 additions and 6 deletions
|
|
@ -35,6 +35,7 @@ Revision History:
|
|||
#include "smt/theory_seq_empty.h"
|
||||
#include "smt/theory_seq.h"
|
||||
#include "smt/theory_char.h"
|
||||
#include "smt/theory_nseq.h"
|
||||
#include "smt/theory_special_relations.h"
|
||||
#include "smt/theory_sls.h"
|
||||
#include "smt/theory_pb.h"
|
||||
|
|
@ -571,7 +572,9 @@ namespace smt {
|
|||
else if (m_params.m_string_solver == "auto") {
|
||||
setup_unknown();
|
||||
}
|
||||
|
||||
else if (m_params.m_string_solver == "nseq") {
|
||||
setup_nseq();
|
||||
}
|
||||
else if (m_params.m_string_solver == "empty") {
|
||||
setup_seq();
|
||||
}
|
||||
|
|
@ -579,7 +582,7 @@ namespace smt {
|
|||
// don't register any solver.
|
||||
}
|
||||
else {
|
||||
throw default_exception("invalid parameter for smt.string_solver, valid options are 'seq', 'auto'");
|
||||
throw default_exception("invalid parameter for smt.string_solver, valid options are 'seq', 'auto', 'nseq'");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -754,11 +757,14 @@ namespace smt {
|
|||
else if (m_params.m_string_solver == "none") {
|
||||
// don't register any solver.
|
||||
}
|
||||
else if (m_params.m_string_solver == "nseq") {
|
||||
setup_nseq();
|
||||
}
|
||||
else if (m_params.m_string_solver == "auto") {
|
||||
setup_seq();
|
||||
}
|
||||
else {
|
||||
throw default_exception("invalid parameter for smt.string_solver, valid options are 'seq', 'auto'");
|
||||
throw default_exception("invalid parameter for smt.string_solver, valid options are 'seq', 'auto', 'nseq'");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -785,6 +791,11 @@ namespace smt {
|
|||
m_context.register_plugin(alloc(smt::theory_char, m_context));
|
||||
}
|
||||
|
||||
void setup::setup_nseq() {
|
||||
m_context.register_plugin(alloc(smt::theory_nseq, m_context));
|
||||
setup_char();
|
||||
}
|
||||
|
||||
void setup::setup_finite_set() {
|
||||
m_context.register_plugin(alloc(smt::theory_finite_set, m_context));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue