Questions tagged [alloy]

Alloy from MIT is a declarative specification language for expressing complex structural constraints and behavior in a software system, and a tool for exploring and checking properties of the resulting structures.

Alloy from MIT is a declarative specification language for expressing complex structural constraints and behavior in a software system, and a tool for exploring and checking properties of the resulting structures.

The home page for Alloy is alloy.mit.edu.

Tutorials and documentation

  1. MIT Alloy tutorial page
  2. Official Alloy documentation

Reference books

  1. Software Abstraction by Daniel Jackson
594 questions
4
votes
1 answer

transitive closure in alloy

Can any one here explains how the transitive closure operator works in Alloy in terms of the matrix. I mean what's translation rule for translating closure operator into actual matrix operation.
user1197891
  • 265
  • 1
  • 12
4
votes
1 answer

Disseminating a token in Alloy

I'm following an example in Daniel Jackson's excellent book (Software Abstractions), specifically the example in which he has a token-ring setup in order to elect a leader. I'm attempting to extend this example (Ring election) to ensure that the…
erik
  • 3,810
  • 6
  • 32
  • 63
3
votes
1 answer

How to use a set comprehension for the body of a function

Suppose I have the following signatures: sig A {} sig B {} sig P { a: A, b: B } How can I write a function f, say, such that f returns the set of P for which each member has the value x: A for its a field? Entering the expression {p: P |…
user3887150
3
votes
1 answer

Is there a way to find out what is causing 'No Instance Found' on run in Alloy?

I have written in model using Alloy. However for certain conditions running the predicate to find an instance is failing and it says that no instance can be found. I tried increasing the bound to about 16 instances, yet it does not find any…
Kevin
  • 635
  • 3
  • 9
  • 18
3
votes
0 answers

Why does the name of a signature impact the number of variables?

Using Alloy 4.2, the following Alloy model... sig E {} sig G {} sig D extends G { x: E } sig F1 extends G { x: G } sig F2 extends G { x: G } sig F3 extends G { x: G } sig F4 extends G { x: G } run {} for 3 ... executes with the following…
jacquev6
  • 620
  • 4
  • 18
3
votes
1 answer

How do constraints defined in Alloy result in better software?

Alloy newbie here. I really like creating constraints in Alloy and having the analyzer check that the model is valid per the constraints. But I ask myself, “Are these constraint definitions mere mental gymnastics, or will they help build better…
Roger Costello
  • 3,007
  • 1
  • 22
  • 43
3
votes
1 answer

Using set comprehension on binary relationships in Alloy

I have the following signatures: sig Id, Grade {} sig Foo { result : Id -> Grade } Now I want to create a function that takes in a foo variable and returns all associating Foo -> Grade relationships: fun results[ id : Id ]: Foo -> Grade { …
Yahya Uddin
  • 26,997
  • 35
  • 140
  • 231
3
votes
1 answer

Has Alloy ever been used to specify itself rigorously?

I would like to know if somebody has ever fully specified the Alloy language in Alloy. If such a metamodel exists, is it publicly available?
Loïc Gammaitoni
  • 4,173
  • 16
  • 39
3
votes
1 answer

Provide Alloy with a "pool" of custom Strings

I'm interested in using the String type of Alloy, (especially due to the fact it allows the use of special character). I noticed that in order to add a given String to an instance, it is sufficient to include it in an expression. e.g. fact…
Loïc Gammaitoni
  • 4,173
  • 16
  • 39
3
votes
2 answers

xor operation in Alloy

Is there an xor operation in alloy, if not, how can I define it: I would like to have a predicate named xor that gets two predicates as argument and it holds true when their xor hold true. more elaborately, if I have P1 and P2, I know that I can…
qartal
  • 2,024
  • 19
  • 31
3
votes
1 answer

Running alloy analyzers in parallel?

I would like to refer to the question that can be found at this address : Running alloy analyzers in parallel Is there any ongoing research or conclusion reached on the decomposition of Alloy models, in order to allow a more optimal analysis of…
fifou
  • 65
  • 6
3
votes
1 answer

Solving maximizing problems in Alloy (or other optimization problems)

I've bought and read the Software Abstractions book (great book actually) a couple of months if not 1.5 years ago. I've read online tutorials and slides on Alloy, etc. Of course, I've also done exercises and a few models of my own. I've even…
fred
  • 31
  • 2
3
votes
3 answers

Translating ecore models (accompanying OCL expressions) to alloy specification

I am looking to see if there is any tool or engine which translates Ecore (meta-)models to Alloy specification? if it does this translation considering accompanying OCL expressions, it would be great :) Thx
qartal
  • 2,024
  • 19
  • 31
3
votes
2 answers

Alloy model without GUI

I want to write a scalable program in Python that would create Alloy models depending on the user input. In particular, I want user to input a graph and use Alloy to tell the user whether the graph has an Eulerian path. I have the model ready in…
harshal.c
  • 306
  • 3
  • 12
3
votes
2 answers

Meaning of square brackets in Alloy grammar spec

In the Alloy grammar spec on the Alloy Web site, I find myself confused by the use of square brackets. In a production like the following, things seem clear. specification ::= [module] open* paragraph* I guess the square brackets indicate…
C. M. Sperberg-McQueen
  • 24,596
  • 5
  • 38
  • 65
1
2
3
39 40