3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-15 21:38:44 +00:00
Commit graph

2820 commits

Author SHA1 Message Date
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
Nikolaj Bjorner 1dca6402fb move model and proof converters to self-contained module 2022-11-03 05:23:01 -07:00
Nikolaj Bjorner 7b12a5c5a8 build fix 2022-11-03 04:49:20 -07:00
Nikolaj Bjorner 070c5c624a wip - converting the equation solver as a simplifier 2022-11-03 03:35:30 -07:00
Nikolaj Bjorner c0f483528d working on solve_eqs 2022-11-03 03:35:29 -07:00
Nikolaj Bjorner e141759768 init solve_eqs 2022-11-03 03:35:29 -07:00
Nikolaj Bjorner df71e83428 remove incorrect assertion
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-02 17:32:09 -07:00
Nikolaj Bjorner 0d97d2214c adding virtual destructor
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-11-02 09:37:55 -07:00
Nikolaj Bjorner e57674490f adding simplifiers layer
simplifiers layer is a common substrate for global non-incremental and incremental processing.
The first two layers are new, but others are to be ported form tactics.

- bv::slice - rewrites equations to cut-dice-slice bit-vector extractions until they align. It creates opportunities for rewriting portions of bit-vectors to common sub-expressions, including values.
- euf::completion - generalizes the KB simplifcation from asserted formulas to use the E-graph to establish a global and order-independent canonization.

The interface dependent_expr_simplifier is amenable to forming tactics. Plugins for asserted-formulas is also possible but not yet realized.
2022-11-02 08:51:30 -07:00
Nikolaj Bjorner 1646a41b2f minor fixes
- ensure mk_extract performs simplification to distribute over extract and removing extract if the range is the entire bit-vector
- ensure bool_rewriter simplifeis disjunctions when applicable.
2022-11-02 08:44:55 -07:00
Nikolaj Bjorner a409a4a677 enforce flat within QF_BV tactic, cap in-processing var-elim loops 2022-10-27 20:10:55 -07:00
Nikolaj Bjorner 1fae3aa152 rename set-flat to set-flat-and-or to allow to differentiate parameters 2022-10-27 11:22:57 -07:00
Nikolaj Bjorner fe1b4bf5ce disable ternary, fixes to propagation, make bv_rewrites for multiplier n-ary 2022-10-26 23:44:38 -07:00
Nikolaj Bjorner 5352a0106d fix #6426 2022-10-26 12:20:55 -07:00
Nikolaj Bjorner c62c5e9d23 add opportunistic, missing, bv rewrites
- x >> x logical = 0
- ~x = -1 -x
- x * (y << z) = (x * y) << z
2022-10-25 10:29:48 -07:00
Nikolaj Bjorner e1a00f4917 remove unused experimental feature - diff 2022-10-24 16:13:24 -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 7b3a634b8d wip - features and bug-fixes to proof logging 2022-10-18 07:54:49 -07:00
Nikolaj Bjorner ac1552d194 wip - updates to proof logging and self-checking
move self-checking functionality to inside sat/smt so it can be used on-line and not just off-line.

when self-validation fails, use vs, not clause, to check. It allows self-validation without checking and maintaining RUP validation.

new options sat.smt.proof.check_rup, sat.smt.proof.check for online validation.

z3 sat.smt.proof.check=true sat.euf=true /v:1 sat.smt.proof.check_rup=true /st file.smt2 sat.smt.proof=p.smt2
2022-10-16 23:33:30 +02:00
Nikolaj Bjorner 8a30128933 formatting updates 2022-10-13 15:20:24 +02:00
Nikolaj Bjorner 4623117af8 wip - proof hints 2022-10-08 20:12:57 +02:00
Nikolaj Bjorner 876ca2f1a5 fix #6371 2022-09-30 14:51:28 -04:00
Nikolaj Bjorner b9cba82531 work on proof checking
- add outline of trim routine
- streamline how proof terms are checked and how residue units are extracted.
2022-09-30 13:04:19 -04:00
Nikolaj Bjorner 107981f099 update proof formats for new core
- update proof format for quantifier instantiation to track original literals
- update proof replay tools with ability to extract proof object

