3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-20 23:44:41 +00:00
Commit graph

81 commits

Author SHA1 Message Date
Nikolaj Bjorner
c387b20ac6 move smt params to params directory, update release.yml 2025-06-09 10:47:22 -07:00
LeeYoungJoon
0a93ff515d
Centralize and document TRACE tags using X-macros (#7657)
* Introduce X-macro-based trace tag definition
- Created trace_tags.def to centralize TRACE tag definitions
- Each tag includes a symbolic name and description
- Set up enum class TraceTag for type-safe usage in TRACE macros

* Add script to generate Markdown documentation from trace_tags.def
- Python script parses trace_tags.def and outputs trace_tags.md

* Refactor TRACE_NEW to prepend TraceTag and pass enum to is_trace_enabled

* trace: improve trace tag handling system with hierarchical tagging

- Introduce hierarchical tag-class structure: enabling a tag class activates all child tags
- Unify TRACE, STRACE, SCTRACE, and CTRACE under enum TraceTag
- Implement initial version of trace_tag.def using X(tag, tag_class, description)
  (class names and descriptions to be refined in a future update)

* trace: replace all string-based TRACE tags with enum TraceTag
- Migrated all TRACE, STRACE, SCTRACE, and CTRACE macros to use enum TraceTag values instead of raw string literals

* trace : add cstring header

* trace : Add Markdown documentation generation from trace_tags.def via mk_api_doc.py

* trace : rename macro parameter 'class' to 'tag_class' and remove Unicode comment in trace_tags.h.

* trace : Add TODO comment for future implementation of tag_class activation

* trace : Disable code related to tag_class until implementation is ready (#7663).
2025-05-28 14:31:25 +01:00
Nikolaj Bjorner
a3f35b6830 Add command to set initial value hints for solver in various components 2024-09-18 17:48:03 +03:00
Nikolaj Bjorner
5cac9b84e4 fix build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-02-01 09:36:52 -08:00
Nikolaj Bjorner
17913f3ec8 remove braces 2023-12-04 10:32:02 -08:00
Nikolaj Bjorner
a8f3396b24 #7033 2023-12-03 10:34:16 -08:00
Nikolaj Bjorner
4406011881 fix #6984 2023-11-14 07:40:32 -08:00
Nikolaj Bjorner
8c00181815 fix #6955 2023-10-19 10:41:24 -07:00
Arie Gurfinkel
51d3c279d0
QEL: Fast Approximated Quantifier Elimination (#6820)
* qe_lite: cleanup and comment

no change to code

* mbp_arrays: refactor out partial equality (peq)

Partial array equality, PEQ, is used as an intermediate
expression during MBP for arrays. We need to factor it out
so that it can be shared between MBP-QEL and existing MBP.

Partial array equality (peq) is used in MBP for arrays.
Factoring this out to be used by multiple MBP implementations.

* rewriter: new rewrite rules

These rules are specializes for terms that are created in QEL.
QEL commit is comming later

* datatype_rw: new rewrite rule for ADTs

The rule handles this special case:

    (cons (head x) (tail x)) --> x

* array_rewriter rules for rewriting PEQs

Special rules to simplify PEQs

* th_rewriter: wire PEQ simplifications

* spacer_iuc: avoid terms with default in IUC

Spacer prfers to not have a term representing default value of an array.
This guides IUC from picking such terms in interpolation

* mbp_term_graph: replace root with repr

* mbp_term_graph: formatting

* mbp_term_graph: class_props, getters, setters

Class properties allow to keep information for an equivalence class.

Getters and setters for terms allow accessing information

* mbp_term_graph: auxiliary methods for qel

QEL commit is comming later in the history

* mbp_term_graph: bug fix

* mbp_term_graph: pick, refine repr, compute cgrnd

* mbp_term_graph: internalize deq

* mbp_term_graph: constructor

* mbp_term_graph: optionally internalize equalities

Reperesent equalities explicitly by nodes in the term_graph

* qel

* formatting

* comments on term_lt

* get terms and other api for mbp_qel

* plugins for mbp_qel

* mbp_qel_util: utilities for mbp_qel

* qe_mbp: QEL-based mbp

* qel: expose QEL API

* spacer: replace qe_lite in qe_project_spacer by qel

This changes the default projection engine that spacer uses.

* cmd_context: debug commands for qel and mbp_qel

New commands are

  mbp-qel -- MBP with term graphs
  qel     -- QEL with term graphs
  qe-lite -- older qelite

* qe_mbp: model-based rewriters for arrays

* qe_mbp: QEL-based projection functions

* qsat: wire in QEL-based mbp

* qsat: debug code

* qsat: maybe a bug fix

Changed the code to follow the paper by adding all predicates above a given
level, not just predicates of immediately preceding level.

* chore: use new api to create solver in qsat

* mbp_term_graph use all_of idiom

* feat: solver for integer multiplication

* array_peq: formatting, no change to code

* mbp_qel_util: block comment + format

* mbt_term_graph: clang-format

* bug fix. Move dt rewrite to qe_mbp

* array_peq: add header

* run clang format on mbp plugins

* clang format on mul solver

* format do-while

* format

* format do-while

* update release notes

---------

Co-authored-by: hgvk94 <hgvk94@gmail.com>
Co-authored-by: Isabel Garcia <igarciac@uwaterloo.ca>
2023-08-02 09:34:06 -07:00
Nikolaj Bjorner
09ab575d29 parens 2022-08-21 18:27:14 -07:00
Nikolaj Bjorner
1d87592b13 fixes to mod/div elimination
elimination of mod/div should be applied to all occurrences of x under mod/div at the same time. It affects performance and termination to perform elimination on each occurrence since substituting in two new variables for eliminated x doubles the number of variables under other occurrences.

Also generalize inequality resolution to use div.

The new features are still disabled.
2022-08-14 11:34:03 -07: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
4a6083836a call it data instead of c_ptr for approaching C++11 std::vector convention. 2021-04-13 18:17:35 -07:00
Nikolaj Bjorner
3ae4c6e9de refactor get_sort 2021-02-02 04:45:54 -08:00
Nikolaj Bjorner
0643e7c0fc fix #4886
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-12-12 12:40:14 -08:00
Nikolaj Bjorner
2f756da294
adding dt-solver (#4739)
* adding dt-solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* dt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* move mbp to self-contained module

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* files

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* Create CMakeLists.txt

* dt

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>

* rename to bool_var2expr to indicate type class

* mbp

* na
2020-10-18 15:28:21 -07:00
Nikolaj Bjorner
57086edc42 close #4432
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-04 03:06:58 -07:00
Nikolaj Bjorner
04829e6b7a fix #4437, not really interesting bug as debug assertion is really for non-interrupted flow
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-02 18:41:26 -07:00
Nikolaj Bjorner
4ef480e2a5 add op cache
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-02 12:52:42 -07:00
Nikolaj Bjorner
1c2aa1076b fix #4125 2020-04-27 11:31:02 -07:00
Nikolaj Bjorner
f1193986c9 fix #4102
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-26 21:24:54 -07:00
Nikolaj Bjorner
c2e0491456 fix #4113
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-26 21:04:28 -07:00
Nikolaj Bjorner
a3844af94b fix #4081
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-24 10:44:20 -07:00
Nikolaj Bjorner
fadc3761bd fix #3731 - abuse of parameter combinations, trying to use qsat on arrays, but disabling array equality expansion during model evaluation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-04 17:06:43 -07:00
Nikolaj Bjorner
426e4cc75c fix #3557
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-03 16:37:59 -07:00
Nikolaj Bjorner
37bc4a4407 fix #3420
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-19 17:50:23 -07:00
Nikolaj Bjorner
cd434d8bd5 fix #3420
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-19 17:49:48 -07:00
Nikolaj Bjorner
9e41e88392 delay-initialize solver to avoid conflicts with global parameters #3076
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-10 11:34:49 -07:00
Nikolaj Bjorner
bed2097fc4 fix #3076 - need to apply relevancy propagation in mk_bits. Assume bv v is already relevant but did not have bits associated with it, the bits need to then be marked as relevant
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-10 10:36:00 -07:00
Nikolaj Bjorner
bdd66e1fa0 fix #3180 fix #3181 #3184
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-03-07 12:13:43 +01:00
Nikolaj Bjorner
589db2052a fix #3064
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-02-21 20:26:57 -08:00
Nikolaj Bjorner
1d3e9fb76c fix #3009
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-02-15 21:30:09 -10:00
Nikolaj Bjorner
99b71a9f9e fix #2975, parameter validation to avoid cases where domain of sort is not fixed
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-02-13 20:20:08 -08:00
Nikolaj Bjorner
8ad939a10f fix #2990
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-02-13 20:20:08 -08:00
Nikolaj Bjorner
1ce0d7512a fix #2974 by using same code path as qe. It now diverges, but this is due to the use of an uninterpreted predicate which the use of mbp doesn't handle
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-02-13 20:20:08 -08:00
Nikolaj Bjorner
0f566ddf38 fix #2789
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-12-07 11:09:52 +03:00
Nikolaj Bjorner
a2aab76c22 fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-12-07 11:02:25 +03:00
Nikolaj Bjorner
eec153bb57 fix #2779 2019-12-03 14:49:58 +01:00
Nikolaj Bjorner
feff1f7f96 fix #2609
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-02 14:40:11 -07:00
Nikolaj Bjorner
68e4ed3c9c fix #2531
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-09-02 09:59:58 -07:00
Nikolaj Bjorner
e1fd167e01 remove stale assertions due to lambda #2446
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-07-30 14:35:09 +08:00
Nikolaj Bjorner
74631265b9 remove stale assertions due to lambda #2446
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-07-30 14:32:06 +08:00
Nikolaj Bjorner
8248ec879e fix qsat destructor memory allocation #1948
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-11-28 15:35:46 -08:00
Nikolaj Bjorner
e0490450f3 add capabilities to python API, fix model extraction for qsat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-09-28 13:23:28 -07:00
Nuno Lopes
cef17c22a1 remove some allocs from exceptions 2018-07-02 17:08:02 +01:00
Nikolaj Bjorner
520ce9a5ee integrate lambda expressions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-26 07:23:04 -07:00
Nikolaj Bjorner
335d672bf1 fix #1675, regression in core processing in maxres
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-06-19 23:23:19 -07:00
Nikolaj Bjorner
c513f3ca09 merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-25 14:57:01 -07:00
Bruce Mitchener
76eb7b9ede Use nullptr. 2018-02-12 14:05:55 +07:00
Bruce Mitchener
7167fda1dc Use override rather than virtual. 2018-02-10 09:56:33 +07:00