3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-18 06:39:02 +00:00
Commit graph

1837 commits

Author SHA1 Message Date
Nikolaj Bjorner 7e1e64d027 fix #6313
remaining new issues
2022-09-02 17:48:00 -07:00
Nikolaj Bjorner e4ef1717e3 fix variable tracking bug in explanations with literals 2022-09-01 23:26:38 -07:00
Nikolaj Bjorner ac5b190a72 track instantiations from MBQI in proof logging for new solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-09-01 08:51:53 -07:00
Nikolaj Bjorner d3e6ba9f98 remove union
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-31 19:09:13 -07:00
Nikolaj Bjorner 3011b34b3b log E-matching based quantifier instantiations as hints 2022-08-31 18:59:02 -07:00
Nikolaj Bjorner 6077c4154a #6116 bv2int bug fix 2022-08-31 17:31:54 -07:00
Nikolaj Bjorner 4abff18e8d fill in missing pieces of proof hint checker for Farkas and RUP
The proof validator based on SMT format proof logs uses RUP to check propositional inferences and has plugins for theory axioms/lemmas.
2022-08-31 05:29:15 -07:00
Nikolaj Bjorner 0f475f45b5 Add RUP checking mode to proof checker. 2022-08-30 09:45:19 -07:00
Nikolaj Bjorner dd90689339 build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-28 18:54:36 -07:00
Nikolaj Bjorner 4d29925c3f build fixes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-28 18:43:50 -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 dd91fab6f4 Merge branch 'master' of https://github.com/Z3Prover/z3 2022-08-26 10:44:40 -07:00
Nikolaj Bjorner 159026b5e8 regression fix to ackerman gc and memory smash, perf fix for handling bv2int axioms, perf fix for filtering ackerman
this update addresses some perf regressions introduced when handling axioms for bv2int and a memory smash regression when decoupling bv-ackerman from in-processing. It adds a filter based on bv_eq_axioms for disabling ackerman reductions on disequalities.
2022-08-26 10:44:33 -07:00
Nikolaj Bjorner 458f417f44 move drat functionality into euf 2022-08-25 19:19:13 -07:00
Nikolaj Bjorner 1ffbe23ee3 add virtual destructor to fix build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-25 18:37:24 -07:00
Nikolaj Bjorner 1894c86ee0 virtual
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-25 18:27:30 -07:00
Nikolaj Bjorner ca0a82952f add function pointer to class to see how MacOs build reacts
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-25 16:15:34 -07:00
Nikolaj Bjorner 0d7b7a417a selectively re-add solver_params
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-25 13:29:42 -07:00
Nikolaj Bjorner 5f2387b3be revert some changes that coincide with breaking macos build 2022-08-25 11:22:35 -07:00
Nikolaj Bjorner a628e4c4e5 updates to printer to get instantiations, take 1 2022-08-25 11:22:35 -07:00
Nikolaj Bjorner f0eee41ab9 include depenency 2022-08-25 09:09:04 -07:00
Nikolaj Bjorner fb8532bf55 succinct logging
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-23 21:06:04 -07:00
Nikolaj Bjorner 74c61f49b4 move std::function to header of sat-drat - alignment?
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-23 20:20:51 -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 ce1f3987d9 fix unsoundness in quantifier propagation #6116 and add initial lemma logging 2022-08-23 19:10:01 -07:00
Nikolaj Bjorner 17fc438476 don't have bv-ackerman influence simplification
previous scheme has Ackmerman module instrument main solver to backjump and simplify when reaching a threshold.
This destroys overall performance: simplification does many more things than invoking Ackerman axioms.
Having a dependency between simplification (in-processing) and depleting a priority queue of auxiliary axioms therefore hurts overall performance. It has to be decoupled. The current approach is now to empty the axiom queue on occasion.
It is still not ideal - it should be coupled with the search level - axioms don't survive higher levels where redundant clauses get garbage collected as they don't have a chance of being used.
2022-08-21 15:25:18 -07:00
Nikolaj Bjorner bb5d81195c use equalities 2022-08-19 18:17:16 -07:00
Nikolaj Bjorner 8e167aa213 #6116
fix unsoundness issue due to book-keeping changes for whether the solver uses assumptions.
2022-08-18 03:58:06 -07:00
Nikolaj Bjorner b169292743 add parameter descriptions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-08-16 08:26:53 -07:00
Nikolaj Bjorner f989521a8c add initial skeleton for xor-solver 2022-08-12 11:54:10 -04:00
Nikolaj Bjorner 49064252ac fix issues for user-propagator from new core 2022-08-09 14:56:27 +03:00
Nikolaj Bjorner 410eed9bd5 #6116 2022-08-07 11:09:43 +03:00
Nikolaj Bjorner 8e077d8ef9 #6116 2022-08-07 10:25:04 +03:00
Nikolaj Bjorner 539d44464f #6196
map can be simplified
2022-08-07 10:17:24 +03:00
Bruce Mitchener 5014b1a34d Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
Bruce Mitchener 77e5d6ab19 Use nullptr consistently instead of 0 or NULL. 2022-08-01 14:24:32 +03:00
Bruce Mitchener 5d0dea05aa
Remove empty leaf destructors. (#6211) 2022-07-30 10:07:03 +01:00
Bruce Mitchener 1eb84fe4b9
Mark override methods appropriately. (#6207) 2022-07-29 23:29:15 +02:00
Nikolaj Bjorner 43f2b848d4 fix typo
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-25 03:44:12 +02:00
Nikolaj Bjorner 5c2c0ae900 force-push on new_eq, new_diseq in user propagator, other fixes to Python bindings for user propagator
This update allows the python bindings for user-propagator to handle functions that are declared to be registered with the user propagator plugin. It fixes a bug in UserPropagateBase.add to allow registering terms dynamically during search.
It also fixes a bug in theory_user_propagate as scopes were not fully pushed when the solver gets the callbacks for new equalities and new disequalities.
It also adds equality and disequality interfaces to the sat/smt solver version (which isn't being exercised in earnest yet)
2022-07-25 03:42:29 +02:00
Bruce Mitchener 3e38bbb009
Make sure all headers do #pragma once. (#6188) 2022-07-23 10:41:14 -07:00
Nikolaj Bjorner efa74fe6c6 fix #6180
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-21 12:20:36 -07:00
Nikolaj Bjorner cf5a8fd248 fix validation code for pb
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-21 08:58:32 -07:00
Nikolaj Bjorner 32c0d1f636 fix #6168 2022-07-20 21:48:47 -07:00
Nikolaj Bjorner 5c54d6564b fix #6143 2022-07-11 12:09:15 -07:00
Nikolaj Bjorner b68af0c1e5 working on reconciling perf for arithmetic solvers
this update integrates inferences to smt.arith.solver=6 related to grobner basis computation and handling of div/mod axioms to reconcile performance with smt.arith.solver=2.

The default of smt.arth.nl.grobner_subs_fixed is changed to 1 to make comparison with solver=2 more direct.

The selection of cluster equalities for solver=6 was reconciled with how it is done for solver=2.
2022-07-11 07:38:51 -07:00
Nikolaj Bjorner 580ed31afd fix types and incompleteness for feature #6104 2022-07-06 01:08:54 -07:00
Nikolaj Bjorner f82ca197d2 #6104 also in the new core 2022-07-05 12:38:07 -07:00
Nikolaj Bjorner 0353fc38ff fix #6127 again
this time adding inheritance to the recfun plugin so it properly contains the recursive definitions from the source.
2022-07-04 12:42:11 -07:00
Mark Marron e054f1683c
fixing compiler warn (missing override) (#6125) 2022-06-30 15:39:28 -07:00
Nikolaj Bjorner 8ab8b63a4c fix incorrect mod axiomatization #6116 2022-06-29 12:32:04 -07:00
Nikolaj Bjorner 1a9122663c remove unsound axioms, fix #6115 2022-06-29 11:16:10 -07:00
Nikolaj Bjorner 4c8f6b60ce fix #6107 2022-06-27 20:51:30 -07:00
Nikolaj Bjorner 61f5489223 fix #6107 2022-06-27 16:53:18 -07:00
Nikolaj Bjorner 1fcf7cf0b7 add nl div mod axioms 2022-06-27 09:02:53 -07:00
Clemens Eisenhofer 2fa60aa43c
Added function to select the next variable to split on (User-Propagator) (#6096)
* Added function to select the next variable to split on

* Fixed typo

* Small fixes

* uint -> int
2022-06-19 10:49:25 -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 637120ced5 Treat arguments to recursive functions as beta redexes
An argument to a recursive function would escape the scope of the function application when the recursive function definitions are unfolded. Therefore, such argument occurrences need not be considered for extensional equality / equality sharing.

This filter is mostly relevant for recursive functions that take a lambda expression as argument. Lambda expressions / arrays that occur in shared occurrences are checked for extensionality.
2022-06-14 09:51:06 -07:00
Nikolaj Bjorner 25ad5cb073 prepare ground for drup trim
By not deleting justifications in base level unit literals it is possible for drup-trim to inspect the trail for dependencies - which clauses were used to derive a literal.
2022-06-14 09:51:06 -07:00
Nikolaj Bjorner 35d4605425 remove spurious output to stdout 2022-06-14 09:51:06 -07:00
Nikolaj Bjorner 04f94d818f fix #6091 2022-06-14 09:51:06 -07:00
Nikolaj Bjorner 470bf27d1d drat
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-11 09:15:32 -07:00
Nikolaj Bjorner 5db133f875 add a way to supress lambdas
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-10 14:35:20 -07:00
Nikolaj Bjorner 97437bce4c Update sat_params.pyg 2022-06-09 10:09:30 -07:00
Nikolaj Bjorner 828850f298 prepare for trim 2022-06-09 10:08:57 -07:00
Nikolaj Bjorner dee6c30f1b na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-08 08:05:19 -07:00
Nikolaj Bjorner 80604c7bc5 na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-08 07:00:59 -07:00
Nikolaj Bjorner 51ed13f96a update topological sort to use arrays instead of hash tables, expose Context over Z3Object for programmability
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-08 06:28:24 -07:00
Nikolaj Bjorner dca1dcca6d ea
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-06 08:42:47 -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 a9d70fca1a fix #6061
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-31 19:09:10 -07:00
Nikolaj Bjorner e9cff33feb fix #5068
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-30 11:24:58 -07:00
Nikolaj Bjorner da3f31697b fix proof checking for bounds propagation 2022-05-30 10:18:16 -07:00
Nikolaj Bjorner cb279fba2b fix sign for binary propagation hints
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-29 10:32:05 -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 48701826f1 indent
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-28 13:57:03 -07:00
Nikolaj Bjorner dd46224a1d use structured proof hints
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-28 09:37:41 -07:00
Nikolaj Bjorner 8c95dff33b cnf 2022-05-22 09:10:26 -04:00
Nikolaj Bjorner 386c511f54 core opt 2022-05-21 10:27:37 -04:00
Nikolaj Bjorner 7497856ded add ignore int to new arithmetic solvers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-11 15:14:22 -07:00
Nikolaj Bjorner ad2445e423 gauss jordan
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-09 16:33:15 -07:00
Nikolaj Bjorner dcc01b874a prep for pragmas 2022-05-09 11:18:15 -07:00
Nikolaj Bjorner 7def610a69 build warnings
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-08 10:31:11 -07:00
Nikolaj Bjorner 14214c5a07 exposing user propagators over .Net
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-07 11:08:40 -07:00
Nikolaj Bjorner 367bfedab0 add min/max diff in final check
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-04 07:39:38 -07:00
Nikolaj Bjorner c29cfa81ae prep for max/min diff 2022-05-04 02:08:11 -07:00
Nikolaj Bjorner 81d97a81af enable nested ADT and sequences
add API to define forward reference to recursively defined datatype.
The forward reference should be used only when passed to constructor declarations that are used in a datatype definition (Z3_mk_datatypes). The call to Z3_mk_datatypes ensures that the forward reference can be resolved with respect to constructors.
2022-04-27 09:58:38 +01:00
Nikolaj Bjorner 8e2f09b517 #5778 - ensure arrays used inside of extensionality function are treated as shared
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-04-25 17:17:59 +01:00
Nikolaj Bjorner 0a665b0fa0 #5778 2022-04-25 14:27:38 +01:00
Nikolaj Bjorner 489459a1f7 #5778
reprogram flush, mark clauses during reinit as non-redundant.
2022-04-25 11:22:00 +01:00
Nikolaj Bjorner 24baf56e27 fix missing propagation on final 2022-04-24 16:29:25 +01:00
Nikolaj Bjorner ec57d3b15c missing switch cases 2022-04-19 16:20:02 +01:00
Nikolaj Bjorner 3cc9d7f443 improve pre-processing 2022-04-15 12:55:26 +02:00
Nikolaj Bjorner a634876180 sort muxes 2022-04-15 12:55:26 +02:00
Nikolaj Bjorner eb2dd92d37 Merge branch 'master' of https://github.com/z3prover/z3 2022-04-11 17:06:03 +02:00
Nikolaj Bjorner c996a66da0 separate pre-processing, add callback parameter to push/pop in python API 2022-04-11 17:05:59 +02:00
Clemens Eisenhofer b0d8b27f37
Fixed registering expressions in push/pop (#5964)
* Fixed registering expressions in push/pop

* Reused existing function
2022-04-11 16:50:13 +02:00