eclipse-viatra / org.eclipse.viatra

Main components of the VIATRA framework
https://eclipse.dev/viatra
Eclipse Public License 2.0
0 stars 1 forks source link

Ordered edges by index #1

Open eclipse-viatra-bot opened 6 months ago

eclipse-viatra-bot commented 6 months ago

| --- | --- | | Bugzilla Link | 398737 | | Status | NEW | | Importance | P3 normal | | Reported | Jan 22, 2013 08:42 EDT | | Modified | Apr 19, 2016 05:25 EDT | | Version | oldinquery | | Reporter | Istvan Rath |

Description

Cloned from: 99: Ordered edges by index\ https://github.com/ujhelyiz/EMF-IncQuery/issues/issue/99

Support ordered edge index path expressions, such as:

pattern myPattern() 
{
  Type.refType[X](Src,Trg);
}

where X would be the index variable (that can be replaced by a constant if necessary.)

eclipse-viatra-bot commented 6 months ago

By Istvan Rath on May 20, 2013 04:35

I'm setting version to "unspecified" as we currently do not (firmly) know when these future ideas will be addressed.

eclipse-viatra-bot commented 6 months ago

By Zoltan Ujhelyi on May 31, 2013 04:19

Henshin has now something similar, see corresponding blog post: http://www.ckrause.org/2013/05/henshin-098-working-with-lists.html

eclipse-viatra-bot commented 6 months ago

By Abel Hegedus on Apr 19, 2016 05:25

Updating to correct milestone.

bergmanngabor commented 4 months ago

Probably the simplest solution would be to introduce a constraint in the language and a new inputkey for a binary relation (element, valueList) identified by a structural feature, where each element is associated with the list of values that eGet() would return. IT is easy for the EMFScope to maintain such relations (if indexed, which should happen on demand), and it is possible to process such lists further in VQL: eval() could call e.g. head, while eval unwind could call a helper method to transform the list to a set of index-value pairs (similar to IterableExtensions.forEach).

Path.steps[](path, stepList);
lastStep == eval(stepList.tail);

Open question: semantics of this relation for elements where the result list is empty.

bergmanngabor commented 4 months ago

The original syntax suggestion is probably better: