Commit d91a41fb authored by Philip Makedonski's avatar Philip Makedonski
Browse files

+ added constraint for gate reference aliases, #209

parent 83c7110e
Loading
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -600,6 +600,15 @@ context GateReference
        self.component.type.allGates()->includes(self.gate)
  

  -- Named 'GateReference's 
  inv NamedGateReferences ('The names of \'GateReference\'s that in turn refer to identical pairs of \'GateInstance\'/\'ComponentInstance\' within a \'TestConfiguration\' shall be identical and the names of \'GateReference\'s that in turn refer to different pairs of \'GateInstance\'/\'ComponentInstance\' shall be different.' + self.toString()):
		self.name.oclIsUndefined() or
		    self.container().container().oclAsType(TestConfiguration).connection.endPoint->forAll(ep | ep.name.oclIsUndefined() or (
		        (self.name = ep.name implies (self.component = ep.component and self.gate = ep.gate)) and 
		        (self.name <> ep.name implies (self.component <> ep.component or self.gate <> ep.gate)))
		    )
		



context Connection
@@ -636,7 +645,7 @@ context TestConfiguration
  

  -- At most one connection between any two 'GateInstance'/'ComponentInstance' pairs
  inv UniqueConnections ('Given the set of \'Connection\'s contained in a \'TestConfiguration\'. There shall be no two \'Connection\'s containing \'GateReference\'s that in turn refer to identical pairs of \'GateInstance\'/\'ComponentInstance\'.' + self.toString()):
  inv UniqueConnections ('Given the set of \'Connection\'s contained in a \'TestConfiguration\', there shall be no two \'Connection\'s containing \'GateReference\'s that in turn refer to identical pairs of \'GateInstance\'/\'ComponentInstance\'.' + self.toString()):
        self.connection->forAll(c1 | 
        	self.connection->one(c2 | c1.endPoint->reject(ep1 | c2.endPoint->exists(ep2 |
		        (ep1.component = ep2.component and ep1.gate = ep2.gate)