3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-04-03 18:31:08 +00:00
Commit graph

112 commits

Author SHA1 Message Date
Nikolaj Bjorner
8eaa9d9e6b add back cur_path as a local variable
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-25 06:30:52 -07:00
Nikolaj Bjorner
9893a09fad na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-25 06:11:08 -07:00
CEisenhofer
c91b485fcf Int Bounds where not updated properly 2026-03-25 12:47:52 +01:00
CEisenhofer
178d7439f2 Fixed to_dot for integer constraints 2026-03-25 11:25:07 +01:00
Copilot
e3e235aa7f
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>
2026-03-24 22:18:30 -07:00
CEisenhofer
da9d8c8694 Asserting character constraints 2026-03-24 16:51:01 +01:00
CEisenhofer
48273ca0ed Fixed unit substitution 2026-03-24 16:24:28 +01:00
CEisenhofer
aab96dbd29 Rule for unwinding powers in membership constraints 2026-03-24 14:58:10 +01:00
CEisenhofer
538fbc1b8d Added unit (not char) case in apply_const_nielsen 2026-03-24 13:34:39 +01:00
CEisenhofer
b74f0bbb00 Signature splits
Fixed dot printing errorfor Skolems
2026-03-24 13:20:30 +01:00
Copilot
1c24c835c9
Fix three assertion violations in nseq string solver (#9106)
- seq_model.cpp: skip trivial memberships in collect_var_regex_constraints;
  SAT leaf nodes can have "" in nullable_regex (trivial) in addition to
  primitive (single-variable) memberships after Brzozowski derivative
  consumption reduces a concrete string membership to empty.

- seq_nielsen.cpp: fix SASSERT(!var) typo in var_ub(); should be SASSERT(var)
  matching the pattern in var_lb().

- seq_regex.cpp: replace VERIFY(re_expr) with null guard in
  minterm_to_char_set(); nullptr means no regex constraint and should
  return the full alphabet, as the test test_minterm_nullptr_is_full expects.


Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/31db5346-9b60-4a20-a101-beca9fc9e4f8

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-23 13:20:06 -07:00
Copilot
8db175447b
Handle unit-unit prefix/suffix splits in simplify_and_init (#9097)
When both leading (or trailing) tokens of a string equality are
is_char_or_unit(), split the equality:
  unit(a) ++ rest1 == unit(b) ++ rest2  ->  unit(a)==unit(b), rest1==rest2
  unit(a) ++ rest1 == unit(b)           ->  unit(a)==unit(b), rest1==empty
  unit(a) == unit(b) ++ rest2           ->  unit(a)==unit(b), empty==rest2
(symmetric suffix case handled too)

Add three unit tests covering prefix split, prefix split with empty
rest, and suffix split.


Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/565287e9-a121-4bae-8aa4-6c2ec93e660f

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-22 19:39:33 -07:00
Nikolaj Bjorner
7b27866310 simplify solution conditions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-22 18:30:52 -07:00
Copilot
e0ca916e23
refactor: move nielsen graph display/to_dot routines into seq_nielsen_pp.cpp (#9090)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/c2457bcf-85f0-4ad7-9ff1-d394f4315698

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-22 17:44:22 -07:00
Nikolaj Bjorner
1863290b71 add deterministic solving for unit equations
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-22 15:34:16 -07:00
Copilot
6b5401ef68
Remove s_other from snode_kind; unify under s_var and is_var() (#9087)
* remove s_other, use s_var and is_var() instead

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/d56594ed-7f7e-436a-a4b2-e6dc986b18a8

* fix build: add reset() override to test dummy solver stubs

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/d437376d-55d8-4087-baf1-e89451d2d597

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-22 12:05:24 -07:00
Nikolaj Bjorner
aa210882c5 add review
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-21 10:14:34 -07:00
Nikolaj Bjorner
ae12956545 updates based on discussion
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-20 11:20:29 -07:00
CEisenhofer
2bd5283f6a Assertions 2026-03-20 15:11:51 +01:00
CEisenhofer
737c5d44ed Simplify regex splits 2026-03-20 13:33:53 +01:00
CEisenhofer
5d912bdfa5 ... 2026-03-20 12:22:38 +01:00
CEisenhofer
fdb7f33552 ... one more 2026-03-20 12:20:16 +01:00
CEisenhofer
e3ed7f214b Removed debug lines 2026-03-20 12:19:53 +01:00
CEisenhofer
a873d5cdda Fixed output error 2026-03-20 11:51:37 +01:00
Nikolaj Bjorner
1d928663de add reset method
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-19 22:57:59 -07:00
Nikolaj Bjorner
a895548b99 cleanup
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-19 16:39:41 -07:00
CEisenhofer
51f3996464 Create dummy sat-node to avoid problems in case the preprocessor solves the problem entirely 2026-03-19 16:02:51 +01:00
Copilot
f837651434
seq_nielsen: replace mk_fresh_var() with mk_fresh_var(sort* s) (#9037)
* replace mk_fresh_var() with mk_fresh_var(sort* s) in seq_nielsen; fix snode_label_html linkage

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

* remove mk_var(symbol const&) from sgraph; update all callers to pass sort explicitly

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>
2026-03-18 20:41:41 -07:00
CEisenhofer
777bda01a5 Subsolver was not reset properly 2026-03-18 20:22:08 +01:00
Nikolaj Bjorner
c43df60182 fix build of unit tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-18 10:29:41 -07:00
Nikolaj Bjorner
8ac8eb4ae7 create sub-class for tracked eq and mem relations to separate from seq_nielsen
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-18 10:04:01 -07:00
CEisenhofer
e7431400b4 Regex bug fixes (still not there) 2026-03-18 18:01:44 +01:00
CEisenhofer
983379f5e2 Missing semicolon 2026-03-18 16:16:59 +01:00
CEisenhofer
0a32337f0a Removed some brackets 2026-03-18 16:15:37 +01:00
CEisenhofer
43950569eb More fixes 2026-03-18 15:41:27 +01:00
CEisenhofer
b288c2e7dc Some more bug fixes 2026-03-18 14:54:12 +01:00
CEisenhofer
ab53889c10 Fixed couple of regex problems [there are still others] 2026-03-18 14:29:18 +01:00
Nikolaj Bjorner
b1bae695e6 comment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-17 16:32:01 -07:00
Nikolaj Bjorner
2847dd8bb3 small simplification
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-17 16:30:53 -07:00
Nikolaj Bjorner
3719b449e8 re-organize dependencies
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-17 16:18:27 -07:00
Copilot
ef22ae8871
Replace dep_tracker uint_set with scoped_dependency_manager<dep_source> in seq_nielsen (#9014)
* Initial plan

* replace dep_tracker uint_set with scoped_dependency_manager<dep_source>

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

* fix test build: update dep_tracker usages in test files and seq_state.h

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>
2026-03-16 15:52:18 -07:00
CEisenhofer
84d371f2e9 Bugfix in regex overapproximation 2026-03-16 19:54:12 +01:00
CEisenhofer
16f693b09a Regex intersection bug fixe 2026-03-16 16:30:20 +01:00
Nikolaj Bjorner
db8a2f4f9e update print and cancelation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-15 20:43:49 -07:00
Nikolaj Bjorner
7dea14f732 move statistics
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-15 20:09:19 -07:00
Copilot
1a8570ed3f
Refactor seq_nielsen: address NSB review comments (#8993)
* Initial plan

* Refactor seq_nielsen: m_graph reference, accessor methods, seq_util.is_power, m.are_equal/are_distinct

- Add ast_manager& m_m and seq_util& m_seq members to nielsen_graph with accessors
- Change m_graph from pointer to reference in nielsen_node
- Remove redundant g parameter from simplify_and_init (use m_graph instead)
- Use seq.str.is_power() matcher in get_power_base/exp_expr and handle_empty_side
- Use m.are_equal/are_distinct for E-graph-aware token comparison
- Fix seq.is_const_char unchecked return value
- Simplify has_char/all_eliminable loop with std::any_of/all_of
- Fix rebuilt=nullptr pattern in merge_adjacent_powers and simplify_const_powers
- Add formal Spec: comments for DirectionalInconsistency and CommPower cancellation
- Remove addressed NSB review comments

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix CI: update test files for simplified simplify_and_init signature

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: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-03-15 10:35:45 -07:00
Copilot
d53846d501
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>
2026-03-15 10:10:53 -07:00
Nikolaj Bjorner
40b9d80ae5 more review
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-14 12:20:01 -07:00
Nikolaj Bjorner
744d75e8cc more review
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-14 12:10:12 -07:00
Nikolaj Bjorner
0dc5b4eef5 add review comments
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-14 11:59:47 -07:00