2021-10-20 14:57:21 +00:00
|
|
|
import 'PetriNet.ecore'
|
2021-10-20 14:36:15 +00:00
|
|
|
|
|
|
|
package petrinet
|
|
|
|
|
|
|
|
context Network
|
|
|
|
inv validName('Invalid name: ' + self.name):
|
|
|
|
self.name.matches('[A-Za-z_][A-Za-z0-9_]*')
|
|
|
|
inv uniqNamesNode: self.nodes
|
|
|
|
->forAll(n1, n2 | n1 = n2 or n1.name <> n2.name)
|
|
|
|
|
|
|
|
context Node
|
|
|
|
inv nameMin2Char: self.name.matches('..+')
|
|
|
|
inv weirdName: not self.name.matches('([0-9]*|_*)')
|
|
|
|
|
|
|
|
context Place
|
|
|
|
inv negativeQuantity: self.tokens >= 0
|
|
|
|
|
|
|
|
context Arc
|
|
|
|
inv negativeQuantity: self.weight >= 0
|
|
|
|
|
|
|
|
endpackage
|