Skip to main content
summaryrefslogtreecommitdiffstats
blob: 82b38d3a1208a008b4265dee78e0875068626748 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import 'QVTcore.ecore'

package qvtcore

context BottomPattern
inv VariablesAreBottomVariables:
	variable->forAll(oclIsKindOf(BottomVariable))

context GuardPattern
inv VariablesAreGuardVariables:
	variable->forAll(oclIsKindOf(GuardVariable))

context Mapping
inv DomainsAreCoreDomains:
	domain->forAll(oclIsKindOf(CoreDomain))

inv NestedNameIsNull:
	_context <> null implies name = null

inv RootNameIsNotNull:
	transformation <> null implies name <> null

--context NavigationAssignment
--def: getReferredTargetProperty() : pivot::Property[1] = invalid
--inv TargetPropetyIsSlotProperty: slotExpression.type.conformsTo(getReferredTargetProperty().owningClass)

context OppositePropertyAssignment
def: getReferredTargetProperty() : pivot::Property[1] = targetProperty.opposite

inv CompatibleTypeForValue('OppositePropertyAssignment::CompatibleTypeForValue: ' + value.type?.name + ' must conform to ' + getReferredTargetProperty().type?.name + ' or vice-versa'):
	let propertyType = getReferredTargetProperty().type in
	let valueType = value.type in
		valueType.conformsTo(propertyType)
		or propertyType.conformsTo(valueType)

inv OppositePropertyIsImplicit:
	targetProperty.isImplicit
	
inv TargetPropetyIsSlotProperty:
	slotExpression.type.conformsTo(getReferredTargetProperty().owningClass)

context PropertyAssignment
def: getReferredTargetProperty() : pivot::Property[1] = targetProperty

inv CompatibleTypeForValue('PropertyAssignment::CompatibleTypeForValue: ' + value.type?.name + ' must conform to ' + getReferredTargetProperty().type?.name + ' or vice-versa'):
	let propertyType = getReferredTargetProperty().type in
	let valueType = value.type in
		valueType.conformsTo(propertyType)
		or propertyType.conformsTo(valueType)

inv PropertyIsNotImplicit:
	not targetProperty.isImplicit

inv TargetPropetyIsSlotProperty:
	slotExpression.type.conformsTo(getReferredTargetProperty().owningClass)

context RealizedVariable
inv NonDataTypeForType: not type.oclIsKindOf(ocl::DataType)

context VariableAssignment
inv CompatibleTypeForValue('VariableAssignment::CompatibleTypeForValue: ' + value.type?.name + ' must conform to ' + targetVariable.type?.name + ' or vice-versa'):
	targetVariable.type.conformsTo(value.type)
	or value.type.conformsTo(targetVariable.type)

endpackage

Back to the top