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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:42:23+00:00 2026-06-14T06:42:23+00:00

I read in the alloy website that a signature defines a set. Given this

  • 0

I read in the alloy website that a signature defines a set. Given this definition, I was trying to understand the below alloy code:

enum dooroptype { unlocked, locked, opened}
enum enginetype {on,off}
enum motortype { ismoving, still}
enum key_location { in_car, faralone}

abstract sig state{
  inside,far, near : set Person,
  car_action : motortype,
  engine : enginetype,
  key_position : (Person + key_location),
  door : dooroptype
}

If a signature actually defines a set, then why do we have so many parameters in the signature definiton as a set is a unary relation? If I am wrong, how does one interpret this definition.

  • 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-14T06:42:25+00:00Added an answer on June 14, 2026 at 6:42 am

    I’m taking my first steps in Alloy, but I’ll try to answer. This is what you have in the above code:

    1. dooroptype = set (unary relation) with exactly 3 atoms.
    2. enginetype = set (unary relation) with exactly 2 atoms.
    3. motortype = set (unary relation) with exactly 2 atoms.
    4. key_location = set (unary relation) with exactly 2 atoms.
    5. state = set (unary relation) with 0 or more atoms.
    6. inside, far and near = binary relations defined as state -> set Person
    7. car_action = binary relation defined as state -> one motortype
    8. engine = binary relation defined as state -> one enginetype
    9. key_position = a union of two binary relations state -> Person and state -> key_location (but with multiplicity that constrains each state to appear at most once, so a state can be associated with either a Person or a key_location, but not with both)
    10. door = binary relation defined as state -> dooroptype

    In short, everything defined above is a relation, some are unary, some are binary. The binary relations inside, far and near are defined with set multiplicity, while all the others are defined with a multiplicity of one.

    In other words, a signature is a set, and relations are defined inside the signatures, but are visible globally.

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

Sidebar

Related Questions

I've set up a website that allows the user to add places to a
please read all of this before commenting. I'm currently working on a large website
I need to allow users to upload PDF documents that other users will read.
Is there a standard MBEAN of JMX that can allow me to read files
Read on before you say this is a duplicate, it's not. (as far as
Read about the issue in this stackoverflow question . Still have the same issue
I'm trying to learn how to read from a plist... mine is a simple
I just first want to say, thanks for taking the time to read this!
I have read here that in Java it is possible for two variables having
I have read several forums but am seemingly unable to accomplish this simple task.

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.