eclipse / epsilon

Epsilon is a family of Java-based scripting languages for automating common model-based software engineering tasks, such as code generation, model-to-model transformation and model validation, that work out of the box with EMF (including Xtext and Sirius), UML (including Cameo/MagicDraw), Simulink, XML and other types of models.
https://eclipse.org/epsilon
Eclipse Public License 2.0
55 stars 11 forks source link

Variable leakage in EPL #13

Open kolovos opened 1 year ago

kolovos commented 1 year ago

In this example, referring to p1 in the TaskLeader pattern should throw an exception but it doesn't because presumable the variable leaks from the Collaborators pattern.

// Find pairs of people that work
// on at least one common task
pattern Collaborators
    p1, p2 : Person {

    match: Task.all.exists(t|t.effort.person.
        includesAll(Sequence{p1, p2}))
}

// Pair tasks with their leaders
pattern TaskLeader 
    t : Task,
    p : Person from: t.effort.person {

    match: t.effort.sortBy(e|-e.percentage).
        first()?.person = p1 
}