3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-09 19:01:50 +00:00
Commit graph

17423 commits

Author SHA1 Message Date
Nikolaj Bjorner 903cddcaaa fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-30 17:10:18 -04:00
Nikolaj Bjorner ab045f0645 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-30 16:52:19 -04:00
Nikolaj Bjorner 876ca2f1a5 fix #6371 2022-09-30 14:51:28 -04:00
Nikolaj Bjorner b9cba82531 work on proof checking
- add outline of trim routine
- streamline how proof terms are checked and how residue units are extracted.
2022-09-30 13:04:19 -04:00
Nikolaj Bjorner ccda49bad5 fix #6376
have solver throw an exception when user supplies a non-propositional assumption
2022-09-30 13:03:34 -04:00
Nikolaj Bjorner 6eb2d2acfa update dependencies for build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-28 11:25:36 -07:00
Nikolaj Bjorner 107981f099 update proof formats for new core
- update proof format for quantifier instantiation to track original literals
- update proof replay tools with ability to extract proof object

The formats and features are subject to heavy revisions.

Example
```
(set-option :sat.euf true)
(set-option :sat.smt.proof eufproof.smt2)
(declare-fun f (Int) Int)
(declare-const x Int)
(assert (or (= (f (f (f x))) x) (= (f (f x)) x)))
(assert (not (= (f (f (f (f (f (f x)))))) x)))
(check-sat)
```

eufproof.smt2 is:
```
(declare-fun x () Int)
(declare-fun f (Int) Int)
(define-const $24 Int (f x))
(define-const $25 Int (f $24))
(define-const $26 Int (f $25))
(define-const $27 Bool (= $26 x))
(define-const $28 Bool (= $25 x))
(assume $27 $28)
(define-const $30 Int (f $26))
(define-const $31 Int (f $30))
(define-const $32 Int (f $31))
(define-const $33 Bool (= $32 x))
(assume (not $33))
(declare-fun rup () Proof)
(infer (not $33) rup)
(declare-fun euf (Bool Bool Proof Proof Proof Proof) Proof)
(declare-fun cc (Bool) Proof)
(define-const $42 Bool (= $32 $30))
(define-const $43 Proof (cc $42))
(define-const $40 Bool (= $31 $24))
(define-const $41 Proof (cc $40))
(define-const $38 Bool (= $30 $25))
(define-const $39 Proof (cc $38))
(define-const $36 Bool (= $24 $26))
(define-const $37 Proof (cc $36))
(define-const $34 Bool (not $33))
(define-const $44 Proof (euf $34 $28 $37 $39 $41 $43))
(infer (not $28) $33 $44)
(infer (not $28) rup)
(infer $27 rup)
(declare-fun euf (Bool Bool Proof Proof Proof) Proof)
(define-const $49 Bool (= $32 $26))
(define-const $50 Proof (cc $49))
(define-const $47 Bool (= $31 $25))
(define-const $48 Proof (cc $47))
(define-const $45 Bool (= $24 $30))
(define-const $46 Proof (cc $45))
(define-const $51 Proof (euf $34 $27 $46 $48 $50))
(infer $33 $51)
(infer rup)
```

Example of inspecting proof from Python:

```
from z3 import *

def parse(file):
    s = Solver()
    set_option("solver.proof.save", True)
    set_option("solver.proof.check", False)
    s.from_file(file)
    for step in s.proof().children():
        print(step)

parse("../eufproof.smt2")
```

Proof checking (self-validation) is on by default.
Proof saving is off by default.

You can use the proof logs and the proof terms to retrieve quantifier instantiations from the new core.