The formats and features are subject to heavy revisions.

Example
```
(set-option :sat.euf true)
(set-option :sat.smt.proof eufproof.smt2)
(declare-fun f (Int) Int)
(declare-const x Int)
(assert (or (= (f (f (f x))) x) (= (f (f x)) x)))
(assert (not (= (f (f (f (f (f (f x)))))) x)))
(check-sat)
```

eufproof.smt2 is:
```
(declare-fun x () Int)
(declare-fun f (Int) Int)
(define-const $24 Int (f x))
(define-const $25 Int (f $24))
(define-const $26 Int (f $25))
(define-const $27 Bool (= $26 x))
(define-const $28 Bool (= $25 x))
(assume $27 $28)
(define-const $30 Int (f $26))
(define-const $31 Int (f $30))
(define-const $32 Int (f $31))
(define-const $33 Bool (= $32 x))
(assume (not $33))
(declare-fun rup () Proof)
(infer (not $33) rup)
(declare-fun euf (Bool Bool Proof Proof Proof Proof) Proof)
(declare-fun cc (Bool) Proof)
(define-const $42 Bool (= $32 $30))
(define-const $43 Proof (cc $42))
(define-const $40 Bool (= $31 $24))
(define-const $41 Proof (cc $40))
(define-const $38 Bool (= $30 $25))
(define-const $39 Proof (cc $38))
(define-const $36 Bool (= $24 $26))
(define-const $37 Proof (cc $36))
(define-const $34 Bool (not $33))
(define-const $44 Proof (euf $34 $28 $37 $39 $41 $43))
(infer (not $28) $33 $44)
(infer (not $28) rup)
(infer $27 rup)
(declare-fun euf (Bool Bool Proof Proof Proof) Proof)
(define-const $49 Bool (= $32 $26))
(define-const $50 Proof (cc $49))
(define-const $47 Bool (= $31 $25))
(define-const $48 Proof (cc $47))
(define-const $45 Bool (= $24 $30))
(define-const $46 Proof (cc $45))
(define-const $51 Proof (euf $34 $27 $46 $48 $50))
(infer $33 $51)
(infer rup)
```

Example of inspecting proof from Python:

```
from z3 import *

def parse(file):
    s = Solver()
    set_option("solver.proof.save", True)
    set_option("solver.proof.check", False)
    s.from_file(file)
    for step in s.proof().children():
        print(step)

parse("../eufproof.smt2")
```

Proof checking (self-validation) is on by default.
Proof saving is off by default.

You can use the proof logs and the proof terms to retrieve quantifier instantiations from the new core.

The self-checker contains a few built-in tuned checkers but falls back to self-checking inferred clauses using SMT.
2022-09-28 10:40:43 -07:00
Nikolaj Bjorner 9be8fc7857 Add EUF (congruence closure) proof hints and checker to the new core
EUF proofs are checked modulo union-find.
Equalities are added to to union-find if they are assumptions or if they can be derived using congruence closure. The congruence closure assumptions are added as proof-hints.
Note that this proof format does not track equality inferences, symmetry and transitivity. Instead they are handled by assuming a union-find based checker.
2022-09-25 14:26:20 -07:00
Nikolaj Bjorner 79b4357442 #6363 2022-09-23 14:32:01 -05:00
Nikolaj Bjorner 3d9512b93c fix #6363 2022-09-23 14:32:01 -05:00
Nikolaj Bjorner eba5a5d141 Merge branch 'master' of https://github.com/z3prover/z3 2022-09-20 20:32:07 -07:00
Nikolaj Bjorner 4518f4fe02 fix #6352
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-20 20:31:55 -07:00
Nikolaj Bjorner bd4db4c41f add option to rewrite and for arithmetic simplification 2022-09-18 17:22:59 -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
Nikolaj Bjorner 3c8c80bbac fix #6336 2022-09-11 12:22:49 -07:00
Nikolaj Bjorner 53611f47df modify clauses used by not-contains
The literal "emp" can be true in the current assignment, in which case the clause
cnt or emp or ~postf is true and does not contribute to propagation.
This saves, potentially, for generating lemmas for postf.

