3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-16 05:48:44 +00:00
Commit graph

4006 commits

Author SHA1 Message Date
Nikolaj Bjorner 63f48f8fd4 add options for logging learned lemmas and theory axioms
- add solver.axioms2files
  - prints negated theory axioms to files. Each file should be unsat
- add solver.lemmas2console
  - prints lemmas to the console.
- remove option smt.arith.dump_lemmas. It is replaced by solver.axioms2files
2022-08-08 11:18:56 +03:00
Nikolaj Bjorner f34317d604 #6196 2022-08-07 09:44:10 +03:00
Bruce Mitchener 5014b1a34d Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
Bruce Mitchener 1d9345c3de Fix typos. 2022-08-05 07:40:50 +03:00
Bruce Mitchener 08165f5367 No need to return a const bool. 2022-08-05 07:40:19 +03:00
Nikolaj Bjorner 9da6895276 add option to select with folding 2022-08-04 16:59:26 +03:00
Nikolaj Bjorner a8ff976bcc max maximal unfolding configurable 2022-08-04 16:59:26 +03:00
Nikolaj Bjorner 774ce3d7ab create special case for osx arm
shortcut when store/select are distinct

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-03 07:56:02 +03:00
Jakob Rath 9275d1e57a sparse_matrix iterators 2022-08-01 18:37:11 +03:00
Bruce Mitchener 77e5d6ab19 Use nullptr consistently instead of 0 or NULL. 2022-08-01 14:24:32 +03:00
Bruce Mitchener 5d0dea05aa
Remove empty leaf destructors. (#6211) 2022-07-30 10:07:03 +01:00
Bruce Mitchener 1eb84fe4b9
Mark override methods appropriately. (#6207) 2022-07-29 23:29:15 +02:00
Nikolaj Bjorner 8551b217ce fix #6194 2022-07-27 08:03:57 +02:00
JohnLyu2 3e8daa5965
fix re.range symbolic argument bug in z3str3 (#6189) 2022-07-27 04:24:20 +02:00
Nikolaj Bjorner 5c2c0ae900 force-push on new_eq, new_diseq in user propagator, other fixes to Python bindings for user propagator
This update allows the python bindings for user-propagator to handle functions that are declared to be registered with the user propagator plugin. It fixes a bug in UserPropagateBase.add to allow registering terms dynamically during search.
It also fixes a bug in theory_user_propagate as scopes were not fully pushed when the solver gets the callbacks for new equalities and new disequalities.
It also adds equality and disequality interfaces to the sat/smt solver version (which isn't being exercised in earnest yet)
2022-07-25 03:42:29 +02:00
Bruce Mitchener 3e38bbb009
Make sure all headers do #pragma once. (#6188) 2022-07-23 10:41:14 -07:00
Nikolaj Bjorner 7f983e7d9e fix #6174
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-20 21:22:41 -07:00
Nikolaj Bjorner 1b83a4556b fix #6178
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-20 20:48:23 -07:00
Clemens Eisenhofer 95c3dd9224
Added missing decide-callback for tactics (#6166)
* Added function to select the next variable to split on

* Fixed typo

* Small fixes

* uint -> int

* Fixed missing assignment for binary clauses

* Added missing decide-callback for tactics
2022-07-17 10:07:52 -07:00
Nikolaj Bjorner b253db2c0a redundant parenthesis 2022-07-13 16:20:03 -07:00
Nikolaj Bjorner 1378e713ba fix #6157 2022-07-13 14:37:04 -07:00
Nikolaj Bjorner 8e23af33d7 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-13 14:20:21 -07:00
Nikolaj Bjorner 7d0c789af0 propagate has-length over map/mapi 2022-07-12 20:50:28 -07:00
Nikolaj Bjorner ca80d99617 fix #6153 2022-07-12 15:49:57 -07:00
Nikolaj Bjorner 43cf053066 fix #6128 2022-07-12 15:43:12 -07:00
Nikolaj Bjorner 49b7e9084f Merge branch 'master' of https://github.com/z3prover/z3 2022-07-11 09:26:34 -07:00
Clemens Eisenhofer 1f2346073a
Fixed missing assignment for binary clauses (#6148)
* Added function to select the next variable to split on

* Fixed typo

* Small fixes

* uint -> int

* Fixed missing assignment for binary clauses
2022-07-11 09:24:03 -07:00
Nikolaj Bjorner b68af0c1e5 working on reconciling perf for arithmetic solvers
this update integrates inferences to smt.arith.solver=6 related to grobner basis computation and handling of div/mod axioms to reconcile performance with smt.arith.solver=2.

The default of smt.arth.nl.grobner_subs_fixed is changed to 1 to make comparison with solver=2 more direct.

The selection of cluster equalities for solver=6 was reconciled with how it is done for solver=2.
2022-07-11 07:38:51 -07:00
Nikolaj Bjorner 0c42d3b079 small format update
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-06 11:41:48 -07:00
Nikolaj Bjorner 580ed31afd fix types and incompleteness for feature #6104 2022-07-06 01:08:54 -07:00
Nikolaj Bjorner d7472f0726 fix #6124
expression pointers were changed within a function, but not pinned. So the pointers got stale. To enforce their life-time within the function body (for use in logging) pin the expressions.
2022-07-05 12:48:21 -07:00
Nikolaj Bjorner de41cfd277 fix #6104
add equality reasoning to bit-vector solver to instantiate int2bv(bv2int(x)) = x identity on demand.
2022-07-05 12:23:24 -07:00
Nikolaj Bjorner 71fc83c051 Move out equality use out of the loop 2022-07-04 12:42:39 -07:00
Nikolaj Bjorner 6ed2b444b5 probably won't fix #6127
recfun decl plugin does not get copied so recursive functions are lost when cloning.
Fix is risky and use case is limited to threads + recursive definitions
2022-07-03 18:10:52 -07:00
Nikolaj Bjorner 1e8f9078e3 fix unsoundness in explanation handling for nested datatypes and sequences 2022-07-03 17:00:39 -07:00
Nikolaj Bjorner 1a9122663c remove unsound axioms, fix #6115 2022-06-29 11:16:10 -07:00
Nikolaj Bjorner ff265235c1 adjust trace output 2022-06-29 08:20:01 -07:00
Nikolaj Bjorner fd8ee34564 add logging 2022-06-29 08:20:01 -07:00
Nikolaj Bjorner 30165ed40a fix #6105
non-linear division axioms appear incomplete.
Fixed for legacy arithmetic. Fix pending for new arithmetic solver.
2022-06-26 20:37:18 -07:00
Nikolaj Bjorner 56aa4261b6 fix #6082 2022-06-23 07:43:06 -07:00
Clemens Eisenhofer 2fa60aa43c
Added function to select the next variable to split on (User-Propagator) (#6096)
* Added function to select the next variable to split on

* Fixed typo

* Small fixes

* uint -> int
2022-06-19 10:49:25 -07:00
Nuno Lopes 73a24ca0a9 remove '#include <iostream>' from headers and from unneeded places
It's harmful to have iostream everywhere as it injects functions in the compiled files
2022-06-17 14:10:19 +01:00
Nuno Lopes 70bcf0b51d reduce sizeof(enode) from 120 to 112 bytes by swapping the order of fields
Yes, those 8 bytes are yours now, use responsibly.
2022-06-17 12:07:15 +01:00
Nikolaj Bjorner 99b606b861 add logging 2022-06-16 15:40:00 -07:00
Nikolaj Bjorner 637120ced5 Treat arguments to recursive functions as beta redexes
An argument to a recursive function would escape the scope of the function application when the recursive function definitions are unfolded. Therefore, such argument occurrences need not be considered for extensional equality / equality sharing.

This filter is mostly relevant for recursive functions that take a lambda expression as argument. Lambda expressions / arrays that occur in shared occurrences are checked for extensionality.
2022-06-14 09:51:06 -07:00
Nikolaj Bjorner 04f94d818f fix #6091 2022-06-14 09:51:06 -07:00
Nikolaj Bjorner 8efa3c8ade introduce notion of beta redex to deal with lambdas in non-extensional positions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-10 17:35:01 -07:00
Nikolaj Bjorner b9b5377c69 add a way to supress lambdas
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-10 14:37:25 -07:00
Nikolaj Bjorner 5db133f875 add a way to supress lambdas
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-10 14:35:20 -07:00
Nikolaj Bjorner 6a1193eebd reorg if-then-else structure 2022-06-08 10:00:45 -07:00
Nikolaj Bjorner 51ed13f96a update topological sort to use arrays instead of hash tables, expose Context over Z3Object for programmability
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-08 06:28:24 -07:00
Nikolaj Bjorner a9d70fca1a fix #6061
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-31 19:09:10 -07:00
Nikolaj Bjorner ca2497eecb na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-15 12:00:41 -07:00
Nikolaj Bjorner 7497856ded add ignore int to new arithmetic solvers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-11 15:14:22 -07:00
Nikolaj Bjorner 54648f6b50 add stats for binary clause creation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-10 14:58:15 -07:00
Nikolaj Bjorner 7def610a69 build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-08 10:31:11 -07:00
JohnLyu2 5a9b0dd747
Z3str3 Debug (#6000)
* z3str3 debug

* add comments of reference to bugs in the report

Co-authored-by: John Lu <z52lu@uwaterloo.ca>
2022-04-27 12:37:07 +02:00
Nikolaj Bjorner 81d97a81af enable nested ADT and sequences
add API to define forward reference to recursively defined datatype.
The forward reference should be used only when passed to constructor declarations that are used in a datatype definition (Z3_mk_datatypes). The call to Z3_mk_datatypes ensures that the forward reference can be resolved with respect to constructors.
2022-04-27 09:58:38 +01:00
Nikolaj Bjorner 8e2f09b517 #5778 - ensure arrays used inside of extensionality function are treated as shared
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-04-25 17:17:59 +01:00
Clemens Eisenhofer 81189d6fdd
Added bit2bool to the API (#5992)
* Fixed registering expressions in push/pop

* Reused existing function

* Reverted reusing can_propagate

* Added decide-callback to user-propagator

* Refactoring

* Fixed index

* Added bit2bool to the API
Fixed bug in user-propagator's decide callback

* Fixed typo
2022-04-22 09:54:21 +01:00
Nikolaj Bjorner a1ead5f47d #5986
add memory limit check to internalize
2022-04-19 07:31:40 +02:00
Nikolaj Bjorner f4c500c519 fix build
reference types are not part of C
2022-04-16 15:16:53 +02:00
Nikolaj Bjorner 807121aa03 wip 2022-04-16 14:55:43 +02:00
Clemens Eisenhofer e11496bc65
Added decide-callback to user-propagator (#5978)
* Fixed registering expressions in push/pop

* Reused existing function

* Reverted reusing can_propagate

* Added decide-callback to user-propagator

* Refactoring

* Fixed index
2022-04-15 20:07:17 +02:00
Nikolaj Bjorner 3cc9d7f443 improve pre-processing 2022-04-15 12:55:26 +02:00
Clemens Eisenhofer b264e6c290
Reverted reusing can_propagate (#5966)
* Fixed registering expressions in push/pop

* Reused existing function

* Reverted reusing can_propagate
2022-04-12 12:29:53 +02:00
Clemens Eisenhofer b0d8b27f37
Fixed registering expressions in push/pop (#5964)
* Fixed registering expressions in push/pop

* Reused existing function
2022-04-11 16:50:13 +02:00
Nikolaj Bjorner 0fa0feb979 allow add_expr during pop
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-04-06 16:27:10 +02:00
Nikolaj Bjorner 03a2d9a018 fix #5942 2022-04-03 11:03:28 -07:00
Nikolaj Bjorner 81084b8232 #5778 #5937 2022-04-01 13:07:17 -07:00
Nikolaj Bjorner dd27f7e937 #5935
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-03-30 17:47:48 -10:00
Clemens Eisenhofer 7bb969ab52
Fixed problem with registering bitvector functions (#5923) 2022-03-26 16:36:15 -10:00
Nikolaj Bjorner d790523c59 #5917
Add model.user_functions (default true) to control whether user functions are added to the model.
2022-03-23 09:49:44 -07:00
Nikolaj Bjorner b4873d226c fix #5907
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-03-20 11:40:19 -07:00
Nikolaj Bjorner dfa65443e9 fix name for artifact
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-03-19 13:51:58 -07:00
Nikolaj Bjorner 964e513353 re-add bv_eq_axioms, fix #5842 2022-03-19 12:37:01 -07:00
Nikolaj Bjorner 545341e699 fix #5895 2022-03-12 09:17:13 -08:00
Nikolaj Bjorner 580012e19f fix #5894
expp is not implemented. This is the second time a fuzz bug reports it. Instead of closing the bug, just disable code path as fuzzers are not considering the comment from previous bug.
2022-03-10 09:45:09 -08:00
Nuno Lopes 43f7636826 remove some copies/moves 2022-03-09 12:46:41 +00:00
Nikolaj Bjorner deaad86d6a nit 2022-03-01 12:11:10 -08:00
Clemens Eisenhofer 412b05076c
User-functions fix (#5868) 2022-02-26 09:21:01 -08:00
Nikolaj Bjorner 7b4f1ed530 missing initialization of m_user_propagator, disable unsound in-processing in pb_solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-23 04:49:42 -08:00
Nikolaj Bjorner 6af170b058 fix #5861
sigh
2022-02-22 11:26:09 -08:00
Nikolaj Bjorner b843618051 fix #5798
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-20 13:54:15 -08:00
Nikolaj Bjorner 1e463955c2 #4889 avoid double internalize of bvle
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-20 09:09:28 -08:00
Nikolaj Bjorner 2e00f2f32d
Propagator (#5845)
* user propagator without ids

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

* user propagator without ids

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

* fix signature

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

* references #5818

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

* fix c++ build

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

* switch to vs 2022

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

* switch 2022

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

* Update propagator example (I) (#5835)

* fix #5829

* na

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

* switch to vs 2022

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

* Adapted the example to the changes in the propagator

Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* context goes out of scope in stack allocation, so can't used scoped context when passing objects around

* parameter check

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

* add rewriter

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

* Fixed bug in user-propagator "created" (#5843)

Co-authored-by: Clemens Eisenhofer <56730610+CEisenhofer@users.noreply.github.com>
2022-02-17 09:21:41 +02:00
Qix 9cf50766a6
fix compiler warnings under clang (#5839) 2022-02-16 23:36:34 +02:00
Nikolaj Bjorner 6202cd5394 fix #5842
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-16 17:38:19 +02:00
Nikolaj Bjorner aa6ec418e3 move idiv test to after cuts/branch
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-14 19:50:49 +02:00
Nikolaj Bjorner 3d26b501e7 fix #5827 #5828 2022-02-14 10:31:04 +02:00
Nikolaj Bjorner 0059e88036 fix #5808
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-07 20:10:32 +02:00
Nikolaj Bjorner 9958cab5cc fix #5808
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-07 07:43:30 +02:00
Nikolaj Bjorner 3f3d058567 extract also units from search state 2022-02-07 06:16:22 +02:00
Nikolaj Bjorner 9d655cc658 track all unhandled operators instead of latest 2022-02-04 22:07:29 -08:00
Nikolaj Bjorner 474949542e Merge branch 'master' of https://github.com/z3prover/z3 2022-02-04 13:08:59 -08:00
Nikolaj Bjorner 05e28e4344 fix #5812 2022-02-04 13:08:52 -08:00
Nikolaj Bjorner a326ad4cd9 flag incomplete on lambdas #5803 2022-01-31 11:54:06 -08:00
Nikolaj Bjorner c6539deb61 fixing null check
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 17:25:42 +01:00
Nikolaj Bjorner 435f79eab0 tup
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 16:40:55 +01:00
Nikolaj Bjorner 9294b2ceb2 created
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 16:33:23 +01:00