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

385 commits

Author SHA1 Message Date
Nikolaj Bjorner c2b7b58c78 #7468 - add option (get-info :parameters) to display solver parameters that were updated globally and distinct from defaults
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2025-02-10 11:57:14 -08:00
Nikolaj Bjorner 1ce6e66ac9 generalize logic detection to use sub-string matching 2025-01-30 16:34:54 -08:00
Nikolaj Bjorner decaee83f3 move from justified_expr to dependent_expr by aligning datatypes 2025-01-22 11:46:10 -08:00
Nikolaj Bjorner f3e7c8c9df include QF_SNIA 2025-01-13 08:13:39 -08:00
Nikolaj Bjorner 09825edcd8 remove compute depth in favor of already existing get_depth 2024-12-23 18:49:54 -08:00
Nikolaj Bjorner 87f7a20e14 Add (updated and general) solve_for functionality for arithmetic, add congruence_explain to API to retrieve explanation for why two terms are congruent Tweak handling of smt.qi.max_instantations
Add API solve_for(vars).
It takes a list of variables and returns a triangular solved form for the variables.
Currently for arithmetic. The solved form is a list with elements of the form (var, term, guard).
Variables solved in the tail of the list do not occur before in the list.
For example it can return a solution [(x, z, True), (y, x + z, True)] because first x was solved to be z,
then y was solved to be x + z which is the same as 2z.

Add congruent_explain that retuns an explanation for congruent terms.
Terms congruent in the final state after calling SimpleSolver().check() can be queried for
an explanation, i.e., a list of literals that collectively entail the equality under congruence closure.
The literals are asserted in the final state of search.

Adjust smt_context cancellation for the smt.qi.max_instantiations parameter.
It gets checked when qi-queue elements are consumed.
Prior it was checked on insertion time, which didn't allow for processing as many
instantations as there were in the queue. Moreover, it would not cancel the solver.
So it would keep adding instantations to the queue when it was full / depleted the
configuration limit.
2024-12-19 23:27:57 +01:00
Nikolaj Bjorner 05e053247d add facility to solve for a linear term over API 2024-11-30 09:34:27 -08:00
Nikolaj Bjorner 012fc1b72b more detailed tracing of where unmaterialized exceptions happen
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-19 18:15:50 -08:00
Nikolaj Bjorner e855a50d9b add exception handling to easier diagnose #7418
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-19 11:46:54 -08:00
Nikolaj Bjorner 5168a13efa track exceptions in reason-unknown
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-19 09:29:23 -08:00
Nikolaj Bjorner abd16740ce inherit more exceptions from std::exception
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-04 13:52:14 -08:00
Nikolaj Bjorner 92065462b4 use std::exception as base class to z3_exception
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-11-04 11:08:15 -08:00
Nikolaj Bjorner 5a5e39ae74 fix incrementality bug for pre-processing: replay has to be invoked on every push regardless. 2024-10-16 13:07:18 -07:00
Nikolaj Bjorner efde656036 fix recursive self call for slice_solver check-sat-cc method
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-10-10 16:38:00 -07:00
Nikolaj Bjorner da614c65e5 remove m_level attribute, use s->get_scope_level directly 2024-10-08 19:56:57 -07:00
Nikolaj Bjorner 8a95dd4d65 A slice solver option for interactive use case
A slice solver prunes the set of active assertions based on symbol occurrences in a goal that is tracked as a @query.
Ground assertions that have symbols intersecting with the query are included in the solver state, and quantifiers that with patterns that intersect with the slice are included. The slice is the fixedpoint of including symbols from all included assertions.
Enable the functionality for command-line use by setting solver.slice=true
2024-10-08 09:24:52 -07:00
Nuno Lopes 3586b613f7 remove default destructors 2024-10-02 22:20:12 +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 48712b4f60 Add initial value setting for variables in Z3 API, solver, and optimize modules 2024-09-18 16:13:15 +03:00
Nuno Lopes 8061765574 remove default destructors & some default constructors
Another ~700 KB reduction in binary size
2024-09-04 22:30:23 +01:00
Nikolaj Bjorner 3381fd2b52 spell check from https://github.com/microsoft/z3guide/pull/165
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2024-01-12 09:57:46 -08:00
Nikolaj Bjorner dff419a7cb pin expressions to fix unsound behavior 2023-12-18 16:57:52 -08:00
Bruce Mitchener e90a844508
Use override more. (#7059) 2023-12-15 08:44:57 +00:00
Nikolaj Bjorner 8fac89cdcc enable more simplification in case inequality triggers a change. 2023-10-21 19:58:39 -07:00
Nikolaj Bjorner b0df74c1c1 #6930
simplify assumptions and only replay assumptions after constraints are simplified. This allows simplifying assumptions with the current set of constraints independently of whether there is another check-sat.
2023-10-05 17:23:17 +09:00
Nikolaj Bjorner c2e73a6aae logging pre-processing
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-09-03 15:19:31 -07:00
Nikolaj Bjorner adad468cd7 allow copy within a user scope #6827
this will allow copying the solver state within a scope.
The new solver state has its state at level 0. It is not possible to pop scopes from the new solver (you can still pop scopes from the original solver). The reason for this semantics is the relative difficulty of implementing (getting it right) of a state copy that preserves scopes.
2023-07-31 19:46:08 -07:00
THE Spellchecker dc0887db5a
Typo Fixes (#6803) 2023-07-09 11:56:10 -07:00
Nikolaj Bjorner b451735aa0 fix #6778
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-06-25 21:08:13 -07:00
Clemens Eisenhofer 7b513b4a40
Some UP bugfixes in the new core (#6673) 2023-04-08 12:50:46 -07:00
Nikolaj Bjorner d1c7ff1a36 add unconstrained elimination for sequences 2023-03-20 17:07:04 +01:00
Nikolaj Bjorner 79d47eb302 add preprocessor parameter whether to use bound simplifier 2023-02-28 17:40:08 -08:00
Nikolaj Bjorner 1b0c76e3f0 fixes to mbqi in the new core based on #6575 2023-02-10 16:56:06 -08:00
Nikolaj Bjorner 39d2818923 compiler warnings/bugs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-02-02 19:36:22 -08:00
Nikolaj Bjorner 2e068e3f56 add simplifiers to .net API 2023-02-02 17:41:00 -08:00
Nikolaj Bjorner 72e7a8a481 fix incremental pre-processing to work with consequences/cubes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-02-01 20:00:38 -08:00
Nikolaj Bjorner 6c7dd4a863 fix incremental pre-processing to work with assumptions/cores and consequences
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-02-01 19:47:58 -08:00
Nikolaj Bjorner ebc2cd572b fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-31 14:53:04 -08:00
Nikolaj Bjorner d263b373ed update release notes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-31 12:19:33 -08:00
Nikolaj Bjorner 971b9d4081 fix #6564
fixes to simplifier command front-end
2023-01-31 09:32:34 -08:00
Nikolaj Bjorner 6022c17131 Add simplification customization for SMTLIB2
Add the ability to customize incremental pre-processing simplification for the SMTLIB2 front-end. The main new capability is to use pre-processing tactics in incremental mode that were previously not available. The main new capabilities are
- solve-eqs
- reduce-args
- elim-unconstrained
There are several more. Documentation and exposed simplifiers are populated incrementally. The current set of supported simplifiers can be inspected by using z3 with the --simplifiers flag or referring to https://microsoft.github.io/z3guide/docs/strategies/simplifiers

Some pending features are:
- add the ability to update parameters to simplifiers similar to how tactics can be controlled using parameters.
- expose simplification solvers over the binary API.
2023-01-30 22:38:51 -08:00
Nikolaj Bjorner dd0decfe5d create simplifier_solver wrapper to supply simplifier layer
move sat_smt_preprocess to solver
fix bugs in model_reconstruction_trail for dependency replay

This is a preparatory step for exposing pre-processing as tactics.
2023-01-30 16:12:25 -08:00
Nikolaj Bjorner b700dbffce fix #6528 2023-01-10 14:42:23 -08:00
Nikolaj Bjorner fcea32344e add missing tactic descriptions, add rewrite for tamagochi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2023-01-08 13:32:26 -08:00
Nikolaj Bjorner f6d411d54b experimental feature to access congruence closure of SimpleSolver
This update includes an experimental feature to access a congruence closure data-structure after search.
It comes with several caveats as pre-processing is free to eliminate terms. It is therefore necessary to use a solver that does not eliminate the terms you want to track for congruence of. This is partially addressed by using SimpleSolver or incremental mode solving.

```python
from z3 import *
s = SimpleSolver()
x, y, z = Ints('x y z')
s.add(x == y)
s.add(y == z)
s.check()
print(s.root(x), s.root(y), s.root(z))
print(s.next(x), s.next(y), s.next(z))
```
2022-12-30 21:41:27 -08:00
Nikolaj Bjorner dd1ca8f6bd move qhead to attribute on the state instead of the simplifier,
- add sat.smt option to enable the new incremental core (it is not ready for mainstream consumption as cloning and other features are not implemented and it hasn't been tested in any detail yet).
- move "name" into attribute on simplifier so it can be reused for diagnostics by the seq-simplifier.
2022-11-29 16:36:02 +07:00
Nikolaj Bjorner f4e17ecc65 add logging and diagnostics 2022-11-12 18:03:47 -08:00
Nikolaj Bjorner 8da13ae24a add statistics to verbose output of asserted formulas 2022-11-08 18:37:30 -08:00
Nikolaj Bjorner 1dca6402fb move model and proof converters to self-contained module 2022-11-03 05:23:01 -07:00
Nikolaj Bjorner ad5fa9433f add experiment with quot-rem encoding
experiment seeks to determine whether quot-rem encoding can substitute the division circuit encoding.
A first test suggests it makes no difference.
2022-10-21 09:25:45 -07:00