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

4345 commits

Author SHA1 Message Date
Nikolaj Bjorner ab4b7c50ed fix #6749 2023-06-07 16:09:50 -07:00
Nikolaj Bjorner 06a8987314 fix #6748
destructive equality resolution uses an occurs check function that is only safe for quantifier-free formulas. In the special case where a bound variable is Boolean and occurs on a side of an equality the other side cannot have a quantifier.
2023-06-07 15:59:39 -07:00
Nikolaj Bjorner 2bff0a6b8a regression on quantifier weight computation when weights are 0 vs non-0. It modifies a change made for the fix of #2667. That fix caused a regression in F*. Reported @mtzguido
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-06 16:35:37 -07:00
Clemens Eisenhofer 82667bd86b
Fix UP's decide callback (#6707)
* Query Boolean Assignment in the UP

* UP's decide ref arguments => next_split

* Fixed wrapper

* More fixes
2023-06-02 09:52:54 +02:00
Nikolaj Bjorner 5e1869d8eb fix #6734
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-26 09:48:58 +01:00
Nikolaj Bjorner 046b80f6a4 remove output
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-11 12:31:05 -07:00
Nikolaj Bjorner f6ab5a61ac reformat code to remove brackets 2023-05-11 12:31:05 -07:00
Nikolaj Bjorner 2e441e38c9 fix #6713 fix #6714
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-08 12:24:20 -07:00
Nikolaj Bjorner d5231f8b33 fix regressions #6703
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-04-27 08:43:59 -07:00
Nikolaj Bjorner c48dc69050 adding stubs to find fixed variables
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-04-26 19:39:42 -07:00
Nikolaj Bjorner ef943347ee ensure assume-eqs is invoked after check-lia statically
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-04-26 11:16:15 -07:00
Nikolaj Bjorner d2e3e4895e add instrumentation to theory_lra for shuffling final check 2023-04-26 10:05:00 -07:00
Nikolaj Bjorner 3029fb24a1 remove references to validating 2023-04-26 10:05:00 -07:00
Nikolaj Bjorner 50c855e2eb count gcd conflicts, log row id in rows 2023-04-26 10:05:00 -07:00
Nikolaj Bjorner 59bc070268 count gcd conflicts 2023-04-26 10:05:00 -07:00
Nikolaj Bjorner ace6e8eea1 add gcd-conflicts stats, formatting updates 2023-04-26 10:04:59 -07:00
Nikolaj Bjorner ec1480b12a fix #6693 2023-04-18 08:40:29 -07:00
Nikolaj Bjorner b75d81f3c2 fix #6690 2023-04-14 16:38:33 -07:00
Nikolaj Bjorner 0b5c38dea5 fix #6676 get rid of rem0 declare it to be mod0 semantics to simplify code paths 2023-04-11 16:46:43 -07:00
Nikolaj Bjorner 368d60f553 add branch / cut selection heuristic from solver=2
disabled for testing.
2023-04-10 22:14:16 -07:00
Clemens Eisenhofer 98d3fabc24
Bugfix relevancy propagation + UP (old core) (#6678)
* Some UP bugfixes in the new core

* Bugfix relevancy propagation + UP (old core)

* Revert smt_context.cpp
2023-04-10 12:57:59 -07:00
Nikolaj Bjorner e6ea81546e fix #6662 2023-04-08 17:14:39 -07:00
Nikolaj Bjorner af9c760a68 fix #6670 2023-04-08 16:55:23 -07:00
Nikolaj Bjorner ccb250c32b fix #6671 2023-04-08 16:39:40 -07:00
Nikolaj Bjorner f8242c58dd fix regression from Grobner port
- scan_for_linear returns true if it finds a new linear equation. It then should break GB.
- if scan_for_linear returns false, it should still allow try_modify_eqs.
This behavior was masked by requiring scan_for_linear to always be true before
allowing try_to_modify_eqs.

based on repro from Guido Martinez @mtzguido
2023-04-04 22:29:22 -07:00
Nikolaj Bjorner 5b385bd2fe fix #6665
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-04-02 10:58:21 -07:00
Nikolaj Bjorner e0a066efa3 #6654
fix reflexivity for tree-order
2023-03-31 15:38:29 -07:00
Nikolaj Bjorner a62e4b2893 extract multi-patterns when pattern can be decomposed
deals with fluke regression for F* reported by Guido Martinez

Background:
The automatic pattern inference facility looks for terms that contains all bound variables of a quantifier. It may end up with a term that contains all bound variables but the extracted term can be simplified.

Example. The pattern

(ApplyTT (ApplyTT @x3!1 (ApplyTT @x4!0 (:var 1))) (ApplyTT @x4!0 (:var 0)))
can be decomposed into a multi-pattern
(ApplyTT @x4!0 (:var 1))) (ApplyTT @x4!0 (:var 0))
The multi-pattern may enable a quantifier instantiation while the original pattern does not. The multi-pattern should be preferred.