The self-checker contains a few built-in tuned checkers but falls back to self-checking inferred clauses using SMT.
2022-09-28 10:40:43 -07:00
Nikolaj Bjorner 9782d4a730 #5261
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-26 05:04:02 -07:00
Nikolaj Bjorner 7b982a812e fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-25 18:09:32 -07:00
Nikolaj Bjorner 3df8b9c7e2 Merge branch 'master' of https://github.com/z3prover/z3 2022-09-25 18:03:26 -07:00
Nikolaj Bjorner d7b9cc70d0 smc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-25 18:03:16 -07:00
Nikolaj Bjorner 9be8fc7857 Add EUF (congruence closure) proof hints and checker to the new core
EUF proofs are checked modulo union-find.
Equalities are added to to union-find if they are assumptions or if they can be derived using congruence closure. The congruence closure assumptions are added as proof-hints.
Note that this proof format does not track equality inferences, symmetry and transitivity. Instead they are handled by assuming a union-find based checker.
2022-09-25 14:26:20 -07:00
Nikolaj Bjorner 6f2fde87d1 move has-default up before merge of parents
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-24 14:40:30 -07:00
Nikolaj Bjorner aadb1a2d44
Update msvc-static-build.yml
move "permissions" to same location as wasm actions
2022-09-24 09:56:45 -07:00
Nikolaj Bjorner b3c2169838
Update msvc-static-build.yml 2022-09-24 09:55:15 -07:00
Clemens Eisenhofer 5ca53f37c0
Throw an exception if the variable in decide-callback is already assigned (#6362)
* Memory leak in .NET user-propagator
The user-propagator object has to be manually disposed (IDisposable), otherwise it stays in memory forever, as it cannot be garbage collected automatically

* Throw an exception if variable passed to decide is already assigned instead of running in an assertion violation
2022-09-24 09:54:14 -07:00
Nikolaj Bjorner 3dfff3d7a1 tracing for fpa 2022-09-23 22:48:54 -07:00
Nikolaj Bjorner 1f150ecd52 #6319
#6319 - fix incompleteness in propagation of default to all array terms in the equivalence class.

Fix bug with q_mbi where domain restrictions are not using values because the current model does not evaluate certain bound variables to values. Set model completion when adding these bound variables to the model to ensure their values are not missed.

Add better propagation of diagnostics when tactics and the new solver return unknown. The reason for unknown can now be traced to what theory was culprit (currently no additional information)
2022-09-23 22:22:34 -05:00
Nikolaj Bjorner 6226875283 fix regression with uninitialized variable 2022-09-23 15:51:26 -05:00
Nikolaj Bjorner c41b6da6bb #6319
using a queue for disequality propagaiton was a regression: values of numerals can change along the same stack so prior passing the filter does not mean it passes later.
2022-09-23 14:47:48 -05:00
Nikolaj Bjorner 79b4357442 #6363 2022-09-23 14:32:01 -05:00
Nikolaj Bjorner 3d9512b93c fix #6363 2022-09-23 14:32:01 -05:00
Nikolaj Bjorner de74e342c6
#5261 2022-09-23 13:19:55 -05:00
Nikolaj Bjorner 4c6d7158cb extended debugging for sat.euf 2022-09-22 17:05:32 -05:00
Nikolaj Bjorner c24d445886 fix #6355
conversion from AIG to expressions should always use the optimized conversion function.

the aig-tactic should throttle regarding output bloat from AIG.
If the expression after AIG simpification, for whatever reason, is bloated the rewrite does not take place.
2022-09-22 17:05:32 -05:00
gmh5225 b0d0c36b11
Add option 'MSVC_STATIC' (#6358)
* Add option 'MSVC_STATIC'

* Update CMakeLists.txt

* Update CMakeLists.txt

* Upload msvc-static-build.yml
2022-09-22 15:55:40 -05:00
Alex 00cf5ed4c7
GitHub Workflows security hardening (#6353)
* build: harden wasm-release.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>

* build: harden wasm.yml permissions
Signed-off-by: Alex <aleksandrosansan@gmail.com>
2022-09-22 15:03:59 -05:00
Clemens Eisenhofer a67fe054d5
Memory leak in .NET user-propagator (#6360)
The user-propagator object has to be manually disposed (IDisposable), otherwise it stays in memory forever, as it cannot be garbage collected automatically
2022-09-22 13:26:08 -05:00
Peter Bruch 58fad41dfa
Dotnet Api: Fix infinite finalization of Context (#6361)
* Dotnet Api: suppress GC finalization of dotnet context in favor of re-registering finalization

* Dotnet Api: enable concurrent dec-ref even if context is created without parameters.

* Dotnet Api: removed dead code.
2022-09-22 13:25:17 -05:00
Nikolaj Bjorner 42945de240 #6319
align use of optsmt and the new core (they should not be used together)
2022-09-21 12:09:31 -07:00
Nikolaj Bjorner eba5a5d141 Merge branch 'master' of https://github.com/z3prover/z3 2022-09-20 20:32:07 -07:00
Nikolaj Bjorner 4518f4fe02 fix #6352
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-20 20:31:55 -07:00
Nikolaj Bjorner 20250b200f #6319
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-19 20:31:36 -07:00
Nikolaj Bjorner 7caf6a682b #6319 resolve for unsat core when using assumptions 2022-09-19 20:10:53 -07:00
Jack·Boos·Yu 9118a93e44
[document] Add vcpkg instruction step (#6345) 2022-09-19 09:36:54 -07:00
Nikolaj Bjorner f4bea58852 #6319
ensure unknown when a lambda is not in beta redex
2022-09-19 03:19:47 -07:00
Nikolaj Bjorner fce4d2ad90 #6319 2022-09-19 03:07:51 -07:00
Nikolaj Bjorner d6d34a8962 #6319 2022-09-19 02:32:04 -07:00
Nikolaj Bjorner 13f43ea107 bug fix for #6319
literals that are replayed need to be registered with respective theories, otherwise, they will not propagate with the theories (the enode have to be attached with relevant theory variables).
2022-09-18 17:23:00 -07:00
Nikolaj Bjorner e54635e0ed rename statistics to something more meaningful: instantiations from MBQI are tagged with mbi 2022-09-18 17:23:00 -07:00
Nikolaj Bjorner 2b4ba5e170 updated header file for arithmetic solver 2022-09-18 17:23:00 -07:00
Nikolaj Bjorner 0b9c9cbbce add a queue head to delay propagation
delay propagation on each disequality/equality should suffice once. It adds relevant inequalities to ensure the arithmetic solver is coherent about disequalities.
2022-09-18 17:23:00 -07:00
Nikolaj Bjorner d479bd9c53 formatting 2022-09-18 17:22:59 -07:00
Nikolaj Bjorner c11bd79484 add assertions 2022-09-18 17:22:59 -07:00
Nikolaj Bjorner 9a987237d5 don't rename uint_set but keep the original name 2022-09-18 17:22:59 -07:00
Nikolaj Bjorner bd4db4c41f add option to rewrite and for arithmetic simplification 2022-09-18 17:22:59 -07:00
Nikolaj Bjorner 088898834c filter length limits to be non-skolems and under concat/""/unit 2022-09-15 07:41:13 -07:00
Nikolaj Bjorner af258d1720 add method for accessing i'th domain sort in array #6344 2022-09-15 07:38:02 -07:00
Nikolaj Bjorner c47ca341b7 fix #6343
The bug was that axiom generation was not enabled on last_index, so no axioms got created to constrain last-index.
With default settings the solver is now very slow on this example. It is related to that the smallest size of a satisfying assignment is above 24. Pending a good heuristic to find initial seeds and increments for iterative deepening, I am adding another parameter smt.seq.min_unfolding that when set to 30 helps for this example.
2022-09-14 10:17:25 -07:00
Nuno Lopes 16ef89905d fix infinite loop in internalize 2022-09-14 11:50:53 +01:00