diff --git a/mCRL2/TrafiicLights/TrafficLights v2_spec.lps b/mCRL2/TrafiicLights/TrafficLights v2_spec.lps new file mode 100644 index 0000000..4470614 Binary files /dev/null and b/mCRL2/TrafiicLights/TrafficLights v2_spec.lps differ diff --git a/mCRL2/TrafiicLights/v2/v2.mcrl2proj b/mCRL2/TrafiicLights/v2/v2.mcrl2proj new file mode 100644 index 0000000..79816d9 --- /dev/null +++ b/mCRL2/TrafiicLights/v2/v2.mcrl2proj @@ -0,0 +1,4 @@ + + v2_spec.mcrl2 + + diff --git a/mCRL2/TrafiicLights/v2/v2_spec.lps b/mCRL2/TrafiicLights/v2/v2_spec.lps new file mode 100644 index 0000000..431f53f Binary files /dev/null and b/mCRL2/TrafiicLights/v2/v2_spec.lps differ diff --git a/mCRL2/TrafiicLights/v2/v2_spec.mcrl2 b/mCRL2/TrafiicLights/v2/v2_spec.mcrl2 new file mode 100644 index 0000000..5d06f0d --- /dev/null +++ b/mCRL2/TrafiicLights/v2/v2_spec.mcrl2 @@ -0,0 +1,55 @@ +%----------------------------------------------------------------------- + +sort + CardinalDirection = struct north | east | south | west; + +map + otherDirection : CardinalDirection -> CardinalDirection; + +eqn + otherDirection(north) = south; + otherDirection(south) = north; + otherDirection(east) = west; + otherDirection(west) = east; + +%----------------------------------------------------------------------- + +sort + Colour = struct red | green | yellow; + +map + nextColour: Colour -> Colour; + +eqn + nextColour(red) = green; + nextColour(green) = yellow; + nextColour(yellow) = red; + + +%------------------------------------------------------------------------ + +act + show : CardinalDirection # Colour; + crossingUnsafe : Colour # Colour # Colour # Colour; + safe : Bool; + emptyAct; + +%------------------------------------------------------------------------ + +proc + TrafficLight(direction : CardinalDirection) = TF(direction, red); + + TF(direction : CardinalDirection, colour : Colour) = + show(direction, colour) . TF(direction, nextColour(colour)) + ; + + Monitor = + emptyAct + ; + + + + +init + TrafficLight(north) || TrafficLight(east) || TrafficLight(south) || TrafficLight(west) || Monitor +; \ No newline at end of file diff --git a/mCRL2/VendingMachine/VendingMachine_spec.lps b/mCRL2/VendingMachine/VendingMachine_spec.lps index 4ef8f62..deea810 100644 Binary files a/mCRL2/VendingMachine/VendingMachine_spec.lps and b/mCRL2/VendingMachine/VendingMachine_spec.lps differ diff --git a/mCRL2/VendingMachine/VendingMachine_spec.lts b/mCRL2/VendingMachine/VendingMachine_spec.lts index 2d52125..a61f92d 100644 Binary files a/mCRL2/VendingMachine/VendingMachine_spec.lts and b/mCRL2/VendingMachine/VendingMachine_spec.lts differ diff --git a/mCRL2/VendingMachine/VendingMachine_spec.mcrl2 b/mCRL2/VendingMachine/VendingMachine_spec.mcrl2 index 6b7cdef..3027a87 100644 --- a/mCRL2/VendingMachine/VendingMachine_spec.mcrl2 +++ b/mCRL2/VendingMachine/VendingMachine_spec.mcrl2 @@ -65,14 +65,15 @@ act % Definition of the processes % proc - VendingMachine = VM(0); VM(credit : Int) = (credit < 200) -> sum c : Coin.accept(c).VM(credit + value(c)) - + (credit > 0) -> returnChange(credit).ReturnChange(credit); + + + (credit > 0) -> returnChange(credit).ReturnChange(credit) + + sum p : Product.( (credit >= price(p)) -> offer(p).serve(p).VM(credit - price(p)) - ) + ); ReturnChange(credit : Int) = @@ -80,8 +81,10 @@ proc ((credit - value(c)) > 0) -> ReturnChange(credit - value(c)) <> VM(credit - value(c)) )); + + % ----------------------------------------------------------------------------------------------------------------------- init - VendingMachine + VM(0) ;