Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 11:21 Go to next message
Philipp Kutter is currently offline Philipp KutterFriend
Messages: 306
Registered: July 2009
Senior Member
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 15:50 Go to previous messageGo to next message
Eclipse UserFriend
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 18:15 Go to previous messageGo to next message
Philipp Kutter is currently offline Philipp KutterFriend
Messages: 306
Registered: July 2009
Senior Member
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 18:30 Go to previous message
Eclipse UserFriend
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<-----
Previous Topic:Customizing OCL Environment...
Next Topic:eContainer()
Goto Forum:
  


Current Time: Fri Mar 29 09:37:40 GMT 2024

Powered by FUDForum. Page generated in 0.03996 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top