mirror of
https://github.com/Z3Prover/z3
synced 2026-06-28 11:28:49 +00:00
Refactor: replace int_constraint with constraint struct, promote cur_path to member, expose path leaf side constraints (#9124)
* chore: update plan with cur_path and side constraints requirements Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/1523cf0a-b7a4-41a6-b792-7cd41b4dcd3b * Refactor: rename int_constraint to constraint, remove int_constraint_kind enum - Rename int_constraint struct to constraint with fields fml/dep - Remove int_constraint_kind enum; pre-build formula expressions instead - nielsen_edge: add_side_int/side_int() -> add_side_constraint/side_constraints() - nielsen_node: add_int_constraint/int_constraints() -> add_constraint/constraints() - nielsen_graph: mk_int_constraint(lhs,rhs,kind,dep) -> mk_constraint(fml,dep) - Remove int_constraint_to_expr (no longer needed) - search_dfs/simplify_and_init/check_int_feasibility/check_lp_le: drop cur_path param - Add m_cur_path member to nielsen_graph; m_cur_path.reset() in solve() - Add get_path_leaf_side_constraints() implementation - Update seq_parikh.h/cpp and seq_nielsen_pp.cpp to use new constraint API Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * refactor: constraint struct, promote cur_path, expose path leaf side constraints Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/1523cf0a-b7a4-41a6-b792-7cd41b4dcd3b * fix: remove spurious includes from seq_nielsen.cpp Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/aa283d79-cd42-4b87-aaf0-4273a8327b76 * fix: update test files to use renamed constraint API and fix inverted root guard Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/b09bbc56-9617-4277-8e0c-27fa7e588037 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
9f6eb4f455
commit
e3e235aa7f
7 changed files with 183 additions and 231 deletions
|
|
@ -209,16 +209,10 @@ namespace seq {
|
|||
return dot_html_escape(os.str());
|
||||
}
|
||||
|
||||
// Helper: render an int_constraint as an HTML string for DOT edge labels.
|
||||
static std::string int_constraint_html(int_constraint const& ic, obj_map<expr, std::string>& names, uint64_t& next_id, ast_manager& m) {
|
||||
std::string r = arith_expr_html(ic.m_lhs, names, next_id, m);
|
||||
switch (ic.m_kind) {
|
||||
case int_constraint_kind::eq: r += " = "; break;
|
||||
case int_constraint_kind::le: r += " ≤ "; break; // ≤
|
||||
case int_constraint_kind::ge: r += " ≥ "; break; // ≥
|
||||
}
|
||||
r += arith_expr_html(ic.m_rhs, names, next_id, m);
|
||||
return r;
|
||||
// Helper: render a constraint as an HTML string for DOT edge labels.
|
||||
static std::string constraint_html(constraint const& ic, obj_map<expr, std::string>& names, uint64_t& next_id, ast_manager& m) {
|
||||
if (ic.fml) return arith_expr_html(ic.fml, names, next_id, m);
|
||||
return "null";
|
||||
}
|
||||
|
||||
static std::string regex_expr_html(expr* e, ast_manager& m, seq_util& seq) {
|
||||
|
|
@ -499,9 +493,9 @@ namespace seq {
|
|||
}
|
||||
}
|
||||
// integer constraints
|
||||
for (auto const& ic : m_int_constraints) {
|
||||
for (auto const& ic : m_constraints) {
|
||||
if (!any) { out << "Cnstr:<br/>"; any = true; }
|
||||
out << int_constraint_html(ic, names, next_id, m) << "<br/>";
|
||||
out << constraint_html(ic, names, next_id, m) << "<br/>";
|
||||
}
|
||||
|
||||
if (!any)
|
||||
|
|
@ -606,11 +600,11 @@ namespace seq {
|
|||
<< " → ?" << cs.m_val->id();
|
||||
}
|
||||
// side constraints: integer equalities/inequalities
|
||||
for (auto const& ic : e->side_int()) {
|
||||
for (auto const& ic : e->side_constraints()) {
|
||||
if (!first) out << "<br/>";
|
||||
first = false;
|
||||
out << "<font color=\"gray\">"
|
||||
<< int_constraint_html(ic, names, next_id, m)
|
||||
<< constraint_html(ic, names, next_id, m)
|
||||
<< "</font>";
|
||||
}
|
||||
out << ">";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue