3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-27 00:18:45 +00:00
Commit graph

137 commits

Author SHA1 Message Date
Nikolaj Bjorner
1dca6402fb move model and proof converters to self-contained module 2022-11-03 05:23:01 -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
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
ac822acb0f add parameter incremental to ensure preprocessing does not interefere with adding constraints during search
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-05 08:10:20 -07:00
Nikolaj Bjorner
3f5eb7fcf2 re-enable pre-process 2022-04-13 11:24:24 +02:00
Nikolaj Bjorner
d6d9b25c68 Allow adding constraints in the model_eh callback 2022-04-08 17:12:20 +02:00
Henrich Lauko
96671cfc73
Add and fix a few general compiler warnings. (#5628)
* rewriter: fix unused variable warnings

* cmake: make missing non-virtual dtors error

* treewide: add missing virtual destructors

* cmake: add a few more checks

* api: add missing virtual destructor to user_propagator_base

* examples: compile cpp example with compiler warnings

* model: fix unused variable warnings

* rewriter: fix logical-op-parentheses warnings

* sat: fix unused variable warnings

* smt: fix unused variable warnings
2021-10-29 15:42:32 +02:00
Nikolaj Bjorner
b1bc890992 fix #5515
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-08-28 18:05:51 -07:00
Nikolaj Bjorner
56478f917b enable sat.euf in opt, enable smt legacy for lns 2021-03-02 06:21:20 -08:00
Nikolaj Bjorner
13f05ae9dc enable wcnf output for weighted maxsat problems 2021-02-28 09:59:36 -08:00
Nikolaj Bjorner
08f55f9d1f start wcnf
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-02-26 11:13:44 -08:00
Nikolaj Bjorner
16448104eb add new model event handler for incremental optimization 2021-02-05 17:11:04 -08:00
Nikolaj Bjorner
d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00
Nikolaj Bjorner
1155db383e fix #3540
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-29 10:55:47 -07:00
Nikolaj Bjorner
4ff940a29e mbi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-02-25 18:14:41 -08:00
Nikolaj Bjorner
7fa9768c36 improving drat output perf
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-02-01 09:16:46 -08:00
Nikolaj Bjorner
c45ab6efed add setting to dump intermediary models #2087
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-01-18 15:12:08 -08:00
Nikolaj Bjorner
c4829dfa22 fix #1577 again
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-10-06 09:01:01 -07:00
Nikolaj Bjorner
3bc2213d54 fix #1577
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-10-03 17:43:42 -07:00
Nikolaj Bjorner
74621e0b7d first eufi example running
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 16:08:52 -07:00
Nikolaj Bjorner
da0239d200 fix #1655
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-05-25 21:21:27 -07:00
Nikolaj Bjorner
727ba13566 fix #1653
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-05-25 12:55:04 -07:00
Nikolaj Bjorner
c963f6f2df merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-05-23 08:02:16 -07:00
Nikolaj Bjorner
f525f43e43 merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-04-30 09:30:43 -07:00
Nikolaj Bjorner
5dbba8bd53 fix #1599. fix #1600
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-04-27 17:48:04 +02:00
Nikolaj Bjorner
a81a8de975 remove lns
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-25 19:54:11 -07:00
Nikolaj Bjorner
c4ff5c7ac7 remove lns code
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-25 18:32:16 -07:00
Nikolaj Bjorner
c513f3ca09 merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-25 14:57:01 -07:00
Nikolaj Bjorner
4375f54c45 adding lns
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-13 13:31:27 -07:00
Nikolaj Bjorner
e7d43ed516 fix pb rewriter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-12 11:22:05 -07:00
Bruce Mitchener
76eb7b9ede Use nullptr. 2018-02-12 14:05:55 +07:00
Bruce Mitchener
7167fda1dc Use override rather than virtual. 2018-02-10 09:56:33 +07:00
Nikolaj Bjorner
e4198c38e2 add solution_prefix per #1463, have parto with single objective behave similar to multipe-objectives #1439
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-01-28 11:45:39 -08:00
Nikolaj Bjorner
57406d6cc4 more updates for #1439
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-01-17 18:11:14 -08:00
Nikolaj Bjorner
8357210d3c fix lack of warning/error for unbounded objectives in context of quantifiers #1382
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-12-01 01:07:41 -08:00
Nikolaj Bjorner
0d15b6abb7 add stubs for converting assertions, consolidate filter_model_converter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-11-17 14:51:13 -08:00
Nikolaj Bjorner
3de8c193ea implementing model updates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-10-30 16:11:51 -05:00
Nikolaj Bjorner
b19f94ae5b make include paths uniformly use path relative to src. #534
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-07-31 13:24:11 -07:00
Nikolaj Bjorner
f3a0b7e0cd change command-line experience for pareto fronts. It now requires multiple check-sat calls to loop over the fronts. This allows querying each model in turn. #1008 2017-05-23 20:05:10 -07:00
Nikolaj Bjorner
c99205fa7e return box model based on index. Issue #955
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-03-31 08:12:53 -07:00
Nikolaj Bjorner
e02160c674 expose bounds as vector expressions instead of containing ad-hoc expressions. Issue #911
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-02-24 11:07:40 -08:00
Nikolaj Bjorner
2307a7ffa7 fix bug in handling of repeated soft constraints. #815
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-12-11 10:19:57 +01:00
Nikolaj Bjorner
0ab2067b69 produce error message for cores with optimization. Issue #825
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-12-09 13:15:40 +01:00
Nikolaj Bjorner
23b9d3ef55 fix at-most-1 constraint compiler bug
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-10-22 18:50:16 -07:00
Nikolaj Bjorner
491b3b34aa tune consequence finding. Factor solver pretty-printing as SMT-LIB into top-level
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-08-03 11:14:29 -07:00
Nikolaj Bjorner
c725fe7698 tune lra optimization
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-05-22 17:03:29 -07:00
Nikolaj Bjorner
1aa3fdab8a remove min/max, use qmax; disable cancellation during model evaluation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-05-19 13:04:20 -07:00
Nikolaj Bjorner
c75fd02c95 qsat-opt
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-04-28 21:31:16 -07:00
Nikolaj Bjorner
45fdb95f53 fix performance for model construction, recognize concats of values as a value for pre-processing
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-03-23 17:23:57 -07:00
Nuno Lopes
8b53628d67 remove a few unused decls 2016-03-09 17:01:06 +00:00