Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [qvtd-dev] QVTi Guard Pattern Assignments

Hi Ed,

Yes, it seems that it would be the best approach.

The other one I can think is that property assignments with null target
properties will be considered variable assignments... but it will be hard
to know if it is an error or really a variable assignment.

Regards,

Horacio Hoyos Rodríguez
EngD Student
University of York

http://www.york.ac.uk/docs/disclaimer/email.htm

-----Original Message-----
From: qvtd-dev-bounces@xxxxxxxxxxx [mailto:qvtd-dev-bounces@xxxxxxxxxxx]
On Behalf Of Ed Willink
Sent: 13 August 2013 12:31
To: QVTD developers mailing list
Subject: [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
_______________________________________________
qvtd-dev mailing list
qvtd-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/qvtd-dev


Back to the top