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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:47:24+00:00 2026-06-13T01:47:24+00:00

I am using the Z3 SMT solver by Microsoft, and I am trying to

  • 0

I am using the Z3 SMT solver by Microsoft, and I am trying to define constants of a custom sort. It seems like such constants are not unequal by default. Suppose you have the following program:

(declare-sort S 0)

(declare-const x S)
(declare-const y S)

(assert (= x y))
(check-sat)

This will give “sat”, because it is of course perfectly possible that two constants of the same sort are equal. Since I am making model in which constants have to be different from each other, this means that I would need to add an axiom of the form

(assert (not (= x y)))

for every pair of constants of the same sort. I was wondering if there is some way to do this generic, so that each constant of a sort is unique by default.

  • 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-13T01:47:24+00:00Added an answer on June 13, 2026 at 1:47 am

    You can use datatypes to encode enumeration types found in many programming languages. In the following example, the sort S has three elements and they are different from each other.

    (declare-datatypes () ((S a b c)))
    

    Here is a complete example: http://rise4fun.com/Z3/ncPc

    (declare-datatypes () ((S a b c)))
    
    (echo "a and b are different")
    (simplify (= a b))
    
    ; x must be equal to a, b or c
    (declare-const x S)
    
    ; since x != a, then it must be b or c
    (assert (not (= x a)))
    (check-sat)
    (get-model)
    ; in the next check-sat x must be c
    (assert (not (= x b)))
    (check-sat)
    (get-model)
    

    Another possibility is to use distinct.

    (assert (distinct a b c d e))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey, so I'm trying to build a simple lan game using sockets (not tcpclient
I want submit form with some parameters using httpunit. I wrote smt like WebForm
Using Microsoft SQL Server 2005, is there any way to see when a table
Using Java, I would like to take a document in the following format: <tag1>
Hi I am new to Z3 SMT solver. I know you can invoke Z3
Using Jenkins or Hudson I would like to create a pipeline of builds with
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
How do I get the maximum of a formula using smt-lib2? I want something

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.