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.
  • : 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.

alloy facts one of the properties

 
Posted on: Sat, 11/12/2011 - 20:37
Joined: 2011-11-12
Points: 6
User is offline
alloy facts one of the properties
I need help in writing a fact in alloy i have this code

abstract sig Table{
breakfast: one breakFast,
lunch: one Lunch,
dinner: one Dinner
}

one sig Free{

}

one sig Reserved{

}

sig breakFast {
breakfastfree:one Free,
breakfastReserved:one Reserved
}

sig Lunch {
Lunchfree:one Free,
LunchReserved:one Reserved

}

sig Dinner  {
Dinnerfree:one Free,
DinnertReserved:one Reserved
}

fact{

  -- All instructors are either Faculty or Graduate Students
 // all i: Instructor | i in Faculty+Graduate

all b : breakFast | no (b.breakfastfree+b.breakfastReserved)
all L : Lunch | no (L.Lunchfree+L.LunchReserved)
all d : Dinner | no (d.Dinnerfree+d.DinnertReserved)

all t1,t2 : Table | t1 != t2 => t1.breakfast != t2.breakfast
all t1,t2 : Table | t1 != t2 => t1.lunch != t2.lunch
all t1,t2 : Table | t1 != t2 => t1.dinner != t2.dinner

//all F:Free | .Free.BreakFast !in T.Reserved.breakFast
//all T:Table | T.Free.Lunch !in T.Reserved.Lunch
//all T:Table | T.Free.Dinnert !in T.Reserved.Dinner

}

pred RealismConstraints []{

#Table = 4

}
run RealismConstraints for 4

all b : breakFast | no (b.breakfastfree+b.breakfastReserved)
all L : Lunch | no (L.Lunchfree+L.LunchReserved)
all d : Dinner | no (d.Dinnerfree+d.DinnertReserved)
those facts are not working and what i want is make a fact that means for every meal there is one choice only either free or reserved not both please any ideas
 
Posted on: Sun, 11/13/2011 - 06:01    #1
Joined: 2011-01-05
Points: 15
User is offline
In your meal signatures you say there is exactly 'one' free and 'one' reserved. I think you have to change those multiplicities to 'lone' and then add facts to say that one of them (either free or reserved) has to exist, and if one of them exists then the other cannot.

Something like this:

all b: breakFast | (some b.breakfastfree or some b.breakfastReserved) and
                   some b.breakfastfree implies no b.breakfastReserved or
                   some b.breakfastReserved implies no b.breakfastfree

P.S. I haven't actually tested this code and there may be more elegant solutions.
 
Posted on: Mon, 11/14/2011 - 06:16    #2
Joined: 2011-11-12
Points: 6
User is offline
thank you this helped me a lot

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