The regression showed up based on a change that should not be considered harmful but turned out to be noticeable.
The change was a simplification of and-or expressions based on sorting. This played with the case split queue used by F* (smt.case_split = 3) that uses a top-level case split of clauses to avoid redundant branches. The net effect was that without sorting, the benchmarks would always choose the opportune branch that enabled matching against the larger term. With sorting it would mostly choose inopportune branches.
2023-03-31 12:45:51 -07:00
Nikolaj Bjorner ce501e0b6e #6646
- always enable special-relations theory to deal with default setting and push
- fix bugs related to equality and transitivity.
2023-03-25 17:37:59 -07:00
Nikolaj Bjorner 50bd6efea4 fix #6624 2023-03-22 14:00:09 +01:00
Nikolaj Bjorner 03a44803b6 fix #6635 2023-03-22 13:38:02 +01:00
Nikolaj Bjorner c6e3fb446a print lemmas2console faster
- add option pp.no_lets (default = false) to print formulas without let (used by the low-level SMT2 printer).
- print lemmas2console faster by using the low level printer
2023-03-20 17:07:04 +01:00
Nikolaj Bjorner a9e6e567b0 make generation of "some" Boolean value fair 2023-03-20 17:07:04 +01:00
Nuno Lopes a0f3727e90 BV: add missing neg internalizer
usually bvneg is eliminated during rewriting, but it can be left behind during e.g. a badly-timed timeout
2023-03-12 19:26:47 +00:00
Lev Nachmanson 377ceba6d5 rm lu 2023-03-08 10:27:05 -08:00
Lev Nachmanson ea16f6608c before rm lu
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-08 10:27:05 -08:00
Lev Nachmanson 92fe8c5968 restore the previous state
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-03 18:30:17 -08:00
Lev Nachmanson ff1dc0424c rm lp_solver 2023-03-03 16:32:49 -08:00
Lev Nachmanson 2dd30fa350 rm lp_primal_simplex 2023-03-03 15:44:50 -08:00
Lev Nachmanson d2e8297d41 remove includes of lp_dual_simplex 2023-03-03 15:38:47 -08:00
Nikolaj Bjorner 79d47eb302 add preprocessor parameter whether to use bound simplifier 2023-02-28 17:40:08 -08:00
Nikolaj Bjorner 76aad689c6 Update smt_context_pp.cpp
print units in statistics
2023-02-28 17:40:08 -08:00
Nikolaj Bjorner 0758c93086 fix #6591
- add check for lambdas similar to as-array in context of quantifiers. MBQI is not a decision procedure for this combination and can then incorrectly conclude satisfiabiltiy.

Scenario

The formula contains assertions
 - bv = (map or (lambda ..) t)
 - forall y (not (select bv (pair s y)))

Since bv is extensionally equal to a term that depends on a lambda, MBQI cannot just take the current finite approximation of bv when checking the quantifier for satisfiability.
2023-02-19 11:09:52 -08:00
Nikolaj Bjorner 6352340478 update do logging 2023-02-19 09:59:33 -08:00
Nikolaj Bjorner c0f80f92ba deal with compiler warnings (unused variables etc) 2023-02-18 17:53:37 -08:00
Nikolaj Bjorner 7c08e53e94 fixes for #6590 2023-02-15 15:11:44 -08:00
Nikolaj Bjorner bb81bc5452 fix #6580
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-02-12 20:21:53 -08:00
Nikolaj Bjorner 1b0c76e3f0 fixes to mbqi in the new core based on #6575 2023-02-10 16:56:06 -08:00
Nikolaj Bjorner efbecb19b1 compiler warning
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-02-02 19:23:30 -08:00
Nikolaj Bjorner 304b316314 move bounded division lemmas to nla solver/ nla_divisions. 2023-01-30 11:11:04 -08:00
Nikolaj Bjorner 2c4a9c2f5c fix division filter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-30 08:20:26 -08:00
Nikolaj Bjorner 8e37e2f913 handle non-linear division axioms, consolidate backtracking state in nla_core
this update enables new incremental linear axioms based on division terms.
It also consolidates some of the backtracking state in nla_core / emons to use stack traces instead of custom backtracking state.
2023-01-29 17:22:57 -08:00
Nikolaj Bjorner 8ea49eed8e convert reduce-args to a simplifier
- convert reduce-args to a simplifier. Currently exposed as reduce-args2 tactic until the old tactic code gets removed.
- bug fixes in model_reconstruction trail
  - allow multiple defs to be added with same pool of removed formulas
  - fix tracking of function symbols instead of expressions to filter replay
