Giter Club home page Giter Club logo

Comments (4)

wintersteiger avatar wintersteiger commented on August 28, 2024

Resolved on stackoverflow.

from z3.

szymtor avatar szymtor commented on August 28, 2024

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.

wintersteiger avatar wintersteiger commented on August 28, 2024

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.

szymtor avatar szymtor commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.