formal languages - Predefined Set in Alloy -
I am trying to learn alloy imagery. Lang . I can not find a way out of the question. My question relates to the predefined number of elements.
Theater_set must have 4 members in the set. The audience must have 10 members in the set.
is a theater which is available in 4 seats. But there are 10 people who want to see the theater. Only 4 of them can be held. The rest will have to go back home. I am in trouble. Can you help me about it?
Thanks in advance.
Edit Here is my code: edit How can I eliminate that problem? (Sitting on a single seat) Regards Can you show us what You had already done it, and find out where you are absolutely right, there will be an ambiguous answer to the unclear question: "seems declarative". Edit Here it does not work for two reasons: First , you Written by syntax incorrect cardinal operator # and not '#' (I redirect you there: for a good overview of key concepts and related syntax in alloy ) Then , the default scope is 3 when you run an order. The sign defined by the sign will have cardiacity of up to 3. To find relevant cases, you need increase your scope in your case You can specify the number of seats and audiences directly in the scope: There are still other problems in your model, in your current situation, all the people sitting in the same seat Is possible for I think you do not want to do this. Good luck
module example sig Audense {Result: Single Seat} Some Sig Seat {} previous valid notation {'#' seat = 4 '#' audience = 10 all A: audience | Alone a.result} Run valid disbursement
Run a valid subscription for exactly 4 seats, actually 10 audiences
Comments
Post a Comment