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

19 commits

Author SHA1 Message Date
Bruce Mitchener
5d0dea05aa
Remove empty leaf destructors. (#6211) 2022-07-30 10:07:03 +01:00
Stefan Muenzel
2f5fef92b7
Cache param descrs when modifying solver params (#6156) 2022-07-14 11:11:56 -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
d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00
Nuno Lopes
8fda4f904d API: dont deref already free'd memory on error 2020-06-30 15:04:40 +01:00
Nikolaj Bjorner
55225824ee remove std::mutex, replace by util/mutex.h in api_solver
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-05-18 19:15:11 -07:00
Nikolaj Bjorner
ecba7b3cde fix #1006
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-09 21:47:43 -07:00
Nikolaj Bjorner
fd1974845b fix assert-and-track semantics for smt2 logging
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-09 21:16:41 -07:00
Nikolaj Bjorner
26c34c9193 fix #2623
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-09 15:22:31 -07:00
Nikolaj Bjorner
228b952a50 add also get-consequences
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-08 12:28:45 -07:00
Nikolaj Bjorner
f6f3ca1507 adding SMT2 log file for solver interaction #867
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2019-10-08 11:44:47 -07:00
Bruce Mitchener
76eb7b9ede Use nullptr. 2018-02-12 14:05:55 +07:00
Bruce Mitchener
7167fda1dc Use override rather than virtual. 2018-02-10 09:56:33 +07:00
Nikolaj Bjorner
b19f94ae5b make include paths uniformly use path relative to src. #534
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2017-07-31 13:24:11 -07:00
Nikolaj Bjorner
b080e3a216 garbage collect all api::object references when calling del_context. Request issue #679
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2016-07-13 22:26:21 -07:00
Nikolaj Bjorner
4bc044c982 update header guards to be C++ style. Fixes issue #9
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2015-07-08 23:18:40 -07:00
Leonardo de Moura
8198e62cbd solver factories, cleanup solver API, simplified strategic solver, added combined solver
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-12-11 17:47:27 -08:00
Leonardo de Moura
b70687acc9 cleanning solver initialization, and fixing named assertion support
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-11-02 16:35:08 -07:00
Leonardo de Moura
dcf778a287 Reorganizing the code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-21 14:16:35 -07:00
Renamed from lib/api_solver.h (Browse further)