Home » Modeling » OCL » left-hand-side evaluation of OCL expression: request for advice
left-hand-side evaluation of OCL expression: request for advice [message #46988] |
Wed, 19 December 2007 06:21  |
Eclipse User |
|
|
|
Hi.
The MDT OCL implementation provides great support to
evaluate OCL-expressions over EMF.
There are a number of closed source products, which
use OCL not only to write expressions, but as well
updates. They typically write:
ocl1 := ocl2
One can call this eXecutable OCL (or XOCL).
Evaluation of the right-hand-side expression ocl2 is
what MDT OCL provides us today. I call that rhsEval(_).
The most natural semantics of the left-hand-side
evaluation lhsEval(_) is that the expression ocl1
returns not values, but objects and features, such
that the folowing equation holds:
Let ocl0 be an ocl expression:
lhsEval(ocl0) = (object0, feature0)
=>
rhsEval(ocl0) = object0.eGet(feature0)
Here my question:
What would be the easiest and least intrusive way
of implementing evaluation of left-hand-side expression,
as described above?
Best, Philipp
PS: XOCL versus UML Action Semanics
The role of XOCL is a more abstract version of UML
Action Semantics. While UML Action Semantics is
useful to have more fine granular control over what
is calculated when (needed for embedded systems,
airplanes, e.t.c.) the role of XOCL is to define
state changes of objects as abstract as possible.
I can immagine, that in the future, the same imperative
code may be specified first in XOCL, then in Action
Semantics, and finally in Java/C/Cobol. All of these
abstraction levels are needed, and on all of them,
various static analysis and transformation technologies
are possible. Bottomline: XOCL is not about replacing
UML Action Semantics.
PPS: We would like to have an open definition of Xocl and
XOcl Annotations for EMF. For this we would like to
provide the domain www.xocl.org If anybody is interested,
please let us know.
|
|
|
Re: left-hand-side evaluation of OCL expression: request for advice [message #47019 is a reply to message #46988] |
Wed, 19 December 2007 10:50   |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Philipp,
The QVT languages have assignment semantics, and extend OCL. In fact, the
M3 milestone of MDT OCL significantly refactored its LPG grammar to support
extension of the language by Eclipse's QVT implementations.
The approach I would start with is to create a grammar defining the
assignment operation, then specializing the concrete-syntax parser
(AbstractOCLParser) and AST analyzer (AbstractOCLAnalyzer) to complete the
XOCL parser. Evaluation might be done by extending/wrapping OCL's
EvaluationVisitor; I'm not sure.
You might want to see how Ed Willink extends OCL to implement the Relational
QVT language in his UMLX component of the GMT project.
HTH,
Christian
Philipp W. Kutter wrote:
> Hi.
> The MDT OCL implementation provides great support to
> evaluate OCL-expressions over EMF.
>
> There are a number of closed source products, which
> use OCL not only to write expressions, but as well
> updates. They typically write:
>
> ocl1 := ocl2
>
> One can call this eXecutable OCL (or XOCL).
> Evaluation of the right-hand-side expression ocl2 is
> what MDT OCL provides us today. I call that rhsEval(_).
>
> The most natural semantics of the left-hand-side
> evaluation lhsEval(_) is that the expression ocl1
> returns not values, but objects and features, such
> that the folowing equation holds:
>
> Let ocl0 be an ocl expression:
>
> lhsEval(ocl0) = (object0, feature0)
>
> =>
>
> rhsEval(ocl0) = object0.eGet(feature0)
>
>
>
> Here my question:
> What would be the easiest and least intrusive way
> of implementing evaluation of left-hand-side expression,
> as described above?
>
> Best, Philipp
>
> PS: XOCL versus UML Action Semanics
>
> The role of XOCL is a more abstract version of UML
> Action Semantics. While UML Action Semantics is
> useful to have more fine granular control over what
> is calculated when (needed for embedded systems,
> airplanes, e.t.c.) the role of XOCL is to define
> state changes of objects as abstract as possible.
>
> I can immagine, that in the future, the same imperative
> code may be specified first in XOCL, then in Action
> Semantics, and finally in Java/C/Cobol. All of these
> abstraction levels are needed, and on all of them,
> various static analysis and transformation technologies
> are possible. Bottomline: XOCL is not about replacing
> UML Action Semantics.
>
> PPS: We would like to have an open definition of Xocl and
> XOcl Annotations for EMF. For this we would like to
> provide the domain www.xocl.org If anybody is interested,
> please let us know.
|
|
|
Re: left-hand-side evaluation of OCL expression: request for advice [message #47049 is a reply to message #47019] |
Wed, 19 December 2007 13:15   |
Eclipse User |
|
|
|
Hi, Christian.
True, this is part of QVT too. I forgot this. I'll find out how far they
are and will test their newest code, and try to make the assignment
semantics/implementation of QVT working for us.
Sorry,
Philipp
Christian W. Damus wrote:
> Hi, Philipp,
>
> The QVT languages have assignment semantics, and extend OCL. In fact, the
> M3 milestone of MDT OCL significantly refactored its LPG grammar to support
> extension of the language by Eclipse's QVT implementations.
>
> The approach I would start with is to create a grammar defining the
> assignment operation, then specializing the concrete-syntax parser
> (AbstractOCLParser) and AST analyzer (AbstractOCLAnalyzer) to complete the
> XOCL parser. Evaluation might be done by extending/wrapping OCL's
> EvaluationVisitor; I'm not sure.
>
> You might want to see how Ed Willink extends OCL to implement the Relational
> QVT language in his UMLX component of the GMT project.
>
> HTH,
>
> Christian
>
>
> Philipp W. Kutter wrote:
>
>> Hi.
>> The MDT OCL implementation provides great support to
>> evaluate OCL-expressions over EMF.
>>
>> There are a number of closed source products, which
>> use OCL not only to write expressions, but as well
>> updates. They typically write:
>>
>> ocl1 := ocl2
>>
>> One can call this eXecutable OCL (or XOCL).
>> Evaluation of the right-hand-side expression ocl2 is
>> what MDT OCL provides us today. I call that rhsEval(_).
>>
>> The most natural semantics of the left-hand-side
>> evaluation lhsEval(_) is that the expression ocl1
>> returns not values, but objects and features, such
>> that the folowing equation holds:
>>
>> Let ocl0 be an ocl expression:
>>
>> lhsEval(ocl0) = (object0, feature0)
>>
>> =>
>>
>> rhsEval(ocl0) = object0.eGet(feature0)
>>
>>
>>
>> Here my question:
>> What would be the easiest and least intrusive way
>> of implementing evaluation of left-hand-side expression,
>> as described above?
>>
>> Best, Philipp
>>
>> PS: XOCL versus UML Action Semanics
>>
>> The role of XOCL is a more abstract version of UML
>> Action Semantics. While UML Action Semantics is
>> useful to have more fine granular control over what
>> is calculated when (needed for embedded systems,
>> airplanes, e.t.c.) the role of XOCL is to define
>> state changes of objects as abstract as possible.
>>
>> I can immagine, that in the future, the same imperative
>> code may be specified first in XOCL, then in Action
>> Semantics, and finally in Java/C/Cobol. All of these
>> abstraction levels are needed, and on all of them,
>> various static analysis and transformation technologies
>> are possible. Bottomline: XOCL is not about replacing
>> UML Action Semantics.
>>
>> PPS: We would like to have an open definition of Xocl and
>> XOcl Annotations for EMF. For this we would like to
>> provide the domain www.xocl.org If anybody is interested,
>> please let us know.
>
|
|
|
Re: left-hand-side evaluation of OCL expression: request for advice [message #47079 is a reply to message #47049] |
Wed, 19 December 2007 13:30  |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Philipp,
Don't apologize! More clients of QVT means more clients of OCL, and that's
good for us. :-)
cW
Philipp W. Kutter wrote:
> Hi, Christian.
> True, this is part of QVT too. I forgot this. I'll find out how far they
> are and will test their newest code, and try to make the assignment
> semantics/implementation of QVT working for us.
>
> Sorry,
> Philipp
>
-----8<-----
|
|
|
Goto Forum:
Current Time: Sat May 10 05:50:04 EDT 2025
Powered by FUDForum. Page generated in 0.03278 seconds
|