Nikolaj Bjorner
c2b7b58c78
#7468 - add option (get-info :parameters) to display solver parameters that were updated globally and distinct from defaults
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-02-10 11:57:14 -08:00
Nikolaj Bjorner
87f7a20e14
Add (updated and general) solve_for functionality for arithmetic, add congruence_explain to API to retrieve explanation for why two terms are congruent Tweak handling of smt.qi.max_instantations
...
Add API solve_for(vars).
It takes a list of variables and returns a triangular solved form for the variables.
Currently for arithmetic. The solved form is a list with elements of the form (var, term, guard).
Variables solved in the tail of the list do not occur before in the list.
For example it can return a solution [(x, z, True), (y, x + z, True)] because first x was solved to be z,
then y was solved to be x + z which is the same as 2z.
Add congruent_explain that retuns an explanation for congruent terms.
Terms congruent in the final state after calling SimpleSolver().check() can be queried for
an explanation, i.e., a list of literals that collectively entail the equality under congruence closure.
The literals are asserted in the final state of search.
Adjust smt_context cancellation for the smt.qi.max_instantiations parameter.
It gets checked when qi-queue elements are consumed.
Prior it was checked on insertion time, which didn't allow for processing as many
instantations as there were in the queue. Moreover, it would not cancel the solver.
So it would keep adding instantations to the queue when it was full / depleted the
configuration limit.
2024-12-19 23:27:57 +01:00
Nikolaj Bjorner
05e053247d
add facility to solve for a linear term over API
2024-11-30 09:34:27 -08:00
Nikolaj Bjorner
f6d411d54b
experimental feature to access congruence closure of SimpleSolver
...
This update includes an experimental feature to access a congruence closure data-structure after search.
It comes with several caveats as pre-processing is free to eliminate terms. It is therefore necessary to use a solver that does not eliminate the terms you want to track for congruence of. This is partially addressed by using SimpleSolver or incremental mode solving.
```python
from z3 import *
s = SimpleSolver()
x, y, z = Ints('x y z')
s.add(x == y)
s.add(y == z)
s.check()
print(s.root(x), s.root(y), s.root(z))
print(s.next(x), s.next(y), s.next(z))
```
2022-12-30 21:41:27 -08:00
Nikolaj Bjorner
dd1ca8f6bd
move qhead to attribute on the state instead of the simplifier,
...
- add sat.smt option to enable the new incremental core (it is not ready for mainstream consumption as cloning and other features are not implemented and it hasn't been tested in any detail yet).
- move "name" into attribute on simplifier so it can be reused for diagnostics by the seq-simplifier.
2022-11-29 16:36:02 +07:00
Nikolaj Bjorner
07dd1065db
added API to monitor clause inferences
...
See RELEASE_NOTES for more information
examples pending.
2022-10-19 08:34:55 -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
Bruce Mitchener
5014b1a34d
Use = default
for virtual constructors.
2022-08-05 18:11:46 +03:00
Bruce Mitchener
5d0dea05aa
Remove empty leaf destructors. ( #6211 )
2022-07-30 10:07:03 +01:00
Nikolaj Bjorner
3cc9d7f443
improve pre-processing
2022-04-15 12:55:26 +02:00
Nikolaj Bjorner
3f3d058567
extract also units from search state
2022-02-07 06:16:22 +02:00
Nikolaj Bjorner
b5efb87118
base -> core
2021-11-29 19:55:10 -08:00
Nikolaj Bjorner
5857236f2f
introducing base namespace for user propagator
2021-11-29 19:41:30 -08: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
f05ac8a429
updated C++ API for escaped and unescaped strings #5615
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-10-21 14:52:59 -04:00
Nikolaj Bjorner
c7a7d40a8f
remove incorrect and inefficient default model conversion
2021-07-15 18:47:25 +02:00
Nikolaj Bjorner
4a6083836a
call it data instead of c_ptr for approaching C++11 std::vector convention.
2021-04-13 18:17:35 -07:00
Nikolaj Bjorner
0ec567fe15
integrate v2 of lns
2021-02-04 15:47:40 -08:00
Nikolaj Bjorner
fb1509d011
expose internal API for set_phase
2021-02-02 14:29:06 -08:00
Nikolaj Bjorner
8f577d3943
remove ast_manager get_sort method entirely
2021-02-02 13:57:01 -08:00
Nikolaj Bjorner
1d199b707b
connect mbi
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-29 23:51:31 -07:00
Nikolaj Bjorner
367e5fdd52
delay internalize ( #4714 )
...
* adding array solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* use default in model construction
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* debug delay internalization
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* bv
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* arrays
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* get rid of implied values and bounds
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* redo egraph
* remove out
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* remove files
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-28 19:24:16 -07:00
Nikolaj Bjorner
43db7df2b5
user solver ( #4709 )
...
* user solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
* na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-24 04:55:34 -07:00
Nikolaj Bjorner
666e835e08
na
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-23 09:39:36 -07:00
Nikolaj Bjorner
96f10b8c1c
user propagator
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-22 19:01:04 -07:00
Nikolaj Bjorner
2d5b749745
extend solver callbacks with methods
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-21 19:24:59 -07:00
Nikolaj Bjorner
080be7a2af
merge
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-21 12:14:28 -07:00
Nikolaj Bjorner
4857d60c99
user propagator over the API
2020-08-18 21:53:02 -07:00
Nikolaj Bjorner
0c93c7aa08
adding user propagation to API
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-18 10:30:10 -07:00
Nikolaj Bjorner
152c95f72a
adding user-propagator ability
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-17 22:39:55 -07:00
Nikolaj Bjorner
59d8895d15
add accessors for implied values to API
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-28 19:46:39 -07:00
Nikolaj Bjorner
d0e20e44ff
booyah
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00
Nikolaj Bjorner
16bc5b8432
build warning
2020-04-30 19:30:54 -07:00
Nikolaj Bjorner
dcd4fff284
fixes to cuts
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-02-21 18:06:57 -08:00
Nikolaj Bjorner
fc41a61b6e
expose strategic solver factory prototype at level of solver module
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-08-09 15:52:12 -07:00
Nikolaj Bjorner
8893913c98
remove internal referenes to set_activity
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-05-30 16:06:05 -07:00
Nikolaj Bjorner
89bf2d4368
add API for setting variable activity
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-02-15 12:05:24 -08:00
Nikolaj Bjorner
8d20310758
adding trail/levels
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-01-29 14:45:51 -08:00
Nikolaj Bjorner
498864c582
adding dump facility for cancelation #2095 , easing dimacs in/out
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-01-24 12:21:23 -08:00
Nikolaj Bjorner
a9e6d83c6e
std::cout -> out
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-11-18 10:40:08 -08:00
Nikolaj Bjorner
c59a957737
add non-units method
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-09-20 20:37:14 -07:00
Nikolaj Bjorner
792bf6c10b
fix tests
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-20 08:22:15 -07:00
Nikolaj Bjorner
bfeb15b876
move to list of clauses
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 16:08:50 -07:00
Arie Gurfinkel
26339119e4
solver::check_sat_cc : check_sat assuming cube and clause
...
Extends check_sat with an ability to assume a single clause in
addition to assuming a cube of assumptions
2018-06-14 16:08:50 -07:00
Nikolaj Bjorner
b73aa3642a
check with cube and clause
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-14 16:08:49 -07:00
Arie Gurfinkel
1da002d7b1
scoped params on solver
...
solver::push_params() saves current parameters
solver::pop_params() restores previously saved parameters
2018-06-14 16:08:49 -07:00
Arie Gurfinkel
49821e7c91
Revised solver_pool
2018-06-14 16:08:48 -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
718e5a9b6c
add unit extraction
...
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-06 01:08:17 -08:00
Bruce Mitchener
b7d1753843
Use override rather than virtual.
2018-02-09 21:19:27 +07:00