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

223 commits

Author SHA1 Message Date
Lev Nachmanson ea16f6608c before rm lu
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-08 10:27:05 -08:00
Lev Nachmanson 92fe8c5968 restore the previous state
Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
2023-03-03 18:30:17 -08:00
Lev Nachmanson f986ac6a75 remove mps_reader 2023-03-03 14:50:10 -08:00
Nikolaj Bjorner 0f86a00229 use setter method to easier track updates to settings. 2023-02-01 10:18:14 -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 80033e8744 cave in to supporting proofs (partially) in simplifiers, updated doc 2022-12-06 17:02:04 -08:00
yizhou7 54a8d65617
move flushes in display_statistics (#6472) 2022-12-02 13:56:53 -08:00
Nikolaj Bjorner fc30461828 unused variables
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-10-20 09:09:06 -07:00
Nikolaj Bjorner ac1552d194 wip - updates to proof logging and self-checking
move self-checking functionality to inside sat/smt so it can be used on-line and not just off-line.

when self-validation fails, use vs, not clause, to check. It allows self-validation without checking and maintaining RUP validation.

new options sat.smt.proof.check_rup, sat.smt.proof.check for online validation.

z3 sat.smt.proof.check=true sat.euf=true /v:1 sat.smt.proof.check_rup=true /st file.smt2 sat.smt.proof=p.smt2
2022-10-16 23:33:30 +02:00
Nikolaj Bjorner 9782d4a730 #5261
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-26 05:04:02 -07:00
Nikolaj Bjorner de74e342c6
#5261 2022-09-23 13:19:55 -05:00
Nikolaj Bjorner 37fab88de0 respect dependencies, move proof_cmds to extra_cmds
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-28 18:16:43 -07:00
Nikolaj Bjorner e2f4fc2307 overhaul of proof format for new solver
This commit overhauls the proof format (in development) for the new core.

NOTE: this functionality is work in progress with a long way to go.
It is shielded by the sat.euf option, which is off by default and in pre-release state.
It is too early to fuzz or use it. It is pushed into master to shed light on road-map for certifying inferences of sat.euf.

It retires the ad-hoc extension of DRUP used by the SAT solver.
Instead it relies on SMT with ad-hoc extensions for proof terms.
It adds the following commands (consumed by proof_cmds.cpp):

- assume  - for input clauses
- learn   - when a clause is learned (or redundant clause is added)
- del     - when a clause is deleted.

The commands take a list of expressions of type Bool and the
last argument can optionally be of type Proof.
When the last argument is of type Proof it is provided as a hint
to justify the learned clause.

Proof hints can be checked using a self-contained proof
checker. The sat/smt/euf_proof_checker.h class provides
a plugin dispatcher for checkers.
It is instantiated with a checker for arithmetic lemmas,
so far for Farkas proofs.

Use example:
```
(set-option :sat.euf true)
(set-option :tactic.default_tactic smt)
(set-option :sat.smt.proof f.proof)
(declare-const x Int)
(declare-const y Int)
(declare-const z Int)
(declare-const u Int)
(assert (< x y))
(assert (< y z))
(assert (< z x))
(check-sat)
```

Run z3 on a file with above content.
Then run z3 on f.proof

```
(verified-smt)
(verified-smt)
(verified-smt)
(verified-farkas)
(verified-smt)
```
2022-08-28 17:44:33 -07:00
Nikolaj Bjorner c6263587c3 fix validator bug returning true for unprocessed case, bug reported in #6116 2022-08-23 20:17:32 -07:00
Nikolaj Bjorner 912b284602 disable validate_hint too permissive 2022-08-23 19:07:55 -07:00
Nikolaj Bjorner b169292743 add parameter descriptions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-16 08:26:53 -07:00
Arie Gurfinkel a9b7348b4b (cmake): fix visibility on shell z3 binary
Commit #b361226 changed symbol visibility from a global to a local option.
This creates inconsistency for shell that is compiled as an executable rather
than as z3 component.

This commit adds same local options to shell target in cmake.

Prior to the fix, clang on OSX complains with lots of warnings about symbol visibility
being different in different translation units that are linked together
2022-08-05 09:00:40 +03:00
Bruce Mitchener 3e38bbb009
Make sure all headers do #pragma once. (#6188) 2022-07-23 10:41:14 -07:00
Nuno Lopes 73a24ca0a9 remove '#include <iostream>' from headers and from unneeded places
It's harmful to have iostream everywhere as it injects functions in the compiled files
2022-06-17 14:10:19 +01:00
Nikolaj Bjorner 470bf27d1d drat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-11 09:15:32 -07:00
Nikolaj Bjorner b629960afb proof format
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-06 07:18:33 -07:00
Nikolaj Bjorner ea365de820 add cut
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-04 11:59:00 -07:00
Nikolaj Bjorner f652c57bfe fix proof checker
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-03 20:17:59 -07:00
Nikolaj Bjorner 3d1e03e00a add start of self-contained proof checker for arithmetic
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-03 09:11:02 -07:00
Nikolaj Bjorner da3f31697b fix proof checking for bounds propagation 2022-05-30 10:18:16 -07:00
Nikolaj Bjorner bffa7ff2f6 add hint verification, combine bounds/farkas into one rule
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-29 10:12:05 -07:00
Nikolaj Bjorner 63b9c4bdf0 for AG
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-28 18:49:27 -07:00
Nikolaj Bjorner d9f3625f93 change default output to print objective value
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-04-20 17:11:46 +01:00
Jamey Sharp 426306376f
CNF conversion refactoring (#5547)
* split sat2goal out of goal2sat

These two classes need different things out of the sat::solver class,
and separating them makes it easier to fiddle with their dependencies
independently.

I also fiddled with some headers to make it possible to include
sat_solver_core.h instead of sat_solver.h.

* limit solver_core methods to those needed by goal2sat

And switch sat2goal and sat_tactic over to relying on the derived
sat::solver class instead. There were no other uses of solver_core.

I'm hoping this makes it feasible to reuse goal2sat's CNF conversion
from places like the tseitin-cnf tactic, so they can be unified into a
single implementation.
2021-09-20 08:53:10 -07:00
Nikolaj Bjorner 7de8c72246 cleanups
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-31 11:32:47 -07:00
Nikolaj Bjorner 6a9241ff0f #5429 2021-07-31 11:00:12 -07:00
Nikolaj Bjorner e5401a4303 use quantifier 2021-07-31 00:32:43 -07:00
Nikolaj Bjorner 1e8009bbfc build/labels 2021-07-30 22:29:00 -07:00
Nikolaj Bjorner 53ab931626 #5429
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-30 21:35:09 -07:00
Nikolaj Bjorner ec034679ce #5215
memory leaks
2021-05-19 12:42:38 -07:00
Nikolaj Bjorner d27d09f87a #5261 2021-05-10 13:35:25 -07:00
Nikolaj Bjorner 897a2d6470 #5261 2021-05-10 13:33:37 -07: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
Nuno Lopes fc558d3946 fix #5059: exit straight away on hard timeout
dont run atexit handlers as its not safe to do so with multiple threads
code might be inside malloc, for example, and glibc tries to cleanup its heap
state with an atexit handler
2021-03-01 14:34:41 +00:00
Nikolaj Bjorner 3ae4c6e9de refactor get_sort 2021-02-02 04:45:54 -08:00
Nikolaj Bjorner 11477f1ed1 fixes in new solver
fix logging and lemma signs in arith_solver, move logging of drat equalities to euf
2020-12-16 10:40:17 -08:00
Nikolaj Bjorner 4d55f83654 misc 2020-12-04 16:59:13 -08:00
Nikolaj Bjorner 12198d13ac fix #4794 2020-12-02 12:24:35 -08:00
Nikolaj Bjorner 797f50e699 DRAT debugging updates 2020-11-22 15:38:57 -08:00
Nikolaj Bjorner 065e0652a3 fix crash when parsing datalog format
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-11-21 15:15:28 -08:00
Nuno Lopes 1730bc7c7f fix #4763: shell not finishing before hard timeout
The timer thread for the hard timeout was leaking and thus the thread only exited on timeout
2020-10-30 10:01:09 +00:00
Nikolaj Bjorner 7c2bdfe3fb
delay internalization, relevancy (#4707)
* delay evaluation

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

* Update bv_solver.cpp

* delay internalize

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

* compiler warnings

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

* remove gc

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

* add bv delay option

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-23 17:12:01 -07:00
Nikolaj Bjorner 549753845e
bv and gc of literals (#4692)
* bv and gc of literals

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

* overload

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

* diseq

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

* diseq

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-17 14:24:07 -07:00
Nikolaj Bjorner 2d52367368 build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-15 16:45:11 -07:00
Nikolaj Bjorner 6a4261d1af debugging bv
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-15 15:37:31 -07:00