eclipse-qvtd / org.eclipse.qvtd

Eclipse Public License 2.0
0 stars 0 forks source link

[scheduler] Incorrect transformation execution #189

Closed eclipse-qvtd-bot closed 16 hours ago

eclipse-qvtd-bot commented 16 hours ago

| --- | --- | | Bugzilla Link | 496420 | | Status | RESOLVED FIXED | | Importance | P3 normal | | Reported | Jun 20, 2016 11:49 EDT | | Modified | Nov 24, 2016 13:17 EDT | | Reporter | Adolfo Sanchez-Barbudo Herrera |

Description

Branches: \ ocl-master\ qvtd-asanchez/miniocl\ \ Repro:

[1] \org.eclipse.qvtd.doc.minioclcs.xtext.tests\src\org\eclipse\qvtd\doc\tests\MiniOCLCSParsingTest.xtend\ [2] \org.eclipse.qvtd.doc.minioclcs.xtext.tests__synthetic0.mocl.xmi

eclipse-qvtd-bot commented 16 hours ago

By Ed Willink on Jun 20, 2016 15:29

Please refresh the commit so that

--

The problem is a cyclic dependency through a helper:

map m_PropertyCallExp_NameExpCS_Variable in MiniOCLCS2AS_qvtp_qvtcas\ {\ check leftCS(lNameExpCS : NameExpCS) {}\ enforce rightAS() {\ realize rPropertyCallExp : PropertyCallExp\ }\ where (not lNameExpCS.isPropCallExpWithExplicitSource();\ lNameExpCS.isPropCallExpWithImplicitSource();\ not lNameExpCS.isVariableExp(); ) {\ lNameExpCS.ast := rPropertyCallExp;\ }\ }

def : isVariableExp() : Boolean =\ roundedBrackets = null \ and not isNameExpOfACallExpCS()\ and expName.path->size() = 1 -- If using a qualified name, we assume we are looking for a fully qualified property\ and lookupVariable() <> null

def : lookupVariable() : as::Variable = \ ast.lookupVariable(expName.path->first().pathName)

lNameExpCS.ast is used in the predicate for its assignment.

In principle, use of the AS must be done with care. In this case it is the unnecessary use of ast as the lookupVariable source that is the problem.

In practice, there should be a diagnostic about the insoluble dependency loop.

eclipse-qvtd-bot commented 16 hours ago

By Ed Willink on Jun 20, 2016 15:44

