3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-18 22:59:02 +00:00
Commit graph

14955 commits

Author SHA1 Message Date
Nikolaj Bjorner a4d4e2e483 track assertions 2023-01-09 15:18:33 -08:00
Nikolaj Bjorner 64ec8acd30 fix model reconstruction ordering for elim_unconstrained 2023-01-09 15:18:19 -08:00
Nikolaj Bjorner 30e0f78c16 remove exit
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-09 10:00:36 -08:00
dependabot[bot] a4f2a1bb2e
Bump json5 from 2.2.1 to 2.2.3 in /src/api/js (#6527)
Bumps [json5](https://github.com/json5/json5) from 2.2.1 to 2.2.3.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v2.2.1...v2.2.3)

---
updated-dependencies:
- dependency-name: json5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-09 09:16:55 +00:00
Nikolaj Bjorner 49ee570b09 split into separate function
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-08 19:16:46 -08:00
Nuno Lopes 5899fe3cea
Add rewrite for array selects of chain of stores of a same value (#6526)
* Add rewrite for array selects of chain of stores of a same value

Example:
```smt
(declare-fun mem () (Array (_ BitVec 4) (_ BitVec 4)))
(declare-const x (_ BitVec 4))
(declare-const y (_ BitVec 4))
; simplifies to #x1
(simplify (select (store (store (store mem #x1 #x1) y #x1) x #x1) #x1))
```

* Update array_rewriter.cpp

* Update array_rewriter.cpp
2023-01-08 19:09:01 -08:00
Nikolaj Bjorner 1ddef117a2 several fixes to proof logging in legacy solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-08 16:11:31 -08:00
Nikolaj Bjorner 61b90e64b2 disable new simplifcation for multiplier until really understood
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-08 14:17:49 -08:00
Nikolaj Bjorner fcea32344e add missing tactic descriptions, add rewrite for tamagochi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-08 13:32:26 -08:00
Nikolaj Bjorner 95cb06d8cf add quasi macro detection 2023-01-06 19:53:55 -08:00
Nikolaj Bjorner 25112e47b4 bugfix to flatten-clases simplifier
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-05 20:59:28 -08:00
Nikolaj Bjorner c07b6ab38f more tactic descriptions 2023-01-05 20:23:01 -08:00
Nikolaj Bjorner 0d8a472aac pass sign into literal definition for pbge 2023-01-04 16:55:44 -08:00
Nikolaj Bjorner 81ce57b5a8 #6429 2023-01-04 15:38:13 -08:00
Nikolaj Bjorner e0099150ca #6429 2023-01-04 15:28:57 -08:00
Nikolaj Bjorner 380c701cbe restore debug clang/gcc build 2023-01-04 15:01:40 -08:00
Nikolaj Bjorner 21362c0b98 make case-def and recfun-num-rounds re-parsable for logging 2023-01-04 15:00:25 -08:00
Nikolaj Bjorner ef10119005 #6429 fixes 2023-01-04 13:05:45 -08:00
Nikolaj Bjorner aa080a6b19 update ignore-int handling #6429
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-04 12:22:38 -08:00
Nikolaj Bjorner 8d0d6d8f04 Merge branch 'master' of https://github.com/z3prover/z3 2023-01-04 11:56:38 -08:00
Nikolaj Bjorner 6f95c77023 fix bugs in flatten_clauses simplifier, switch proof/fml
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-04 11:56:28 -08:00
Nuno Lopes e448191212 array rewriter: expand select of store with const array into an ite
This:
(simplify (select (store ((as const (Array (_ BitVec 4) (_ BitVec 4))) #x0) x #x1) y))
=>
(ite (= x y) #x1 #x0)
2023-01-03 11:08:57 +00:00
Nuno Lopes e508ef17f6 fix Alive bug #875: bit blaster not respecting soft memory limit 2023-01-03 10:39:28 +00:00
Nuno Lopes a2cc504d4a remove a couple more std::endl 2023-01-03 09:49:58 +00:00
Nuno Lopes d30cb55bae don't flush stream when printing param vals 2023-01-03 09:35:17 +00:00
Nikolaj Bjorner d4490738bc Merge branch 'master' of https://github.com/z3prover/z3 2023-01-02 16:49:43 -08:00
Nikolaj Bjorner ea0d09b6c8 add pointer to build parameters to README #6518
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-02 16:49:31 -08:00
Walden Yan dbf93c5fbd
Fixing array select for lambda expressions in Python API (#6516)
* fix: making array select work for lambda expressions

* more elegant solution
2023-01-01 15:27:54 -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 c0f1f33898 dampen second setup of theory_bv 2022-12-30 18:47:32 -08:00
Nikolaj Bjorner 5f6f2fc758 rename bit_blaster class to bit_blaster_simplifier to avoid name clash 2022-12-30 18:39:02 -08:00
Nikolaj Bjorner 0d05e0649b initialization order
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-30 18:16:24 -08:00
Nikolaj Bjorner 2c3ecceb03 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-30 15:47:24 -08:00
Nikolaj Bjorner 293627c889 fix #6513
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-30 09:55:33 -08:00
Nikolaj Bjorner 07ab4d38b6 fix #6513
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-30 09:55:10 -08:00
Nuno Lopes 47324af210 be nicer when memout is reached in SMT internalize: return undef rather than crashing 2022-12-29 11:08:57 +00:00
Nikolaj Bjorner 7cc58c9cc3 Merge branch 'master' of https://github.com/z3prover/z3 2022-12-27 20:19:39 -08:00
Nikolaj Bjorner ec74a87423 fix #6510
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-27 20:19:26 -08:00
Nikolaj Bjorner 3e8cbb6611 #5884
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-27 18:07:57 -08:00
Nikolaj Bjorner abef260d67 Merge branch 'master' of https://github.com/z3prover/z3 2022-12-27 12:03:49 -08:00
Nikolaj Bjorner bc19992543 add doc for ackermannize
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-27 12:02:08 -08:00
Nikolaj Bjorner 8d332cc3a1
#6508 (#6509) 2022-12-26 15:42:04 -08:00
Nikolaj Bjorner 6fab4fec23
#6508 2022-12-26 15:36:58 -08:00
Nikolaj Bjorner b9c4f5d4fa #6506
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-25 18:33:01 -08:00
Nikolaj Bjorner 8efaaaf249 Fix #6503
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-25 17:29:06 -08:00
Nikolaj Bjorner fe8034731d fix #6501 2022-12-19 21:02:55 -08:00
Nikolaj Bjorner f961300036 Merge branch 'master' of https://github.com/z3prover/z3 2022-12-19 12:40:51 -08:00
Nikolaj Bjorner 603597a22e deal with cancellation in qe for #6500
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-19 12:40:39 -08:00
Nikolaj Bjorner e423fabf6a tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-15 20:35:36 -08:00
Nikolaj Bjorner 0768a2ead1 updated doc 2022-12-15 19:23:32 -08:00
Nikolaj Bjorner ecf25a4fe2 outline scheme
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-15 14:57:52 -08:00
Nikolaj Bjorner 13920c4772 more doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-15 11:42:02 -08:00
Nikolaj Bjorner d5316e017e add tactic descriptions 2022-12-14 20:38:28 -08:00
Nikolaj Bjorner f01d9d29d2 Merge branch 'master' of https://github.com/z3prover/z3 2022-12-14 16:46:25 -08:00
Nikolaj Bjorner aed3d76a88 add doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-14 16:45:58 -08:00
Nikolaj Bjorner d47dd159d7 set encoding into gparams because this is the only entry point in zstring #6490 2022-12-14 09:43:29 -08:00
Nikolaj Bjorner c4b2acac24 add missing error checking #6492
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-14 09:27:43 -08:00
Nikolaj Bjorner dbb4bbe7dc remove debug out 2022-12-13 19:36:55 -08:00
Nikolaj Bjorner 9054e72920 fix #6467 2022-12-13 19:35:20 -08:00
Nikolaj Bjorner cd3d38caf7 sort out terminology/add explanations, add shortcut to C++, fix #6491
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-13 16:17:38 -08:00
Nikolaj Bjorner 2d7a38e95e fix #6488
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-13 16:07:41 -08:00
Nikolaj Bjorner 7afcaa5364 update doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-12 18:56:21 -08:00
Nikolaj Bjorner e648e68d36 add doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-12 17:29:58 -08:00
Duncan Ogilvie e82c8e78ae
Fix a compilation error with clang-cl (VS2022) (#6489) 2022-12-12 22:12:31 +00:00
Nikolaj Bjorner aded8e5bf4 fix #6488
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-12 11:40:59 -08:00
Nikolaj Bjorner 4598af70c8 fix #6488
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-12 11:04:46 -08:00
Nikolaj Bjorner a3e6885680 fix #6488 2022-12-12 09:50:44 -08:00
Nikolaj Bjorner 039de6a2c8 build issues
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-11 15:05:13 -08:00
Nuno Lopes cb8603177e fix build 2022-12-11 22:17:11 +00:00
Nuno Lopes d308b8f555 simplify code + remove unused file 2022-12-11 22:11:19 +00:00
Nikolaj Bjorner 2520dcb04b merge
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-11 14:03:22 -08:00
Nuno Lopes 2d43ccc4c6 Revert "fix crashes in elim-uncnstr2"
This reverts commit a302c2f15e.
2022-12-11 21:37:25 +00:00
Nikolaj Bjorner 6a1b3f7344 move debug output to before state update 2022-12-11 12:51:46 -08:00
Nikolaj Bjorner f7269bb60a update doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-11 10:16:17 -08:00
Nikolaj Bjorner a9f52b0069 doc fixes 2022-12-11 10:04:01 -08:00
Nikolaj Bjorner 527fb18366 add doc for card2bv 2022-12-11 09:51:49 -08:00
Nuno Lopes a302c2f15e fix crashes in elim-uncnstr2
This would crash before:
(declare-fun x () (_ BitVec 4))
(assert (not (bvule x #x1)))
(apply elim-uncnstr2)

That's because the index_set iterator was querying qtail to compute the end of the iteration
But the problem is that elim-uncnstr2 may add new fmls to the goal, as in this case.
The bvule is replaced with an 'or', but since it's negated, it turns into 2 goals
Solve the issue by freezing the qtail for the iteration loop.
This is the right behavior for elim-uncnstr2, as it can't rewrite exprs that haven't been analyzed before

@NikolajBjorner please check if this the right behavior for the other simplifiers. Thank you
2022-12-11 15:21:23 +00:00
Nikolaj Bjorner ee307dd84f Merge branch 'master' of https://github.com/z3prover/z3 2022-12-09 08:50:46 -08:00
Nikolaj Bjorner 1434c7d394 #6059
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-09 08:50:32 -08:00
Nuno Lopes 9ebacd87e2 fix buggy mask (typo in my last commit..) 2022-12-09 16:16:52 +00:00
Nikolaj Bjorner 96a2c04026 fix bug reported by Nuno
qhead should not be changed after tactic execution. It should remain 0 so the same tactic can be applied repeatedly on the entire state
2022-12-09 07:57:06 -08:00
Nuno Lopes a96f5a9b42 fix overflow in mpz::bitwise_not 2022-12-09 11:59:39 +00:00
Nuno Lopes c6f9c09d70 cleanup more in dependent_expr_state_tactic to reduce mem consumption 2022-12-09 11:34:53 +00:00
Nuno Lopes ca6fed8b25 minor code simplification 2022-12-08 18:20:46 +00:00
Nikolaj Bjorner 8981d32caf
#6481 2022-12-08 07:06:27 -08:00
Nikolaj Bjorner 4a451b10d8 add custom coercion for floats. fix #6482
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-07 09:07:13 -08:00
Nikolaj Bjorner c45c40e782 doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-07 08:51:18 -08:00
Nikolaj Bjorner 7e69dab8f6 distribute forall cpp code 2022-12-06 18:15:18 -08:00
Nikolaj Bjorner c33e58ee1a update distribute forall
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-06 17:59:33 -08:00
Nikolaj Bjorner 80033e8744 cave in to supporting proofs (partially) in simplifiers, updated doc 2022-12-06 17:02:04 -08:00
Nikolaj Bjorner aaabbfb594 remove comment that does not align with result
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-06 15:53:55 -08:00
Nikolaj Bjorner d125d87aed typo
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-06 15:51:42 -08:00
Nikolaj Bjorner 1e06c7414a add doc 2022-12-06 15:44:21 -08:00
Nikolaj Bjorner 7df4e04a2c add der description
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-06 05:46:52 -08:00
Nikolaj Bjorner 90ba225ae3 add more doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-12-06 05:39:05 -08:00
Nikolaj Bjorner 5a5758baaa add documentation to initial selection of tactics 2022-12-05 20:05:06 -08:00
Nikolaj Bjorner f1a65d9642 add documentation notes 2022-12-05 20:05:06 -08:00
Nuno Lopes a2f5a5b50b remove memory alloc from statistics_report 2022-12-05 14:29:14 +00:00
Nuno Lopes eb8c53c164 simplify factory of dependent_expr_state_tactic
And as a side-effect, remove heap allocations for factories
2022-12-05 14:07:57 +00:00
Nikolaj Bjorner de916f50d6 add demodulator tactic based on demodulator-simplifier
- some handling for commutative operators
- fix bug in demodulator_index where fwd and bwd are swapped
2022-12-05 03:20:46 -08:00
Nikolaj Bjorner 87095950cb fix #6477 2022-12-04 13:02:45 -08:00
Nikolaj Bjorner ead2a46a88 build 2022-12-04 10:38:24 -08:00
Nikolaj Bjorner b76ed6a47f proper fix to #6476 2022-12-04 10:19:39 -08:00
Nikolaj Bjorner 9b58135876 try to fix linux builds 2022-12-04 09:55:31 -08:00
Nikolaj Bjorner 0f7bebcbed try big M for linux build 2022-12-04 09:49:32 -08:00
Nikolaj Bjorner 1974c224ab add demodulator simplifier
refactor demodulator-rewriter a bit to separate reusable features.
2022-12-04 09:39:28 -08:00
Nikolaj Bjorner 9acbfa3923 move it into substitution to handle dependencies 2022-12-04 06:23:32 -08:00
Nikolaj Bjorner 3d7bd40a87 a round of cleanup 2022-12-04 06:07:45 -08:00
Nikolaj Bjorner d218083145 The demodulator doesn't produce proofs so remove code path that depends it does. 2022-12-04 04:48:48 -08:00
Nikolaj Bjorner 7fe6787748 ufbv-rewriter is really a demodulator rewriter and does not reference ufbv
so moving first the rewriter into place of other rewriters
2022-12-04 04:44:02 -08:00
Nikolaj Bjorner e455897178 fix #6476 2022-12-04 04:36:06 -08:00
Nikolaj Bjorner 79e6d4e32d tune and debug elim-unconstrained (v2 - for simplifiers infrastructure) 2022-12-04 03:53:31 -08:00
Nikolaj Bjorner 59fa8964ca minor code cleanup 2022-12-04 03:53:31 -08:00
Nikolaj Bjorner 3ebbb8472a fix perf bugs in new value propagation 2022-12-04 03:53:30 -08:00
Nikolaj Bjorner 758c3b2c3b fix filtering for recursive functions 2022-12-04 03:53:30 -08:00
Nikolaj Bjorner cf7bba6288 use ast_manager as an attribute 2022-12-04 03:53:30 -08:00
Nikolaj Bjorner 5073959ae0 add macro attribute 2022-12-04 03:53:29 -08:00
yizhou7 54a8d65617
move flushes in display_statistics (#6472) 2022-12-02 13:56:53 -08:00
Nikolaj Bjorner a96b7d243a remove incorrect check for quantifier 2022-12-01 00:04:08 -08:00
Nikolaj Bjorner e5984dd397 add cnf/nnf simplifier 2022-11-30 23:04:38 -08:00
Nikolaj Bjorner e3e2c21632 Create cnf_nnf.h 2022-11-30 22:53:14 -08:00
Nikolaj Bjorner 847aec1d30 update dependencies 2022-11-30 22:48:10 -08:00
Nikolaj Bjorner 529f116be0 disable new code until pre-condition gets fixed
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-30 22:29:59 -08:00
Nikolaj Bjorner 30c9cda61e increment generation for literals created during E-matching 2022-12-01 10:04:33 +09:00
Nikolaj Bjorner f24ecde35c wip - fixes to simplifiers 2022-12-01 09:31:52 +09:00
Nikolaj Bjorner cfc8e19baf add more simplifiers, fix model reconstruction order for elim_unconstrained
- enable sat.smt in smt_tactic that
is invoked by default on first goals
add flatten-clauses
add push-ite
have tptp5 front-end pretty print SMT2 formulas a little nicer.
2022-12-01 02:35:43 +09:00
Nikolaj Bjorner edb0fc394b rewrite some simplifiers 2022-11-30 23:15:32 +09:00
Nikolaj Bjorner 23c53c6820 fix build 2022-11-30 19:36:13 +09:00
Nikolaj Bjorner c1ff3d3192 wip - adding quasi macro detection 2022-11-30 13:46:00 +07:00
Nikolaj Bjorner b084821a0c wip - dependent expr simpliifer
- simplify iterator over current indices
- add more simplifiers used by asserted_formulas
- improve diagnostics printing
2022-11-30 13:41:40 +07:00
Nikolaj Bjorner bec3acd146 consolidate freeze functionality into dependent_expr_state
rename size() to qtail() and introduce shortcuts
ensure tactic goals are not updated if they are in inconsistent state (because indices could be invalidated)
2022-11-30 08:35:29 +07:00
Nikolaj Bjorner 73a652cf4b some fixes to backtracking restore points in new solver 2022-11-29 16:42:42 +07: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 ac023935a3 introduce sat-smt-solver
in an iteration of inc-sat-solver introduce sat-smt-solver to allow incremental pre-processing.
The aim is to allow incrementally handling formulas while at the same time retaining the main benefits of global in/pre-processing that change models. Previous incremental solving capabilities have been limited to use pre-processing that does not require model conversion.
2022-11-28 15:06:31 +07:00
Nikolaj Bjorner 82d9e4a4fc update goal2sat interface to use explicit initialization 2022-11-28 15:04:12 +07:00
Nikolaj Bjorner 500626e814 add sat-smt-preprocess module
self-contained pre-processing initialization
2022-11-28 12:13:00 +07:00
Nikolaj Bjorner 85f9c7eefa replace restore_size_trail by more generic restore_vector
other updates:
- change signature of advance_qhead to simplify call sites
- have model reconstruction replay work on a tail of dependent_expr state, while adding formulas to the tail.
2022-11-28 11:45:56 +07:00
Nikolaj Bjorner 6454014119 enable incrementality for model reconstruction 2022-11-25 15:28:38 +07:00
Nikolaj Bjorner 4e9f21c2a1 add rewriter and seq simplifiers 2022-11-25 15:16:14 +07:00
Nikolaj Bjorner a152f9cfd6 port bit-blaster to simplifiers
inc_sat_solver uses bit-blaster, card2bv and max_bv_sharing.
By turning these into simplifiers it will be possible to remove
dependencies on tactics and goals in inc_sat_simplifier and instead use a modular and general incremental pre-processing infrastructure.
2022-11-25 13:37:16 +07:00
Nikolaj Bjorner f0570fbc0e remove tactic exception dependency 2022-11-25 11:48:44 +07:00
Nikolaj Bjorner e95b0bd2cd remove include of tactical 2022-11-25 11:47:38 +07:00
Nikolaj Bjorner 8184e7fe0a keep track of qhead 2022-11-25 11:42:16 +07:00
Nikolaj Bjorner 5af6e1a046 make max_bv_sharing a simplifier 2022-11-25 11:38:41 +07:00
Nikolaj Bjorner db74e23de1 make card2bv a simplifier 2022-11-25 11:07:31 +07:00
Nikolaj Bjorner cb789f6ca8 add arithmetical macros
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-24 23:44:35 +07:00
Nikolaj Bjorner eb812e47be cleanup 2022-11-24 22:46:35 +07:00
Nikolaj Bjorner b0247d8201 add exception handling for rewriter exceptions 2022-11-24 22:20:25 +07:00
Nikolaj Bjorner 1815812889 fix typo in name of tactic 2022-11-24 22:05:30 +07:00
Nikolaj Bjorner a64c7c5d19 add incremental version of value propagate 2022-11-24 21:52:55 +07:00
Nikolaj Bjorner decb3d3907 stashed header file 2022-11-24 19:51:26 +07:00
Nikolaj Bjorner 3479129582 remove unused structs 2022-11-24 19:47:26 +07:00
Nikolaj Bjorner caf204ab95 hoist macro-replacer as shared utility, update eliminate-predicates and model reconstruction 2022-11-24 19:45:51 +07:00
Nikolaj Bjorner 5fe2ff84e9 change functionality to not track ite terms for congruence closure 2022-11-24 19:45:16 +07:00
Nikolaj Bjorner 15dc7b78a0 Move merge_tf handling to euf_internalize
literals true/false are not necessarily created when the merge flag is set.
Also disable merge_tf for if-then-else expressions
Perhaps even not insert children of if expressions into congruence table?
2022-11-24 15:09:13 +07:00
Nikolaj Bjorner eceeb295fc fix #6457 2022-11-24 14:41:50 +07:00
Nikolaj Bjorner 4ac5e51e3a #6429 2022-11-23 18:35:17 +07:00
Nikolaj Bjorner f87e187b62 #6429 2022-11-23 17:52:14 +07:00
Nikolaj Bjorner 0a671f2f44 fix #6464 2022-11-23 17:21:51 +07:00
Nikolaj Bjorner 0a28bacd0f remove debug out 2022-11-23 16:42:36 +07:00
Nikolaj Bjorner 9a2693bb72 tune euf-completion 2022-11-23 16:39:20 +07:00
Nikolaj Bjorner 22353c2d6c new core perf - add merge_tf and enable_cgc distinction
perf fix for propagation behavior for equalities in the new core.
The old behavior was not to allow congruence closure on equalities.
The new behavior is to just not allow merging tf with equalities unless they appear somewhere in a foreign context (not under a Boolean operator)

The change re-surfaces merge_tf and enable_cgc distinction from the old core.
They can both be turned on or off.

merge_enabled renamed to cgc_enabled

The change is highly likely to introduce regressions in the new core.

Change propagation of literals from congruence:
- track antecedent enode. There are four ways to propagate
literals from the egraph.
- the literal is an equality and the two arguments are congruent
- the antecedent is merged with node n and the antecedent has a Boolean variable assignment.
- the antecedent is true or false, they are merged.
- the merge_tf flag is toggled to true but the node n has not been merged with true/false
2022-11-23 11:37:24 +07:00
Nikolaj Bjorner 11b712fee0 switch to new configuration convention in solver object 2022-11-23 11:37:23 +07:00
Nikolaj Bjorner 6188c536ef add logging of propagations to smt core
log theory propagations with annotation "smt".
It allows tracking theory propagations (when used in conflicts) in the clause logs similar to the new core.
2022-11-23 11:37:23 +07:00
Nikolaj Bjorner 5374142e3e continue updates for adding proof-log to smt core 2022-11-23 11:37:23 +07:00
Nikolaj Bjorner c7781f346d move parameter sat.smt.proof to solver.proof.log
this update breaks use cases that set sat.smt.proof to True.
As it is such a new feature and the change affects possibly at most the tutorial it is made without compatibility layers.
2022-11-23 11:37:23 +07:00
Nikolaj Bjorner cd0d52acec using C++11 features to simplify for-loops 2022-11-23 11:37:23 +07:00
Nikolaj Bjorner 5c5673bc09 make sure parser context within solver object has its parameters updated
this is to enable use cases like:

```
from z3 import *

s = Solver()
OnClause(s, print)
s.set("solver.proof.check", False)
s.from_file("../satproof.smt2")
```

instead of setting global parameters before the proof replay is initialized.
2022-11-23 11:37:23 +07:00
Nuno Lopes 477b90228e fix #6460: crash in mk_to_ieee_bv_i 2022-11-20 19:19:12 +00:00
Nuno Lopes 0445d6f264 FPA->BV fix unused vars 2022-11-20 19:03:32 +00:00
Nikolaj Bjorner b9f34286a7 generalize macro head detection and elaboration 2022-11-20 11:36:45 +07:00
Nikolaj Bjorner fcaa85d7a8 #6456 - elaborate on error message 2022-11-20 11:27:39 +07:00
Nikolaj Bjorner 86f3702403 prevent re-declaration of enumeration sort names
preventing redeclaration of all ADT cases is not part of this update.
2022-11-19 19:46:34 +07:00
Nikolaj Bjorner c3c45f495a add some comments to elim_predicates 2022-11-19 19:45:25 +07:00
Nikolaj Bjorner 251d49d133 remove outdated comment 2022-11-19 18:55:30 +07:00
Nikolaj Bjorner 3f10933225 remove VERBOSE 0 2022-11-19 18:55:01 +07:00
Nikolaj Bjorner 771157696b new simplifier/tactic
eliminate_predicates finds macros and eliminates predicates from formulas as pre-processing.
2022-11-19 18:51:20 +07:00
Nikolaj Bjorner d735faae4e add isolated hide/add model converter functions 2022-11-19 18:50:37 +07:00
Nikolaj Bjorner a81a5ec68c add virtual function requirement to dependent_expr_state 2022-11-19 18:46:31 +07:00
Nikolaj Bjorner dcc995f0e5 code simplification 2022-11-19 18:45:54 +07:00
Nikolaj Bjorner 41b40c3a51 remove dead code 2022-11-19 18:45:07 +07:00
Nikolaj Bjorner c2e9016d04 display model-add parameters in correct order 2022-11-19 18:44:52 +07:00
Nikolaj Bjorner ba68652c72 add destructive equality resolution to existentials 2022-11-19 18:43:46 +07:00
Nikolaj Bjorner 7da91f4313 allow printing declarations with reverse variable order 2022-11-19 18:43:21 +07:00
Nikolaj Bjorner 59b7845c7d reset visited (fast mark) to not clash with occurs 2022-11-17 17:36:21 +09:00
Nikolaj Bjorner 6662afdd26 perf improvements to solve-eqs and euf-completion 2022-11-16 22:15:02 -08:00
Nikolaj Bjorner 2c7799939e wip - tuning and fixes to euf-completion 2022-11-16 03:47:38 -08:00
Nikolaj Bjorner 98fc8c99db add shortcut to equality mk utility 2022-11-16 03:47:01 -08:00
Nikolaj Bjorner 55ab7778f4 fix perf bug in new solve_eqs. 2022-11-16 03:46:17 -08:00
Nikolaj Bjorner d70dbdad50 wip euf-completion - debugging 2022-11-15 20:17:39 -08:00
Nikolaj Bjorner 255414f4a9 fix regression crash
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-15 11:20:12 -08:00
Nikolaj Bjorner 9845c33236 add shortcuts in rewriter, eliminate redundancies in dependent_expr tactic 2022-11-15 09:13:13 -08:00
Nikolaj Bjorner bfae8b2162 set flat_and_or to false in bv rewriter 2022-11-15 05:47:28 -08:00
Nikolaj Bjorner 041b5f9ef0 rename away solve_eqs2 to solve_eqs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-14 20:01:37 -08:00
Nikolaj Bjorner 48c0f8694f euf-completion bug fix, streamline name to solve_eqs 2022-11-14 20:01:00 -08:00
Nikolaj Bjorner 3eeb59db34 fix #6451 missing occurrence marking when there is an unsafe equality already
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-14 19:23:27 -08:00
Nikolaj Bjorner 95e07ffe8e disable unsound context equality solving
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-14 19:14:51 -08:00
Nikolaj Bjorner 6297c001ee remove legacy solve_eqs_tactic entirely
also, bug fixes to elim_unconstrained (elim_uncnstr2) which is to replace legacy tactic for eliminating unconstrained constants.
2022-11-14 18:57:16 -08:00
Nikolaj Bjorner 3f2bbe5589 harness del_object #6452
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-14 08:54:08 -08:00
Nikolaj Bjorner 3d2bf13577 streamline statistics, fix bug in updating goals 2022-11-13 20:30:00 -08:00
Nikolaj Bjorner ce6cfeaa68 fix bug in euf-completion relating to missed normalization 2022-11-13 18:01:17 -08:00
Nikolaj Bjorner 3fa81d6527 bug fixes to elim-uncnstr2 tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-13 13:25:19 -08:00
Nikolaj Bjorner 38cde14e08 wip missing updates 2022-11-13 12:10:43 -08:00
Nikolaj Bjorner 196788a091 bug fix for equality solving 2022-11-13 12:09:56 -08:00
Nikolaj Bjorner ce76e3138d streamlining expr-inverter code 2022-11-13 11:48:32 -08:00
Nikolaj Bjorner 3d570aaa0a add missing process_eq
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-12 18:43:57 -08:00
Nikolaj Bjorner 0b83732b82 missing override specifier 2022-11-12 18:35:41 -08:00
Nikolaj Bjorner 343603f643 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-12 18:34:04 -08:00
Nikolaj Bjorner e33e66212c propagate values should not flatten and/or
also, elim_uncstr should only be disabled on recursive functions
2022-11-12 18:03:47 -08:00
Nikolaj Bjorner f4e17ecc65 add logging and diagnostics 2022-11-12 18:03:47 -08:00
Nikolaj Bjorner 9d09064ad0 add comments to elim_unconstrained and remove unused function 2022-11-12 18:01:38 -08:00
Nikolaj Bjorner efbe0a6554 wip - updated version of elim_uncstr_tactic
- remove reduce_invertible. It is subsumed by reduce_uncstr(2)
- introduce a simplifier for reduce_unconstrained. It uses reference counting to deal with inefficiency bug of legacy reduce_uncstr. It decomposes theory plugins into expr_inverter.

reduce_invertible is a tactic used in most built-in scenarios. It is useful for removing subterms that can be eliminated using "cheap" quantifier elimination. Specifically variables that occur only once can be removed in many cases by computing an expression that represents the effect computing a value for the eliminated occurrence.

The theory plugins for variable elimination are very partial and should be augmented by extensions, esp. for the case of bit-vectors where the invertibility conditions are thoroughly documented by Niemetz and Preiner.
2022-11-12 17:56:45 -08:00
Nikolaj Bjorner 689af3b4df add comments to elim_unconstr_tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-10 16:42:09 -08:00
Nikolaj Bjorner 15be80c954 remove dependency on hash_compare 2022-11-09 09:06:34 -08:00
Nikolaj Bjorner 8da13ae24a add statistics to verbose output of asserted formulas 2022-11-08 18:37:30 -08:00
Nikolaj Bjorner 9a656772b4 fix #6446 2022-11-08 18:37:16 -08:00
Nikolaj Bjorner ff68df3451 update output of z3 doc 2022-11-08 16:10:50 -08:00
Nikolaj Bjorner 254f7b97ef cleanup state to clear model trail during calls. 2022-11-08 15:56:10 -08:00
Nikolaj Bjorner 3faca52c40 re-enable new solve_eqs with bug fixes 2022-11-08 14:17:17 -08:00
Nikolaj Bjorner 9ef78fcfa7 revert new solve-eqs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-08 13:57:58 -08:00
Nikolaj Bjorner 3a37cfca30 switch to solve_eqs2 tactic 2022-11-08 12:23:36 -08:00
Nikolaj Bjorner f769e2f1f6 have bool rewriter use flat_and_or, and integrate hoist rewriter 2022-11-08 12:21:50 -08:00
Nikolaj Bjorner 238ea0a264 add shorthands for concatentation 2022-11-08 12:21:25 -08:00
Nikolaj Bjorner 3a4b8e2334 add rewrite rules to bv-rewriter 2022-11-08 12:20:51 -08:00
Nikolaj Bjorner a34701471f clean up hoist rewriter 2022-11-08 12:20:25 -08:00
Nikolaj Bjorner ab36f86843 add handler for reporting statistics 2022-11-08 12:19:48 -08:00
Nikolaj Bjorner 8afec86fe8 add option for flat_and_or 2022-11-08 12:19:27 -08:00
Nikolaj Bjorner 10fb71cf93 better error description for configuring restart 2022-11-08 12:18:45 -08:00
Nikolaj Bjorner cbc5b1f4f6 have theory_recfun use recursive function discriminator to control when it is enabled 2022-11-06 12:09:45 -08:00
Nikolaj Bjorner f004478565 produce tseitin justification for clause proofs when a clause is a "gate". 2022-11-06 12:00:25 -08:00
Nikolaj Bjorner 53b6059276 bypass built-in proof objects for clause trail
the build-in proof constructors are not flexible when it comes to allowing alternation of justified lemmas and lemmas without justifications.
2022-11-06 11:59:56 -08:00
Nikolaj Bjorner 8ff1e44a95 add discriminator to whether context contains recursive functions to avoid enabling recursive function solver when there are just macros 2022-11-06 11:58:21 -08:00
Nikolaj Bjorner a4c2a2b22c use ast_util::mk_not to avoid redundant double negations during nff 2022-11-06 11:57:46 -08:00
Nikolaj Bjorner 78f9e6b31a extend error type message with more information - display the arguments that are passed 2022-11-06 11:57:21 -08:00
Nikolaj Bjorner 4c1a3fab64 fix #6442 2022-11-05 23:15:03 -07:00
Nikolaj Bjorner d8133a47c2 Update solve_eqs.cpp 2022-11-05 22:47:46 -07:00
Nikolaj Bjorner 6c12aaad74 wip - testing solve-eqs2, added as tactic 2022-11-05 22:42:59 -07:00
Nikolaj Bjorner 4d8860c0bc wip - adding context equation solver
the solve_eqs_tactic is to be replaced by a re-implementation that uses solve_eqs in the simplifiers directory.
The re-implementation should address efficiency issues with the previous code.
At this point it punts on low level proofs. The plan is to use coarser
dependency tracking instead of low level proofs for pre-processing. Dependencies can be converted into a proof hint representation that can be checked using a stronger checker.
2022-11-05 10:34:57 -07:00
Nikolaj Bjorner ae2672f132 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-04 14:11:24 -07:00
Nikolaj Bjorner 154b09309b fixing build, wip on model reconstruction integration into dependent-expr-state 2022-11-04 14:04:44 -07:00
Nikolaj Bjorner 7bb962d934 add ad-hoc any-of for cross compatibility and simplifying interface
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-04 12:49:55 -07:00
Nikolaj Bjorner 49d1490454 add ad-hoc any-of for cross compatibility and simplifying interface
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-04 12:48:30 -07:00
Nikolaj Bjorner de9368bab0 Update expr_replacer.h 2022-11-04 11:25:39 -07:00
Nikolaj Bjorner 28668c6efc set up model reconstruction trail 2022-11-04 11:25:39 -07:00
Nikolaj Bjorner 84af521514 fixes #6439 #6436 2022-11-04 09:36:06 -07:00
Nikolaj Bjorner 626380b3c7 fixing build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-03 22:08:21 -07:00
Nikolaj Bjorner e8112a6564 add initial stubs for model reconstruction trail 2022-11-03 21:35:07 -07:00
Nikolaj Bjorner 9007bdf780 move horn_subsume_model_converter to ast/converters 2022-11-03 20:26:02 -07:00
Nikolaj Bjorner 25bb935793 move more converters 2022-11-03 20:18:21 -07:00
Nikolaj Bjorner 06eb460c75 move tactic_params to params 2022-11-03 05:50:46 -07:00