3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-06-29 09:28:45 +00:00
Commit graph

107 commits

Author SHA1 Message Date
Bruce Mitchener
5014b1a34d Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
Nikolaj Bjorner
f20db3e644 allow for toggling proof and core mode until the first assertion. 2022-07-02 09:31:36 -07:00
Nikolaj Bjorner
815518dc02 add facility for incremental parsing #6123
Adding new API object to maintain state between calls to parser.
The state is incremental: all declarations of sorts and functions are valid in the next parse. The parser produces an ast-vector of assertions that are parsed in the current calls.

The following is a unit test:

```
from z3 import *

pc = ParserContext()

A = DeclareSort('A')

pc.add_sort(A)
print(pc.from_string("(declare-const x A) (declare-const y A) (assert (= x y))"))
print(pc.from_string("(declare-const z A) (assert (= x z))"))

print(parse_smt2_string("(declare-const x Int) (declare-const y Int) (assert (= x y))"))

s = Solver()
s.from_string("(declare-sort A)")
s.from_string("(declare-const x A)")
s.from_string("(declare-const y A)")
s.from_string("(assert (= x y))")
print(s.assertions())
s.from_string("(declare-const z A)")
print(s.assertions())
s.from_string("(assert (= x z))")
print(s.assertions())
```

It produces results of the form

```
[x == y]
[x == z]
[x == y]
[x == y]
[x == y]
[x == y, x == z]
```
Thus, the set of assertions returned by a parse call is just the set of assertions added.
The solver maintains state between parser calls so that declarations made in a previous call are still available when declaring the constant 'z'.
The same holds for the parser_context_from_string function: function and sort declarations either added externally or declared using SMTLIB2 command line format as strings are valid for later calls.
2022-07-01 20:27:18 -07:00
Nikolaj Bjorner
1346a168a1 #5952 2022-04-08 07:00:53 +02:00
Nikolaj Bjorner
5c9f4dc4d7 #5486 - improve type elaboration by epsilon to make common cases parse without type annotation 2021-08-17 16:43:36 -07:00
Nikolaj Bjorner
b1606487f0 fix #5289 2021-05-30 10:32:30 -07:00
Nuno Lopes
f1e0d5dc8a remove a hundred implicit constructors/destructors 2021-05-23 14:25:01 +01:00
Nikolaj Bjorner
673d2d700e more #5164 2021-04-09 13:11:53 -07:00
Nikolaj Bjorner
070eba0fe8 patch for #5164 2021-04-09 12:29:13 -07:00
Nikolaj Bjorner
7aa4fc2d8f fixing #5164
overloading resolution has evolved a bit given how it inter-operates with automatic insertion of coercions, instantiation of polymorphic data-types, arrays as function spaces and other goodies. This is a rewrite of overloading resolution to disentangle the main components and allow them to cascade to give room for each-other.
2021-04-09 11:29:00 -07:00
Nikolaj Bjorner
d9af8ea9fb fix #5113 2021-04-07 12:20:12 -07:00
Nikolaj Bjorner
d03fdf5fed more descriptive naming convention 2021-03-15 15:48:33 -07:00
Nikolaj Bjorner
4b3fecc35e remove dependency on ast from params 2021-03-15 15:40:41 -07:00
Nikolaj Bjorner
e1f71d4932 fix #4904
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-12-18 14:32:16 -08:00
Nikolaj Bjorner
9704733693 fix #4790 2020-11-11 17:37:06 -08:00
Nikolaj Bjorner
ab199dedf9 debug arith/mbi
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-11-02 12:13:19 -08:00
Nikolaj Bjorner
b7ec4489a6
bv fixes and tuning (#4703)
* heap size information

* bv tuning

* fix #4701

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

* throw on set-has-size #4700

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-21 19:54:53 -07:00
Nikolaj Bjorner
6a4261d1af debugging bv
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-09-15 15:37:31 -07:00
Nikolaj Bjorner
b9cbb08858 shuffle dependencies
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-08-29 09:51:39 -07:00
Nikolaj Bjorner
6b380811b8 fix #4524
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-09 15:05:55 -07:00
Nikolaj Bjorner
d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00
Nikolaj Bjorner
af90992858 fix #4404
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-06-03 17:01:36 -07:00
Nikolaj Bjorner
c85113acdb fix #3928
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-12 15:25:08 -07:00
Nikolaj Bjorner
4842c71019 fix #3537
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-04-05 00:38:14 -07:00
Nikolaj Bjorner
18b8089a1e Revert "remove unused random seed parameter on cmd_context"
This reverts commit e2a9cb80e2.
2019-10-29 11:05:50 -07:00
Nikolaj Bjorner
e2a9cb80e2 remove unused random seed parameter on cmd_context
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-22 08:42:18 -07:00
Nikolaj Bjorner
a337a51374 fixes for #2513
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-08-23 23:29:24 +03:00
Nikolaj Bjorner
eea041383d fix #2502
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-08-21 11:11:22 +08:00
Nikolaj Bjorner
45aa8dd39a remove more references
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-02-14 17:06:38 -08:00
Nikolaj Bjorner
96c05b0289 remove reference to deprecated code in cmd_context
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-02-14 17:00:02 -08:00
Nikolaj Bjorner
092c25d596 fix #2007
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-12-10 18:37:30 -08:00
Nikolaj Bjorner
0f0287d129 prepare release notes
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-10-28 17:42:16 -05:00
Nikolaj Bjorner
51a0022450 add recfun to API
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-10-27 11:41:18 -05:00
Nikolaj Bjorner
c7d0d4e191 add c-cube's recursive function theory
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-10-17 04:56:58 -07:00
Nikolaj Bjorner
c4829dfa22 fix #1577 again
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-10-06 09:01:01 -07:00
Nikolaj Bjorner
3bc2213d54 fix #1577
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-10-03 17:43:42 -07:00
Nikolaj Bjorner
c513f3ca09 merge with master
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-25 14:57:01 -07:00
Nikolaj Bjorner
fc719a5ee8 fix diagnostic output #1553
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-03-24 10:37:05 -07:00
Bruce Mitchener
76eb7b9ede Use nullptr. 2018-02-12 14:05:55 +07:00
Bruce Mitchener
b7d1753843 Use override rather than virtual. 2018-02-09 21:19:27 +07:00
Bruce Mitchener
177414c0ee Use const refs to reduce copying.
These are things that have been found by `clang-tidy`.
2018-01-30 21:43:56 +07:00
Nikolaj Bjorner
ece5ad90e0 fix model conversion bugs
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-01-20 17:09:43 -08:00
Nikolaj Bjorner
7b8101c502 fix bugs related to model-converter
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2018-01-17 12:25:24 -08:00
Simon Cruanes
d5e134dd94 wip: add recursive functions 2017-12-25 22:51:39 +01:00
Nikolaj Bjorner
92b4b9e7a7 fix error messaging for parsers
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-11-28 11:14:00 -08:00
Nikolaj Bjorner
7c743b3d16 add direct FromFile method to solvers so that model transformations are loaded along with assertions.
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-11-02 09:25:18 -05:00
Nikolaj Bjorner
fd49a0c89c added facility to persist model transformations
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-11-02 00:05:52 -05:00
Nikolaj Bjorner
caaf0ba33c model-add/del
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-11-01 22:32:22 -05:00
Nikolaj Bjorner
3de8c193ea implementing model updates
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-10-30 16:11:51 -05:00
Nikolaj Bjorner
cab4e4b461 add feature to display benchmark in format seen by SAT solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-09-21 18:32:46 -05:00