(In reply to Ed Willink from comment #1)

In practice, there should be a diagnostic about the insoluble dependency loop.

o_isVariableExp(minioclcs_NameExpCS)-1-create.dot

shows almost no dependencies at all. No dependencies => no loop.

eclipse-qvtd-bot commented 16 hours ago

By Ed Willink on Jun 22, 2016 11:10

(In reply to Ed Willink from comment #2)

o_isVariableExp(minioclcs_NameExpCS)-1-create.dot

shows almost no dependencies at all. No dependencies => no loop.

There seems to be a confusion wrt Operation/OperationCallExp in the DependencyAnalyzer; distinct Operation specializations are simulated for each permutation of hidden call dependencies. The OperationCallExp is dependent on all the complexities of the source/arguments. The Operation however is only dependent on the direct source/argument types. However fixing this should simplify dramatically. It should not however find find a lost dependency; another bug.

The DependencyAnalyzer debug diagnostics are very hard to understand; time for another go.

eclipse-qvtd-bot commented 16 hours ago

By Ed Willink on Jul 06, 2016 11:55

(In reply to Ed Willink from comment #3)

There seems to be a confusion wrt Operation/OperationCallExp in the DependencyAnalyzer;

Indeed and once this is fixed, a bug in the PropertyCall analysis shows up. The call is possible for both sub and super types.

eclipse-qvtd-bot commented 16 hours ago

By Ed Willink on Jul 06, 2016 14:17

Fixing the DependencyAnalyzer makes no difference to the lack of a getA() body. However isVariableExp() now has many sensible dependencies, but not NameExpCS.ast. It looks as if the folded middle is being ignored.

eclipse-qvtd-bot commented 16 hours ago

By Adolfo Sanchez-Barbudo Herrera on Jul 12, 2016 13:42

Hi Ed,

Looking at this. I've created a minor workaround, and the scheduler still seems not to properly do its job.

Concerning the lookup that is done to disambiguate, now it is performed from its parent. In this way, the cyclic dependency should not happen anymore, i.e. to create the AS element corresponding to a NameExpCS, it previously required the oen AS element to exist. Now, this should not happen. However, the lookup is performed from the corresponding parent getA() operation, which has not initialized its ownedBody property, hence, transformation failure.

Please fetch the new asanchez/miniocl (don't get distracted by not seeing a couple of commits you had done, as they have been fixed up with previous commits). The generation of the CGed java tx should also be free of compilation errors, now.


I've also activated the debug. Unfortunately, I don't see how to benefit from this yet. In the console I see the following erroneous outputs:

Failed to generate 'o_lookupvariable(miniocl_oclexpression,minioclcs:-1-create.dot' : no protocol: o_lookupvariable(miniocl_oclexpression,minioclcs:-1-create.dot\ Failed to generate 'o_lookupvariable(miniocl_oclexpression,minioclcs:-1-create.graphml' : no protocol: o_lookupvariable(miniocl_oclexpression,minioclcs:-1-create.graphml

How should I interpret the message, as a missing file ? Anything else ?

In the generated graphs folder, I see a similarly named:

o_isVariableExp(minioclcs_NameExpCS,minioclcs_Na-1-create.graphml

I presume it is not the same one, but if I open it, I can't figure out what is going wrong there.

Additionally, just to let you know that some .graphml files seem to be corrupted as the tool does not open them. For instance, if I try to open the following graph:

m_NameExpCS_ast_expName_1-1-create.graphml

I get the error:

"yEd has encountered the following error: Could not import file m_NameExpCS_ast_expName_1-1-create.graphml."

This happens with many of them.

eclipse-qvtd-bot commented 16 hours ago

By Ed Willink on Jul 12, 2016 14:35

(In reply to Adolfo Sanchez-Barbudo Herrera from comment #6)

In the console I see the following erroneous outputs:

Failed to generate 'o_lookupvariable(miniocl_oclexpression,minioclcs:-1-create.dot' : no protocol: o_lookupvariable(miniocl_oclexpression,minioclcs:-1-create.dot Failed to generate 'o_lookupvariable(miniocl_oclexpression,minioclcs:-1-create.graphml' : no protocol: o_lookupvariable(miniocl_oclexpression,minioclcs:-1-create.graphml

How should I interpret the message, as a missing file ? Anything else ?

It's Windows complaining about a ":" in a file name. I fixed it, but the fix seems to have got lost. I think it's benign, except the graph is not produced.

"yEd has encountered the following error: Could not import file m_NameExpCS_ast_expName_1-1-create.graphml."

It may be worth deleting the temp tree and rerunning; stale files can persist and confuse. (my tests generate to the bin folder and so clean up with a rebuild.)

eclipse-qvtd-bot commented 16 hours ago

By Adolfo Sanchez-Barbudo Herrera on Jul 12, 2016 15:02

(In reply to Ed Willink from comment #7)\

"yEd has encountered the following error: Could not import file m_NameExpCS_ast_expName_1-1-create.graphml."

It may be worth deleting the temp tree and rerunning; stale files can persist and confuse. (my tests generate to the bin folder and so clean up with a rebuild.)

Have you tried that particular graph ? Because I removed the graphs folder, before looking for an/that specific graph file.

Regards,\ Adolfo.

eclipse-qvtd-bot commented 16 hours ago

By Ed Willink on Nov 10, 2016 04:01

Mini OCL has been promoted to master with some tests, so I'm unclear if any of the comments describe issues that still need to be addressed.

eclipse-qvtd-bot commented 16 hours ago

By Ed Willink on Nov 24, 2016 13:17

DependencyAnalyzer substantially fixed.