Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9085639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T21:17:39+00:00 2026-06-16T21:17:39+00:00

See the PyZ3 program at http://rise4fun.com/Z3Py/GTYu . The first call to check() works fine,

  • 0

See the PyZ3 program at http://rise4fun.com/Z3Py/GTYu. The first call to check() works fine, but if we add a constraint to the solver and call check() again, we get an inconsistent model!

sy_i = Bool('sy_i')
s0_v, s1_v, s2_v, sx_v, sy_v = Reals('s0_v s1_v s2_v sx_v sy_v')

c = [s0_v >= 1,
     sx_v >= 1,

     s1_v >= s0_v * sx_v,

     sy_v >= 1,

     Or(Not(sy_i), s1_v == RealVal(0.0)),

     s2_v >= s1_v * sy_v
]

solver = Solver()
solver.add(c)
print solver.check()
print solver.model()

solver.add(True)
solver.check()
print solver.model()

Somebody knows what is going on?

The unstable Z3 version gets the same result.

Additional context:

The program is a simplification of a bigger one that uses the combined nlsat and bool solvers, following the great advice of the answer: Z3 real arithmetics and data types theories integrating not that well

Note that the method seems to work very well, but when trying to add more constraints and reuse the solver this problem arises. Maybe it misdetects the solving method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T21:17:40+00:00Added an answer on June 16, 2026 at 9:17 pm

    The default solver object Solver() is essentially a portfolio of solvers. It also tries to detect the usage pattern (incremental or non-incremental). If more than one check() is executed, it assumes the user is in “incremental” mode, and uses a general purpose incremental solver which is not complete for non-linear arithmetic.

    To force Z3 to always use nlsat, we should create the solver object using

    solver = Tactic('qfnra-nlsat').solver()
    

    If we do that, we can still use push(), pop(), multiple check()‘s. However, nlsat will not “reuse” work from previous check() calls. Here is the new version of your script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

See here: http://jsfiddle.net/zYcJm/ The jQuery should be validating each field to check if they
See following code carefully. Because it works perfectly. Try to add in your application.
See the jsfiddle here: http://jsfiddle.net/x7N66/3/ See the screenshot here: https://i.stack.imgur.com/dC9Gp.png Note the white band
See JsFiddle here http://jsfiddle.net/WtgbV/2/ In words: I have some ajax call, and in the
See http://jsfiddle.net/gazmcghee/v6PSA/ . Clicking the link shows an alert. But changing the version of
See: http://jsfiddle.net/D4eu9/1/ <p><i class=icon-envelope></i> foo@foobar.com</p> <ol> <li>one@foobar.com</li> <li>two@foobar.com</li> <li>three@foobar.com</li> <ol> Say I want icon-envelope
See the jsFiddle link here for the UI I am trying to construct. First,
See this screenshot from Firebug's Net tab: http://www.scdi.org/~avernet/try/firefox-times.png I know that: The time between
See http://www.martenminkema.nl The layers of each entry only gain the height of the text
See http://jsfiddle.net/PdZrt/ Basically I have applied the yui reset and base and am the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.