add examples
This commit is contained in:
parent
8504ba52f6
commit
42757ddc4f
35 changed files with 1104 additions and 609 deletions
13
examples/semantics/operational/port/rules/README.txt
Normal file
13
examples/semantics/operational/port/rules/README.txt
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
The names of the files in this directory are important.
|
||||
|
||||
A rule must always be named:
|
||||
r_<rule_name>_<lhs|rhs|nac>.od
|
||||
|
||||
It is allowed to have more than one NAC. In this case, the NACs must be named:
|
||||
r_<rule_name>_nac.od
|
||||
r_<rule_name>_nac2.od
|
||||
r_<rule_name>_nac3.od
|
||||
...
|
||||
|
||||
|
||||
For the assignment, you can delete the existing rules (they are nonsense) and start fresh.
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
berthState:RAM_BerthState {
|
||||
RAM_numShips = `get_value(this) == 0`;
|
||||
RAM_status = `get_value(this) == "empty"`;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
berthState:RAM_BerthState {
|
||||
RAM_numShips = `1`;
|
||||
RAM_status = `"served"`;
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# Find any place that has at least one ship:
|
||||
|
||||
placeState:RAM_PlaceState {
|
||||
RAM_numShips = `get_value(this) > 0`;
|
||||
}
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
placeState:RAM_PlaceState {
|
||||
# Decrement number of ships:
|
||||
RAM_numShips = `get_value(this) - 1`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue