Comments (4)
Resolved on stackoverflow.
from z3.
I don't see why this resolves the problem:
a) I still can't create an uninterpreted sort in the C++ API,
b) a segmentation fault is not the expected behaviour.
Ad a).
I suggest adding the following code to z3++.h (which works for me):
(line 181):
/**
\brief Create an uninterpreted sort with given symbol
*/
sort uninterpreted_sort(char const * s);
(line 1564):
inline sort context::uninterpreted_sort(char const *name) {
Z3_symbol r = Z3_mk_string_symbol(m_ctx, name); check_error();
Z3_sort s = Z3_mk_uninterpreted_sort(m_ctx, r); check_error(); return sort(*this, s); }
from z3.
Yes, you can create an uninterpreted sort in the C++ API, in exactly the way that you describe. (Your sort(*this, s)
is what I call wrapping in z3::sort(ctx, ...)
).
The C++ API is not intended to be a fully featured abstraction layer type of API, it's a thin layer on top of the C API that hides the reference counting mechanism for the various object types. For every other purpose, the functions from the C API can be used unmodified.
from z3.
The C++ API is not intended to be a fully featured abstraction layer type
of API, it's a thin layer on top of the C API that hides the reference
counting mechanism for the various object types. For every other purpose,
the functions from the C API can be used unmodified.Thanks for the explanation, now I get it.
—
Reply to this email directly or view it on GitHub
#40 (comment).
from z3.
Related Issues (20)
- Missing universes for uninterpreted sorts HOT 2
- 4.8.5 and 4.13.0 hang on example that works in 4.6.0 (linear constraints with int variables)
- ASSERTION VIOLATION, File: ../src/qe/qsat.cpp Line: 655
- Huge performance issue solved by tiny inlining
- unable to use z3-solver (typescript/javascript) due to import issues HOT 1
- SAT solver runtime changes depending on Z3 version HOT 1
- Incorrect results yet no errors reported (with Datatypes and contexts)
- 4.13.0 hangs on an example that works in 4.8.7 HOT 2
- Solving with regular constraints doesn't finish in unsat case
- Link to C++ and C API HOT 1
- Issue with tactic `qsat` HOT 3
- In C++ code, using solver.unsat_core() yields an empty result. HOT 1
- Seq Theory Map / Fold functionality not exposed via C API HOT 1
- Empty universes HOT 1
- [Question]: z3 py in overflow checking for bit-vectors HOT 1
- Invalid model issue on String theory
- ASSERTION VIOLATION, File: ../src/sat/sat_drat.cpp HOT 2
- Failed to build libz3.so because of missing `LDFLAGS` in `SLIBEXTRAFLAGS` when cross compiling z3 HOT 1
- Remaining deprecated `distutils` in Python scripts.
- Z3_solver_pop() does not clear ASTs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from z3.