3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-07 03:31:23 +00:00
Commit graph

16670 commits

Author SHA1 Message Date
Lev Nachmanson
727dfd2d8d use the new throttle in order lemmas 2025-06-26 16:33:16 -07:00
Lev Nachmanson
832cfb3c41 consolidate throttling 2025-06-26 16:33:16 -07:00
Lev Nachmanson
f32066762c remove debug_location parameter 2025-06-26 16:33:16 -07:00
Lev Nachmanson
5caa7f1a29 throttle lemmas in nla_solver untested 2025-06-26 16:33:16 -07:00
Lev Nachmanson
46319156b8 a version of key
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-26 16:33:16 -07:00
Lev Nachmanson
20fb830682 filter out empty lemmas from nla_solver on consumption
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-26 16:33:16 -07:00
Lev Nachmanson
4e33b44d27 add lemma.is_empty()
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-26 16:33:16 -07:00
Lev Nachmanson
5bda42e104 rename new_lemma to lemma_builder
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-26 16:33:16 -07:00
Dongjae Lee
3916c451e5
Fix: typo in z3 python api (#7693) 2025-06-24 07:13:44 -07:00
Nikolaj Bjorner
98043873d0 add -> as another array sort constructor
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-22 21:35:23 -07:00
Nikolaj Bjorner
5ad1647061 missing ; 2025-06-22 21:32:32 -07:00
Nikolaj Bjorner
95ffad80c6 dealloc m_imp
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-22 21:32:32 -07:00
Copilot
218379aaca
[WIP] Leaks (#7691)
* Initial plan for issue

* Initial analysis of memory leak issue

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

* Fix memory leak in lar_solver by adding var_register cleanup

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

* Complete memory leak fix: add dealloc(m_imp) to lar_solver destructor

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

* Delete leak.smt2

* Update lar_solver.cpp

---------

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-06-20 20:26:43 -07:00
Lev Nachmanson
8f88bf9998 use is_square_free_at_sample instead of is_well_oriented
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-17 07:22:03 -07:00
Lev Nachmanson
f2912b25a2 remove debug output 2025-06-17 07:22:03 -07:00
Lev Nachmanson
126e06b8b6 fix the test-z3 build
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-17 07:22:03 -07:00
Lev Nachmanson
0e71a9d11c comment and restore
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-17 07:22:03 -07:00
Lev Nachmanson
84c8a93ca5 renaming
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-17 07:22:03 -07:00
Lev Nachmanson
945eef7ab6 work on well-orientedness
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2025-06-17 07:22:03 -07:00
Nikolaj Bjorner
b2f01706be euf_completion with AC: add first cut of AC matching for top-level, add plugins and fix shared expression rewriting in ac-plugin 2025-06-16 11:46:03 -07:00
Nikolaj Bjorner
bc312768c8 remove dependency on pattern inference
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-15 14:07:50 -07:00
Nikolaj Bjorner
cb22cdc98f remove dependency on pattern inference
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-15 14:00:19 -07:00
Nikolaj Bjorner
20ddfc7795 sketch possible AC functionality 2025-06-15 13:49:19 -07:00
Nikolaj Bjorner
f932d480a0 use propagation queues and hash-tables to schedule bindings 2025-06-15 13:49:18 -07:00
Nikolaj Bjorner
8d1e954709 introduce notion of auxiliary constraints created by nla_solver lemmas
notes: auxiliary constraints could extend to Gomory and B&B.
2025-06-12 20:37:51 -07:00
Nikolaj Bjorner
93d5e3f28e use mk_ite utility instead of custom local function
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-06-12 16:10:08 -07:00
Nikolaj Bjorner
a2ad90cba1 Update bit_blaster_tpl_def.h 2025-06-12 16:07:28 -07:00
Nikolaj Bjorner
a15e4ad1e3 #7673
perf fix
2025-06-12 15:16:28 -07:00
Nikolaj Bjorner
e018b024c5 adding proofs to euf-completion 2025-06-12 11:31:55 -07:00
Nikolaj Bjorner
bba10c7a88 dampen order lemmas 2025-06-12 11:31:55 -07:00
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
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
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
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
Nikolaj Bjorner
e2e54527db remove trace that accesses stale data #7668 2025-06-02 08:58:35 +02:00