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

2319 commits

Author SHA1 Message Date
Nikolaj Bjorner a66095bb08 fix the path to ../build/z3-built
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-20 22:36:34 -07:00
Nikolaj Bjorner dc9565990c did I mess up wasm paths in jest - or not?
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-20 22:15:22 -07:00
Nikolaj Bjorner 37008226c3 did I mess up wasm paths in jest?
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-20 22:14:21 -07:00
Nikolaj Bjorner 5b219aab76 add mutual recursive datatypes to c++ API #6179
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-20 20:32:00 -07:00
Nikolaj Bjorner 2e13c0bf41 add API and example for one dimensional algebraic datatype #6179 2022-07-20 19:43:18 -07:00
Nikolaj Bjorner 81cb575c22 simplify
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-19 22:58:12 -07:00
Nikolaj Bjorner 2e52029114 add command-line overwrite capability to setup.py
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-19 22:53:25 -07:00
Nikolaj Bjorner 2c8df54b70 enable fresh for python wrapper for user-propagator
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-19 13:48:44 -07:00
Nikolaj Bjorner dead0c9de2 reverting relative path
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-18 11:47:57 -07:00
Nikolaj Bjorner afcfc80c42 the relative path seems out of sync with how it is set up in node.ts 2022-07-18 11:21:16 -07:00
Nikolaj Bjorner 7f1893d781 add missing MkSub to NativeContext
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-18 10:21:27 -07:00
Nikolaj Bjorner 393c63fe0c fix #6114 2022-07-18 09:33:39 -07:00
Nikolaj Bjorner 527914db05 update documentation to use latest conventions
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-17 11:49:28 -07:00
Nikolaj Bjorner b5a89eb4ab add missing generation of z3.z3 for pydoc and add some explanations to logging function declaration 2022-07-17 11:03:55 -07:00
Nuno Lopes 6e5ced0080 optimizations to api ctx ref counting 2022-07-17 11:44:35 +01:00
Nikolaj Bjorner eb2ee34dfe fix typo
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-16 16:58:57 -07:00
Nikolaj Bjorner aefd336c18 set OCaml default behaivor to enable concurrent dec ref #6160
Add Z3_enable_concurrent_dec_ref to the API.
It is enables behavior of dec_ref functions that are exposed over the API to work with concurrent GC. The API calls to dec_ref are queued and processed in the main thread where context operations take place (in a way that is assumed thread safe as context operations are only allowed to be serialized on one thread at a time).
2022-07-16 16:49:39 -07:00
Nikolaj Bjorner 6688c1d62a prepare for #6160
The idea is to set _concurrent_dec_ref from the API
(function not yet provided externally, but you can experiment with it by setting the default of m_concurrent_dec_ref to true).
It then provides concurrency support for dec_ref operations.
2022-07-15 03:53:15 -07:00
Stefan Muenzel 2f5fef92b7
Cache param descrs when modifying solver params (#6156) 2022-07-14 11:11:56 -07:00
Nikolaj Bjorner 49b7e9084f Merge branch 'master' of https://github.com/z3prover/z3 2022-07-11 09:26:34 -07:00
Stefan Muenzel 99212a2726
Use int64 for ocaml api functions that require it (#6150)
* Use int64 for ocaml api functions that require it

Signed-off-by: Stefan Muenzel <source@s.muenzel.net>

* Use elif

Signed-off-by: Stefan Muenzel <source@s.muenzel.net>
2022-07-11 09:25:05 -07:00
Nikolaj Bjorner 9dd529bb12 missing initialization of List for cmd interpreter 2022-07-11 08:17:38 -07:00
Kevin Gibbons 0d4169533a
fix js distributable (#6139) 2022-07-06 10:59:01 -07:00
Nikolaj Bjorner 02a92fb9e9 revert to use GCHandle for UserPropagator
avoids using a global static array
2022-07-03 17:00:40 -07:00
Nikolaj Bjorner bb966776b8
Update UserPropagator.cs 2022-07-02 13:15:05 -07:00
Nikolaj Bjorner d37ed4171d
Update Expr.cs
Add a Dup functionality that allows extending the life-time of expressions that are passed by the UserPropagator callbacks (or other code).
2022-07-02 13:12:54 -07:00
Nikolaj Bjorner 54b16f0496
Update NativeStatic.txt
not so automatically generated
2022-07-02 13:04:09 -07:00
Nikolaj Bjorner 4d23f2801c ml pre
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-01 20:35:47 -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 3c94083a23 fix doc errors
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-07-01 15:29:44 -07:00
Max Levatich 12e7b4c3d6
fix gc'ed callbacks in .NET propagator api (#6118)
Co-authored-by: Maxwell Levatich <t-mlevatich@microsoft.com>
2022-06-28 19:22:41 -07:00
Nikolaj Bjorner 79778767b0 add doc string 2022-06-28 14:25:43 -07:00
Nikolaj Bjorner 798a4ee86e use IEnumerator and format 2022-06-28 14:24:05 -07:00
Nikolaj Bjorner 556f0d7b5f use static list to connect managed and unmanaged objects 2022-06-28 14:09:22 -07:00
Nikolaj Bjorner 820c782b5e pinned semantics 2022-06-28 13:03:52 -07:00
Nikolaj Bjorner 9836d5e6fc missing public 2022-06-28 12:46:29 -07:00
Kevin Gibbons 352666b19f
JS api: fix type for from (#6103)
* JS api: fix type for from

* whitespace
2022-06-22 14:51:40 -07:00
Kevin Gibbons c15a000d9b
Make high-level JS API more idiomatic/type-safe (#6101)
* make JS api more idiomatic

* make JS api type-safe by default

* use strings, not symbols, for results

* add toString

* add miracle sudoku example

* ints should be ints

* add error handling

* add missing Cond to Context

* fewer side-effecting getters
2022-06-22 09:26:44 -07:00
Nikolaj Bjorner 8234eeae40 unbreak
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-22 09:03:32 -07:00
Nikolaj Bjorner 3189544050 next split
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2022-06-22 09:03:32 -07:00
Nikolaj Bjorner f24c5ca99a #6095
arrays that are interpreted using as-array should be reflected back to store expressions
2022-06-21 12:42:44 -07:00
Nikolaj Bjorner d792d30e88 Update NativeContext.cs
TraceToFile does not correspond to the functionality of enable_trace. Z3_enable_trace tags a trace tag as input. It can be invoked multiple times with different tags. The debug tracing then shows logs with the corresponding tags.
2022-06-21 09:09:42 -07:00
Nikolaj Bjorner b254f4086b Separate out native static content for Java
Make it easier to add native methods for callbacks (for user propagator) #6097

The Java User propagator wrapper should define a base class with virtual methods that can be invoked from functions defined in NativeStatic.txt
2022-06-21 09:09:42 -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
Olaf Tomalka 7fdcbbaee9
Add high level bindings for js (#6048)
* [Draft] Added unfinished code for high level bindings for js

* * Rewrote structure of js api files
* Added more high level apis

* Minor fixes

* Fixed wasm github action

* Fix JS test

* Removed ContextOptions type

* * Added Ints to JS Api
* Added tests to JS Api

* Added run-time checks for contexts

* Removed default contexts

* Merged Context and createContext so that the api behaves the sames as in other constructors

* Added a test for Solver

* Added Reals

* Added classes for IntVals and RealVals

* Added abillity to specify logic for solver

* Try to make CI tests not fail

* Changed APIs after a round of review

* Fix test

* Added BitVectors

* Made sort into getter

* Added initial JS docs

* Added more coercible types

* Removed done TODOs
2022-06-14 09:55:58 -07:00
Dominic Steinhöfel 46bc726391
Better error message for mismatching sorts in substitutions in z3.substitute (#6093) 2022-06-13 13:46:30 -07:00
Nikolaj Bjorner e468386359 #5656
guard __del__ operator by checking if library was unloaded.
2022-06-08 09:59:29 -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
Christoph M. Wintersteiger 33454193d4
Change FP default rounding mode in the Python API 2022-06-04 08:45:52 +01:00