From 60f01f46ba232ed6416054f0a6115cb2a9b70b4e Mon Sep 17 00:00:00 2001 From: OszkarSemerath Date: Sat, 10 Jun 2017 19:05:05 +0200 Subject: Migrating Additional projects --- .../domains/transima/fam/patterns/pattern.vql | 114 +++++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.transima.fam/queries/hu/bme/mit/inf/dslreasoner/domains/transima/fam/patterns/pattern.vql (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.transima.fam/queries') diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.transima.fam/queries/hu/bme/mit/inf/dslreasoner/domains/transima/fam/patterns/pattern.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.transima.fam/queries/hu/bme/mit/inf/dslreasoner/domains/transima/fam/patterns/pattern.vql new file mode 100644 index 00000000..60df0bef --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.transima.fam/queries/hu/bme/mit/inf/dslreasoner/domains/transima/fam/patterns/pattern.vql @@ -0,0 +1,114 @@ +package hu.bme.mit.inf.dslreasoner.domains.transima.fam.patterns + +import epackage "FAM"; + +@Constraint(message="terminatorAndInformation", severity="error", key={T}) +pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { + FunctionalOutput.outgoingLinks(Out,I); + FunctionalOutput.terminator(Out,T); +} or { + InformationLink.to(I,In); + FunctionalInput.terminator(In,T); +} + +@QueryBasedFeature +pattern type(This : Function, Target : FunctionType) = { + find rootElements(_Model, This); + Target == FunctionType::Root; +} or { + neg find parent(_Child, This); + neg find rootElements(_Model, This); + Target == FunctionType::Leaf; +} or { + find parent(This, _Par); + find parent(_Child, This); + Target == FunctionType::Intermediate; +} + +pattern rootElements(Model: FunctionalArchitectureModel, Root : Function) = { + FunctionalArchitectureModel.rootElements(Model, Root); +} + +pattern parent(Func : Function, Par : Function) = { + Function.parent(Func, Par); +} + +@QueryBasedFeature +pattern model(This:FunctionalElement, Target: FunctionalArchitectureModel) { + FunctionalElement(This); + FunctionalArchitectureModel(Target); +} + +pattern hasRoot(F : Function) { + find rootElements(_Model, F); +} +pattern hasInt(F : Function) { + neg find parent(_Child, F); + neg find rootElements(_Model, F); +} +pattern hasLeaf(F : Function) { + find parent(F, _Par); + find parent(_Child, F); +} + +@Constraint(message="noRoot", severity="error", key={fam}) +pattern noRoot(fam: FunctionalArchitectureModel) { + FunctionalArchitectureModel(fam); + neg find hasRoot(_); +} +@Constraint(message="noIntermediate", severity="error", key={fam}) +pattern noInt(fam: FunctionalArchitectureModel) { + FunctionalArchitectureModel(fam); + neg find hasInt(_); +} +@Constraint(message="noLeaf", severity="error", key={fam}) +pattern noLeaf(fam: FunctionalArchitectureModel) { + FunctionalArchitectureModel(fam); + neg find hasLeaf(_); +} + + +/* +@QueryBasedFeature +pattern model(This : FunctionalElement, Target : FunctionalArchitectureModel) = { + find parent+(This, Parent); + find rootElements(Target, Parent); +} or { + find rootElements(Target, This); +} + +pattern interfaceData(FI : FunctionalInterface, FD : FunctionalData) = { + FunctionalInterface.data(FI, FD); +} + +@QueryBasedFeature +pattern inputs(This : FunctionalInterface, Target : FunctionalInput) = { + find interfaceData(This, Target); +} + +@QueryBasedFeature +pattern outputs(This : FunctionalInterface, Target : FunctionalOutput) = { + find interfaceData(This, Target); +} + +@QueryBasedFeature +pattern outgoingLinks(This : FunctionalElement, Target : InformationLink) = { + FunctionalElement.interface.outputs(This, Output); + InformationLink.from(Target, Output); +} + +@QueryBasedFeature +pattern incomingLinks(This : FunctionalElement, Target : InformationLink) = { + FunctionalElement.interface.inputs(This, Input); + InformationLink.to(Target, Input); +} + +@QueryBasedFeature +pattern connects(This : FunctionalElement, Target : FunctionalElement) = { + FunctionalElement.outgoingLinks(This,Link); + FunctionalElement.incomingLinks(Target,Link); +}*/ + +/*pattern frequency(a: Function, b : EInt) { + Function.minimumFrequency(a,b); +}*/ -- cgit v1.2.3-70-g09d2