3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-02 20:47:52 +00:00
Commit graph

3485 commits

Author SHA1 Message Date
kper
b24aec3c4c
Fixed tests by making methods public for finite sets (#7977) 2025-10-15 14:03:00 +02:00
Nikolaj Bjorner
f2260d959d test
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 18:01:41 +02:00
Nikolaj Bjorner
a1b831a3e1 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:50:08 +02:00
Copilot
930ba5ebd6
Implement inverter functions for finite-set operators (#7974)
* Initial plan

* Add set operator inverters to array_expr_inverter

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

* Refactor expr_inverter to remove set operations

Removed handling for set operations like union, intersection, and difference in expr_inverter.cpp. Introduced finite_set_inverter class to manage set union operation.

* Remove OP_SET_COMPLEMENT case from expr_inverter

Removed handling for OP_SET_COMPLEMENT in expr_inverter.

* Change OP_SET_UNION to OP_FINITE_SET_UNION

---------

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>
2025-10-14 17:48:40 +02:00
Nikolaj Bjorner
0efe3820fc build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:46:49 +02:00
Nikolaj Bjorner
5dacb270f8 add to spec
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-14 17:33:19 +02:00
Copilot
75bac9c0ce
Implement finite_set_axioms.cpp and fix empty set constructor bug (#7973)
* Initial plan

* Add finite_set_axioms.cpp implementation and update CMakeLists.txt

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

* Fix finite_set_decl_plugin bug and complete implementation

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

* Use array select instead of function application for map and select axioms

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

* Simplify range assignment in finite_set_decl_plugin

---------

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>
2025-10-14 17:16:29 +02:00
Copilot
c526c20cfc
Implement finite_set_rewriter with basic algebraic simplification rules (#7972)
* Initial plan

* Add finite_set_rewriter implementation with basic rewrite rules

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

* Fix finite_set_decl_plugin bug and complete implementation

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

* Revert finite_set_decl_plugin changes and disable difference rule

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

* Re-enable difference rule using set_sort directly

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

* Update finite_set_rewriter.h

---------

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>
2025-10-14 17:13:18 +02:00
Nikolaj Bjorner
9442b41716 remove debug output
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-13 22:40:21 +02:00
Nikolaj Bjorner
1b9f27a798 patch definitions, add pretty print support
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-13 22:39:32 +02:00
Lev Nachmanson
fc2c5c7f58 fix the order of parameter evaluation
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-13 21:01:22 +02:00
Lev Nachmanson
e1db3c0b17 fixing the order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-13 21:01:22 +02:00
Lev Nachmanson
33ae08ab29 fixing the order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-10-13 21:00:54 +02:00
Copilot
df4052ec69
Implement finite_set_decl_plugin with complete operator support and polymorphism infrastructure (#7961)
* Initial plan

* Implement finite_sets_decl_plugin with all specified operations

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

* Add tests for finite_sets_decl_plugin

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

* Add set.singleton operator to finite_sets_decl_plugin

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

* Refactor finite_sets_decl_plugin to use polymorphic signatures and Array sorts

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

* Rename finite_sets to finite_set everywhere including file names

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

* Rename set.filter to set.select

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

* Refactor finite_set_decl_plugin to use polymorphism_util

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

* Move psig and match method to polymorphism_util

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

* Add MATCH macros and fix is_fully_interp return value

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

* Add is_finite_set helper and parameter count validation

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>
2025-10-13 10:58:53 +02:00
Nikolaj Bjorner
7356b5ff88 outline finite_set theory solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-05 16:22:28 -07:00
Nikolaj Bjorner
97c8fb15fa update contract
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-05 14:15:08 -07:00
Nikolaj Bjorner
2ce30019ee remove old files
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-05 14:06:36 -07:00
Nikolaj Bjorner
ad7b248956 add outline of axiomatization
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-05 14:04:51 -07:00
Nikolaj Bjorner
522be5d8c2 add stub for rewriter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-04 18:14:43 -07:00
Nikolaj Bjorner
fb41fbf5e1 placeholder for finite set signature
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-04 17:30:25 -07:00
Nikolaj Bjorner
e0fca3ba25 placeholder for finite set signature
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-10-04 17:18:12 -07:00
Nikolaj Bjorner
ce53e06e29
Par (#7945)
* port parallel

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* updates

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* update smt-parallel

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* cleanup

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* neat

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* configuration parameter renaming

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* config parameters

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-09-21 10:11:04 +03:00
Lev Nachmanson
c43cb18e63 better rewriting
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-09-18 08:08:32 -07:00
Lev Nachmanson
37904b9e85 fix the parameter evaluation order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-09-18 07:52:13 -07:00
Lev Nachmanson
9b88aaf134 determine parameter evaluation order
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-09-16 16:32:46 -07:00
Nikolaj Bjorner
3c897b450f add rewrite rules for update-field under accessors and recognizers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-09-14 06:14:42 -07:00
Nikolaj Bjorner
d701702735 remove model converter operator on expr_ref& 2025-09-07 16:42:20 -07:00
Nikolaj Bjorner
7005d04755 propagate mod over ite even if it hurts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-09-02 18:39:29 -07:00
Nikolaj Bjorner
a382ddbd8a add rewrite for mod over negation, refine axioms for grobner quotients 2025-09-02 18:26:22 -07:00
Nikolaj Bjorner
debe04350c fix #7796
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-08-18 09:30:03 -07:00
Nikolaj Bjorner
7ff0b246e8 fix #7792
add missing revert operations
2025-08-17 17:08:27 -07:00
Nikolaj Bjorner
4082e4e56a update on euf 2025-08-17 16:51:00 -07:00
Copilot
a467d8c004
Fix compilation warning: add missing is_passive_eq case to switch statement (#7785)
* Initial plan

* Fix compilation warning: add missing is_passive_eq case to switch statement

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>
2025-08-15 09:50:45 -07:00
Nikolaj Bjorner
6df8b39718 Update seq_rewriter.cpp 2025-08-14 14:40:26 -07:00
Nikolaj Bjorner
237891c901 updates to euf completion 2025-08-13 10:24:46 -07:00
Nikolaj Bjorner
fcd3a70c92 remove theory_str and classes that are only used by it 2025-08-07 21:05:12 -07:00
Nikolaj Bjorner
d4a4dd6cc7 add arithemtic saturation 2025-08-06 21:11:54 -07:00
Nikolaj Bjorner
b9b3e0d337 Update euf_completion.cpp
try out restricting scope of equalities added by instantation
2025-08-03 14:17:00 -07:00
Nikolaj Bjorner
d8fafd8731 Update euf_ac_plugin.cpp
include reduction rules in forward simplification
2025-08-03 14:17:00 -07:00
Nikolaj Bjorner
f77123c13c enable passive, add check for bloom up-to-date 2025-07-27 17:18:23 -07:00
Nikolaj Bjorner
67695b4cd6 updates to ac-plugin
fix incrementality bugs by allowing destructive updates during saturation at the cost of redoing saturation after a pop.
2025-07-27 13:38:37 -07:00
Nikolaj Bjorner
e3139d4e03 #7750
add pre-processing simplification
2025-07-27 13:38:36 -07:00
Nikolaj Bjorner
ad2934f8cf fix unsound len(substr) axiom
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-07-26 15:38:25 -07:00
Nikolaj Bjorner
1f8b08108c #7739 optimization
add simplification rule for at(x, offset) = ""

Introducing j just postpones some rewrites that prevent useful simplifications. Z3 already uses common sub-expressions.
The example highlights some opportunities for simplification, noteworthy at(..) = "".
The example is solved in both versions after adding this simplification.
2025-07-26 14:02:34 -07:00
Nikolaj Bjorner
8e1a528796 ensure atomic constraints are processed by arithmetic solver 2025-07-26 12:52:48 -07:00
Nikolaj Bjorner
0528c86905 fix #7745
axioms for len(substr(...)) escaped due to nested rewriting
2025-07-26 12:30:42 -07:00
Nikolaj Bjorner
95be0cf9ba remove verbose output
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-07-25 20:22:52 -07:00
Nikolaj Bjorner
e54928679f add option to selectively disable variable solving for only ground expressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-07-25 19:15:20 -07:00
Nikolaj Bjorner
01633f7ce2 respect smt configuration parameter in elim_unconstrained simplifier
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-07-24 16:22:08 -07:00
Nikolaj Bjorner
a6c51df144 ensure solve_eqs is fully disabled when smt.solve_eqs=false, #7743
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-07-24 14:54:15 -07:00