3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 02:15:19 +00:00
Commit graph

18001 commits

Author SHA1 Message Date
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
dependabot[bot] 7c4d098f65
Bump docker/build-push-action from 4.0.0 to 4.1.1 (#6772)
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 4.0.0 to 4.1.1.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v4.0.0...v4.1.1)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-24 10:20:56 +01: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