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

2999 commits

Author SHA1 Message Date
Nikolaj Bjorner
a805e1f27d fixes to AC plugin 2023-11-28 12:50:43 -08:00
Nikolaj Bjorner
14483dcd6e n/a
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-11-20 16:15:30 -08:00
Nikolaj Bjorner
6a572543b4 n/a
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-11-20 15:54:00 -08:00
Nikolaj Bjorner
cbefe74219 hastwo
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-11-18 15:41:18 -08:00
Nikolaj Bjorner
7ad8c6a6ce na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-11-15 17:56:45 -08:00
Nikolaj Bjorner
a76aca57f0 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-11-15 17:03:41 -08:00
Nikolaj Bjorner
108275dcd9 n/a 2023-11-15 15:00:02 -08:00
Nikolaj Bjorner
bf5e6936c0 updated AC simplification 2023-11-15 11:01:51 -08:00
Nikolaj Bjorner
d5315e2283 prepare for subsumption
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-11-14 10:56:01 -08:00
Nikolaj Bjorner
616d00409f updates to AC plugin, notes in BV plugin 2023-11-14 00:52:46 -08:00
Nikolaj Bjorner
54909f8755 use uint set to track superset of equations that are in simplified state 2023-11-13 01:15:37 -08:00
Nikolaj Bjorner
654dce3dc4 bug fixes 2023-11-12 17:35:42 -08:00
Nikolaj Bjorner
5c71824f2b adding unit test for arith_plugin 2023-11-12 16:48:10 -08:00
Nikolaj Bjorner
65a8c162f5 add E(T) functionality for bv and ac functions
Add an option to register EUF modulo theories,
The current theory with a unit test is BV.
The arithmetic theory plugs into an AC completion. It is partially finished, pending setting up testing and implementing handling of shared terms.
2023-11-12 15:39:56 -08:00
Jakob Rath
3e7f7ef605 egraph comment, remove unneeded check 2023-08-17 17:57:42 +02:00
Jakob Rath
114e7b73e5 move callback into member function 2023-07-19 12:51:35 +02:00
Jakob Rath
af73f26941 slicing: track disequalities 2023-07-19 12:04:45 +02:00
Jakob Rath
28ed3bd7ab fix backtracking of m_needs_congruence 2023-07-18 16:00:26 +02:00
Jakob Rath
82b1f9297b utils 2023-07-17 14:41:45 +02:00
Jakob Rath
1d3a31c323 Add getter for target and justification to enode 2023-07-12 15:47:33 +02:00
Jakob Rath
59c3234fb8 Merge branch 'master' into polysat 2023-07-10 09:45:55 +02: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
5806869ae4 fix #6792, add scaffolding for type variables
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-07 17:22:56 -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
f4b87b3763 fix memory smash in euf completion
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-07-05 13:04:49 -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
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
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
Jakob Rath
8bde66420a Merge branch 'master' into polysat 2023-06-12 14:02:20 +02: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
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
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
Jakob Rath
f54f33551e Merge branch 'master' into polysat 2023-05-26 15:58:09 +02: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
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
2e441e38c9 fix #6713 fix #6714
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-05-08 12:24:20 -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
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
cb041c1b6d fix #6689 2023-04-17 12:05:08 -07:00
Nikolaj Bjorner
1a70ac75df fix #6687 2023-04-13 09:01: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
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