Add a lemma a = "" or |s| >= idx when a = tail(s, idx)
The lemma ensures that length bounding on s is enforced
(the branch that expands not-contains for long sequences s is closed).
2022-09-11 05:48:17 -07:00
Nikolaj Bjorner 3900c03b72 make error message more descriptive 2022-09-11 05:43:33 -07:00
Nikolaj Bjorner 6df711254b fix type error when mapping over the empty sequence 2022-09-10 16:03:52 -07:00
Nikolaj Bjorner 8311525472 map and fold cannot be treated as variables 2022-09-10 16:03:24 -07:00
Nikolaj Bjorner 0629353fdc add match for foldli 2022-09-10 16:02:11 -07:00
Nikolaj Bjorner 9732169b04 #6320 2022-09-05 13:44:27 -07:00
Nikolaj Bjorner f2afb369bd extend distinct check to ADT 2022-09-01 14:18:13 -07:00
Nikolaj Bjorner 46383a0811 AG - unary datatypes, tester always is true. 2022-09-01 09:45:56 -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 36d76a5bb2 fix #6304
Conditionals are used to guard unfolding of recursive functions.
This is, as shown in #6304, incompatible with the case where recursive functions are used inside if-then-else guards.
We address this by disabling if-conditions as guards if they contain a recursive definition.
The approach is simplistic: if a recursive function, defined prior (not mutually recursive) is used in a guard it should be fine and the condition can guard the current recursive unfolding.
2022-08-30 09:50:58 -07:00
Nikolaj Bjorner 6f2a6da600 address unused variable warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-28 18:50:54 -07:00
Nikolaj Bjorner 4d29925c3f build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-28 18:43:50 -07:00
J Sailor f5d2b9b89a
fix typo in comment defining macros (#6306)
The existing comment describes macros as "formulas of the form
`(forall X (= (f X) T[X]))` ... where `T[X]` does not contain `X`". This is
incorrect; of course the macros' definitions are allowed to be in terms of
the macros' arguments. The comment should say "...does not contain `f`" because
macros can't be recursive.
2022-08-28 17:49:52 -07:00
Nikolaj Bjorner e2f4fc2307 overhaul of proof format for new solver
This commit overhauls the proof format (in development) for the new core.

NOTE: this functionality is work in progress with a long way to go.
It is shielded by the sat.euf option, which is off by default and in pre-release state.
It is too early to fuzz or use it. It is pushed into master to shed light on road-map for certifying inferences of sat.euf.

It retires the ad-hoc extension of DRUP used by the SAT solver.
Instead it relies on SMT with ad-hoc extensions for proof terms.
It adds the following commands (consumed by proof_cmds.cpp):

- assume  - for input clauses
- learn   - when a clause is learned (or redundant clause is added)
- del     - when a clause is deleted.

The commands take a list of expressions of type Bool and the
last argument can optionally be of type Proof.
When the last argument is of type Proof it is provided as a hint
to justify the learned clause.

Proof hints can be checked using a self-contained proof
checker. The sat/smt/euf_proof_checker.h class provides
a plugin dispatcher for checkers.
It is instantiated with a checker for arithmetic lemmas,
so far for Farkas proofs.

Use example:
```
(set-option :sat.euf true)
(set-option :tactic.default_tactic smt)
(set-option :sat.smt.proof f.proof)
(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(declare-const u Int)
(assert (< x y))
(assert (< y z))
(assert (< z x))
(check-sat)
```

Run z3 on a file with above content.
Then run z3 on f.proof

```
(verified-smt)
(verified-smt)
(verified-smt)
(verified-farkas)
(verified-smt)
```
2022-08-28 17:44:33 -07:00
Nikolaj Bjorner 9922c766b9 add extra information for type error message
a recent opened and closed bug report was due to an error of taking bit-wise or between two bit-vectors of different size. The error message was not understood by the user. Adding a little extra generic information to see if it helps.
2022-08-28 17:39:14 -07:00
Nikolaj Bjorner a628e4c4e5 updates to printer to get instantiations, take 1 2022-08-25 11:22:35 -07:00
Nikolaj Bjorner fb8532bf55 succinct logging
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-23 21:06:04 -07:00
Nikolaj Bjorner 9eb4237dfe fix #6292
this patches a case where macro-finder is used with arrays. It doesn't work so macro quantifiers have to be re-instated to ensure correctness
2022-08-21 16:32:01 -07:00
Nikolaj Bjorner 4be26eb543 #6116
handle also nan/oo/0+ as numerals
2022-08-18 04:26:14 -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 fa91a644d3 make extensionality commutative 2022-08-13 07:07:14 -07:00
Nikolaj Bjorner 88b6c4a30d pdate decl collection to include functions under arrays
Signedoff-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-12 13:45:16 -07:00
Nikolaj Bjorner 786280c646 print skolem declarations only for lemma tracing 2022-08-11 11:34:54 +03:00
Bruce Mitchener 5014b1a34d Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
Nikolaj Bjorner 80c516bb50 squash stores 2022-08-05 13:57:35 +03:00
Bruce Mitchener 1d9345c3de Fix typos. 2022-08-05 07:40:50 +03:00
Bruce Mitchener 112dba559f Remove unused private member from smaller_pattern. 2022-08-03 08:21:32 +03:00
Bruce Mitchener 42f5047463 cmake: Cleanup remnants of workaround for USES_TERMINAL.
In older versions, this was dependent upon the version of cmake,
but when it was updated for newer cmake, these remnants were
left.
2022-08-02 17:39:10 +03:00
Bruce Mitchener 82d853e5f8 Use = delete to delete special methods.
This provides a better experience than just marking them as
private and leaving them as undefined symbols.
2022-08-02 09:23:14 +03:00
Jakob Rath 2c2ab0d57a Additional BV matchers 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 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 1e0f71c971 add way to access range bounds directly #6186
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-22 09:35:37 -07:00
Nikolaj Bjorner a374e2c575 ignore qid if they are both numerical - come from the parser
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-05 15:47:48 -07:00
Nikolaj Bjorner 6e53621146 #6112
add q->get_qid() to comparison of quantifiers
2022-07-05 13:17:04 -07:00
Nikolaj Bjorner 0353fc38ff fix #6127 again
this time adding inheritance to the recfun plugin so it properly contains the recursive definitions from the source.
2022-07-04 12:42:11 -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 004139b320 rewrites for characters
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-02 11:37:21 -07:00
Nikolaj Bjorner ea2a843325 flat only
remove option for uzers (users who are in reality fuzzers) to toggle flat option. The legacy arithmetic solver bakes in assumptions about flat format so it isn't helpful to expose this to fuzzers, I mean uzers.
2022-06-30 19:59:46 -07:00
Nuno Lopes 41deed59a3 fix bug in array rewriter introduced in 202ce1e 2022-06-21 22:40:40 +01:00
Nikolaj Bjorner 36a1f758bc mask regression 2022-06-21 14:34:47 -07:00
Nikolaj Bjorner ab9aee189b perf #6100 2022-06-21 13:49:52 -07:00
Nikolaj Bjorner 202ce1edf0 #6100 - two perf fixes
remaining perf bug is dealing with very large bit-widths. mod 2^n should be computed natively based on n instead of 2^n because we pre-populate an array with all values up to n. Suppose n is 10000, the array has size 10000.
2022-06-21 12:45:29 -07:00
Nuno Lopes d9fcfdab34 fix debug build 2022-06-17 14:35:33 +01: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
Nikolaj Bjorner 08c44bc6f6 remove unused static features
remove static features that tax solving time on large instances.
2022-06-16 15:40:01 -07:00
Nikolaj Bjorner 477e9625ef Don't reset the cache between applications of replace
tactic/lia2card shows a huge slowdown because the same replace function is called on thousands of assertions. Each time the cache gets reset with thousands of entries - they are all the same.
So don't reset the cache just because... Instead reset the cache if m_refs grows large.
2022-06-16 15:40:01 -07:00
Nikolaj Bjorner 9cd339841a for Arie
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-10 18:07:54 -07:00
Nikolaj Bjorner 994dab8eb6 add pre-filter for F* use case
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-10 17:56:48 -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 72a6384353 time overflow before stack overflow 2022-06-08 10:00:16 -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 fe08c9976e fix #6081 2022-06-06 11:29:11 -07:00
Christoph M. Wintersteiger f77608ed88
Add interpreted versions of unspecified cases of fp.to_ieee_bv and fp.to_real (#6077) 2022-06-04 17:53:23 +01:00
Christoph M. Wintersteiger 6422a6b5a7
Fix rounding bug in to_fp (#6074) 2022-06-04 14:32:08 +01:00
Christoph M. Wintersteiger ed7db892f9
Fix a couple compiler warnings 2022-06-04 08:00:56 +01:00
Nikolaj Bjorner 63b9c4bdf0 for AG
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-28 18:49:27 -07:00
Nikolaj Bjorner 6abea2de2c fix nightly, fix regression identified by Nuno
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-28 18:03:15 -07:00
Nikolaj Bjorner 8d980ea704 remove internal configuration
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-28 12:13:18 -07:00
Nikolaj Bjorner de892ed9f2 fix #6054
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-26 15:51:57 -04:00
Nikolaj Bjorner f77037e9a5 expand select/store when I/J are values #6053
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-25 20:23:43 -04:00
Nikolaj Bjorner 4d8e4b5bd3 fix #6052
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-25 17:21:01 -04:00
Nikolaj Bjorner c850259f89 rw 2022-05-22 07:54:27 -04:00
Nikolaj Bjorner 40fe472e95
nit 2022-05-18 13:23:33 -07:00
Nikolaj Bjorner ca2497eecb na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-15 12:00:41 -07:00
Nikolaj Bjorner 1028c80851 update pretty printer for recursive function filtering
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-15 11:59:41 -07:00
Nikolaj Bjorner 5a685ba9b5 expose maxdiff
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-04 08:52:42 -07:00
Nikolaj Bjorner 367bfedab0 add min/max diff in final check
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-04 07:39:38 -07:00
Nikolaj Bjorner c29cfa81ae prep for max/min diff 2022-05-04 02:08:11 -07:00
Nikolaj Bjorner 87d2a3b4e5 map/mapi/foldl/foldli
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-04 01:10:18 -07: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 459cfc8eb4 fix #5993
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-04-23 19:33:55 +01:00
Nikolaj Bjorner 5393f1d98f #5980 2022-04-19 11:10:37 +01:00
Nikolaj Bjorner a180254c1a fix #5980 2022-04-19 11:10:20 +01:00
Nikolaj Bjorner b7169e2a41 fix #5985 2022-04-19 07:54:55 +02:00
Nikolaj Bjorner 98c7069f75 add rewrite for hoisting multipliers over modular inverses
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-04-18 14:29:16 +02:00
Clemens Eisenhofer 0b20a4ebf4
Added rewriting distinct with bitvectors to false if bit-size is too low (#5956)
* Fixed problem with registering bitvector functions

* Added rewriting distinct with bitvectors to false if bit-size is too low

* Removed debug output

* Incorporated Nikolaj's comments

* Simplifications
2022-04-09 21:46:21 +02:00
Nikolaj Bjorner 011c1b2dd2 remove refs to bare_str 2022-04-09 12:06:27 +02:00
Nikolaj Bjorner 8c2909f52b working on python make for arm
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-04-07 13:36:23 +02:00
Nikolaj Bjorner 431c3af409 fix #5929 - add parameter bv_le2extract to allow disabling the disassembly to extract 2022-03-27 18:23:41 -10:00
Nikolaj Bjorner 815c971c9a #5778
regression when tracking literal explanations
2022-03-22 01:55:43 -07:00
Nikolaj Bjorner 20bd59bb20 #5778 - missed tracking literal assignment justification
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-03-21 10:15:00 -07:00
Nikolaj Bjorner f1806d32d6 remove buggy code, close, fix #5825
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-03-20 13:25:44 -07:00
Nikolaj Bjorner e1929ca9b9 add regex power to API and for Java per request
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-03-15 19:18:33 -07:00
Nikolaj Bjorner c51ca86203 add another constant folding case 2022-03-10 17:39:40 -08:00
Nikolaj Bjorner e839e18381 minimal addition to rewrite bit-vector to character conversion using constant folding. 2022-03-10 17:31:17 -08:00
Nikolaj Bjorner 8f2ea90db1 Merge branch 'master' of https://github.com/Z3Prover/z3 2022-03-10 17:09:36 -08:00
Nikolaj Bjorner 081c62d006 allow range comparison for bit-vectors and int/real 2022-03-10 17:08:49 -08:00
Nuno Lopes 43f7636826 remove some copies/moves 2022-03-09 12:46:41 +00:00
Nuno Lopes 689e2d41de remove a bunch of unneeded memory allocations 2022-02-25 16:08:23 +00:00
Nikolaj Bjorner 11030fc81d disable unsound mk_seq_butlast
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-21 18:56:49 -08:00
Nikolaj Bjorner ea0876b6d6 add lambda definitions during ast translation #5820
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-21 18:05:29 -08:00
Nikolaj Bjorner 91045d3e4a two words 2022-02-20 10:29:57 +02:00
Nikolaj Bjorner 9a4d6cee6c overhead with push-ite on shared terms 2022-02-14 19:36:14 +02:00
Nikolaj Bjorner 3d26b501e7 fix #5827 #5828 2022-02-14 10:31:04 +02:00
Nikolaj Bjorner 81e94b2154 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-02-09 12:10:01 +02:00
Nikolaj Bjorner 07d02ea415 fix #5829 2022-02-09 12:08:36 +02:00
Nikolaj Bjorner 03ff3201b9 block recursive definitions with lambdas until they are properly supported #5813 2022-02-06 08:57:58 +02:00
Nikolaj Bjorner 6a412f7f04 allow to pass Booleans as arguments to arithmetic expressions 2022-01-31 12:00:54 -08:00
Nikolaj Bjorner 773e829c58 #5804 2022-01-31 10:16:09 -08:00
Nikolaj Bjorner 913b90f7aa fix #5802
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-30 10:42:34 -08:00
Nikolaj Bjorner 2551631957 mul overflow #5797 2022-01-29 09:15:38 -08:00
Nikolaj Bjorner 5e81c1220c #5797 probably still wrong wrt underflow. 2022-01-27 12:48:15 -08:00
Nikolaj Bjorner 4da930b490 #5794
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-27 10:50:48 -08:00
Nikolaj Bjorner 461e71017d fix #5792 again
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-26 15:54:44 -08:00
Nikolaj Bjorner 3b8c0b7ae6 fix #5791 2022-01-24 15:11:24 +01:00
Nikolaj Bjorner 20f9814939 fix #5789
fix incorrect constant folding
2022-01-24 09:42:14 +01:00
Nikolaj Bjorner 007af9cb8a fix #5784
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-01-21 03:08:03 +01:00
Nikolaj Bjorner 5b0389615b #5780 2022-01-19 10:10:36 +01:00
Nikolaj Bjorner 0dd5a5e576 #5777 2022-01-16 17:46:08 -08:00
Nikolaj Bjorner cd56d55e34 #5753 2022-01-16 09:31:16 -08:00