| package org.eclipse.viatra.examples.cps.tests.queries |
| |
| import "http://www.eclipse.org/emf/2002/Ecore" |
| import "http://org.eclipse.viatra/model/cps" |
| |
| |
| pattern trickyJoin1(ht) = { |
| find helper(ht); |
| Identifiable.identifier(ht, id1); |
| Identifiable.identifier(ht, id2); |
| check(id1 != id2 + "asdf"); |
| } |
| |
| pattern trickyJoin2(ins1, ins2, cartesian) = { |
| find helper2(ins1, ins2); |
| find helper2(ins2, ins1); |
| CyberPhysicalSystem(cartesian); |
| } |
| |
| pattern trickyJoin3(ins1, ins2, cartes, ian) = { |
| find helper2(ins1, ins2); |
| find helper2(ins1, ins2); |
| find helper2(cartes, ian); |
| check(ins1.toString + ins2.toString + cartes.toString + ian.toString != "asdf"); |
| } |
| |
| pattern trickyJoin4(ins1, ins2, ins3, cartes, ian) = { |
| find helper2(ins1, ins2); |
| find helper2(ins1, ins3); |
| CyberPhysicalSystem.identifier(cartes, ian); |
| check(ins1.toString + ins2.toString + ins3.toString + ian != "asdf"); |
| } |
| |
| pattern trickyJoin5(id) = { |
| find helper2(id, id); |
| } |
| |
| pattern trickyJoin6(id) = { |
| find helper2(id, _); |
| find helper2(id, id); |
| } |
| |
| |
| |
| pattern helper(ht: HostType) = { |
| HostType.defaultCpu(ht, 0); |
| } |
| |
| pattern helper2(ins1, ins2) = { |
| find helper(ht); |
| HostType.instances.identifier(ht, ins1); |
| HostType.instances.identifier(ht, ins2); |
| } |
| |