- add nla_divisions to track (cheap) divisibility lemmas.
-
2023-01-28 20:12:14 -08:00
Nikolaj Bjorner ae24b73b19 bugfixes to incremental linearization for expanding power
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-26 21:19:45 -08:00
Nikolaj Bjorner eac7d7576f force to_fp to disambiguate +zero and -zero, #6548, filter unsupported on relevancy
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-24 12:29:42 -08:00
Nikolaj Bjorner 4601d1d664 fix #6550
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-24 03:37:09 -08:00
Nikolaj Bjorner 2ae476416c initial outline of exponentiation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-23 17:38:34 -08:00
Nikolaj Bjorner 83662701b6
Update theory_lra.cpp
remove spurious output
2023-01-22 16:27:48 -08:00
Nikolaj Bjorner 806a4772bc revert effect of filtering unsupported
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-20 17:28:24 -08:00
Nikolaj Bjorner 4e6d498a60 adding placeholder for refining power of 2 2023-01-20 14:37:05 -08:00
Nikolaj Bjorner 0f4f32c5d0 apply relevancy filtering on unsupported ops, fix term construction bug in bv2fpa_converter fix #6548 2023-01-20 13:05:01 -08:00
Nikolaj Bjorner f3d6856736 remove msf example, add option to make model converter not reduce models
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-19 20:24:31 -08:00
Nikolaj Bjorner 7368f9f7d3 increase build version, better propagation in euf-egraph, handle assumptions in sat.smt
- increase build version to 4.12.1. This prepares updated release for MacOs-11 build on x86
- move literal propagation mode in euf-egraph to a callback and traversal of equivalence class. Track antecedent by newest equality instead of root. This makes equality propagation to literals have similar behavior as in legacy solver and appears to result in a speedup (10% fewer conflicts on QF_UF/QG-classification/qg5/iso_icl478.smt2 in preliminary testing)
- fix interaction of pre-processing and assumptions. Pre-processing has to freeze assumption literals so they don't get eliminated. This is similar to dependencies that are already frozen.
2023-01-17 14:07:07 -08:00
Nikolaj Bjorner dde5218b29 fix mbqi value caching issue raised by Clemens and Martin 2023-01-15 22:47:34 -05:00
Nikolaj Bjorner 4f7f4376b8 fix bug in new core not detecting conflict, fix #6525, add tactic doc
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-14 17:20:43 -05:00
Nikolaj Bjorner 8970a54eaa expose parameters to control behavior for #5660 2023-01-10 22:06:19 -08:00
Nikolaj Bjorner d415f07386 memory leak on proof justifications
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-10 18:58:25 -08:00
Nikolaj Bjorner c3e31149a5 fix #6530
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-10 13:43:17 -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 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
Nuno Lopes d30cb55bae don't flush stream when printing param vals 2023-01-03 09:35:17 +00: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
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 fe8034731d fix #6501 2022-12-19 21:02:55 -08:00
Nuno Lopes d308b8f555 simplify code + remove unused file 2022-12-11 22:11:19 +00: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 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 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 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 bfae8b2162 set flat_and_or to false in bv rewriter 2022-11-15 05:47:28 -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 84af521514 fixes #6439 #6436 2022-11-04 09:36:06 -07:00
Nikolaj Bjorner 1dca6402fb move model and proof converters to self-contained module 2022-11-03 05:23:01 -07:00
Nikolaj Bjorner 7eee7914bd align format of quantifier instantiation with new core
So far the format is

