|
@@ -2,15 +2,16 @@ import models/SimpleClassDiagrams as SCD
|
|
|
include "primitives.alh"
|
|
|
|
|
|
SCD PetriNets{
|
|
|
- Class Natural {
|
|
|
- $
|
|
|
- if (bool_not(is_physical_int(self))):
|
|
|
- return "Natural has no integer value"!
|
|
|
- elif (integer_lt(self, 0)):
|
|
|
- return "Natural does not have a positive or zero value"!
|
|
|
- else:
|
|
|
- return "OK"!
|
|
|
- $
|
|
|
+ SimpleAttribute Natural {
|
|
|
+ constraint = $
|
|
|
+ String function constraint(model : Element, name : String):
|
|
|
+ if (bool_not(is_physical_int(model["model"][name]))):
|
|
|
+ return "Natural has no integer value"!
|
|
|
+ elif (integer_lt(model["model"][name], 0)):
|
|
|
+ return "Natural does not have a positive or zero value"!
|
|
|
+ else:
|
|
|
+ return "OK"!
|
|
|
+ $
|
|
|
}
|
|
|
Class Place{
|
|
|
tokens : Natural
|