3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-14 12:58:44 +00:00
Commit graph

15262 commits

Author SHA1 Message Date
Nikolaj Bjorner 48deb4d3e0 fix proof generation for euf-solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-23 14:31:44 -07:00
Nikolaj Bjorner e64bab4bb8 simplify code
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-22 13:19:03 -07:00
Nikolaj Bjorner d0f2b00f96 fix build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-22 12:24:30 -07:00
Nikolaj Bjorner a0892c6669 rename antecedent utilities for clarity
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-22 11:30:34 -07:00
Nikolaj Bjorner 4d31ff7a38 remove unused variable
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-21 08:35:09 -07:00
Nikolaj Bjorner 3479cdc10b separate hint literals 2023-07-20 10:52:58 -07:00
Nikolaj Bjorner e8a38c5482 build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-18 19:14:45 -07:00
Nikolaj Bjorner 3d8f75b3d8 enable on-clause with dependencies
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-18 16:59:02 -07:00
Nikolaj Bjorner 9db636c38b Merge branch 'master' of https://github.com/z3prover/z3 2023-07-17 11:00:11 -07:00
Nikolaj Bjorner 3e74989a9d fixup dependencies for trim'
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-17 11:00:02 -07:00
Lev Nachmanson bfc37bd266 add to m_touched_rows only when bound
propagation is required
2023-07-17 08:00:01 -10:00
Lev Nachmanson 0a91465e13 comment out debug output 2023-07-16 18:40:53 -10:00
Nikolaj Bjorner 75a9038aa2 add missing dependencies in rup
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-16 16:54:26 -07:00
Lev Nachmanson fd5902f76e relax an assertion in int_solver::patcher 2023-07-16 11:55:42 -10:00
Nikolaj Bjorner 305c1c1dc2 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-15 17:52:33 -07:00
Nikolaj Bjorner 715081cbd1 Merge branch 'master' of https://github.com/z3prover/z3 2023-07-15 17:04:54 -07:00
Nikolaj Bjorner 30e8330907 fix #6813
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-15 17:03:44 -07:00
Nikolaj Bjorner 8a913981f6 fix #6813 - proofs terms are fragile with respect to simplificiation of not(not(e)). It would be better if proof terms didn't have to track this level of detail, but the legacy proof format assumes strictly checkable proofs. A patch is to fixup terms within the mk_transitivity constructor
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-15 17:03:04 -07:00
Lev Nachmanson 144c9a7b82 restore the change_rows population in lar_solver 2023-07-15 10:09:48 -07:00
Lev Nachmanson 401ec04ec3
code cleaning around m_touched_rows of lar_solver (#6814) 2023-07-14 20:19:13 -07:00
Nikolaj Bjorner 3849f665d6 #6523 2023-07-14 10:17:19 -07:00
Nikolaj Bjorner a8da0a6851 #6696
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-13 21:48:46 -07:00
Nikolaj Bjorner dda9242616 revert lt change
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-13 21:39:04 -07:00
Nikolaj Bjorner 3727f70363 fix #6742
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-13 19:22:31 -07:00
Nikolaj Bjorner 4a9c4ca2ce initialize poly solver in incremental mode
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-13 14:12:29 -07:00
Nikolaj Bjorner d1482287d4 fix #6793, disable unbound_compressor when used in context of a moel converter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-13 14:03:40 -07:00
Nikolaj Bjorner 08599177d0 fix #6808
remove bv_eq_axioms as an external option to toggle.
Diseqalities have to be enforced for extensionality.
There are no internal code paths where the option is set to false.
2023-07-13 10:47:55 -07:00
Nikolaj Bjorner d0d434e4f1 fix #6807 2023-07-13 10:23:28 -07:00
Nikolaj Bjorner 3e58f0cff1 build fixes 2023-07-13 09:25:20 -07:00
Nikolaj Bjorner b909b87acc build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-13 09:13:41 -07:00
Nikolaj Bjorner 939bf1c725 wip - alpha support for polymorphism
An initial update to support polymorphism from SMTLIB3 and the API (so far C, Python).

The WIP SMTLIB3 format is assumed to be supporting the following declaration

```
(declare-type-var A)
```
Whenever A is used in a type signature of a function/constant or bound quantified variable, it is taken to mean that all instantiations of A are included in the signature and assertions.
For example, if the function f is declared with signature A -> A, then there is a version of f for all instances of A.
The semantics of polymorphism appears to follow previous proposals: the instances are effectively different functions.
This may clash with some other notions, such as the type signature forall 'a . 'a -> 'a would be inhabited by a unique function (the identity), while this is not enforced in this version (and hopefully never because it is more busy work).

The C API has the function 'Z3_mk_type_variable' to create a type variable and applying functions modulo polymorphic type signatures is possible.
The kind Z3_TYPE_VAR is added to sort discriminators.

This version is considered as early alpha. It passes a first rudimentary unit test involving quantified axioms, declare-fun, define-fun, and define-fun-rec.
2023-07-12 18:09:02 -07:00
Nikolaj Bjorner d6f2c23627 #6805 2023-07-11 09:41:29 -07:00
Lev Nachmanson 9ae6c88e3f fix the build 2023-07-10 12:19:32 -07:00
Lev Nachmanson 1840fd17da Merge branch 'master' of https://github.com/z3prover/z3 2023-07-10 12:06:06 -07:00
Lev Nachmanson e091a2e775 remove the line with clang-format off 2023-07-10 12:05:59 -07:00
Nikolaj Bjorner 241e845da8 fix #6802
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-09 12:07:43 -07:00
THE Spellchecker dc0887db5a
Typo Fixes (#6803) 2023-07-09 11:56:10 -07:00
Nikolaj Bjorner 28a0c2d18f Merge branch 'master' of https://github.com/z3prover/z3 2023-07-07 17:23:08 -07:00
Nikolaj Bjorner 5806869ae4 fix #6792, add scaffolding for type variables
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-07 17:22:56 -07:00
Lev Nachmanson 56b5492752 remove dead code 2023-07-07 15:05:17 -07:00
Lev Nachmanson 0fceb80e0f edit tracing, add lar_solver::column_is_feasible() 2023-07-07 11:48:21 -07:00
Clemens Eisenhofer 4cb158a79b
User Propagator: Return if propagated lemma is redundant (#6791)
* Give users ability to see if propagation failed

* Skip propagations in the new core if they are already satisfied
2023-07-07 09:58:41 -07:00
Nikolaj Bjorner f645bcf605 add direct detection for integer expressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-07 09:54:18 -07:00
Nikolaj Bjorner f450bc4ae0 Merge branch 'master' of https://github.com/z3prover/z3 2023-07-07 09:29:49 -07:00
Nikolaj Bjorner 8c7525c97f revert log addition
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-07 09:29:38 -07:00
Nikolaj Bjorner 0ab102cbec fix coefficient extraction and passing in Farkas lemmas, thanks to H. F. Bryant
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-07 09:28:47 -07:00
Lev Nachmanson ff875c936f add TRACE stmts, more efficient remove from inf_heap
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-07-06 16:45:22 -07:00
Lev Nachmanson 167e0dc66d Merge branch 'master' of https://github.com/z3prover/z3 2023-07-06 15:07:32 -07:00
Lev Nachmanson 4e327babda remove dead code 2023-07-06 15:07:26 -07:00
Nikolaj Bjorner 68663fd97a fix indentation for python file
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-06 09:02:58 -07:00
Nikolaj Bjorner 3782eb1be4 fix #6785
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-05 19:50:07 -07:00
Nikolaj Bjorner f4b87b3763 fix memory smash in euf completion
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-05 13:04:49 -07:00
Nikolaj Bjorner 14f69c6c01 Merge branch 'master' of https://github.com/z3prover/z3 2023-07-05 12:58:23 -07:00
Nikolaj Bjorner 4ad3324d2e fixes to trim
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-05 12:58:17 -07:00
Lev Nachmanson 1c907e8d09 add a comment 2023-07-05 09:14:57 -07:00
Lev Nachmanson e360de6d71 improve tracing and a small fix in
lp_core_solver_base::make_column_feasible
2023-07-04 13:23:56 -07:00
Lev Nachmanson 8a49cf62f4 Merge branch 'master' of https://github.com/z3prover/z3 2023-07-04 11:38:20 -07:00
Lev Nachmanson 75897b7a2e a small change in trace feas 2023-07-04 11:38:10 -07:00
Nikolaj Bjorner f0d3cbe39d add dependency tracking to proof from trim
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-04 16:24:09 +02:00
Nikolaj Bjorner abf5aff0b3 Merge branch 'master' of https://github.com/z3prover/z3 2023-07-04 09:13:12 +02:00
Nikolaj Bjorner ae29a54876 categorize theory axioms as inferences in output to capture justifications
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-04 09:12:58 +02:00
Lev Nachmanson 5ed2a82893
set clang format off for lp files (#6795)
* adding // clang-format off

* set clang-format off at the beginning of  lp files

* set clang-format off

* remove dead code
2023-07-03 17:35:16 -07:00
Nikolaj Bjorner 47fc0cf75c Merge branch 'master' of https://github.com/z3prover/z3 2023-07-03 19:30:24 +02:00
Nikolaj Bjorner d9e7b8c21f fixes to trim
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-03 19:26:19 +02:00
Lev Nachmanson 61948fa1ff find minimal deltas in patching
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-07-01 07:48:07 -07:00
Lev Nachmanson f5d9ffaca1 clean up and add clang-format off
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-06-30 11:57:42 -07:00
Lev Nachmanson 30a2ced9aa
patching merge (#6780)
* patching merge

* fix the format and some warnings

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

* a fix in the delta calculation

* test patching

* try a new version of get_patching_deltas

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

* remove dead code from lp_tst and try optimizing patching

* add comments, replace VERIFY with lp_assert

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

* cleanup

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-06-27 17:53:27 -07:00
Nikolaj Bjorner b2c035ea3f missing negation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-26 18:46:03 -07:00
Clemens Eisenhofer d42693d5b5
Equalities in C# UP-Propagation (#6786)
* Query Boolean Assignment in the UP

* UP's decide ref arguments => next_split

* Fixed wrapper

* More fixes

* Equalities in C# UP-Propagation

---------

Co-authored-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-26 10:59:57 -07:00
Nikolaj Bjorner 7221c84156 fix #6783
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-25 21:21:06 -07:00
Nikolaj Bjorner b451735aa0 fix #6778
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-25 21:08:13 -07:00
Guido Martínez 7c380fd6a0
bool_rewriter: fix possible segfault when disabling rewriter.sort_disjunctions (#6779)
After introducing the rewriter.sort_disjunctions option (#6774), I
noticed a segfault in a Z3 run that was working fine for me before the
PR.

I traced the difference to a slight discrepancy between the first patch
I submitted and the one we ended up merging: my first version would skip
sorting the disjuncts in mk_nflat_core, but still return BR_DONE, while
the patch in master returns BR_FAILED instead.

This patch fixes that problem, and it makes slightly more sense to me to
return a BR_DONE since, if `s` is true, some disjunct (e.g. a `false`
or a repeat) might have been simplified away. However I don't fully
understand this code.

... and I can't say I understand why the segfault happens. Perhaps that
is a separate issue?

This is the file to reproduce:
 https://gist.github.com/mtzguido/b7360c74d3d2e42d89f1bd9149ad26f6

Here's a stack trace of the failure, mk_nflat_or_core is not involved.
```
 (gdb) where
 #0  0x0000555555b98497 in smt::context::get_lit_assignment(unsigned int) const ()
 #1  0x0000555555b984cb in smt::context::get_assignment(sat::literal) const ()
 #2  0x0000555555b98504 in smt::context::get_assignment(unsigned int) const ()
 #3  0x0000555555ca83b8 in smt::context::get_assignment_core(expr*) const ()
 #4  0x0000555555c9af5a in smt::context::get_assignment(expr*) const ()
 #5  0x0000555555d7bd1d in (anonymous namespace)::has_child_assigned_to(smt::context&, app*, lbool, expr*&, unsigned int) ()
 #6  0x0000555555d7c413 in (anonymous namespace)::rel_case_split_queue::next_case_split_core(ptr_vector<expr>&, unsigned int&, unsigned int&, lbool&) ()
 #7  0x0000555555d7c589 in (anonymous namespace)::rel_case_split_queue::next_case_split(unsigned int&, lbool&) ()
 #8  0x0000555555c9c1b7 in smt::context::decide() ()
 #9  0x0000555555ca39fd in smt::context::bounded_search() ()
 #10 0x0000555555ca30c2 in smt::context::search() ()
 #11 0x0000555555ca273d in smt::context::check(unsigned int, expr* const*, bool) ()
 #12 0x0000555555cb166a in smt::kernel::check(unsigned int, expr* const*) ()
 #13 0x0000555555cb9695 in (anonymous namespace)::smt_solver::check_sat_core2(unsigned int, expr* const*) ()
 #14 0x00005555560dc0c6 in solver_na2as::check_sat_core(unsigned int, expr* const*) ()
 #15 0x00005555560d73f3 in combined_solver::check_sat_core(unsigned int, expr* const*) ()
 #16 0x00005555560d34e3 in solver::check_sat(unsigned int, expr* const*) ()
 #17 0x0000555556097b26 in cmd_context::check_sat(unsigned int, expr* const*) ()
 #18 0x0000555556082ff0 in smt2::parser::parse_check_sat() ()
 #19 0x0000555556084dc0 in smt2::parser::parse_cmd() ()
 #20 0x00005555560861b6 in smt2::parser::operator()() ()
 #21 0x00005555560757e6 in parse_smt2_commands(cmd_context&, std::basic_istream<char, std::char_traits<char> >&, bool, params_ref const&, char const*) ()
 #22 0x00005555555e8f68 in read_smtlib2_commands(char const*) ()
 #23 0x00005555555ee6f6 in main ()
 (gdb)
```
2023-06-23 11:45:29 -07:00
Nikolaj Bjorner 1b263f85e4 compile numeral constants into separate variables in the new core
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-21 09:36:20 -07:00
Guido Martínez 3517361a73
Adding some options in support of F* (#6774)
* patterns: add option for pattern decomposition (pi.decompose_patterns)

True by default, retaining current behavior.

* rewriter: add option for sorting of disjunctions (rewriter.sort_disjunctions)

True by default, retaining current behavior.
2023-06-20 16:10:37 -07:00
Nikolaj Bjorner eb1caee18a compile constants into different variables instead of reusing a single variable 1 and coefficients. It delays introducing large coefficients and allows more efficient bounds propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-20 16:09:34 -07:00
Lev Nachmanson 32ec02778e
use heap to track infeasible columns. (#6771)
* use heap to track infeasible columns

* fix the formatting

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

---------

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-06-19 13:50:14 -07:00
Nikolaj Bjorner 4d44e60c33 fix #6757 2023-06-18 16:36:26 -07:00
Nikolaj Bjorner df77541aae #6758
check-assumptions with compound formulas create fresh proxy variables both during compilation to internal format and for the assumptions. These fresh variables may occur in lemmas that are created during search. The lemmas are garbage for future check-sats, but the solver needs to be allowed to invoke GC. Adding a GC call before a check-sat with assumptions allows removing some lemmas every time a new assumptions are used. Eager GC when using assumptions is used elsewhere, for example in cube&conquer scenarios where lemmas learned from one set of assumptions are less likely to be useful for other assumptions.

With the GC invocation memory grows at a lesser pace. However, it is not entirely free of memory increases. To avoid memory bloat, have the solver pre-compile the assumptions by defining them as propositional variables, add assertions that the propositional variables are equivalent to the compound formulas and use the propositional variables as assumptions. The same propositional variables come with no extra overhead when invoking check-assumptions. The lemmas are then over the same fixed vocabulary. It is generally a good idea to recycle useful lemmas during the enumeration pass.
2023-06-18 16:21:41 -07:00
Nikolaj Bjorner 5f22e98396 fix #6766
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-18 10:05:34 -07:00
tcely b93171de78
pattern_inference.h: include rewriter_def.h (#6765)
Needed to use the `rewriter_tpl` constructor.
2023-06-16 08:46:40 -07:00
Nikolaj Bjorner cc4ac0e65a add guard for eq adapter 2023-06-13 16:39:53 -07:00
Nikolaj Bjorner ac00306355 fix context simplification
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-09 11:30:56 -07:00
Nikolaj Bjorner d0085b41c1 disable breaking change
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-09 11:15:54 -07:00
Nikolaj Bjorner 555ccc8aab simplify bounds by subsumption checks
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-09 10:21:45 -07:00
Lev Nachmanson 1006955215
get cached tv value (#6756) 2023-06-08 19:46:38 -07:00
Lev Nachmanson f7ec5c5c64
fix sort_non_basis (#6755)
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-06-08 13:08:09 -07:00
Nikolaj Bjorner 1d62964c58 avoid name clash for multiple special relations #6743 2023-06-07 17:55:11 -07:00
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
Jakob Rath 57e92b2a59
Fix bvnego (#6750) 2023-06-07 11:24:40 -07:00
Nikolaj Bjorner 73c3f34d66 remove debug output
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-06 16:37:24 -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
Nikolaj Bjorner 68f43ac7a4 make der selective to configuration. For F*, quantifiers are hand or machine generated in specific formats and the tool depends on e-matching to use precisely the format of the quantifiers that have been entered. For other cases of quantifiers, destructive equality resolution (der) can be expected to offer simplifications
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-06 16:15:04 -07:00
Nikolaj Bjorner 81068981aa fix #6746, fix type errors in java bindings 2023-06-03 09:41:29 +02: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 d59bf55539 fix formatting bug reported by Alex Nutz
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-30 22:19:42 +02:00
Nikolaj Bjorner 621f1f8a85 sanity check parameters #6737
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-30 09:44:06 +02:00
Manuel Carrasco 230306ddfc
Add solver::interrupt to Python's API. (#6739) 2023-05-28 21:04:36 +02:00
Nikolaj Bjorner 5e1869d8eb fix #6734
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-26 09:48:58 +01:00
ditto 11264c38d8
Java user propagator interface (#6733)
* Java API: user propagator interface

* Java API: improved user propagator interface

* Java API: Add UserPropagatorBase.java

* Remove redundant header file

* Initialize `JavaInfo` object and error handling

* Native.UserPropagatorBase implements AutoCloseable

* Add Override annotation
2023-05-24 18:27:28 +01:00
Nikolaj Bjorner 2c21072c99 remove stub class, it may as well go into NativeStatic.txt as C++
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-22 18:23:10 +01:00
Nikolaj Bjorner b93529997e more stubs #6097
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-22 16:25:54 +01:00
Nikolaj Bjorner 7963ecaf63 stubs for #6097
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-22 16:21:34 +01:00
Nikolaj Bjorner a68f91f0a6 fix #6729
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-22 14:07:12 +01:00
Nikolaj Bjorner 06ea765b82 fix #6721
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-13 09:46:49 -07:00
Michał Górny c9d8e646ed
fix missing <cstdint> include (#6720)
Fix missing <cstdint> include in src/util/tptr.h that causes build
failure with GCC 13:

```
In file included from /tmp/z3/src/util/region.cpp:53:
/tmp/z3/src/util/region.cpp: In member function ‘void* region::allocate(size_t)’:
/tmp/z3/src/util/tptr.h:29:62: error: ‘uintptr_t’ does not name a type
   29 | #define ALIGN(T, PTR) reinterpret_cast<T>(((reinterpret_cast<uintptr_t>(PTR) >> PTR_ALIGNMENT) + \
      |                                                              ^~~~~~~~~
/tmp/z3/src/util/region.cpp:82:22: note: in expansion of macro ‘ALIGN’
   82 |         m_curr_ptr = ALIGN(char *, new_curr_ptr);
      |                      ^~~~~
/tmp/z3/src/util/region.cpp:57:1: note: ‘uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   56 | #include "util/page.h"
  +++ |+#include <cstdint>
   57 |
```
2023-05-13 09:37:57 -07:00
Tomasz Kłoczko 520e692a43
Fix building with gcc 13 (#6723)
Trivial fix to build with gcc 13 reported in #6722.

Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
2023-05-13 09:37:35 -07: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
Antti Hyvärinen 12e45c9d17
Implement proposed smtlib2 bitvector overflow predicates (#6715)
* Logical names for function declarations in c++

Currently, for example, the function declaration symbol member for
checking whether multiplication *does not* overflow is called
`m_bv_smul_ovfl`.  Since we are introducing the upcoming smtlib2 symbols
that check that multpliciation *does* overflow, the not overflow check
symbols are renamed to `m_bv_smul_no_ovfl` etc.

* Implement smtlib overflow preds for multiplication

Smtlib2 is being extended to include overflow predicates for bit
vectors (see https://groups.google.com/u/1/g/smt-lib/c/J4D99wT0aKI).
This commit introduces the predicates `bvumulo` and `bvsmulo` that
return `true` if the unsigned multiplication overflows or the signed
multiplication underflows or overflows, respectively.

* Move mul overflow predicates to BV logic

* Add a todo on illogical argument order

* Implement mk_unary_pred for bv

* Implement bvnego

* Implement bvuaddo

* Implement bvsaddo

* Implement bvusubo

* Implement bvssubo

* Implement bvsdivo
2023-05-09 10:37:46 -07:00
Nikolaj Bjorner 62e1ec0698 Merge branch 'master' of https://github.com/z3prover/z3 2023-05-08 12:24:30 -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
Guillaume Bagan 0c9a5f69fd
JS/TS: add Optimize class (#6712)
* implement  Optimize class for the high level Typescript API

* javascript and wasm: add _malloc to exported functions

fix the bug https://github.com/Z3Prover/z3/issues/6709

* javascript: add tests for the Optimize class

* javascript: no reason that minimize and optimize must be constants
2023-05-06 11:53:43 -07:00
Nikolaj Bjorner 6c24a70c44 remove debug output
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-02 13:05:08 -07:00
Nikolaj Bjorner f17691715b make default argument to ensure_def and mk_def explicit
- insert also macro definitions into models
2023-05-02 12:18:31 -07:00
Nikolaj Bjorner c64d61bd0a formatting updates 2023-05-02 12:17:32 -07:00
Nikolaj Bjorner 392266c278 fix processing of else expression for model table 2023-05-02 12:16:58 -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 8fb4515872 remove redundant function, add checker function to test missed propagations 2023-04-26 10:04:59 -07:00
Nikolaj Bjorner e689dea99c basic formatting updates 2023-04-26 10:04:59 -07:00
Nikolaj Bjorner d4fa990b6e return diagnostics 2023-04-26 10:04:59 -07:00
Nikolaj Bjorner d8156aeff3 weird latent bug in wmax: init() succeeds and it returns undef 2023-04-24 21:14:42 -07:00
Nikolaj Bjorner fdd5c923ed use only maxres if there is a lexicographic objective, fix #6697
- maxlex.enable heuristic does not work if it is chained among multiple objectives. Only maxres is set up to commit the proper constraints.
2023-04-24 20:20:26 -07:00
Nikolaj Bjorner 7a689c3298 disable destructive equality resolution simplification if there are patterns
- regression from F\star
- reported by @mtzguido (stlc_min.smt2)
2023-04-24 17:59:41 -07:00
Nikolaj Bjorner a2bac119d3 differentiate fixed from offset-eq in statistics 2023-04-18 08:40:51 -07:00
Nikolaj Bjorner ec1480b12a fix #6693 2023-04-18 08:40:29 -07:00
Nikolaj Bjorner cb041c1b6d fix #6689 2023-04-17 12:05:08 -07:00
Nikolaj Bjorner 1319b64bb0 fix #6692 2023-04-17 09:11:16 -07:00
Nikolaj Bjorner 97b66d13c0 fix soundness bug in disabled code 2023-04-15 17:09:05 -07:00
Nikolaj Bjorner b75d81f3c2 fix #6690 2023-04-14 16:38:33 -07:00
Nikolaj Bjorner 624907823d add tests for distribution utility and fix loose ends 2023-04-13 11:19:06 -07:00
Nikolaj Bjorner 1a70ac75df fix #6687 2023-04-13 09:01:17 -07:00
Nikolaj Bjorner b783879752 #6687 2023-04-13 08:45:17 -07:00
Nikolaj Bjorner 7cd8edce1f perf and memory smash fixes to internal node count routine 2023-04-12 21:01:05 -07:00
Nikolaj Bjorner f0afbcbb87 fix #6686 2023-04-12 20:13:24 -07:00
Nikolaj Bjorner eba0732629 fix #6675
disable remove_unused_defs from pb-solver until it is integrated with model reconstruction.
2023-04-12 19:50:13 -07:00
Nikolaj Bjorner e8222433c3 count internal nodes, use to block expanding use of hoist, #6683 2023-04-12 19:40:31 -07:00
Nikolaj Bjorner 444238bc53 formatting updates 2023-04-12 19:40:31 -07:00
Nikolaj Bjorner f61168cd53 module for maintaining probability distributions 2023-04-12 19:40:31 -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 58a2a9c79c fix #6680 2023-04-11 14:42:47 -07:00
Nikolaj Bjorner ccc4f2d382 fix #6682 2023-04-11 05:10:03 -07:00
Nikolaj Bjorner 368d60f553 add branch / cut selection heuristic from solver=2
disabled for testing.
2023-04-10 22:14:16 -07:00