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

The Archive Base Latest Questions

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

This question is strongly related to this and this question. The distinct function of

  • 0

This question is strongly related to this and this question.

The distinct function of Z3

(declare-const a S)
(declare-const b S)
(assert (distinct a b))

allows constraining sets of variables (here a and b) such that all variables in the set must take different values.

My question is: is it also possible to force a variable to take a unique value without explicitly referring to the set of variables from which it should be distinct? Something like

(declare-unique-const a S)
(declare-unique-const b S)
(declare-unique-const c S)

This would be nice in situations where you declare new variables in an iterative process, for example, during program verification.

If it is not possible, I guess one has to keep track of all distinct variables and use that set to emit appropriate distinct (newvar, oldvar1, ..., oldvarn)) constraints.

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

    We can define an auxiliary fresh function f from S to Int, and assert

    f(a_1) = 1
    f(a_1) = 2
    f(a_3) = 3
    ...
    f(a_n) = n
    

    Then, a_1, …, a_n must be different from each other.
    If we want to say that b is also different from all a_is. We just assert

    f(b) = n+1
    

    In this approach, we only have to track the counter.

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

Sidebar

Related Questions

My question is strongly related to this one here . As was posted there,
This question is related to the one I asked here . I'm trying to
This is an offshoot question that's related to another I asked here . I'm
This question is directly related to this SO question I posed about 15 minutes
This question is related to another question I wrote: Trouble using DOTNET from PHP.
I found this Related Topic , but it failed to answer my question. When
This question is strongly connected to this answer to How to reference a generic
Firstly I appreciate that this question could be seen as subjective but I strongly
Somebody advised me to use Entity Framework here when I asked this question: what
Why does this code return false? This question/answer strongly implies that it should return

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.