Alloy Community

User login

  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 25.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 26.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 27.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 28.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 29.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 30.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 31.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 32.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 33.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 34.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 25.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 26.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 27.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 28.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 29.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 30.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 31.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 32.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 33.
  • : Function ereg_replace() is deprecated in /afs/csail.mit.edu/proj/alloy/www/data/community/sites/all/themes/Aeon5/advforum/forum-thread.tpl.php on line 34.

Visualization of Solution Instances

 
Posted on: Fri, 09/19/2008 - 15:50
Joined: 2008-09-12
Points: 11
User is offline
Visualization of Solution Instances
Hi to Everyone,

I've just started to experiment with (the last version of) the system and I am finding
a hard time understanding (mathematically speaking)
some of the several solutions presented by visualization tool:

Consider the following script (adapted from the model book (chapter 2) example:
/////////////////////////////////////////////////
module tour/addressBook1e ----- Page 11

sig Name, Addr { }

sig Book {
   addr: Name ->  Addr//I changed here...
}

pred add [b, b': Book, n: Name, a: Addr] {
   b'.addr = b.addr + n->a
}

assert addWorks{
all b, b': Book, n,n': Name, a: Addr |
      add [b, b', n, a] and (n'->a) in b.addr
      implies
        (n'->a) in b'.addr
}
// This command generates an instance similar to Fig 2.4
run add for 3 but 2 Book
check addWorks for 3

Executing 'run add' and going through the several solutions (using next + projection over Book+
magic layout) I observed the following:

1.First Solution:Ok

Book0: pre-state
Book1: pos-state

2. Second Solution: Ok (but)
Book0: pos-state
Book1: pre-state
(I thought Book0 would be always the pre-state)

3. Third Solution: Ok, but  again
Book0: pos-state
Book1: pre-state

4&5. Fourth and Fifth Solution are ok and the same,
showing the two states with the same tuples

6. Sixth Solution: Now we have a problem (at least to me)

In Book0, the pre-state, there is a link from Name0 to Address2 (which has the value "a"),
i.e., (Name0,a), but this tuple is gone in the pos-state (Book1), which has of course
the new link (Name1[(n),Addr2(a)).

In my script above I tried to check this with an assertion,which was found to be true by the
system.

Maybe the question is basic, but I would be grateful for any help on this.

All the best!

Alfio Martini

Executing the assert comand I received (as expected) that assertion holds,
that is to say, if I have a specific link to an address before add, then
adding a new link from a new
 
Posted on: Fri, 09/19/2008 - 18:55    #1
Joined: 2008-05-15
Points: 377
User is offline
Hi Alfio:

>
> I thought Book0 would be always the pre-state
>

No unfortunately that is not true. Book0 and Book1 are just atoms.
There is nothing magical about the name "Book0" versus "Book1",
and there is no ordering relationship among atoms (unless you explicitly specify that they're ordered).

If Alloy finds you a solution, if you look at it and then swap each "Book0" with "Book1",
and each "Book1" with "Book0", you are guaranteed to end up with also a satisfying instance.

>
> In Book0, the pre-state, there is a link from Name0 to Address2
>

Book0 is not always the pre-state.
Book1 is not always the post-state.

With the new understanding, please look at the examples again.
If you have more questions, then since SAT solvers are nondeterministic, I won't see
the instances in the same order you do. So please click XML mode in the visualizer,
then post the XML you see. (So that I can open the XML file in the visualizer and see the same diagram you see)

Syndicate content  

The development of this site is supported by the National Science Foundation under Computing Research Infrastructure Grant No. 0707612.

Theme originally designed by Chris Herberte