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 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

How can I express 10 milliseconds using timeval? This is what I have so
In express, I can something like this to have a static server, with directory
To express that a group can have multiple users, and a user can belong
I am using Application Express 3.2.1 and I have an application that when run
In express, I have defined some routes app.post(/api/v1/client, Client.create); app.get(/api/v1/client, Client.get); ... I have
I have an express server that has a button that issues a POST which
I'm using express-form https://github.com/dandean/express-form Does it have the ability to validate an input of
In my NodeJS express application I have app.js that has a few common routes.
I have an NodeJS Express app that is getting really big in just one
Can I use IIS Express to stream video (by using IIS Media Services, for

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.