3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-05-17 07:29:28 +00:00
Commit graph

4749 commits

Author SHA1 Message Date
CEisenhofer
14f71ea852 Reuse power variables and symbolic characters 2026-03-31 16:36:10 +02:00
Nikolaj Bjorner
54d52d882f remove indirect references to ast_manager
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-30 20:00:02 -07:00
Nikolaj Bjorner
6d2321e6fe edits to seq_nielsen
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-30 17:36:27 -07:00
Nikolaj Bjorner
9aceaf3cac reviewing seq_nielsen, detect repeated final-check to avoid rebuilding nielsen graph
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-30 00:01:24 -07:00
Nikolaj Bjorner
a79a48ed2a add comment about fresh variable
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-29 20:16:07 -07:00
Nikolaj Bjorner
684cb23b40 turn on constraint integrity checking
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-29 19:30:13 -07:00
Nikolaj Bjorner
d7ee475bc3 ensure equalities are propagated
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-29 16:47:05 -07:00
Copilot
09cde1f80c
Port propagate_eq from theory_seq for sk().is_eq in theory_nseq (#9165)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/7c0a330f-3f9f-4c5d-99f2-47fad013538f

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-29 15:44:18 -07:00
Nikolaj Bjorner
3db734d249 add note about propagate-eq
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-29 15:19:36 -07:00
CEisenhofer
ebd35bc5a3 Avoid doing extensions steps twice, as the bounds are recognized too late 2026-03-26 17:32:41 +01:00
CEisenhofer
dcc85cf9ef Bug in power elimination 2026-03-26 17:18:38 +01:00
Nikolaj Bjorner
2a72faf15e make sure conflict literal is negated
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-26 08:01:00 -07:00
CEisenhofer
3b5b53126e Bug fixing with unit replacement 2026-03-26 15:56:58 +01:00
CEisenhofer
17ca44b351 Readded depth limit 2026-03-26 11:30:54 +01:00
Nikolaj Bjorner
fa4cd37c07 add the false literal callback
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-25 13:35:25 -07:00
Nikolaj Bjorner
77d86343d0 add the false literal callback
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-25 13:35:18 -07:00
CEisenhofer
ed403efefd Readded subsolver bound computation (something went wrong with git) 2026-03-25 20:26:30 +01:00
CEisenhofer
910c68cd42 Missing internalization 2026-03-25 20:21:54 +01:00
CEisenhofer
495921ca17 Fixed splitting on symbolic character 2026-03-25 20:21:54 +01:00
CEisenhofer
813a06fa38 Use subsolvers bounds rather than computing them inside nseq 2026-03-25 20:21:49 +01:00
Nikolaj Bjorner
af4677950b add code for adding assumptions after sat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-25 11:45:43 -07:00
Nikolaj Bjorner
a0ba950987 fix type errors
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-25 11:19:53 -07:00
Nikolaj Bjorner
9d2244798d fix insertions into subst.
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-25 09:00:37 -07:00
Copilot
46c76d89e0
Make dep_mgr private in seq_nielsen; expose conflict sources vector (#9129)
* make dep_mgr private in seq_nielsen, expose conflict_sources vector

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/998d8021-4808-4feb-afc5-b2447c6a64e5

* move deps_to_lits to seq namespace in seq_nielsen

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/8d736478-8f9b-4451-8d1f-539ce72525c7

---------

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-25 08:05:00 -07:00
Copilot
49f2eb0e49
seq_nielsen: use arith binary match overloads in get_const_power_diff (#9125)
* refactor get_const_power_diff to use is_add/is_sub binary overloads

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/1d71a642-bb8f-43ca-88fd-9dc48f5aab24

* fix build: remove unnecessary arith_solver.h include from seq_nielsen.cpp

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/bb09a786-4445-4645-9930-e80494d96dbf

---------

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: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-25 06:51:51 -07:00
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
Nikolaj Bjorner
9f6eb4f455 remove unused fields
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-24 19:57:43 -07:00
Nikolaj Bjorner
6a6f9b1892 Merge remote-tracking branch 'origin/master' into c3
# Conflicts:
#	.github/workflows/qf-s-benchmark.lock.yml
#	.github/workflows/qf-s-benchmark.md
#	.github/workflows/zipt-code-reviewer.lock.yml
#	.github/workflows/zipt-code-reviewer.md
#	.gitignore
#	src/ast/rewriter/seq_rewriter.cpp
#	src/test/main.cpp
2026-03-24 17:44:48 -07:00
Nikolaj Bjorner
5803c6f202 fix bug in non-emptiness witness extraction
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-24 13:27:28 -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
Nikolaj Bjorner
dbdccbff97 use recursive function for not-contains
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2026-03-23 13:18:34 -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
Copilot
ad94dd1b7a
implement replace_all_axiom using recursive predicate ra(s,p,t,r) (#9095)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/c550da78-28c6-4ab4-9bfb-7403ecc3320b

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 18:44:29 -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
Copilot
2ab53072e9
Implement ensure_digit_axiom in theory_nseq (#9075)
Agent-Logs-Url: https://github.com/Z3Prover/z3/sessions/9b679ca3-dba7-469c-907a-9abd5edf1e1d

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-20 19:46:22 -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