3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-25 23:33:41 +00:00
Commit graph

19733 commits

Author SHA1 Message Date
Nikolaj Bjorner
423930dbad missing files 2025-06-10 16:31:13 -07:00
Nikolaj Bjorner
e1661759db update version to 4.15.2 2025-06-10 15:55:54 -07:00
Nikolaj Bjorner
b665c99d06 add missing dependencies
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-09 13:05:09 -07:00
Nikolaj Bjorner
c387b20ac6 move smt params to params directory, update release.yml 2025-06-09 10:47:22 -07:00
Nikolaj Bjorner
dc420332b8 use userSpecifiedTag instead of gitTag
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-08 20:51:06 -07:00
Nikolaj Bjorner
81f4125f05 update to @1 for githubpublish action
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-08 19:10:19 -07:00
Nikolaj Bjorner
602cfafd96 update version number of github release
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-08 12:57:35 -07:00
Nikolaj Bjorner
e8f627cde9 disable pypi publishing
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-08 12:46:18 -07:00
Nikolaj Bjorner
d37336eb07 remove trace by default from tests
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-08 09:22:43 -07:00
Nikolaj Bjorner
98d86c6687 disable tracing in test code
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-08 08:08:10 -07:00
Nikolaj Bjorner
4bd999c295 update release notes 2025-06-07 16:18:50 -07:00
Nikolaj Bjorner
befbd8d702 add parameter 2025-06-07 15:48:34 -07:00
Nikolaj Bjorner
9d35a8c702 updates to euf-completion to 2025-06-07 15:39:31 -07:00
Nikolaj Bjorner
9db227dbf1 fix bug in trim code missing dependecy 2025-06-07 15:39:05 -07:00
Nikolaj Bjorner
2897661bb3 register completion with solver 2025-06-06 20:45:54 +02:00
Nikolaj Bjorner
1cd162203d make rule processing fully incremental 2025-06-06 20:45:54 +02:00
Christoph M. Wintersteiger
590b79dc54
Fix #7623 (#7672) 2025-06-06 20:29:04 +02:00
Nikolaj Bjorner
3e75b22c94 fix build 2025-06-06 19:21:11 +02:00
Nikolaj Bjorner
d33d6ebe83 handle build warnings 2025-06-06 15:13:31 +02:00
Nikolaj Bjorner
7566f088f9 vtable
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-06 15:02:34 +02:00
Nikolaj Bjorner
08c4f73e32 add dependencies to fix build 2025-06-06 13:02:48 +02:00
Nikolaj Bjorner
e2cf4d99fb add better bit-blasting for rotation #7673 2025-06-06 12:30:00 +02:00
Nikolaj Bjorner
564830ab31 enable conditional euf-completion with (optional) solver
This allows using z3 for limited E-saturation simplification.
The tactic rewrites all assertions using the E-graph induced by the equalities and instantiated equality axioms.
It does allow solving with conditionals, although this is a first inefficient cut.