(forall ((x Int)) body) (not (body[t/x]))

The alternative could be the clause

(not (forall ((x Int)) body)) body[t/x]

they just better be consistent between engines
2022-10-21 15:26:00 -07:00
Nikolaj Bjorner ad5fa9433f add experiment with quot-rem encoding
experiment seeks to determine whether quot-rem encoding can substitute the division circuit encoding.
A first test suggests it makes no difference.
2022-10-21 09:25:45 -07:00
Nikolaj Bjorner 842e8057bc log also quantifier generation (besides binding)
We add also logging for quantifier generation.
It is auxiliary information that is of use for diagnostics (axiom profiler).
2022-10-20 17:49:15 -07:00
Nikolaj Bjorner fc30461828 unused variables
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-10-20 09:09:06 -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 464d52babe fix #6410
regression after introducing beta-redex optimization
2022-10-18 12:34:45 -07:00
Nikolaj Bjorner 2449ba93c5 add (disabled) experiment to use quot-rem instead of division circuit 2022-10-13 15:20:43 +02:00
Nikolaj Bjorner 93e1db0b0b fix #6398 2022-10-13 11:16:14 +02:00
Nikolaj Bjorner ace727ee0f fix #6391 2022-10-12 09:34:49 +02:00
Nikolaj Bjorner 4623117af8 wip - proof hints 2022-10-08 20:12:57 +02:00
Nikolaj Bjorner 9f78a96c1d wip - trim 2022-10-06 18:19:03 +02: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
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 088898834c filter length limits to be non-skolems and under concat/""/unit 2022-09-15 07:41:13 -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
Nikolaj Bjorner 34969b71ee #6340 again - reduce new assertions in fresh iteration
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-13 19:58:32 -07:00
Nikolaj Bjorner fd5448d26b fix #6340 - again
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-13 17:01:51 -07:00
Nikolaj Bjorner c30b884247 fix #6340
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-12 11:01:24 -07:00
Nikolaj Bjorner 809838fede solve for fold, expand rewrites under fold/map
Occurrences of map and fold are interpreted.
They are defined when the seq argument is expanded into a finite
concatenation. The ensure this expansion takes place, each fold/map term
is registered and defined through rewrites when the seq argument simplifies.
2022-09-11 11:32:18 -07:00
Nikolaj Bjorner 7a55bd5687 beta redex check is used in array theory to filter out safe as-arrays 2022-09-11 05:44:11 -07:00
Nikolaj Bjorner 4a652a4c0c relax giveup condition for as-array when it occurs only in beta redex positions. 2022-09-10 16:02:58 -07:00
Nikolaj Bjorner 660bdc33e3 fix #6330 2022-09-09 08:18:30 -07:00
Nikolaj Bjorner 058ed3de56 fix #6331 2022-09-07 12:37:50 -07:00
Nikolaj Bjorner 55d5af00cc disable bv delay until it is debugged #6324
regression introduced when filter for when to apply delay was fixed, but then it exercises delay tactic that isn't tested.
2022-09-07 00:04:57 -07:00
Nikolaj Bjorner 85c8168af5 use for pattern instead of iterators 2022-09-02 22:45:50 -07:00
JohnLyu2 9dca8d18ed
fix negative contains bug (#6312) 2022-09-02 13:36:11 -07:00
Nikolaj Bjorner 4abff18e8d fill in missing pieces of proof hint checker for Farkas and RUP
The proof validator based on SMT format proof logs uses RUP to check propositional inferences and has plugins for theory axioms/lemmas.
2022-08-31 05:29:15 -07:00
Arie Gurfinkel d2b618df23
Spacer Global Guidance (#6026)
* Make spacer_sem_matcher::reset() public

* Add .clang-format for src/muz/spacer

* Mark substitution::get_bindings() as const

* Fix in spacer_antiunify

* Various helper methods in spacer_util

Minor functions to compute number of free variables, detect presence of certain
sub-expressions, etc.

The diff is ugly because of clang-format

* Add spacer_cluster for clustering lemmas

A cluster of lemmas is a set of lemmas that are all instances of the same
pattern, where a pattern is a qff formula with free variables.

Currently, the instances are required to be explicit, that is, they are all
obtained by substituting concrete values (i.e., numbers) for free variables of
the pattern.

Lemmas are clustered in cluster_db in each predicate transformer.

* Integrate spacer_cluster into spacer_context

* Custom clang-format pragmas for spacer_context

spacer_context.(cpp|h) are large and have inconsistent formatting. Disable
clang-format for them until merge with main z3 branch and re-format.

* Computation of convex closure and matrix kernel

Various LA functions. The implementations are somewhat preliminary.

Convex closure is simplemented via syntactic convex closure procedure.
Kernel computation considers many common cases.

spacer_arith_kernel_sage implements kernel computation by call external
Sage binary. It is used only for debugging and experiments. There is no
link dependence on Sage. If desired, it can be removed.

* Add spacer_concretize

* Utility methods for spacer conjecture rule

* Add spacer_expand_bnd_generalizer

Generalizes arithmetic inequality literals of the form x <= c,
by changing constant c to other constants found in the problem.

* Add spacer_global_generalizer

Global generalizer checks every new lemma against a cluster
of previously learned lemmas, and, if possible, conjectures
a new pob, that, when blocked, generalizes multiple existing
lemmas.

* Remove fp.spacer.print_json option

The option is used to dump state of spacer into json for debugging.

It has been replaced by `fp.spacer.trace_file` that allows dumping an execution
of spacer. The json file can be reconstructed from the trace file elsewhere.

* Workaround for segfault in spacer_proof_utils

Issue #3 in hgvk94/z3

Segfault in some proof reduction. Avoid by bailing out on reduction.

* Revert bug for incomplete models

* Use local fresh variables in spacer_global_generalizer

* Cleanup of spacer_convex_closure

* Allow arbitrary expressions to name cols in convex_closure

* WIP: convex closure

* WIP: convex closure

* Fix bindings order in spacer_global_generalizer

The matcher creates substitution using std_order, which is
reverse of expected order (variable 0 is last). Adjust the code
appropriately for that.

* Increase verbosity level for smt_context stats

* Dead code in qe_mbp

* bug fixes in spacer_global_generalizer::subsumer

* Partially remove dependence of size of m_alphas

I want m_alphas to potentially be greater than currently used alpha variables.
This is helpful for reusing them across multiple calls to convex closure

* Subtle bug in kernel computation

Coefficient was being passed by reference and, therefore, was
being changed indirectly.

In the process, updated the code to be more generic to avoid rational
computation in the middle of matrix manipulation.

* another test for sparse_matrix_ops::kernel

* Implementation of matrix kernel using Fraction Free Elimination

Ensures that the kernel is int for int matrices. All divisions are exact.

* clang-format sparse_matrix_ops.h

* another implementation of ffe kernel in sparse_matrix_ops

* Re-do arith_kernel and convex_closure

* update spacer_global_generalization for new subsumer

* remove spacer.gg.use_sage parameter

* cleanup of spacer_global_generalizer

* Removed dependency on sage

* fix in spacer_convex_closure

* spacer_sem_matcher: consider an additional semantic matching

disabled until it is shown useful

* spacer_global_generalizer: improve do_conjecture

 - if conjecture does not apply to pob, use lemma instead
 - better normalization
 - improve debug prints

* spacer_conjecture: formatting

* spacer_cluster: improve debug prints

* spacer_context: improve debug prints

* spacer_context: re-queue may pobs

enabled even if global re-queue is disabled

* spacer_cluster print formatting

* reset methods on pob

* cleanup of print and local variable names

* formatting

* reset generalization data once it has been used

* refactored extra pob creation during global guidance

* fix bug copying sparse matrix into spacer matrix

* bug fix in spacer_convex_closure

* formatting change in spacer_context

* spacer_cluster: get_min_lvl

chose level based on pob as well as lemmas

* spacer_context: add desired_level to pob

desired_level indicates at which level pob should be proved.
A pob will be pushed to desired_level if necessary

* spacer_context: renamed subsume stats

the name of success/failed was switched

* spacer_convex_closure: fix prototype of is_congruent_mod()

* spacer_convex_closure: hacks in infer_div_pred()

* spacer_util: do not expand literals with mod

By default, equality literal t=p is expanded into t<=p && t>=p

Disable the expansion in case t contains 'mod' operator since such
expansion is usually not helpful for divisibility

* spacer_util: rename m_util into m_arith

* spacer_util: cleanup normalize()

* spacer_util: formatting

* spacer_context: formatting cleanup on subsume and conjecture

* spacer_context: fix handling may pobs when abs_weakness is enabled

A pob might be undef, so weakness must be bumped up

* spacer_arith_kernel: enhance debug print

* spacer_global_generalizer: improve matching on conjecture

* spacer_global_generalizer: set desired level on conjecture pob

* spacer_global_generalizer: debug print

* spacer_global_generalizer: set min level on new pobs

the new level should not be higher than the pob that was generalized

* spacer_global_generalizer: do no re-create closed pobs

If a generalized pob exist and closed, do not re-create it.

* spacer_context: normalize twice

* spacer_context: forward propagate only same kind of pobs

* sketch of inductive generalizer

A better implementation of inductive generalizer that in addition to dropping
literals also attempts to weaken them.

Current implementation is a sketch to be extended based on examples/requirements.

* fix ordering in spacer_cluster_util

* fix resetting of substitution matcher in spacer_conjecture

Old code would forget to reset the substitution provided to the sem_matcher.
Thus, if the substitution was matched once (i.e., one literal of interest is
found), no other literal would be matched.

* add spacer_util is_normalized() method

used for debugging only

* simplify normalization of pob expressions

pob expressions are normalized to increase syntactic matching.
Some of the normalization rules seem out of place, so removing them for now.

* fix in spacer_global_generalizer

If conjecture fails, do not try other generalization strategies -- they will not apply.

* fix in spacer_context

do not check that may pob is blocked by existing lemmas.
It is likely to be blocked. Our goal is to block it again and generalize
to a new lemma.

This can be further improved by moving directly to generalization when pob is
blocked by existing lemmas...

Co-authored-by: hgvk94 <hgvk94@gmail.com>
2022-08-30 15:47:00 -07:00
Nikolaj Bjorner 1a79d92f3a revert last ditch array
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-30 12:56:21 -07:00
Nikolaj Bjorner 45d8d73fce #6303
handle more array instantiation cases for quantifier instantiation
2022-08-30 09:46:19 -07:00
Nikolaj Bjorner 159026b5e8 regression fix to ackerman gc and memory smash, perf fix for handling bv2int axioms, perf fix for filtering ackerman
this update addresses some perf regressions introduced when handling axioms for bv2int and a memory smash regression when decoupling bv-ackerman from in-processing. It adds a filter based on bv_eq_axioms for disabling ackerman reductions on disequalities.
2022-08-26 10:44:33 -07:00
Nikolaj Bjorner a628e4c4e5 updates to printer to get instantiations, take 1 2022-08-25 11:22:35 -07:00
Nuno Lopes 916d1dbb13 fix default parameter regression
bug introduced in commit 63f48f8fd4
2022-08-23 15:26:29 +01:00
Nuno Lopes 7ab904bfc6 remove spurious file 2022-08-23 14:39:44 +01:00
Nikolaj Bjorner a38308792e #6288
floating points may also track bit-literals.
Since the legacy solver doesn't handle dual tracking of literals we just let the floating point solver track.
2022-08-21 15:47:19 -07:00
Nikolaj Bjorner 4092302590 use interface for creating unary equalities
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-21 15:37:43 -07:00
Nikolaj Bjorner be0cd74c71 #6289 2022-08-21 15:25:17 -07:00
Nikolaj Bjorner 2181a0ff74 #6289 2022-08-21 15:25:17 -07:00
Bruce Mitchener 6ba9ada1e2
Fix typos. (#6291) 2022-08-21 12:40:07 -07:00
Bruce Mitchener 706f7fbdc7
Fix some warnings about unused stuff. (#6290) 2022-08-21 12:39:30 -07:00
Nikolaj Bjorner 48b13291d1 add bv-size reduce #6137
- add option smt.bv.reduce_size.
  - it allows to apply incremental pre-processing of bit-vectors by identifying ranges that are known to be constant.
    This rewrite is beneficial, for instance, when bit-vectors are constrained to have many high-level bits set to 0.
2022-08-16 16:35:14 -07:00
Nikolaj Bjorner b169292743 add parameter descriptions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-16 08:26:53 -07:00
Nikolaj Bjorner e0aa32e6c5 fix #6270
MBQI asserts auxiliary function definitions to handle models of arrays. This is unsound if the definition contains a model value.
2022-08-15 00:13:32 -07:00
Nikolaj Bjorner a0d4a8c21c update diagnostics 2022-08-15 00:12:44 -07:00
Nikolaj Bjorner b6d71fccd8 fix #6265 2022-08-12 10:22:22 -04:00
Nikolaj Bjorner 786280c646 print skolem declarations only for lemma tracing 2022-08-11 11:34:54 +03:00
Nikolaj Bjorner b55ad5f20e fix #6267 2022-08-11 09:31:54 +03:00
Nikolaj Bjorner f27485dae7 avoid push/pop if diseq/eq are not defined 2022-08-09 11:33:29 +03:00
Nikolaj Bjorner 78eaefe5a8 move solver-params to params 2022-08-08 11:34:41 +03:00
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
Nikolaj Bjorner 3de9d37772 fix overrides for created_eh
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 16:24:08 +01:00
Nikolaj Bjorner bf6454dccc throw error if created-eh has not been registered
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 13:01:57 +01:00
Nikolaj Bjorner ea6827505e add missing callback to m_created_eh
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-25 10:13:09 +01:00
Nikolaj Bjorner a1f7676c81 remove assertion - literals could be assigned but propagation incomplete
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-21 03:10:41 +01:00
Nikolaj Bjorner 17280846f8 added comments to explain #5781 2022-01-21 01:40:31 +01:00
Nikolaj Bjorner af9ae35984 term
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-20 14:43:16 +01:00
Nikolaj Bjorner c527fda0b6 term
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-20 14:41:27 +01:00
Nikolaj Bjorner f1a302bba7 term
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-20 14:38:34 +01:00
Nikolaj Bjorner 7a8c969033 ensure b_internalized
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-20 13:27:23 +01:00
Nikolaj Bjorner c00591daaf finish is-fixed
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-19 16:28:34 +01:00
Nikolaj Bjorner e5767bf2b8 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-19 15:19:07 +01:00
Nikolaj Bjorner 0f03ef4ab0 for Clemens: ensure fixed values are propagated after registration
Also allow to register expressions that the rewriter changes to ensure they get picked up.
2022-01-19 14:38:11 +01:00
Nikolaj Bjorner d09abdf58e fix #5771
Missing congruence closure enforcement on auxiliary guard predicates.
It diverges but is sound.
2022-01-14 15:46:40 -08:00
Nikolaj Bjorner 56d3718cde add simplification with qe-lite as an option #5767
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-12 03:41:21 -08:00
Nikolaj Bjorner dbd5512d8c ensure enode without recursion
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-11 08:35:57 -08:00
Nikolaj Bjorner 055732423c ensure enode without recursion
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-11 08:35:25 -08:00
Nikolaj Bjorner 0bc8518cb5 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-07 11:53:27 -08:00
Nikolaj Bjorner 199daead50 remove Z3_bool_opt #5757
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-07 11:52:10 -08:00
Nikolaj Bjorner 592b1d7f65 #5752 2022-01-06 13:32:50 -08:00
Nikolaj Bjorner d7c7fbb8f1 setting roots breaks relevancy propagation 2022-01-05 21:16:25 -08:00
Nikolaj Bjorner 9d3c8a6a2f na 2022-01-01 17:59:31 -08:00
Nikolaj Bjorner fc77345bec breaking change. Enforce append semantics everywhere for parameter updates #5744
Replace semantics doesn't work with assumptions made elsewhere in code.
The remedy is to apply append (override) semantics for parameter changes.
2021-12-30 19:11:14 -08:00
Nikolaj Bjorner d88f125818 build 2021-12-26 15:24:03 -08:00
Nikolaj Bjorner 09ee60ccce update comment
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-21 11:04:07 -08:00
Nikolaj Bjorner 4b813bac1c na 2021-12-19 12:31:47 -08:00
Nikolaj Bjorner f0740bdf60 move user propagte declare to context level
declaration of user propagate functions are declared at context level instead of at solver scope.
2021-12-18 10:56:42 -08:00
Nikolaj Bjorner 4856581b68 na 2021-12-17 16:40:19 -08:00
Nikolaj Bjorner 8ca023d541 expose propagate created 2021-12-17 16:12:47 -08:00
Nikolaj Bjorner 9c8800bdde adding a new toy for Clemens
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-17 10:45:59 -08:00
Nikolaj Bjorner 6cc9aa3562 prepare user propagator declared functions for likely Clemens use case 2021-12-16 19:37:30 -08:00
Nikolaj Bjorner dd6a11b526 fix #5715 2021-12-16 09:35:54 -08:00
Nikolaj Bjorner 3b58f548f7 remove dead code 2021-12-14 13:42:52 -08:00
Nikolaj Bjorner b1d167de5b fix co-factoring'
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-14 10:12:38 -08:00
Nikolaj Bjorner 5348af3c4c fix co-factoring
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-14 10:05:09 -08:00
Nikolaj Bjorner f40becf099 remove case for non-emptiness to combine with standard membership
as part of revising engine for addressing #5693
2021-12-13 18:17:40 -08:00
Nikolaj Bjorner b2af7ea68f stdout
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-13 15:19:29 -08:00
Nikolaj Bjorner 9ec0f94ab9 hoisting out blocker for empty
#5693
2021-12-13 14:25:05 -08:00
Nikolaj Bjorner 9f2b18cac5 add tactic name
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-07 13:37:57 -08:00
Nikolaj Bjorner 1e95fb44d1 add ability to register expressions during callback 2021-12-07 09:47:05 -08:00
Nikolaj Bjorner 658a334ecf clear tactic user propagate state on solver destructor 2021-12-07 03:14:50 -08:00
Nikolaj Bjorner fdc253afdd
update arithmetic contract for unbounded (#5696)
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-06 08:19:18 -08:00
Lev Nachmanson 9b4f3a7075
start using lar_solver::is_feasible() (#5697)
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2021-12-06 08:16:57 -08:00
Lev Nachmanson 7758b519bc
Handle correctly cancelled run (#5695)
* remove the bound on total iterations in simplex

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* remove unncesseray checks in  get_freedom_interval_for_column()

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* fix the build of test-z3

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* Revert "remove unncesseray checks in  get_freedom_interval_for_column()"

This reverts commit 6770ed85e3.

* optimize get_freedom_interval_for_column() for feasible case

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* add function lar_solver::status_feasible

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* rename status_is_feasible() to is_feasible()

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>

* fix the linux build

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2021-12-05 18:38:37 -08:00
Nikolaj Bjorner f0e9363e78 fix bug in smt_tactic_core for translating user-ids 2021-12-05 11:13:27 -08:00
Nikolaj Bjorner c845b22c15 fix translation for equality propagation 2021-12-04 11:55:36 -08:00
Nikolaj Bjorner 1b0ac4940b prevent stale user-propagators from being used on the same tactic after it was applied. 2021-12-04 11:51:00 -08:00
Nikolaj Bjorner da765355e8 don't rely on cleanup 2021-12-04 11:48:41 -08:00
Nikolaj Bjorner 3d528c8ef6 typo 2021-12-04 11:19:49 -08:00
Nikolaj Bjorner eae567ac3d indirection for user ids 2021-12-04 11:04:32 -08:00
Nikolaj Bjorner 68b072e7f1 only use setup_and_check if there is no user propagator set. 2021-12-04 09:22:25 -08:00
Nikolaj Bjorner 0077ddf33c try delay init for user propagator in smt_tactic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-03 09:45:07 -08:00
Nikolaj Bjorner bfd61fec00 enable user propagation on tactics
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-02 08:28:52 -08:00
Nikolaj Bjorner 71cbb160d2 fix regression from today, see #5676
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-01 14:29:53 -08:00
Nikolaj Bjorner c6a5aa0cc4 try th_lemma, update documentation of api functions for creating strings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-12-01 09:21:02 -08:00
Nikolaj Bjorner 3b4f976118 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-11-30 19:15:03 -08:00
Nikolaj Bjorner 4daba290b1 change user propagation to apply scheme similar to theory_recfun
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-11-30 19:12:15 -08:00
Nikolaj Bjorner 959f4c9440 rename files to theory_user_propagator 2021-11-29 19:44:58 -08:00
Nikolaj Bjorner 5857236f2f introducing base namespace for user propagator 2021-11-29 19:41:30 -08:00
Nikolaj Bjorner c083aa82ee add debug information in user-propagate #5687
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-11-29 08:59:53 -08:00
Nikolaj Bjorner 833dd62623 fix #5681 2021-11-24 13:24:31 +01:00
Nikolaj Bjorner e8f5a29c31 fix #5679
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-11-22 19:37:10 +01:00