3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-11 17:54:43 +00:00
Commit graph

478 commits

Author SHA1 Message Date
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
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
da9382956c use common functionality 2022-06-04 11:36:05 -07:00
Nikolaj Bjorner
1e7a9e3e61 fix #6023 2022-05-08 12:03:13 -07:00
Nikolaj Bjorner
d58de2f8e4 java build
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-05-08 10:20:32 -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
a634876180 sort muxes 2022-04-15 12:55:26 +02:00
Nikolaj Bjorner
011c1b2dd2 remove refs to bare_str 2022-04-09 12:06:27 +02:00
Nikolaj Bjorner
1346a168a1 #5952 2022-04-08 07:00:53 +02:00
Nikolaj Bjorner
d790523c59 #5917
Add model.user_functions (default true) to control whether user functions are added to the model.
2022-03-23 09:49:44 -07:00
Nuno Lopes
43f7636826 remove some copies/moves 2022-03-09 12:46:41 +00:00
Nikolaj Bjorner
d7c7fbb8f1 setting roots breaks relevancy propagation 2022-01-05 21:16:25 -08:00
Nikolaj Bjorner
a44a46a514 fix #5745 2021-12-31 16:41:51 -08:00
Nikolaj Bjorner
fc77345bec breaking change. Enforce append semantics everywhere for parameter updates #5744
Replace semantics doesn't work with assumptions made elsewhere in code.
The remedy is to apply append (override) semantics for parameter changes.
2021-12-30 19:11:14 -08:00
Nikolaj Bjorner
4856581b68 na 2021-12-17 16:40:19 -08:00
Nikolaj Bjorner
4dad414161 fix performance regression after adding user declared functions to model
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-10-28 05:49:15 +02:00
Nikolaj Bjorner
d980ee0533 fix regression in FPNumRef sign 2021-08-18 10:00:22 -07: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
0ba518b0c0 avoid perf abyss for macros
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-07-20 20:07:06 -07:00
Nikolaj Bjorner
ba56bfa656 spelling 2021-05-31 19:04:38 -07:00
Nikolaj Bjorner
b1606487f0 fix #5289 2021-05-30 10:32:30 -07:00
Nikolaj Bjorner
ce6fc21bef fix #5300
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-28 14:17:13 -07:00
Nikolaj Bjorner
c5d4ff9b6f fix #5300
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-05-28 14:16:43 -07:00
Nuno Lopes
f1e0d5dc8a remove a hundred implicit constructors/destructors 2021-05-23 14:25:01 +01:00
Nikolaj Bjorner
17be37a5f6 fix #5287 2021-05-20 15:40:18 -07:00
Nikolaj Bjorner
1a432529dd fix #5272 2021-05-17 11:10:05 -07:00
Nikolaj Bjorner
ff480d1183 fix #5238 2021-05-02 16:09:01 -07:00
Nikolaj Bjorner
aa3975ed87 fix #5235 2021-05-01 10:53:50 -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
Nikolaj Bjorner
a5f957afb3 fixes for type #5164 2021-04-09 14:44:16 -07: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
cebf83c460 fix #5146 2021-04-02 11:48:44 -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
8412ecbdbf fixes to new solver, add mode for using nlsat solver eagerly from nla_core 2021-03-14 13:57:04 -07:00
Nikolaj Bjorner
8f577d3943 remove ast_manager get_sort method entirely 2021-02-02 13:57:01 -08:00
Nikolaj Bjorner
937b61fc88 fix build, refactor 2021-02-02 05:26:57 -08:00
Nikolaj Bjorner
3ae4c6e9de refactor get_sort 2021-02-02 04:45:54 -08:00
Nikolaj Bjorner
d0f1d8f59e move to unicode as stand-alone theory
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-27 05:46:45 -08:00
Nikolaj Bjorner
ecba26beae missing
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2021-01-26 17:07:46 -08:00
Nikolaj Bjorner
c022a3e573 fix reset break 2020-12-19 16:32:54 -08:00
Nikolaj Bjorner
7ce1c38544 'na
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-12-18 14:33:06 -08:00
Nikolaj Bjorner
e1f71d4932 fix #4904
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-12-18 14:32:16 -08:00
Nikolaj Bjorner
4c1fcbaa62 fix #4865 2020-12-06 14:13:46 -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