Commit d5806dd9 authored by Martti Käärik's avatar Martti Käärik
Browse files

Constraint fixes.

parent 16227608
Loading
Loading
Loading
Loading
+13 −13
Original line number Diff line number Diff line
@@ -133,15 +133,15 @@ context DataElementMapping

  -- All parameters shall be mapped
  inv ParameterMappings ('If the \'mappableDataElement\' refers to a \'StructuredDataType\', an \'Action\' or a \'Function\' definition, all the \'Parameters\' contained in the \'mappableDataElement\' shall be mapped.' + self.toString()):
        (self.mappableDataElement.oclIsTypeOf(SimpleDataType)
        (self.mappableDataElement.oclIsKindOf(SimpleDataType) or self.mappableDataElement.oclIsKindOf(DataInstance)
      or (self.mappableDataElement.oclIsTypeOf(StructuredDataType)
      and self.mappableDataElement.oclAsType(StructuredDataType).member->forAll(p | 
               self.parameterMapping->exists(m | m.parameter = p)))
      or (self.mappableDataElement.oclIsKindOf(Action) 
      and self.mappableDataElement.oclAsType(Action).formalParameter->forAll(p | 
               self.parameterMapping->exists(m | m.parameter = p)))
               self.parameterMapping->exists(m | m.parameter = p)) 
      and self.parameterMapping->forAll(p | 
               self.mappableDataElement.oclAsType(Action).formalParameter->includes(p.parameter)))
               self.mappableDataElement.oclAsType(Action).formalParameter->includes(p.parameter))))
  


@@ -152,6 +152,11 @@ context SimpleDataInstance
        self.dataType.oclIsKindOf(SimpleDataType)
  

  -- SimpleDataInstance container in EnumDataType
  inv  EnumDataInstanceContainment ('A \'SimpleDataInstance\' whose \'dataType\' property refers to an \'EnumDataType\' shall be contained in that \'EnumDataType\'.' + self.toString()):
        not self.dataType.oclIsKindOf(EnumDataType) or self.oclContainer() = self.dataType
  

  -- [Figure 6.3: Structured data type and instance]


@@ -249,14 +254,9 @@ context CollectionDataInstance


context EnumDataType
  -- SimpleDataInstance container in EnumDataType
  inv  EnumDataInstanceContainment ('A \'SimpleDataInstance\' whose \'dataType\' property refers to an \'EnumDataType\' shall be contained in that \'EnumDataType\'.' + self.toString()):
        OclInvalid
  

  -- No extensions for EnumDataType
  inv  EnumDataTypeExtensions ('The \'extension\' property of an \'EnumDataType\' shall be empty.' + self.toString()):
        OclInvalid
        self.extension.oclIsUndefined()
  


@@ -272,7 +272,7 @@ context DataUse
        not self.resolveDataType().oclIsKindOf(StructuredDataType)
      or self.reduction->isEmpty()
      or self.resolveDataType().oclAsType(StructuredDataType).allMembers()->includes(self.reduction->first().member)
      and self.reduction->select(m | self.reduction->indexOf(m) > 0)->forAll(m |
      and self.reduction->select(m | self.reduction->indexOf(m) > 1)->forAll(m |
              self.reduction->at(self.reduction->indexOf(m)-1).member.dataType.oclIsKindOf(StructuredDataType)
          and self.reduction->at(self.reduction->indexOf(m)-1).member.dataType.oclAsType(StructuredDataType).allMembers()
      ->includes(m.member))
@@ -384,9 +384,9 @@ context LiteralValueUse
  

  -- Integer type for integer value
  inv LiteralValueIntType ('If \'intValue\' is specified then the \'dataType\' is either unspecified or the specified \'DataType\' conforms to predefined type \'Integer\'.' + self.toString()):
  inv LiteralValueIntType ('If \'intValue\' is specified then the \'dataType\' is either unspecified or the specified \'DataType\' is instanceof of \'Time\' or conforms to predefined type \'Integer\'.' + self.toString()):
        not self.intValue.oclIsUndefined() 
          implies (self.dataType.oclIsUndefined() or self.dataType.conformsTo('Integer'))
          implies (self.dataType.oclIsUndefined() or self.dataType.oclIsKindOf(Time) or self.dataType.conformsTo('Integer'))
  

  -- Boolean type for Boolean value
@@ -875,7 +875,7 @@ context Assertion

  -- No 'SpecialValueUse'
  inv AssertionNoSpecialValueUse ('The \'otherwise\' shall not evaluate to an instance of a \'SpecialValueUse\'.' + self.toString()):
        not self.otherwise.oclIsKindOf(SpecialValueUse)
        self.otherwise.oclIsUndefined() or not self.otherwise.oclIsKindOf(SpecialValueUse)
  

  -- [Figure 9.5: Interaction behaviour]