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

  • SEARCH
  • Home
  • 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 8454075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T11:55:46+00:00 2026-06-10T11:55:46+00:00

I am implementing a user theory plug-in. I want to test inconsistency in the

  • 0

I am implementing a user theory plug-in. I want to test inconsistency in the user theory to prune some models.

More specifically, in my theory, x is a variable of the user sort of set and f is the function returning the size of the set. I have two assertions: x = set1 OR x = set2 and f x > 2. Suppose the size of set1 is 1 and the size of set2 is 3.

In the search, Z3 goes with x = set1 first. So I can add another assertion f x = 1, which will be inconsistent in the INT part. I want to test the inconsistency so that I can negate the current assignment, let Z3 backtrack and try the other option.

My question is that how I can do that.

I tried 3 approaches:

(1) Add the assertion f x = 1 directly using Z3_theory_assert_axiom(). Then the search terminates immediately returning UNSAT.

(2) I tried to use Z3_check_assumptions() with f x = 1 as the assumption to check with current context. But Z3_check_assumptions() doesn’t allow such a compound formula. So, it can not be the solution.

(3) I firstly push the context, add the assertion f x = 1 with Z3_assert_cnstr(), test the consistency with Z3_check_and_get_model(), and then pop the context just pushed. In the test, if it’s not consistent, I get current assignment with Z3_get_context_assignment(ctx) and assert the negated assignment to trigger the backtrack. What I observe is that Z3 does find the inconsistency but the current assignment only contains assertions about the size part like (= 1 (f x)). Or in other word, the assertions about the user theory like (= x set1) and not (= x set2) is missing. So even I negate the current assignment, after the backtracking, Z3 still tries the x = set1 instead of the other option x = set2.

Where I was wrong? Thanks!

  • 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-10T11:55:47+00:00Added an answer on June 10, 2026 at 11:55 am

    You should use the first option only Z3_theory_assert_axiom() from user theory plugins in the callbacks. You should also only assert tautologies, that is axioms that are true independent of the current assignments. So instead of asserting

    f x = 1
    

    you should assert

    x = set1 => f x = 1
    

    (assuming I understood) because this formula is true regardless.
    You could also assert:

    f set1 = 1
    

    (assuming, again I understood), which would also close branches where y = set1 & f y > 1 for some other variable holds. More generally, you want to assert the strongest theory axiom to prune out as many related branches. But the theory axioms have to be true and not just hold within the local branch of the search.

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

Sidebar

Related Questions

I am implementing a graphical user interface with Morphic / Squeak. Some of the
I'm looking at implementing some form of anonymous user system in Rails. I need
There are many solutions geared toward implementing user-space threads. Be it golang.org goroutines, python's
I'm currently implementing a user registration for an app. I'm tying to change the
I'm implementing a service where each user must have his own json/document database. Beyond
I am implementing a search field where the user can type in a string
I am implementing a method that receive an authentication token from a user. Based
I am implementing in app purchase (non consumable type - songs ).when a user
I am implementing a sound effect that plays while a user is dragging a
I am implementing an back-office application where the user type in prices for products.

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.