The following is a sample use case that rewrites to false.
```
(declare-fun prime () Int)
(declare-fun add (Int Int) Int)
(declare-fun mul (Int Int) Int)
(declare-fun ^ (Int Int) Int)
(declare-fun sub (Int Int) Int)
(declare-fun i () Int)
(declare-fun j () Int)
(declare-fun base () Int)
(declare-fun S () (Seq Int))
(declare-fun hash ((Seq Int) Int Int Int Int) Int)
(assert (let ((a!1 (mul (seq.nth S i) (^ base (sub (sub j i) 1)))))
(let ((a!2 (mod (add (hash S base prime (add i 1) j) a!1) prime)))
  (not (= (hash S base prime i j) a!2)))))
(assert (forall ((x Int))
  (! (= (mod (mod x prime) prime) (mod x prime))
     :pattern ((mod (mod x prime) prime)))))
(assert (forall ((x Int) (y Int))
  (! (= (mod (mul x y) prime) (mod (mul (mod x prime) y) prime))
     :pattern ((mod (mul x y) prime))
     :pattern ((mod (mul (mod x prime) y) prime)))))
(assert (forall ((x Int) (y Int))
  (! (= (mod (mul x y) prime) (mod (mul x (mod y prime)) prime))
     :pattern ((mod (mul x y) prime))
     :pattern ((mod (mul x (mod y prime)) prime)))))
(assert (forall ((x Int) (y Int))
  (! (= (mod (add x y) prime) (mod (add x (mod y prime)) prime))
     :pattern ((mod (add x y) prime))
     :pattern ((mod (add x (mod y prime)) prime)))))
(assert (forall ((x Int) (y Int))
  (! (= (mod (add x y) prime) (mod (add (mod x prime) y) prime))
     :pattern ((mod (add x y) prime))
     :pattern ((mod (add (mod x prime) y) prime)))))
(assert (forall ((x Int) (y Int))
  (! (= (mul x (^ x y)) (^ x (add y 1))) :pattern ((mul x (^ x y))))))
(assert (forall ((x Int) (y Int)) (! (= (mul x y) (mul y x)) :pattern ((mul x y)))))
(assert (forall ((x Int) (y Int)) (! (= (add x y) (add y x)) :pattern ((add x y)))))
(assert (forall ((x Int) (y Int)) (! (= (mul x y) (mul y x)) :pattern ((mul x y)))))
(assert (forall ((x Int) (y Int) (z Int))
  (! (= (add x (add y z)) (add (add x y) z))
     :pattern ((add x (add y z)))
     :pattern ((add (add x y) z)))))
(assert (forall ((x Int) (y Int) (z Int))
  (! (= (mul x (mul y z)) (mul (mul x y) z))
     :pattern ((mul x (mul y z)))
     :pattern ((mul (mul x y) z)))))
(assert (forall ((x Int) (y Int) (z Int))
  (! (= (sub (sub x y) z) (sub (sub x z) y)) :pattern ((sub (sub x y) z)))))
(assert (forall ((x Int) (y Int) (z Int))
  (! (= (mul x (add y z)) (add (mul x y) (mul x z)))
     :pattern ((mul x (add y z))))))
(assert (forall ((x Int)) (! (= (sub (add x 1) 1) x) :pattern ((add x 1)))))
(assert (forall ((x Int)) (! (= (add (sub x 1) 1) x) :pattern ((sub x 1)))))
(assert (let ((a!1 (^ base (sub (sub (sub j 1) i) 1))))
(let ((a!2 (mod (add (hash S base prime (add i 1) (sub j 1))
                     (mul (seq.nth S i) a!1))
                prime)))
  (= (hash S base prime i (sub j 1)) a!2))))
(assert (let ((a!1 (add (seq.nth S (- j 1)) (mul base (hash S base prime i (sub j 1))))))
  (= (hash S base prime i j) (mod a!1 prime))))
(assert (let ((a!1 (add (seq.nth S (- j 1))
                (mul base (hash S base prime (add i 1) (sub j 1))))))
  (= (hash S base prime (add i 1) j) (mod a!1 prime))))
(apply euf-completion)
```

