[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
[qvtd-dev] QVTi Guard Pattern Assignments
|
Hi Horacio
I'm having two problems with the 'decision' that ":=" in guard patterns
is relized by a variable initializer in the AST.
a) my CG makes a mess of them (just needs debugging)
b) OCL validation complains about type errors
If we look at some original QVTc
map primitiveAttribute in umlRdbms refines attributes {
check enforce uml (t:PrimitiveDataType |) {
a.type := t;
}
we see a Bottom pattern predicate. But in QVTi it contributes to:
map classPrimitiveAttributesLM in umlRdbms {
uml (c:Class, t:PrimitiveDataType, a:Attribute |
a.owner = c;
--getAllAttributes(c)->includes(a);
t := a.type;
) {
}
a Guard Pattern Variable Assignment.
The QVT spec is very vague on VariableAssignments but is clear that
PropertyAssignments are bottom pattern only.
The translation to QVTi is really a predicated assignment
a.type.oclIsKindOf(PrimitiveDataType)
t := a.type
so perhaps we define this as the semantics of the Guard VariableAssignment.
t := a.type
avoiding the conflict with the OCL CompatibleVariableInitializer constraint.
Allowing a VariableAssignment in a GuardPattern is a bit of a mess since
CorePattern.bottomPattern is meaningless.
Easier to introduce a new VariablePredicate class (for QVTi only).
Does this make sense?
Regards
Ed