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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:35:07+00:00 2026-05-27T11:35:07+00:00

How do I express soft and hard constraints in Z3? I know from the

  • 0

How do I express soft and hard constraints in Z3? I know from the API that it is possible to have assumptions (soft constraints), but I can’t express this when using the command line tool. I am calling it using z3 /smt2 /si

  • 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-05-27T11:35:08+00:00Added an answer on May 27, 2026 at 11:35 am

    Assumptions are available in the SMT 2.0 frontend. They are used to extract unsatisfiable cores. They may be also used to “retract” assumptions.
    Note that, assumptions are not really “soft constraints”, but they can be used to implement them. See the maxsat example (subdir maxsat) in the Z3 distribution.
    That being said, here is an example on how to use assumptions in the Z3 SMT 2.0 frontend.

    ;; Must enable unsat core generation
    (set-option :produce-unsat-cores true)
    (set-option :produce-models true)
    ;; Declare three Boolean constants to "assumptions"
    (declare-const p1 Bool)
    (declare-const p2 Bool)
    (declare-const p3 Bool)
    ;; We assert (=> p C) to track C using p
    (declare-const x Int)
    (declare-const y Int)
    (assert (=> p1 (> x 10)))
    ;; An Boolean constant may track more than one formula
    (assert (=> p1 (> y x)))
    
    (assert (=> p2 (< y 5)))
    (assert (=> p3 (> y 0)))
    
    (check-sat p1 p2 p3)
    (get-unsat-core) ;; produce core (p1 p2)
    
    (check-sat p1 p3) ;; "retrack" p2
    (get-model)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To express that a group can have multiple users, and a user can belong
How can express this javascript object defintion in a way that value of first
In Visual c# Express Edition, is it possible to make some (but not all)
Is it possible to express the following code in such a way that the
Ive been using express checkout API to convert people's accounts on my site to
Possible Duplicate: PHP Regular express to remove <h1> tags (and their content) I have
SQL Express is installed on the machines that I'm going to, but I'm not
I'm using Express.js to create a server to which I can connect using web
Is it possible to express this in a RowFixture in FitNesse for .net: contains(data)
in vb.net 2008 express, is it possible me to specify an image that would

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.