To use conditional rewriting you can
```
(assert (not (= 0 prime)))
```
and update axioms using modulus with prime to be of the form:
```
(=> (not (= 0 prime)) <original-body of quantifier>)
```
2025-06-06 11:42:31 +02:00
Nikolaj Bjorner
16452fec43 pretty printing for lp 2025-06-06 11:34:28 +02:00
Nikolaj Bjorner
ef284cca5d for Arie 2025-06-04 14:24:01 +02:00
Nikhil Idiculla
bcedb66911
Expose z3_static target for Bazel build (#7660) 2025-06-03 11:51:18 +02:00
Nikolaj Bjorner
e2e54527db remove trace that accesses stale data #7668 2025-06-02 08:58:35 +02:00
Nikolaj Bjorner
7f5427b839 disable assertion that checks nl lemmas if using nra core 2025-05-30 14:47:31 +01:00
Nikolaj Bjorner
2fc3b0730d some cleanup and functionality for tracing 2025-05-30 14:46:55 +01:00
Nikolaj Bjorner
b4c2b455bd #7667 - add API documentation
The scenario works as expected when disabling model compression:

```
from z3 import *
pre_processor = Tactic("bit-blast")
solver = Solver()

set_param("model.compact", False)

x = BitVec('x', 8)
pre_processed = pre_processor(x == 5)
print(pre_processed[0])
solver.add(pre_processed[0]) # add the sole assertion

if solver.check() == sat:
    print(solver.model())
    model = pre_processed[0].convert_model(solver.model())
    print(model)
    print(model[x].as_long())
```
2025-05-30 11:05:51 +01:00
Nikolaj Bjorner
2714dc2623 fix #7661 2025-05-29 17:46:51 +01:00
Nikolaj Bjorner
819c2079cb use array instead of hash-table to track trace 2025-05-29 17:40:45 +01:00
Brandon Stride
257b8e91e6
Fix out of bounds error in OCaml API (#7665) (#7666) 2025-05-29 17:06:48 +01:00
Nikolaj Bjorner
4b2e5adc11 enable tag classes 2025-05-28 17:57:58 +01:00
Nikolaj Bjorner
bbb3d5379b initialize tag class circular linked list 2025-05-28 17:10:23 +01:00
Nikolaj Bjorner
a3aee0247a remove commented out include directives to avoid confusing build scripts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-05-28 16:07:45 +01:00
Nikolaj Bjorner
6d70b49563 add full path to util in include directives
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-05-28 14:57:00 +01:00
LeeYoungJoon
0a93ff515d
Centralize and document TRACE tags using X-macros (#7657)
* Introduce X-macro-based trace tag definition
- Created trace_tags.def to centralize TRACE tag definitions
- Each tag includes a symbolic name and description
- Set up enum class TraceTag for type-safe usage in TRACE macros

* Add script to generate Markdown documentation from trace_tags.def
- Python script parses trace_tags.def and outputs trace_tags.md

* Refactor TRACE_NEW to prepend TraceTag and pass enum to is_trace_enabled

* trace: improve trace tag handling system with hierarchical tagging

- Introduce hierarchical tag-class structure: enabling a tag class activates all child tags
- Unify TRACE, STRACE, SCTRACE, and CTRACE under enum TraceTag
- Implement initial version of trace_tag.def using X(tag, tag_class, description)
  (class names and descriptions to be refined in a future update)

* trace: replace all string-based TRACE tags with enum TraceTag
- Migrated all TRACE, STRACE, SCTRACE, and CTRACE macros to use enum TraceTag values instead of raw string literals

* trace : add cstring header

* trace : Add Markdown documentation generation from trace_tags.def via mk_api_doc.py

* trace : rename macro parameter 'class' to 'tag_class' and remove Unicode comment in trace_tags.h.

* trace : Add TODO comment for future implementation of tag_class activation

* trace : Disable code related to tag_class until implementation is ready (#7663).
2025-05-28 14:31:25 +01:00
Nikolaj Bjorner
d766292dab add seed parameter, fix trail undo order from insertion to ensure lifetime 2025-05-27 18:03:00 +01:00
Can Cebeci
b44c897a59
Fix setup_relevancy for relevancy-dependent case split strategies (#7662) 2025-05-27 16:52:35 +01:00
Nikolaj Bjorner
80c553d24a missing file
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-05-24 00:20:30 +01:00
Nikolaj Bjorner
77fed8b97c v1 of a randomizer simplifier 2025-05-24 00:15:47 +01:00
Nikolaj Bjorner
84a5303def for future ignoring genai files 2025-05-21 14:22:20 -07:00
Nikolaj Bjorner
85e7243108 update add-term to avoid duplicating fresh aux-expr 2025-05-20 14:22:03 -07:00
Nikolaj Bjorner
c2098b41d6
Pr (#7654)
* add prd

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

* missing text

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

* fix

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

* fix #7647

* fix #7647 - with respect to scope level

* initial stab at randomizer

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

* Create prd.yml

* missing text

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

* fix

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

* Update prd.yml

* allows setting simplifier factory independently of whether solver has been allocated.

Instances, such as #7484 can be solved faster by either having authors rewrite benchmarks or by using incremental pre-processing. You can add incremental pre-processing to the SMT solver by using the command

```
(set-simplifier (then simplify propagate-values solve-eqs elim-unconstrained simplify))
```

This command can be invoked any time prior to push or adding assertions.

The effect of the command is that it adds an incremental pre-processing pass to check-sat invocations that is potentially more powerful than the default pre-processing. The default pre-processing functionality is not touched mainly to avoid instability against functionality that is already built around its behavior.

* remove experiment from pr

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-05-19 03:24:45 -07:00
Nikolaj Bjorner
8d67feef9f
Update prd.yml 2025-05-17 17:39:37 -07:00
Nikolaj Bjorner
a4e7123437
Update prd.yml 2025-05-17 17:34:43 -07:00
Nikolaj Bjorner
a7fbddd049
Update prd.yml 2025-05-17 17:24:14 -07:00
Nikolaj Bjorner
ad02d18e63
add prd (#7649)
* add prd

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

* missing text

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

* fix

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

* fix #7647

* fix #7647 - with respect to scope level

---------

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-05-17 17:07:03 -07:00
Nikolaj Bjorner
33812201cb
Create prd.yml 2025-05-16 14:15:52 -07:00