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 8348925
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:50:10+00:00 2026-06-09T07:50:10+00:00

I need to reinitialized a real variable based on some some Boolean flag as

  • 0

I need to reinitialized a real variable based on some some Boolean flag as follows.
Alongside changing the truth value of location_next I want to reinitialize x_next with another value. How can I do that?

location, location_next = Bools('location location_next')
x, x_next = Reals('x x_next')
...
location_next == If(And(Not(location), x_next >= 12),
                    True,
                    If(And(location, x_next <= 0), False, location))
  • 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-09T07:50:12+00:00Added an answer on June 9, 2026 at 7:50 am

    The function If (in the Z3 API) can be also used to create non-Boolean expressions.
    We must have that for every If(c, t1, t2), c has sort Boolean, and t1 and t2 have the same sort (type) S. In this case, If(c, t1, t2) is will produce a Z3 expression of sort S. Here is a small example:

    x, y = Reals('x y')
    print If(x > 0, x + 1, y - 1)
    

    Here is a link with the example above: http://rise4fun.com/Z3Py/V4e

    In the following example, we have a formula such that x_next is equal to x+1 when location is False and x >= 12, is equal to x-1 when location is True and x <= 0, and is equal to x otherwise.

    x_next == If(And(Not(location), x >= 12),
                 x+1,
                 If(And(location, x <= 0), x-1, x))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some small help with some SQL. I am using a VARCHAR value to
Need some regular expressions help. So far I have my code working to allow
Need some help... I have jasperserver 4.1 installed on my ubuntu. It runs via
Need to set some attributes of button. For example Checked. I guess it is
Need some advice to use iframe for widget or not. Will some addons/plugin block
Need some insight on how this works I have the following piece of code
need value advice and help me to sort out the following issue. function max_key($array)
Need some help. I have a table with some columns..like name , phone etc...
Need some help for creating a File and String search engine. The program needs
Hi I am having difficulty changing some attributes in jquery mobile dynamically for some

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.