Git Product home page Git Product logo

Comments (2)

heechul avatar heechul commented on June 1, 2024

This error was caused as parser did not implement unary operatior parsing.

The following code solve the problem.

Thanks for reporting.

diff --git a/src/base/z3_solver.cc b/src/base/z3_solver.cc
index 0984129..845809c 100644
--- a/src/base/z3_solver.cc
+++ b/src/base/z3_solver.cc
@@ -510,8 +510,15 @@ static Z3_ast ParseStatement(Z3_context &ctx, map<var_t,Z3_ast>& vars, string& s
pos = *pos + (end - start);
string val = stmt.substr(start, end-start);
ret = Z3_mk_numeral(ctx, const_cast<char
>(val.c_str()), ty);

  • } else if (stmt[_pos] == '-' || stmt[_pos] == '+') {
  • /* unary */
  • Z3_sort ty = Z3_mk_int_sort(ctx);
  • int start = *pos;
  • int end = stmt.find(' ', start) + 1;
  • *pos = *pos + (end - start);
  • string val = stmt.substr(start, end-start);
  • ret = Z3_mk_numeral(ctx, const_cast<char*>(val.c_str()), ty);
    }

DEBUG(fprintf(stderr, "AST: %s\n", Z3_ast_to_string(ctx, ret)));
return ret;
}

from crest-z3.

wexlermi avatar wexlermi commented on June 1, 2024

Thank you, Heechul.

On Mon, Apr 8, 2013 at 8:06 AM, heechul [email protected] wrote:

This error was caused as parser did not implement unary operatior parsing.

The following code solve the problem.

Thanks for reporting.

diff --git a/src/base/z3_solver.cc b/src/base/z3_solver.cc
index 0984129 https://github.com/heechul/crest-z3/commit/0984129..845809c
100644
--- a/src/base/z3_solver.cc
+++ b/src/base/z3_solver.cc
@@ -510,8 +510,15 @@ static Z3_ast ParseStatement(Z3_context &ctx, map&
vars, string& s
pos = *pos + (end - start);
string val = stmt.substr(start, end-start);
ret = Z3_mk_numeral(ctx, const_cast<char
>(val.c_str()), ty);

  • } else if (stmt[_pos] == '-' || stmt[_pos] == '+') {
  • /* unary */
  • Z3_sort ty = Z3_mk_int_sort(ctx);
  • int start = *pos;
  • int end = stmt.find(' ', start) + 1;
  • *pos = *pos + (end - start);
  • string val = stmt.substr(start, end-start);
  • ret = Z3_mk_numeral(ctx, const_cast(val.c_str()), ty); } -
    DEBUG(fprintf(stderr, "AST: %s\n", Z3_ast_to_string(ctx, ret))); return
    ret; }


Reply to this email directly or view it on GitHubhttps://github.com//issues/1#issuecomment-16046569
.

Mike

from crest-z3.

Related Issues (1)

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.