From 9b83e33c055660f6de218d1b672f67734675f1f6 Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Tue, 7 May 2019 11:53:38 -0400 Subject: Try to restructure satellite case study --- .../configs/generation.vsconfig | 2 +- .../ecore-gen/satellite/CommSubsystem.java | 27 + .../ecore-gen/satellite/CommunicatingElement.java | 17 +- .../ecore-gen/satellite/CubeSat.java | 16 + .../ecore-gen/satellite/CubeSat3U.java | 2 +- .../ecore-gen/satellite/CubeSat6U.java | 2 +- .../ecore-gen/satellite/SatellitePackage.java | 162 +++- .../ecore-gen/satellite/Spacecraft.java | 1 - .../satellite/impl/CommSubsystemImpl.java | 91 +++ .../satellite/impl/CommunicatingElementImpl.java | 78 +- .../ecore-gen/satellite/impl/CubeSat3UImpl.java | 2 +- .../ecore-gen/satellite/impl/CubeSat6UImpl.java | 2 +- .../ecore-gen/satellite/impl/CubeSatImpl.java | 37 + .../satellite/impl/SatellitePackageImpl.java | 59 +- .../ecore-gen/satellite/impl/SpacecraftImpl.java | 12 +- .../satellite/util/SatelliteAdapterFactory.java | 19 + .../ecore-gen/satellite/util/SatelliteSwitch.java | 30 + .../model/satellite.aird | 143 ++-- .../model/satellite.ecore | 10 +- .../model/satellite.genmodel | 4 +- .../outputs/debug/generated3valued.vql_deactivated | 582 ++++++++------ .../outputs/debug/generation.logicproblem | 876 +++++++++++---------- .../outputs/debug/init.partialmodel | 17 +- .../plugin.xml | 12 +- .../domains/satellite/queries/.gitignore | 2 + ...icationLinkDoesNotStartAtContainingElement.java | 579 -------------- .../queries/CommunicationLinkOfElement.java | 705 +++++++++++++++++ .../satellite/queries/CommunicationLoop.java | 6 +- .../satellite/queries/CubeSatWithKaAntenna.java | 6 +- .../queries/IncompatibleSourceAndTargetBand.java | 6 +- .../queries/IncompatibleSourceAndTargetGain.java | 6 +- .../satellite/queries/KaAntennaGainLow.java | 6 +- .../queries/MultipleCommunicationLinks.java | 576 ++++++++++++++ .../satellite/queries/NoLinkToGroundStation.java | 6 +- .../queries/NoPotentialLinkToGroundStation.java | 6 +- .../queries/NotEnoughInterferometryPayloads.java | 6 +- .../satellite/queries/SatelliteQueries.java | 25 +- .../domains/satellite/queries/SmallSat.java | 50 +- .../satellite/queries/SpacecraftOfKind.java | 10 +- .../queries/ThreeUCubeSatWithNonUhfCrossLink.java | 6 +- .../satellite/queries/UhfAntennaGainNotLow.java | 6 +- .../satellite/queries/XAntennaGainNotMedium.java | 6 +- .../internal/AtLeastTwoInterferometryPayloads.java | 2 +- .../queries/internal/CommSubsystemBand.java | 4 +- .../queries/internal/CommSubsystemBandUhf.java | 2 +- .../queries/internal/CommSubsystemGain.java | 4 +- .../queries/internal/CommSubsystemGainLow.java | 2 +- .../queries/internal/CommSubsystemGainMedium.java | 2 +- .../satellite/queries/internal/CubeSat3U.java | 2 +- .../queries/internal/DirectCommunicationLink.java | 4 +- .../queries/internal/GroundStationNetwork.java | 2 +- .../internal/IndirectCommunicationLink.java | 4 +- .../queries/internal/IndirectLinkAllowed.java | 4 +- .../satellite/queries/internal/LinkAllowed.java | 4 +- .../queries/internal/MatchingAntenna.java | 6 +- .../queries/internal/SatelliteQueriesAll.java | 9 +- .../SpacecraftWithInterferometryPayload.java | 4 +- .../domains/satellite/queries/SatelliteQueries.vql | 18 +- 58 files changed, 2752 insertions(+), 1537 deletions(-) create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSatImpl.java delete mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkOfElement.java create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/MultipleCommunicationLinks.java (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite') diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig index 1942980c..726f838f 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig @@ -7,7 +7,7 @@ generate { partial-model = { "inputs/SatelliteInstance.xmi"} solver = ViatraSolver scope = { - #node += 16..32 + #node += 8..16 } config = { diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java index 072a9705..1cee0c0d 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java @@ -15,6 +15,7 @@ import org.eclipse.emf.ecore.EObject; * * * @see satellite.SatellitePackage#getCommSubsystem() @@ -80,4 +81,30 @@ public interface CommSubsystem extends EObject { */ void setGain(AntennaGain value); + /** + * Returns the value of the 'Communication Link' containment reference. + * + *

+ * If the meaning of the 'Communication Link' containment reference isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Communication Link' containment reference. + * @see #setCommunicationLink(DirectedCommunicationLink) + * @see satellite.SatellitePackage#getCommSubsystem_CommunicationLink() + * @model containment="true" + * @generated + */ + DirectedCommunicationLink getCommunicationLink(); + + /** + * Sets the value of the '{@link satellite.CommSubsystem#getCommunicationLink Communication Link}' containment reference. + * + * + * @param value the new value of the 'Communication Link' containment reference. + * @see #getCommunicationLink() + * @generated + */ + void setCommunicationLink(DirectedCommunicationLink value); + } // CommSubsystem diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommunicatingElement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommunicatingElement.java index b96b281f..6e12fd9f 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommunicatingElement.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommunicatingElement.java @@ -41,29 +41,18 @@ public interface CommunicatingElement extends EObject { EList getCommSubsystem(); /** - * Returns the value of the 'Communication Link' containment reference. + * Returns the value of the 'Communication Link' reference. * *

* If the meaning of the 'Communication Link' containment reference isn't clear, * there really should be more of a description here... *

* - * @return the value of the 'Communication Link' containment reference. - * @see #setCommunicationLink(DirectedCommunicationLink) + * @return the value of the 'Communication Link' reference. * @see satellite.SatellitePackage#getCommunicatingElement_CommunicationLink() - * @model containment="true" + * @model transient="true" changeable="false" volatile="true" derived="true" * @generated */ DirectedCommunicationLink getCommunicationLink(); - /** - * Sets the value of the '{@link satellite.CommunicatingElement#getCommunicationLink Communication Link}' containment reference. - * - * - * @param value the new value of the 'Communication Link' containment reference. - * @see #getCommunicationLink() - * @generated - */ - void setCommunicationLink(DirectedCommunicationLink value); - } // CommunicatingElement diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat.java new file mode 100644 index 00000000..a38926d4 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat.java @@ -0,0 +1,16 @@ +/** + */ +package satellite; + +/** + * + * A representation of the model object 'Cube Sat'. + * + * + * + * @see satellite.SatellitePackage#getCubeSat() + * @model abstract="true" + * @generated + */ +public interface CubeSat extends Spacecraft { +} // CubeSat diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat3U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat3U.java index 5758e165..c68bf52c 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat3U.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat3U.java @@ -12,5 +12,5 @@ package satellite; * @model * @generated */ -public interface CubeSat3U extends Spacecraft { +public interface CubeSat3U extends CubeSat { } // CubeSat3U diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat6U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat6U.java index a8d8830f..5ade601a 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat6U.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat6U.java @@ -12,5 +12,5 @@ package satellite; * @model * @generated */ -public interface CubeSat6U extends Spacecraft { +public interface CubeSat6U extends CubeSat { } // CubeSat6U diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java index f0d80ac2..6e8723ae 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java @@ -179,7 +179,7 @@ public interface SatellitePackage extends EPackage { int COMMUNICATING_ELEMENT__COMM_SUBSYSTEM = 0; /** - * The feature id for the 'Communication Link' containment reference. + * The feature id for the 'Communication Link' reference. * * * @generated @@ -225,7 +225,7 @@ public interface SatellitePackage extends EPackage { int GROUND_STATION_NETWORK__COMM_SUBSYSTEM = COMMUNICATING_ELEMENT__COMM_SUBSYSTEM; /** - * The feature id for the 'Communication Link' containment reference. + * The feature id for the 'Communication Link' reference. * * * @generated @@ -271,7 +271,7 @@ public interface SatellitePackage extends EPackage { int SPACECRAFT__COMM_SUBSYSTEM = COMMUNICATING_ELEMENT__COMM_SUBSYSTEM; /** - * The feature id for the 'Communication Link' containment reference. + * The feature id for the 'Communication Link' reference. * * * @generated @@ -343,6 +343,15 @@ public interface SatellitePackage extends EPackage { */ int COMM_SUBSYSTEM__GAIN = 1; + /** + * The feature id for the 'Communication Link' containment reference. + * + * + * @generated + * @ordered + */ + int COMM_SUBSYSTEM__COMMUNICATION_LINK = 2; + /** * The number of structural features of the 'Comm Subsystem' class. * @@ -350,7 +359,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int COMM_SUBSYSTEM_FEATURE_COUNT = 2; + int COMM_SUBSYSTEM_FEATURE_COUNT = 3; /** * The number of operations of the 'Comm Subsystem' class. @@ -463,6 +472,70 @@ public interface SatellitePackage extends EPackage { */ int INTERFEROMETRY_PAYLOAD_OPERATION_COUNT = PAYLOAD_OPERATION_COUNT + 0; + /** + * The meta object id for the '{@link satellite.impl.CubeSatImpl Cube Sat}' class. + * + * + * @see satellite.impl.CubeSatImpl + * @see satellite.impl.SatellitePackageImpl#getCubeSat() + * @generated + */ + int CUBE_SAT = 12; + + /** + * The feature id for the 'Comm Subsystem' containment reference list. + * + * + * @generated + * @ordered + */ + int CUBE_SAT__COMM_SUBSYSTEM = SPACECRAFT__COMM_SUBSYSTEM; + + /** + * The feature id for the 'Communication Link' reference. + * + * + * @generated + * @ordered + */ + int CUBE_SAT__COMMUNICATION_LINK = SPACECRAFT__COMMUNICATION_LINK; + + /** + * The feature id for the 'Payload' containment reference. + * + * + * @generated + * @ordered + */ + int CUBE_SAT__PAYLOAD = SPACECRAFT__PAYLOAD; + + /** + * The feature id for the 'Kind' attribute. + * + * + * @generated + * @ordered + */ + int CUBE_SAT__KIND = SPACECRAFT__KIND; + + /** + * The number of structural features of the 'Cube Sat' class. + * + * + * @generated + * @ordered + */ + int CUBE_SAT_FEATURE_COUNT = SPACECRAFT_FEATURE_COUNT + 0; + + /** + * The number of operations of the 'Cube Sat' class. + * + * + * @generated + * @ordered + */ + int CUBE_SAT_OPERATION_COUNT = SPACECRAFT_OPERATION_COUNT + 0; + /** * The meta object id for the '{@link satellite.impl.CubeSat3UImpl Cube Sat3 U}' class. * @@ -480,16 +553,16 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT3_U__COMM_SUBSYSTEM = SPACECRAFT__COMM_SUBSYSTEM; + int CUBE_SAT3_U__COMM_SUBSYSTEM = CUBE_SAT__COMM_SUBSYSTEM; /** - * The feature id for the 'Communication Link' containment reference. + * The feature id for the 'Communication Link' reference. * * * @generated * @ordered */ - int CUBE_SAT3_U__COMMUNICATION_LINK = SPACECRAFT__COMMUNICATION_LINK; + int CUBE_SAT3_U__COMMUNICATION_LINK = CUBE_SAT__COMMUNICATION_LINK; /** * The feature id for the 'Payload' containment reference. @@ -498,7 +571,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT3_U__PAYLOAD = SPACECRAFT__PAYLOAD; + int CUBE_SAT3_U__PAYLOAD = CUBE_SAT__PAYLOAD; /** * The feature id for the 'Kind' attribute. @@ -507,7 +580,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT3_U__KIND = SPACECRAFT__KIND; + int CUBE_SAT3_U__KIND = CUBE_SAT__KIND; /** * The number of structural features of the 'Cube Sat3 U' class. @@ -516,7 +589,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT3_U_FEATURE_COUNT = SPACECRAFT_FEATURE_COUNT + 0; + int CUBE_SAT3_U_FEATURE_COUNT = CUBE_SAT_FEATURE_COUNT + 0; /** * The number of operations of the 'Cube Sat3 U' class. @@ -525,7 +598,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT3_U_OPERATION_COUNT = SPACECRAFT_OPERATION_COUNT + 0; + int CUBE_SAT3_U_OPERATION_COUNT = CUBE_SAT_OPERATION_COUNT + 0; /** * The meta object id for the '{@link satellite.impl.CubeSat6UImpl Cube Sat6 U}' class. @@ -544,16 +617,16 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT6_U__COMM_SUBSYSTEM = SPACECRAFT__COMM_SUBSYSTEM; + int CUBE_SAT6_U__COMM_SUBSYSTEM = CUBE_SAT__COMM_SUBSYSTEM; /** - * The feature id for the 'Communication Link' containment reference. + * The feature id for the 'Communication Link' reference. * * * @generated * @ordered */ - int CUBE_SAT6_U__COMMUNICATION_LINK = SPACECRAFT__COMMUNICATION_LINK; + int CUBE_SAT6_U__COMMUNICATION_LINK = CUBE_SAT__COMMUNICATION_LINK; /** * The feature id for the 'Payload' containment reference. @@ -562,7 +635,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT6_U__PAYLOAD = SPACECRAFT__PAYLOAD; + int CUBE_SAT6_U__PAYLOAD = CUBE_SAT__PAYLOAD; /** * The feature id for the 'Kind' attribute. @@ -571,7 +644,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT6_U__KIND = SPACECRAFT__KIND; + int CUBE_SAT6_U__KIND = CUBE_SAT__KIND; /** * The number of structural features of the 'Cube Sat6 U' class. @@ -580,7 +653,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT6_U_FEATURE_COUNT = SPACECRAFT_FEATURE_COUNT + 0; + int CUBE_SAT6_U_FEATURE_COUNT = CUBE_SAT_FEATURE_COUNT + 0; /** * The number of operations of the 'Cube Sat6 U' class. @@ -589,7 +662,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int CUBE_SAT6_U_OPERATION_COUNT = SPACECRAFT_OPERATION_COUNT + 0; + int CUBE_SAT6_U_OPERATION_COUNT = CUBE_SAT_OPERATION_COUNT + 0; /** * The meta object id for the '{@link satellite.impl.SmallSatImpl Small Sat}' class. @@ -611,7 +684,7 @@ public interface SatellitePackage extends EPackage { int SMALL_SAT__COMM_SUBSYSTEM = SPACECRAFT__COMM_SUBSYSTEM; /** - * The feature id for the 'Communication Link' containment reference. + * The feature id for the 'Communication Link' reference. * * * @generated @@ -663,7 +736,7 @@ public interface SatellitePackage extends EPackage { * @see satellite.impl.SatellitePackageImpl#getTransceiverBand() * @generated */ - int TRANSCEIVER_BAND = 12; + int TRANSCEIVER_BAND = 13; /** * The meta object id for the '{@link satellite.AntennaGain Antenna Gain}' enum. @@ -673,7 +746,7 @@ public interface SatellitePackage extends EPackage { * @see satellite.impl.SatellitePackageImpl#getAntennaGain() * @generated */ - int ANTENNA_GAIN = 13; + int ANTENNA_GAIN = 14; /** * The meta object id for the '{@link satellite.SpacecraftKind Spacecraft Kind}' enum. @@ -683,7 +756,7 @@ public interface SatellitePackage extends EPackage { * @see satellite.impl.SatellitePackageImpl#getSpacecraftKind() * @generated */ - int SPACECRAFT_KIND = 14; + int SPACECRAFT_KIND = 15; /** * Returns the meta object for class '{@link satellite.ConstellationMission Constellation Mission}'. @@ -760,10 +833,10 @@ public interface SatellitePackage extends EPackage { EReference getCommunicatingElement_CommSubsystem(); /** - * Returns the meta object for the containment reference '{@link satellite.CommunicatingElement#getCommunicationLink Communication Link}'. + * Returns the meta object for the reference '{@link satellite.CommunicatingElement#getCommunicationLink Communication Link}'. * * - * @return the meta object for the containment reference 'Communication Link'. + * @return the meta object for the reference 'Communication Link'. * @see satellite.CommunicatingElement#getCommunicationLink() * @see #getCommunicatingElement() * @generated @@ -844,6 +917,17 @@ public interface SatellitePackage extends EPackage { */ EAttribute getCommSubsystem_Gain(); + /** + * Returns the meta object for the containment reference '{@link satellite.CommSubsystem#getCommunicationLink Communication Link}'. + * + * + * @return the meta object for the containment reference 'Communication Link'. + * @see satellite.CommSubsystem#getCommunicationLink() + * @see #getCommSubsystem() + * @generated + */ + EReference getCommSubsystem_CommunicationLink(); + /** * Returns the meta object for class '{@link satellite.DirectedCommunicationLink Directed Communication Link}'. * @@ -926,6 +1010,16 @@ public interface SatellitePackage extends EPackage { */ EClass getSmallSat(); + /** + * Returns the meta object for class '{@link satellite.CubeSat Cube Sat}'. + * + * + * @return the meta object for class 'Cube Sat'. + * @see satellite.CubeSat + * @generated + */ + EClass getCubeSat(); + /** * Returns the meta object for enum '{@link satellite.TransceiverBand Transceiver Band}'. * @@ -1043,7 +1137,7 @@ public interface SatellitePackage extends EPackage { EReference COMMUNICATING_ELEMENT__COMM_SUBSYSTEM = eINSTANCE.getCommunicatingElement_CommSubsystem(); /** - * The meta object literal for the 'Communication Link' containment reference feature. + * The meta object literal for the 'Communication Link' reference feature. * * * @generated @@ -1112,6 +1206,14 @@ public interface SatellitePackage extends EPackage { */ EAttribute COMM_SUBSYSTEM__GAIN = eINSTANCE.getCommSubsystem_Gain(); + /** + * The meta object literal for the 'Communication Link' containment reference feature. + * + * + * @generated + */ + EReference COMM_SUBSYSTEM__COMMUNICATION_LINK = eINSTANCE.getCommSubsystem_CommunicationLink(); + /** * The meta object literal for the '{@link satellite.impl.DirectedCommunicationLinkImpl Directed Communication Link}' class. * @@ -1188,6 +1290,16 @@ public interface SatellitePackage extends EPackage { */ EClass SMALL_SAT = eINSTANCE.getSmallSat(); + /** + * The meta object literal for the '{@link satellite.impl.CubeSatImpl Cube Sat}' class. + * + * + * @see satellite.impl.CubeSatImpl + * @see satellite.impl.SatellitePackageImpl#getCubeSat() + * @generated + */ + EClass CUBE_SAT = eINSTANCE.getCubeSat(); + /** * The meta object literal for the '{@link satellite.TransceiverBand Transceiver Band}' enum. * diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Spacecraft.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Spacecraft.java index d8775572..6f72322e 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Spacecraft.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Spacecraft.java @@ -59,7 +59,6 @@ public interface Spacecraft extends CommunicatingElement { * @see satellite.SpacecraftKind * @see satellite.SatellitePackage#getSpacecraft_Kind() * @model required="true" transient="true" changeable="false" volatile="true" derived="true" - * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftOfKind'" * @generated */ SpacecraftKind getKind(); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java index cf8f1fe8..70ee268e 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java @@ -4,13 +4,16 @@ package satellite.impl; import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import satellite.AntennaGain; import satellite.CommSubsystem; +import satellite.DirectedCommunicationLink; import satellite.SatellitePackage; import satellite.TransceiverBand; @@ -24,6 +27,7 @@ import satellite.TransceiverBand; * * * @generated @@ -69,6 +73,16 @@ public class CommSubsystemImpl extends MinimalEObjectImpl.Container implements C */ protected AntennaGain gain = GAIN_EDEFAULT; + /** + * The cached value of the '{@link #getCommunicationLink() Communication Link}' containment reference. + * + * + * @see #getCommunicationLink() + * @generated + * @ordered + */ + protected DirectedCommunicationLink communicationLink; + /** * * @@ -136,6 +150,73 @@ public class CommSubsystemImpl extends MinimalEObjectImpl.Container implements C gain)); } + /** + * + * + * @generated + */ + @Override + public DirectedCommunicationLink getCommunicationLink() { + return communicationLink; + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCommunicationLink(DirectedCommunicationLink newCommunicationLink, + NotificationChain msgs) { + DirectedCommunicationLink oldCommunicationLink = communicationLink; + communicationLink = newCommunicationLink; + if (eNotificationRequired()) { + ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, + SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK, oldCommunicationLink, newCommunicationLink); + if (msgs == null) + msgs = notification; + else + msgs.add(notification); + } + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCommunicationLink(DirectedCommunicationLink newCommunicationLink) { + if (newCommunicationLink != communicationLink) { + NotificationChain msgs = null; + if (communicationLink != null) + msgs = ((InternalEObject) communicationLink).eInverseRemove(this, + EOPPOSITE_FEATURE_BASE - SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK, null, msgs); + if (newCommunicationLink != null) + msgs = ((InternalEObject) newCommunicationLink).eInverseAdd(this, + EOPPOSITE_FEATURE_BASE - SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK, null, msgs); + msgs = basicSetCommunicationLink(newCommunicationLink, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK, + newCommunicationLink, newCommunicationLink)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK: + return basicSetCommunicationLink(null, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + /** * * @@ -148,6 +229,8 @@ public class CommSubsystemImpl extends MinimalEObjectImpl.Container implements C return getBand(); case SatellitePackage.COMM_SUBSYSTEM__GAIN: return getGain(); + case SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK: + return getCommunicationLink(); } return super.eGet(featureID, resolve, coreType); } @@ -166,6 +249,9 @@ public class CommSubsystemImpl extends MinimalEObjectImpl.Container implements C case SatellitePackage.COMM_SUBSYSTEM__GAIN: setGain((AntennaGain) newValue); return; + case SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK: + setCommunicationLink((DirectedCommunicationLink) newValue); + return; } super.eSet(featureID, newValue); } @@ -184,6 +270,9 @@ public class CommSubsystemImpl extends MinimalEObjectImpl.Container implements C case SatellitePackage.COMM_SUBSYSTEM__GAIN: setGain(GAIN_EDEFAULT); return; + case SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK: + setCommunicationLink((DirectedCommunicationLink) null); + return; } super.eUnset(featureID); } @@ -200,6 +289,8 @@ public class CommSubsystemImpl extends MinimalEObjectImpl.Container implements C return band != BAND_EDEFAULT; case SatellitePackage.COMM_SUBSYSTEM__GAIN: return gain != GAIN_EDEFAULT; + case SatellitePackage.COMM_SUBSYSTEM__COMMUNICATION_LINK: + return communicationLink != null; } return super.eIsSet(featureID); } diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommunicatingElementImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommunicatingElementImpl.java index 1f79da3b..f472580b 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommunicatingElementImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommunicatingElementImpl.java @@ -3,16 +3,12 @@ package satellite.impl; import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; import org.eclipse.emf.ecore.util.EObjectContainmentEList; @@ -48,16 +44,6 @@ public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Contai */ protected EList commSubsystem; - /** - * The cached value of the '{@link #getCommunicationLink() Communication Link}' containment reference. - * - * - * @see #getCommunicationLink() - * @generated - * @ordered - */ - protected DirectedCommunicationLink communicationLink; - /** * * @@ -98,7 +84,10 @@ public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Contai */ @Override public DirectedCommunicationLink getCommunicationLink() { - return communicationLink; + DirectedCommunicationLink communicationLink = basicGetCommunicationLink(); + return communicationLink != null && communicationLink.eIsProxy() + ? (DirectedCommunicationLink) eResolveProxy((InternalEObject) communicationLink) + : communicationLink; } /** @@ -106,46 +95,11 @@ public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Contai * * @generated */ - public NotificationChain basicSetCommunicationLink(DirectedCommunicationLink newCommunicationLink, - NotificationChain msgs) { - DirectedCommunicationLink oldCommunicationLink = communicationLink; - communicationLink = newCommunicationLink; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, - SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK, oldCommunicationLink, - newCommunicationLink); - if (msgs == null) - msgs = notification; - else - msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setCommunicationLink(DirectedCommunicationLink newCommunicationLink) { - if (newCommunicationLink != communicationLink) { - NotificationChain msgs = null; - if (communicationLink != null) - msgs = ((InternalEObject) communicationLink).eInverseRemove(this, - EOPPOSITE_FEATURE_BASE - SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK, null, - msgs); - if (newCommunicationLink != null) - msgs = ((InternalEObject) newCommunicationLink).eInverseAdd(this, - EOPPOSITE_FEATURE_BASE - SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK, null, - msgs); - msgs = basicSetCommunicationLink(newCommunicationLink, msgs); - if (msgs != null) - msgs.dispatch(); - } else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, - SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK, newCommunicationLink, - newCommunicationLink)); + public DirectedCommunicationLink basicGetCommunicationLink() { + // TODO: implement this method to return the 'Communication Link' reference + // -> do not perform proxy resolution + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); } /** @@ -158,8 +112,6 @@ public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Contai switch (featureID) { case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: return ((InternalEList) getCommSubsystem()).basicRemove(otherEnd, msgs); - case SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK: - return basicSetCommunicationLink(null, msgs); } return super.eInverseRemove(otherEnd, featureID, msgs); } @@ -175,7 +127,9 @@ public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Contai case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: return getCommSubsystem(); case SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK: - return getCommunicationLink(); + if (resolve) + return getCommunicationLink(); + return basicGetCommunicationLink(); } return super.eGet(featureID, resolve, coreType); } @@ -193,9 +147,6 @@ public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Contai getCommSubsystem().clear(); getCommSubsystem().addAll((Collection) newValue); return; - case SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK: - setCommunicationLink((DirectedCommunicationLink) newValue); - return; } super.eSet(featureID, newValue); } @@ -211,9 +162,6 @@ public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Contai case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: getCommSubsystem().clear(); return; - case SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK: - setCommunicationLink((DirectedCommunicationLink) null); - return; } super.eUnset(featureID); } @@ -229,7 +177,7 @@ public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Contai case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: return commSubsystem != null && !commSubsystem.isEmpty(); case SatellitePackage.COMMUNICATING_ELEMENT__COMMUNICATION_LINK: - return communicationLink != null; + return basicGetCommunicationLink() != null; } return super.eIsSet(featureID); } diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat3UImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat3UImpl.java index a7ba37a7..350a9bcc 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat3UImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat3UImpl.java @@ -14,7 +14,7 @@ import satellite.SatellitePackage; * * @generated */ -public class CubeSat3UImpl extends SpacecraftImpl implements CubeSat3U { +public class CubeSat3UImpl extends CubeSatImpl implements CubeSat3U { /** * * diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat6UImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat6UImpl.java index d4f42e6c..3b9c5988 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat6UImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat6UImpl.java @@ -14,7 +14,7 @@ import satellite.SatellitePackage; * * @generated */ -public class CubeSat6UImpl extends SpacecraftImpl implements CubeSat6U { +public class CubeSat6UImpl extends CubeSatImpl implements CubeSat6U { /** * * diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSatImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSatImpl.java new file mode 100644 index 00000000..660bd062 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSatImpl.java @@ -0,0 +1,37 @@ +/** + */ +package satellite.impl; + +import org.eclipse.emf.ecore.EClass; + +import satellite.CubeSat; +import satellite.SatellitePackage; + +/** + * + * An implementation of the model object 'Cube Sat'. + * + * + * @generated + */ +public abstract class CubeSatImpl extends SpacecraftImpl implements CubeSat { + /** + * + * + * @generated + */ + protected CubeSatImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return SatellitePackage.Literals.CUBE_SAT; + } + +} //CubeSatImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java index 2347fe07..68e4ce30 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java @@ -14,6 +14,7 @@ import satellite.AntennaGain; import satellite.CommSubsystem; import satellite.CommunicatingElement; import satellite.ConstellationMission; +import satellite.CubeSat; import satellite.CubeSat3U; import satellite.CubeSat6U; import satellite.DirectedCommunicationLink; @@ -119,6 +120,13 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka */ private EClass smallSatEClass = null; + /** + * + * + * @generated + */ + private EClass cubeSatEClass = null; + /** * * @@ -354,6 +362,16 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka return (EAttribute) commSubsystemEClass.getEStructuralFeatures().get(1); } + /** + * + * + * @generated + */ + @Override + public EReference getCommSubsystem_CommunicationLink() { + return (EReference) commSubsystemEClass.getEStructuralFeatures().get(2); + } + /** * * @@ -434,6 +452,16 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka return smallSatEClass; } + /** + * + * + * @generated + */ + @Override + public EClass getCubeSat() { + return cubeSatEClass; + } + /** * * @@ -514,6 +542,7 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka commSubsystemEClass = createEClass(COMM_SUBSYSTEM); createEAttribute(commSubsystemEClass, COMM_SUBSYSTEM__BAND); createEAttribute(commSubsystemEClass, COMM_SUBSYSTEM__GAIN); + createEReference(commSubsystemEClass, COMM_SUBSYSTEM__COMMUNICATION_LINK); directedCommunicationLinkEClass = createEClass(DIRECTED_COMMUNICATION_LINK); createEReference(directedCommunicationLinkEClass, DIRECTED_COMMUNICATION_LINK__SOURCE); @@ -529,6 +558,8 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka smallSatEClass = createEClass(SMALL_SAT); + cubeSatEClass = createEClass(CUBE_SAT); + // Create enums transceiverBandEEnum = createEEnum(TRANSCEIVER_BAND); antennaGainEEnum = createEEnum(ANTENNA_GAIN); @@ -568,9 +599,10 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka groundStationNetworkEClass.getESuperTypes().add(this.getCommunicatingElement()); spacecraftEClass.getESuperTypes().add(this.getCommunicatingElement()); interferometryPayloadEClass.getESuperTypes().add(this.getPayload()); - cubeSat3UEClass.getESuperTypes().add(this.getSpacecraft()); - cubeSat6UEClass.getESuperTypes().add(this.getSpacecraft()); + cubeSat3UEClass.getESuperTypes().add(this.getCubeSat()); + cubeSat6UEClass.getESuperTypes().add(this.getCubeSat()); smallSatEClass.getESuperTypes().add(this.getSpacecraft()); + cubeSatEClass.getESuperTypes().add(this.getSpacecraft()); // Initialize classes, features, and operations; add parameters initEClass(constellationMissionEClass, ConstellationMission.class, "ConstellationMission", IS_ABSTRACT, @@ -594,8 +626,8 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka 2, CommunicatingElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getCommunicatingElement_CommunicationLink(), this.getDirectedCommunicationLink(), null, - "communicationLink", null, 0, 1, CommunicatingElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, - IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + "communicationLink", null, 0, 1, CommunicatingElement.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); initEClass(groundStationNetworkEClass, GroundStationNetwork.class, "GroundStationNetwork", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -614,6 +646,9 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getCommSubsystem_Gain(), this.getAntennaGain(), "gain", null, 1, 1, CommSubsystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCommSubsystem_CommunicationLink(), this.getDirectedCommunicationLink(), null, + "communicationLink", null, 0, 1, CommSubsystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEClass(directedCommunicationLinkEClass, DirectedCommunicationLink.class, "DirectedCommunicationLink", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -638,6 +673,8 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka initEClass(smallSatEClass, SmallSat.class, "SmallSat", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(cubeSatEClass, CubeSat.class, "CubeSat", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + // Initialize enums and add enum literals initEEnum(transceiverBandEEnum, TransceiverBand.class, "TransceiverBand"); addEEnumLiteral(transceiverBandEEnum, TransceiverBand.UHF); @@ -660,8 +697,6 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka // Create annotations // http://www.eclipse.org/emf/2002/Ecore createEcoreAnnotations(); - // org.eclipse.viatra.query.querybasedfeature - createOrgAnnotations(); } /** @@ -675,16 +710,4 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka addAnnotation(this, source, new String[] { "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" }); } - /** - * Initializes the annotations for org.eclipse.viatra.query.querybasedfeature. - * - * - * @generated - */ - protected void createOrgAnnotations() { - String source = "org.eclipse.viatra.query.querybasedfeature"; - addAnnotation(getSpacecraft_Kind(), source, - new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftOfKind" }); - } - } //SatellitePackageImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SpacecraftImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SpacecraftImpl.java index 73609fbd..ef98fb07 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SpacecraftImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SpacecraftImpl.java @@ -6,7 +6,6 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; @@ -42,15 +41,14 @@ public abstract class SpacecraftImpl extends CommunicatingElementImpl implements protected Payload payload; /** - * The cached setting delegate for the '{@link #getKind() Kind}' attribute. + * The default value of the '{@link #getKind() Kind}' attribute. * * * @see #getKind() * @generated * @ordered */ - protected EStructuralFeature.Internal.SettingDelegate KIND__ESETTING_DELEGATE = ((EStructuralFeature.Internal) SatellitePackage.Literals.SPACECRAFT__KIND) - .getSettingDelegate(); + protected static final SpacecraftKind KIND_EDEFAULT = SpacecraftKind.CUBE_SAT3_U; /** * @@ -130,7 +128,9 @@ public abstract class SpacecraftImpl extends CommunicatingElementImpl implements */ @Override public SpacecraftKind getKind() { - return (SpacecraftKind) KIND__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); + // TODO: implement this method to return the 'Kind' attribute + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); } /** @@ -204,7 +204,7 @@ public abstract class SpacecraftImpl extends CommunicatingElementImpl implements case SatellitePackage.SPACECRAFT__PAYLOAD: return payload != null; case SatellitePackage.SPACECRAFT__KIND: - return KIND__ESETTING_DELEGATE.dynamicIsSet(this, null, 0); + return getKind() != KIND_EDEFAULT; } return super.eIsSet(featureID); } diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java index 1ecf7b19..f71d8da5 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java @@ -126,6 +126,11 @@ public class SatelliteAdapterFactory extends AdapterFactoryImpl { return createSmallSatAdapter(); } + @Override + public Adapter caseCubeSat(CubeSat object) { + return createCubeSatAdapter(); + } + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); @@ -313,6 +318,20 @@ public class SatelliteAdapterFactory extends AdapterFactoryImpl { return null; } + /** + * Creates a new adapter for an object of class '{@link satellite.CubeSat Cube Sat}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see satellite.CubeSat + * @generated + */ + public Adapter createCubeSatAdapter() { + return null; + } + /** * Creates a new adapter for the default case. * diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java index 3eb78d75..1e2fb04b 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java @@ -140,6 +140,8 @@ public class SatelliteSwitch extends Switch { case SatellitePackage.CUBE_SAT3_U: { CubeSat3U cubeSat3U = (CubeSat3U) theEObject; T result = caseCubeSat3U(cubeSat3U); + if (result == null) + result = caseCubeSat(cubeSat3U); if (result == null) result = caseSpacecraft(cubeSat3U); if (result == null) @@ -151,6 +153,8 @@ public class SatelliteSwitch extends Switch { case SatellitePackage.CUBE_SAT6_U: { CubeSat6U cubeSat6U = (CubeSat6U) theEObject; T result = caseCubeSat6U(cubeSat6U); + if (result == null) + result = caseCubeSat(cubeSat6U); if (result == null) result = caseSpacecraft(cubeSat6U); if (result == null) @@ -170,6 +174,17 @@ public class SatelliteSwitch extends Switch { result = defaultCase(theEObject); return result; } + case SatellitePackage.CUBE_SAT: { + CubeSat cubeSat = (CubeSat) theEObject; + T result = caseCubeSat(cubeSat); + if (result == null) + result = caseSpacecraft(cubeSat); + if (result == null) + result = caseCommunicatingElement(cubeSat); + if (result == null) + result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } @@ -355,6 +370,21 @@ public class SatelliteSwitch extends Switch { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Cube Sat'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Cube Sat'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCubeSat(CubeSat object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'EObject'. * diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.aird b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.aird index 31575c3c..4ffc0ea3 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.aird +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.aird @@ -1307,6 +1307,16 @@ ../src/hu/bme/mit/inf/dslreasoner/domains/satellite/metrics/SatelliteMetrics.vql java:/Objects/org.eclipse.viatra.query.runtime.matchers.aggregators.max java:/Objects/hu.bme.mit.inf.dslreasoner.domains.satellite.SpacecraftKind + java:/Objects/satellite.Payload + java:/Objects/hu.bme.mit.inf.dslreasoner.domains.satellite.CubeSat + java:/Objects/satellite.CubeSat + java:/Objects/satellite.Spacecraft + java:/Objects/satellite.CommunicatingElement + java:/Objects/satellite.SpacecraftKind + java:/Objects/satellite.CommSubsystem + java:/Objects/satellite.DirectedCommunicationLink + java:/Objects/satellite.TransceiverBand + java:/Objects/satellite.AntennaGain @@ -1359,6 +1369,24 @@ + + + + + + + + + + + + + + + + + + @@ -1615,38 +1643,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1659,7 +1655,7 @@ - + @@ -1775,6 +1771,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1820,7 +1848,7 @@ - + KEEP_LOCATION @@ -1887,7 +1915,7 @@ - + KEEP_LOCATION @@ -1960,7 +1988,7 @@ - + KEEP_LOCATION @@ -2006,30 +2034,6 @@ - - - - - - labelSize - - - labelSize - - - - - - - - - - bold - - - - - @@ -2215,6 +2219,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore index ae9197da..002c8fd8 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore @@ -18,7 +18,11 @@ + changeable="false" volatile="true" transient="true" derived="true"> + +
+ + @@ -34,6 +38,8 @@ + @@ -42,7 +48,7 @@ + eType="#//CommSubsystem" eOpposite="#//CommSubsystem/communicationLink"/> diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel index f8b6d75b..b570f05e 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel @@ -35,7 +35,7 @@ - + @@ -45,6 +45,7 @@ + @@ -55,5 +56,6 @@ + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/generated3valued.vql_deactivated b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/generated3valued.vql_deactivated index 853b7b54..d28c0d4d 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/generated3valued.vql_deactivated +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/generated3valued.vql_deactivated @@ -110,22 +110,22 @@ private pattern mayInstanceOfConstellationMission_class(problem:LogicProblem, in find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class_UndefinedPart(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfInterferometryMission_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class_UndefinedPart(problem,interpretation,element); neg find scopeDisallowsNewConstellationMission_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class_UndefinedPart(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfInterferometryMission_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class_UndefinedPart(problem,interpretation,element); neg find scopeDisallowsNewConstellationMission_class(problem, interpretation); neg find isPrimitive(element); } or @@ -154,20 +154,20 @@ private pattern mayInstanceOfInterferometryMission_class(problem:LogicProblem, i find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class_UndefinedPart(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find scopeDisallowsNewInterferometryMission_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class_UndefinedPart(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find scopeDisallowsNewInterferometryMission_class(problem, interpretation); neg find isPrimitive(element); } or @@ -196,10 +196,10 @@ private pattern mayInstanceOfCommunicatingElement_class(problem:LogicProblem, in find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class_UndefinedPart(problem,interpretation,element); neg find scopeDisallowsNewCommunicatingElement_class(problem, interpretation); neg find isPrimitive(element); @@ -207,10 +207,10 @@ private pattern mayInstanceOfCommunicatingElement_class(problem:LogicProblem, in find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class_UndefinedPart(problem,interpretation,element); neg find scopeDisallowsNewCommunicatingElement_class(problem, interpretation); neg find isPrimitive(element); @@ -240,9 +240,9 @@ private pattern mayInstanceOfGroundStationNetwork_class(problem:LogicProblem, in find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class_UndefinedPart(problem,interpretation,element); neg find scopeDisallowsNewGroundStationNetwork_class(problem, interpretation); neg find isPrimitive(element); @@ -250,9 +250,9 @@ private pattern mayInstanceOfGroundStationNetwork_class(problem:LogicProblem, in find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class_UndefinedPart(problem,interpretation,element); neg find scopeDisallowsNewGroundStationNetwork_class(problem, interpretation); neg find isPrimitive(element); @@ -282,24 +282,24 @@ private pattern mayInstanceOfSpacecraft_class(problem:LogicProblem, interpretati find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); + neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat_class(problem,interpretation,element); - neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find scopeDisallowsNewSpacecraft_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); + neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat_class(problem,interpretation,element); - neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find scopeDisallowsNewSpacecraft_class(problem, interpretation); neg find isPrimitive(element); } or @@ -328,20 +328,20 @@ private pattern mayInstanceOfCommSubsystem_class(problem:LogicProblem, interpret find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class_UndefinedPart(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewCommSubsystem_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class_UndefinedPart(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewCommSubsystem_class(problem, interpretation); neg find isPrimitive(element); } or @@ -369,19 +369,19 @@ private pattern mayInstanceOfDirectedCommunicationLink_class(problem:LogicProble { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewDirectedCommunicationLink_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewDirectedCommunicationLink_class(problem, interpretation); neg find isPrimitive(element); } or @@ -410,20 +410,20 @@ private pattern mayInstanceOfPayload_class(problem:LogicProblem, interpretation: find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfInterferometryPayload_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); + neg find mustInstanceOfInterferometryPayload_class(problem,interpretation,element); neg find scopeDisallowsNewPayload_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfInterferometryPayload_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); + neg find mustInstanceOfInterferometryPayload_class(problem,interpretation,element); neg find scopeDisallowsNewPayload_class(problem, interpretation); neg find isPrimitive(element); } or @@ -452,18 +452,18 @@ private pattern mayInstanceOfInterferometryPayload_class(problem:LogicProblem, i find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewInterferometryPayload_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewInterferometryPayload_class(problem, interpretation); neg find isPrimitive(element); } or @@ -491,25 +491,25 @@ private pattern mayInstanceOfCubeSat3U_class(problem:LogicProblem, interpretatio { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat6U_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewCubeSat3U_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat6U_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewCubeSat3U_class(problem, interpretation); neg find isPrimitive(element); } or @@ -538,24 +538,24 @@ private pattern mayInstanceOfCubeSat6U_class(problem:LogicProblem, interpretatio find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat3U_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewCubeSat6U_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat3U_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewCubeSat6U_class(problem, interpretation); neg find isPrimitive(element); } or @@ -584,22 +584,22 @@ private pattern mayInstanceOfSmallSat_class(problem:LogicProblem, interpretation find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat_class(problem,interpretation,element); - neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find scopeDisallowsNewSmallSat_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat_class(problem,interpretation,element); - neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find scopeDisallowsNewSmallSat_class(problem, interpretation); neg find isPrimitive(element); } or @@ -628,26 +628,26 @@ private pattern mayInstanceOfCubeSat_class(problem:LogicProblem, interpretation: find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat3U_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfCubeSat6U_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewCubeSat_class(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat3U_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfCubeSat6U_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find scopeDisallowsNewCubeSat_class(problem, interpretation); neg find isPrimitive(element); } or @@ -760,9 +760,9 @@ private pattern mayInstanceOfConstellationMission_class_UndefinedPart(problem:Lo find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfInterferometryMission_class(problem,interpretation,element); neg find scopeDisallowsNewConstellationMission_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); @@ -770,9 +770,9 @@ private pattern mayInstanceOfConstellationMission_class_UndefinedPart(problem:Lo find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfInterferometryMission_class(problem,interpretation,element); neg find scopeDisallowsNewConstellationMission_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); @@ -823,18 +823,18 @@ private pattern mayInstanceOfInterferometryMission_class_UndefinedPart(problem:L find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find scopeDisallowsNewInterferometryMission_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find scopeDisallowsNewInterferometryMission_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); } or @@ -884,10 +884,10 @@ private pattern mayInstanceOfCommunicatingElement_class_UndefinedPart(problem:Lo find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfSpacecraft_class(problem,interpretation,element); neg find scopeDisallowsNewCommunicatingElement_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); @@ -895,10 +895,10 @@ private pattern mayInstanceOfCommunicatingElement_class_UndefinedPart(problem:Lo find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfSpacecraft_class(problem,interpretation,element); neg find scopeDisallowsNewCommunicatingElement_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); @@ -949,9 +949,9 @@ private pattern mayInstanceOfGroundStationNetwork_class_UndefinedPart(problem:Lo find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfSpacecraft_class(problem,interpretation,element); neg find scopeDisallowsNewGroundStationNetwork_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); @@ -959,9 +959,9 @@ private pattern mayInstanceOfGroundStationNetwork_class_UndefinedPart(problem:Lo find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfSpacecraft_class(problem,interpretation,element); neg find scopeDisallowsNewGroundStationNetwork_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); @@ -1012,18 +1012,18 @@ private pattern mayInstanceOfCommSubsystem_class_UndefinedPart(problem:LogicProb find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); neg find scopeDisallowsNewCommSubsystem_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); } or { find interpretation(problem,interpretation); PartialInterpretation.openWorldElements(interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); neg find scopeDisallowsNewCommSubsystem_class_UndefinedPart(problem, interpretation); neg find isPrimitive(element); } or @@ -1155,21 +1155,39 @@ private pattern mayInRelationcommSubsystem_reference_CommunicatingElement( /** * Matcher for detecting tuples t where []communicationLink reference CommunicatingElement(source,target) */ -private pattern mustInRelationcommunicationLink_reference_CommunicatingElement( + private pattern mustInRelationcommunicationLink_reference_CommunicatingElement( + problem:LogicProblem, interpretation:PartialInterpretation, + source: DefinedElement, target:DefinedElement) + { + find mustInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkOfElement(problem,interpretation,source,target); + } +/** + * Matcher for detecting tuples t where []communicationLink reference CommunicatingElement(source,target) + */ + private pattern mayInRelationcommunicationLink_reference_CommunicatingElement( + problem:LogicProblem, interpretation:PartialInterpretation, + source: DefinedElement, target:DefinedElement) + { + find mayInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkOfElement(problem,interpretation,source,target); + } +/** + * Matcher for detecting tuples t where []payload reference Spacecraft(source,target) + */ +private pattern mustInRelationpayload_reference_Spacecraft( problem:LogicProblem, interpretation:PartialInterpretation, source: DefinedElement, target:DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); - PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"communicationLink reference CommunicatingElement"); + PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"payload reference Spacecraft"); PartialRelationInterpretation.relationlinks(relationIterpretation,link); BinaryElementRelationLink.param1(link,source); BinaryElementRelationLink.param2(link,target); } /** - * Matcher for detecting tuples t where <>communicationLink reference CommunicatingElement(source,target) + * Matcher for detecting tuples t where <>payload reference Spacecraft(source,target) */ -private pattern mayInRelationcommunicationLink_reference_CommunicatingElement( +private pattern mayInRelationpayload_reference_Spacecraft( problem:LogicProblem, interpretation:PartialInterpretation, source: DefinedElement, target:DefinedElement) { @@ -1178,11 +1196,11 @@ private pattern mayInRelationcommunicationLink_reference_CommunicatingElement( find mayExist(problem, interpretation, source); find mayExist(problem, interpretation, target); // Type consistency - find mayInstanceOfCommunicatingElement_class(problem,interpretation,source); - find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,target); + find mayInstanceOfSpacecraft_class(problem,interpretation,source); + find mayInstanceOfPayload_class(problem,interpretation,target); // There are "numberOfExistingReferences" currently existing instances of the reference from the source, // the upper bound of the multiplicity should be considered. - numberOfExistingReferences == count find mustInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,source,_); + numberOfExistingReferences == count find mustInRelationpayload_reference_Spacecraft(problem,interpretation,source,_); check(numberOfExistingReferences < 1); // The reference is containment, then a new reference cannot be create if: // 1. Multiple parents @@ -1190,26 +1208,26 @@ private pattern mayInRelationcommunicationLink_reference_CommunicatingElement( // 2. Circle in the containment hierarchy neg find mustTransitiveContains(source,target); } or { - find mustInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,source,target); + find mustInRelationpayload_reference_Spacecraft(problem,interpretation,source,target); } /** - * Matcher for detecting tuples t where []payload reference Spacecraft(source,target) + * Matcher for detecting tuples t where []communicationLink reference CommSubsystem(source,target) */ -private pattern mustInRelationpayload_reference_Spacecraft( +private pattern mustInRelationcommunicationLink_reference_CommSubsystem( problem:LogicProblem, interpretation:PartialInterpretation, source: DefinedElement, target:DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); - PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"payload reference Spacecraft"); + PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"communicationLink reference CommSubsystem"); PartialRelationInterpretation.relationlinks(relationIterpretation,link); BinaryElementRelationLink.param1(link,source); BinaryElementRelationLink.param2(link,target); } /** - * Matcher for detecting tuples t where <>payload reference Spacecraft(source,target) + * Matcher for detecting tuples t where <>communicationLink reference CommSubsystem(source,target) */ -private pattern mayInRelationpayload_reference_Spacecraft( +private pattern mayInRelationcommunicationLink_reference_CommSubsystem( problem:LogicProblem, interpretation:PartialInterpretation, source: DefinedElement, target:DefinedElement) { @@ -1218,11 +1236,11 @@ private pattern mayInRelationpayload_reference_Spacecraft( find mayExist(problem, interpretation, source); find mayExist(problem, interpretation, target); // Type consistency - find mayInstanceOfSpacecraft_class(problem,interpretation,source); - find mayInstanceOfPayload_class(problem,interpretation,target); + find mayInstanceOfCommSubsystem_class(problem,interpretation,source); + find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,target); // There are "numberOfExistingReferences" currently existing instances of the reference from the source, // the upper bound of the multiplicity should be considered. - numberOfExistingReferences == count find mustInRelationpayload_reference_Spacecraft(problem,interpretation,source,_); + numberOfExistingReferences == count find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,source,_); check(numberOfExistingReferences < 1); // The reference is containment, then a new reference cannot be create if: // 1. Multiple parents @@ -1230,7 +1248,7 @@ private pattern mayInRelationpayload_reference_Spacecraft( // 2. Circle in the containment hierarchy neg find mustTransitiveContains(source,target); } or { - find mustInRelationpayload_reference_Spacecraft(problem,interpretation,source,target); + find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,source,target); } /** * Matcher for detecting tuples t where []source reference DirectedCommunicationLink(source,target) @@ -1394,69 +1412,118 @@ private pattern mayInRelationgain_attribute_CommSubsystem( ////////// // 1.3 Relation Definition Indexers ////////// -// Must, May and Current queries for pattern hu bme mit inf dslreasoner domains satellite queries communicationLinkDoesNotStartAtContainingElement -private pattern mustInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkDoesNotStartAtContainingElement( +// Must, May and Current queries for pattern hu bme mit inf dslreasoner domains satellite queries multipleCommunicationLinks +private pattern mustInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_multipleCommunicationLinks( problem:LogicProblem, interpretation:PartialInterpretation, - var_Link) + var_Element) +{ + find interpretation(problem,interpretation); + find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + // Element is exported + find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); + find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual0); + find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual0,var_virtual1); + find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual1); + find mustEquivalent(problem, interpretation, var_virtual1, var_Link1); + find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual2); + find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual2); + find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual2,var_virtual3); + find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual3); + find mustEquivalent(problem, interpretation, var_virtual3, var_Link2); + neg find mayEquivalent(problem, interpretation, var_Link1, var_Link2); +} +private pattern mayInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_multipleCommunicationLinks( + problem:LogicProblem, interpretation:PartialInterpretation, + var_Element) +{ + find interpretation(problem,interpretation); + find mayInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + // Element is exported + find mayInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + find mayInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); + find mayInstanceOfCommSubsystem_class(problem,interpretation,var_virtual0); + find mayInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual0,var_virtual1); + find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual1); + find mayEquivalent(problem, interpretation, var_virtual1, var_Link1); + find mayInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + find mayInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual2); + find mayInstanceOfCommSubsystem_class(problem,interpretation,var_virtual2); + find mayInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual2,var_virtual3); + find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual3); + find mayEquivalent(problem, interpretation, var_virtual3, var_Link2); + neg find mustEquivalent(problem, interpretation, var_Link1, var_Link2); +} +private pattern currentInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_multipleCommunicationLinks( + problem:LogicProblem, interpretation:PartialInterpretation, + var_Element) { find interpretation(problem,interpretation); + find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + // Element is exported + find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); + find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual0); + find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual0,var_virtual1); + find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual1); + find mustEquivalent(problem, interpretation, var_virtual1, var_Link1); + find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); + find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual2); + find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual2); + find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual2,var_virtual3); + find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual3); + find mustEquivalent(problem, interpretation, var_virtual3, var_Link2); + neg find mustEquivalent(problem, interpretation, var_Link1, var_Link2); +} +// Must, May and Current queries for pattern hu bme mit inf dslreasoner domains satellite queries communicationLinkOfElement +private pattern mustInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkOfElement( + problem:LogicProblem, interpretation:PartialInterpretation, + var_Element, var_Link) +{ + find interpretation(problem,interpretation); + find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_Link); + // Element is exported // Link is exported find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); - find mustInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); - find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual0); - find mustEquivalent(problem, interpretation, var_virtual0, var_Link); - find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_Link); - find mustInRelationsource_reference_DirectedCommunicationLink(problem,interpretation,var_Link,var_virtual1); - find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual1); - find mustEquivalent(problem, interpretation, var_virtual1, var_SourceComm); - find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_SourceElement); - find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_SourceElement,var_virtual2); - find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual2); - find mustEquivalent(problem, interpretation, var_virtual2, var_SourceComm); - neg find mayEquivalent(problem, interpretation, var_Element, var_SourceElement); + find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); + find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual0); + find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual0,var_virtual1); + find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual1); + find mustEquivalent(problem, interpretation, var_virtual1, var_Link); } -private pattern mayInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkDoesNotStartAtContainingElement( +private pattern mayInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkOfElement( problem:LogicProblem, interpretation:PartialInterpretation, - var_Link) + var_Element, var_Link) { find interpretation(problem,interpretation); + find mayInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_Link); + // Element is exported // Link is exported find mayInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); - find mayInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); - find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual0); - find mayEquivalent(problem, interpretation, var_virtual0, var_Link); - find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_Link); - find mayInRelationsource_reference_DirectedCommunicationLink(problem,interpretation,var_Link,var_virtual1); - find mayInstanceOfCommSubsystem_class(problem,interpretation,var_virtual1); - find mayEquivalent(problem, interpretation, var_virtual1, var_SourceComm); - find mayInstanceOfCommunicatingElement_class(problem,interpretation,var_SourceElement); - find mayInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_SourceElement,var_virtual2); - find mayInstanceOfCommSubsystem_class(problem,interpretation,var_virtual2); - find mayEquivalent(problem, interpretation, var_virtual2, var_SourceComm); - neg find mustEquivalent(problem, interpretation, var_Element, var_SourceElement); + find mayInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); + find mayInstanceOfCommSubsystem_class(problem,interpretation,var_virtual0); + find mayInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual0,var_virtual1); + find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual1); + find mayEquivalent(problem, interpretation, var_virtual1, var_Link); } -private pattern currentInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkDoesNotStartAtContainingElement( +private pattern currentInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkOfElement( problem:LogicProblem, interpretation:PartialInterpretation, - var_Link) + var_Element, var_Link) { find interpretation(problem,interpretation); + find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_Link); + // Element is exported // Link is exported find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_Element); - find mustInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); - find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual0); - find mustEquivalent(problem, interpretation, var_virtual0, var_Link); - find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_Link); - find mustInRelationsource_reference_DirectedCommunicationLink(problem,interpretation,var_Link,var_virtual1); - find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual1); - find mustEquivalent(problem, interpretation, var_virtual1, var_SourceComm); - find mustInstanceOfCommunicatingElement_class(problem,interpretation,var_SourceElement); - find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_SourceElement,var_virtual2); - find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual2); - find mustEquivalent(problem, interpretation, var_virtual2, var_SourceComm); - neg find mustEquivalent(problem, interpretation, var_Element, var_SourceElement); + find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,var_Element,var_virtual0); + find mustInstanceOfCommSubsystem_class(problem,interpretation,var_virtual0); + find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,var_virtual0,var_virtual1); + find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,var_virtual1); + find mustEquivalent(problem, interpretation, var_virtual1, var_Link); } // Must, May and Current queries for pattern hu bme mit inf dslreasoner domains satellite queries notEnoughInterferometryPayloads private pattern mustInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_notEnoughInterferometryPayloads( @@ -2875,9 +2942,9 @@ private pattern mustContains4(problem:LogicProblem, interpretation:PartialInterp { find mustInRelationcommSubsystem_reference_CommunicatingElement(problem,interpretation,source,target); }or - { find mustInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,source,target); }or + { find mustInRelationpayload_reference_Spacecraft(problem,interpretation,source,target); }or - { find mustInRelationpayload_reference_Spacecraft(problem,interpretation,source,target); } + { find mustInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,source,target); } private pattern mustTransitiveContains(source,target) { find mustContains2+(source,target); @@ -2888,10 +2955,10 @@ private pattern mustTransitiveContains(source,target) { ////////// // 2.1 Invalidated by WF Queries ////////// -pattern invalidatedBy_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkDoesNotStartAtContainingElement(problem:LogicProblem, interpretation:PartialInterpretation, - var_Link) +pattern invalidatedBy_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_multipleCommunicationLinks(problem:LogicProblem, interpretation:PartialInterpretation, + var_Element) { - find mustInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkDoesNotStartAtContainingElement(problem,interpretation,var_Link); + find mustInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_multipleCommunicationLinks(problem,interpretation,var_Element); } pattern invalidatedBy_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_notEnoughInterferometryPayloads(problem:LogicProblem, interpretation:PartialInterpretation, var_Mission) @@ -3021,10 +3088,10 @@ pattern unfinishedLowerMultiplicity_gain_attribute_CommSubsystem(problem:LogicPr ////////// // 3.2 Unfinishedness Measured by WF Queries ////////// -pattern unfinishedBy_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkDoesNotStartAtContainingElement(problem:LogicProblem, interpretation:PartialInterpretation, - var_Link) +pattern unfinishedBy_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_multipleCommunicationLinks(problem:LogicProblem, interpretation:PartialInterpretation, + var_Element) { - find currentInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_communicationLinkDoesNotStartAtContainingElement(problem,interpretation,var_Link); + find currentInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_multipleCommunicationLinks(problem,interpretation,var_Element); } pattern unfinishedBy_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_notEnoughInterferometryPayloads(problem:LogicProblem, interpretation:PartialInterpretation, var_Mission) @@ -3090,55 +3157,55 @@ pattern unfinishedBy_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_querie private pattern hasElementInContainment(problem:LogicProblem, interpretation:PartialInterpretation) { find interpretation(problem,interpretation); - find mustInstanceOfInterferometryPayload_class(problem,interpretation,root); + find mustInstanceOfSpacecraft_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfSpacecraft_class(problem,interpretation,root); + find mustInstanceOfCubeSat6U_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,root); + find mustInstanceOfSmallSat_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfCubeSat_class(problem,interpretation,root); + find mustInstanceOfGroundStationNetwork_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfConstellationMission_class(problem,interpretation,root); + find mustInstanceOfPayload_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfInterferometryMission_class(problem,interpretation,root); + find mustInstanceOfCommunicatingElement_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfCubeSat3U_class(problem,interpretation,root); + find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfCommunicatingElement_class(problem,interpretation,root); + find mustInstanceOfCubeSat_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfCubeSat6U_class(problem,interpretation,root); + find mustInstanceOfCubeSat3U_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfSmallSat_class(problem,interpretation,root); + find mustInstanceOfInterferometryPayload_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfCommSubsystem_class(problem,interpretation,root); + find mustInstanceOfConstellationMission_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfGroundStationNetwork_class(problem,interpretation,root); + find mustInstanceOfInterferometryMission_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); - find mustInstanceOfPayload_class(problem,interpretation,root); + find mustInstanceOfCommSubsystem_class(problem,interpretation,root); find mustExist(problem, interpretation, root); }or{ find interpretation(problem,interpretation); @@ -3181,99 +3248,87 @@ private pattern hasElementInContainment(problem:LogicProblem, interpretation:Par find mustInstanceOfCommSubsystem_class_UndefinedPart(problem,interpretation,root); find mustExist(problem, interpretation, root); } -pattern createObject_DirectedCommunicationLink_class_by_communicationLink_reference_CommunicatingElement( +pattern createObject_GroundStationNetwork_class_UndefinedPart_by_groundStationNetwork_reference_ConstellationMission( problem:LogicProblem, interpretation:PartialInterpretation, relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"DirectedCommunicationLink class"); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"GroundStationNetwork class UndefinedPart"); PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); - PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"communicationLink reference CommunicatingElement"); - find mustInstanceOfCommunicatingElement_class(problem,interpretation,container); - find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,newObject); - find mayInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,container,newObject); + PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"groundStationNetwork reference ConstellationMission"); + find mustInstanceOfConstellationMission_class(problem,interpretation,container); + find mayInstanceOfGroundStationNetwork_class_UndefinedPart(problem,interpretation,newObject); + find mayInRelationgroundStationNetwork_reference_ConstellationMission(problem,interpretation,container,newObject); find mustExist(problem, interpretation, container); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_DirectedCommunicationLink_class( - problem:LogicProblem, interpretation:PartialInterpretation, - typeInterpretation:PartialComplexTypeInterpretation) -{ - find interpretation(problem,interpretation); - neg find hasElementInContainment(problem,interpretation); - PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"DirectedCommunicationLink class"); - find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,newObject); - find mayExist(problem, interpretation, newObject); - neg find mustExist(problem, interpretation, newObject); -} -pattern createObject_InterferometryMission_class_UndefinedPart( +pattern createObject_GroundStationNetwork_class_UndefinedPart( problem:LogicProblem, interpretation:PartialInterpretation, typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); neg find hasElementInContainment(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InterferometryMission class UndefinedPart"); - find mayInstanceOfInterferometryMission_class_UndefinedPart(problem,interpretation,newObject); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"GroundStationNetwork class UndefinedPart"); + find mayInstanceOfGroundStationNetwork_class_UndefinedPart(problem,interpretation,newObject); find mayExist(problem, interpretation, newObject); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_InterferometryPayload_class_by_payload_reference_Spacecraft( +pattern createObject_SmallSat_class_by_spacecraft_reference_ConstellationMission( problem:LogicProblem, interpretation:PartialInterpretation, relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InterferometryPayload class"); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"SmallSat class"); PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); - PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"payload reference Spacecraft"); - find mustInstanceOfSpacecraft_class(problem,interpretation,container); - find mayInstanceOfInterferometryPayload_class(problem,interpretation,newObject); - find mayInRelationpayload_reference_Spacecraft(problem,interpretation,container,newObject); + PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"spacecraft reference ConstellationMission"); + find mustInstanceOfConstellationMission_class(problem,interpretation,container); + find mayInstanceOfSmallSat_class(problem,interpretation,newObject); + find mayInRelationspacecraft_reference_ConstellationMission(problem,interpretation,container,newObject); find mustExist(problem, interpretation, container); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_InterferometryPayload_class( +pattern createObject_SmallSat_class( problem:LogicProblem, interpretation:PartialInterpretation, typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); neg find hasElementInContainment(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InterferometryPayload class"); - find mayInstanceOfInterferometryPayload_class(problem,interpretation,newObject); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"SmallSat class"); + find mayInstanceOfSmallSat_class(problem,interpretation,newObject); find mayExist(problem, interpretation, newObject); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_GroundStationNetwork_class_UndefinedPart_by_groundStationNetwork_reference_ConstellationMission( +pattern createObject_DirectedCommunicationLink_class_by_communicationLink_reference_CommSubsystem( problem:LogicProblem, interpretation:PartialInterpretation, relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"GroundStationNetwork class UndefinedPart"); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"DirectedCommunicationLink class"); PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); - PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"groundStationNetwork reference ConstellationMission"); - find mustInstanceOfConstellationMission_class(problem,interpretation,container); - find mayInstanceOfGroundStationNetwork_class_UndefinedPart(problem,interpretation,newObject); - find mayInRelationgroundStationNetwork_reference_ConstellationMission(problem,interpretation,container,newObject); + PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"communicationLink reference CommSubsystem"); + find mustInstanceOfCommSubsystem_class(problem,interpretation,container); + find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,newObject); + find mayInRelationcommunicationLink_reference_CommSubsystem(problem,interpretation,container,newObject); find mustExist(problem, interpretation, container); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_GroundStationNetwork_class_UndefinedPart( +pattern createObject_DirectedCommunicationLink_class( problem:LogicProblem, interpretation:PartialInterpretation, typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); neg find hasElementInContainment(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"GroundStationNetwork class UndefinedPart"); - find mayInstanceOfGroundStationNetwork_class_UndefinedPart(problem,interpretation,newObject); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"DirectedCommunicationLink class"); + find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,newObject); find mayExist(problem, interpretation, newObject); neg find mustExist(problem, interpretation, newObject); } @@ -3305,31 +3360,31 @@ pattern createObject_CubeSat3U_class( find mayExist(problem, interpretation, newObject); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_SmallSat_class_by_spacecraft_reference_ConstellationMission( +pattern createObject_CubeSat6U_class_by_spacecraft_reference_ConstellationMission( problem:LogicProblem, interpretation:PartialInterpretation, relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"SmallSat class"); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"CubeSat6U class"); PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"spacecraft reference ConstellationMission"); find mustInstanceOfConstellationMission_class(problem,interpretation,container); - find mayInstanceOfSmallSat_class(problem,interpretation,newObject); + find mayInstanceOfCubeSat6U_class(problem,interpretation,newObject); find mayInRelationspacecraft_reference_ConstellationMission(problem,interpretation,container,newObject); find mustExist(problem, interpretation, container); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_SmallSat_class( +pattern createObject_CubeSat6U_class( problem:LogicProblem, interpretation:PartialInterpretation, typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); neg find hasElementInContainment(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"SmallSat class"); - find mayInstanceOfSmallSat_class(problem,interpretation,newObject); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"CubeSat6U class"); + find mayInstanceOfCubeSat6U_class(problem,interpretation,newObject); find mayExist(problem, interpretation, newObject); neg find mustExist(problem, interpretation, newObject); } @@ -3361,31 +3416,43 @@ pattern createObject_CommSubsystem_class_UndefinedPart( find mayExist(problem, interpretation, newObject); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_CubeSat6U_class_by_spacecraft_reference_ConstellationMission( +pattern createObject_InterferometryMission_class_UndefinedPart( + problem:LogicProblem, interpretation:PartialInterpretation, + typeInterpretation:PartialComplexTypeInterpretation) +{ + find interpretation(problem,interpretation); + neg find hasElementInContainment(problem,interpretation); + PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InterferometryMission class UndefinedPart"); + find mayInstanceOfInterferometryMission_class_UndefinedPart(problem,interpretation,newObject); + find mayExist(problem, interpretation, newObject); + neg find mustExist(problem, interpretation, newObject); +} +pattern createObject_InterferometryPayload_class_by_payload_reference_Spacecraft( problem:LogicProblem, interpretation:PartialInterpretation, relationInterpretation:PartialRelationInterpretation, typeInterpretation:PartialComplexTypeInterpretation, container:DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"CubeSat6U class"); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InterferometryPayload class"); PartialInterpretation.partialrelationinterpretation(interpretation,relationInterpretation); - PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"spacecraft reference ConstellationMission"); - find mustInstanceOfConstellationMission_class(problem,interpretation,container); - find mayInstanceOfCubeSat6U_class(problem,interpretation,newObject); - find mayInRelationspacecraft_reference_ConstellationMission(problem,interpretation,container,newObject); + PartialRelationInterpretation.interpretationOf.name(relationInterpretation,"payload reference Spacecraft"); + find mustInstanceOfSpacecraft_class(problem,interpretation,container); + find mayInstanceOfInterferometryPayload_class(problem,interpretation,newObject); + find mayInRelationpayload_reference_Spacecraft(problem,interpretation,container,newObject); find mustExist(problem, interpretation, container); neg find mustExist(problem, interpretation, newObject); } -pattern createObject_CubeSat6U_class( +pattern createObject_InterferometryPayload_class( problem:LogicProblem, interpretation:PartialInterpretation, typeInterpretation:PartialComplexTypeInterpretation) { find interpretation(problem,interpretation); neg find hasElementInContainment(problem,interpretation); PartialInterpretation.partialtypeinterpratation(interpretation,typeInterpretation); - PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"CubeSat6U class"); - find mayInstanceOfCubeSat6U_class(problem,interpretation,newObject); + PartialComplexTypeInterpretation.interpretationOf.name(typeInterpretation,"InterferometryPayload class"); + find mayInstanceOfInterferometryPayload_class(problem,interpretation,newObject); find mayExist(problem, interpretation, newObject); neg find mustExist(problem, interpretation, newObject); } @@ -3393,99 +3460,114 @@ pattern createObject_CubeSat6U_class( ////////// // 4.2 Type refinement ////////// -pattern refineTypeTo_DirectedCommunicationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { +pattern refineTypeTo_GroundStationNetwork_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); - find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + find mayInstanceOfGroundStationNetwork_class_UndefinedPart(problem,interpretation,element); + neg find mustInstanceOfGroundStationNetwork_class_UndefinedPart(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfSpacecraft_class(problem,interpretation,element); } -pattern refineTypeTo_InterferometryMission_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { +pattern refineTypeTo_SmallSat_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); - find mayInstanceOfInterferometryMission_class_UndefinedPart(problem,interpretation,element); + find mayInstanceOfSmallSat_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfInterferometryMission_class_UndefinedPart(problem,interpretation,element); + neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); -} -pattern refineTypeTo_InterferometryPayload_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { - find interpretation(problem,interpretation); - PartialInterpretation.newElements(interpretation,element); - find mayInstanceOfInterferometryPayload_class(problem,interpretation,element); - neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfCubeSat_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfInterferometryPayload_class(problem,interpretation,element); } -pattern refineTypeTo_GroundStationNetwork_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { +pattern refineTypeTo_DirectedCommunicationLink_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); - find mayInstanceOfGroundStationNetwork_class_UndefinedPart(problem,interpretation,element); + find mayInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfGroundStationNetwork_class_UndefinedPart(problem,interpretation,element); - neg find mustInstanceOfSpacecraft_class(problem,interpretation,element); } pattern refineTypeTo_CubeSat3U_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); find mayInstanceOfCubeSat3U_class(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCubeSat3U_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfCubeSat6U_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); } -pattern refineTypeTo_SmallSat_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { +pattern refineTypeTo_CubeSat6U_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); - find mayInstanceOfSmallSat_class(problem,interpretation,element); + find mayInstanceOfCubeSat6U_class(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfCubeSat_class(problem,interpretation,element); + neg find mustInstanceOfSmallSat_class(problem,interpretation,element); neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); + neg find mustInstanceOfCubeSat3U_class(problem,interpretation,element); + neg find mustInstanceOfCubeSat6U_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); } pattern refineTypeTo_CommSubsystem_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); find mayInstanceOfCommSubsystem_class_UndefinedPart(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); - neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfPayload_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class_UndefinedPart(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); } -pattern refineTypeTo_CubeSat6U_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { +pattern refineTypeTo_InterferometryMission_class_UndefinedPart(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { find interpretation(problem,interpretation); PartialInterpretation.newElements(interpretation,element); - find mayInstanceOfCubeSat6U_class(problem,interpretation,element); + find mayInstanceOfInterferometryMission_class_UndefinedPart(problem,interpretation,element); neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); + neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); neg find mustInstanceOfPayload_class(problem,interpretation,element); - neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); - neg find mustInstanceOfGroundStationNetwork_class(problem,interpretation,element); + neg find mustInstanceOfInterferometryMission_class_UndefinedPart(problem,interpretation,element); +} +pattern refineTypeTo_InterferometryPayload_class(problem:LogicProblem, interpretation:PartialInterpretation, element: DefinedElement) { + find interpretation(problem,interpretation); + PartialInterpretation.newElements(interpretation,element); + find mayInstanceOfInterferometryPayload_class(problem,interpretation,element); + neg find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,element); neg find mustInstanceOfCommSubsystem_class(problem,interpretation,element); - neg find mustInstanceOfCubeSat3U_class(problem,interpretation,element); - neg find mustInstanceOfSmallSat_class(problem,interpretation,element); - neg find mustInstanceOfCubeSat6U_class(problem,interpretation,element); + neg find mustInstanceOfCommunicatingElement_class(problem,interpretation,element); + neg find mustInstanceOfConstellationMission_class(problem,interpretation,element); + neg find mustInstanceOfInterferometryPayload_class(problem,interpretation,element); } ////////// // 4.3 Relation refinement ////////// +pattern refineRelation_communicationLink_reference_CommunicatingElement( + problem:LogicProblem, interpretation:PartialInterpretation, + relationIterpretation:PartialRelationInterpretation, + from: DefinedElement, to: DefinedElement) +{ + find interpretation(problem,interpretation); + PartialInterpretation.partialrelationinterpretation(interpretation,relationIterpretation); + PartialRelationInterpretation.interpretationOf.name(relationIterpretation,"communicationLink reference CommunicatingElement"); + find mustExist(problem, interpretation, from); + find mustExist(problem, interpretation, to); + find mustInstanceOfCommunicatingElement_class(problem,interpretation,from); + find mustInstanceOfDirectedCommunicationLink_class(problem,interpretation,to); + find mayInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,from,to); + neg find mustInRelationcommunicationLink_reference_CommunicatingElement(problem,interpretation,from,to); +} pattern refineRelation_source_reference_DirectedCommunicationLink( problem:LogicProblem, interpretation:PartialInterpretation, relationIterpretation:PartialRelationInterpretation, diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/generation.logicproblem b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/generation.logicproblem index 2a54174a..2164c23c 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/generation.logicproblem +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/generation.logicproblem @@ -648,7 +648,38 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -658,15 +689,15 @@ - - - + + + - + @@ -679,25 +710,25 @@ - - - + + + - - - + + + - - + + - + @@ -707,15 +738,15 @@ - - - + + + - + @@ -728,25 +759,25 @@ - - - + + + - - - + + + - - + + - + @@ -756,15 +787,15 @@ - - - + + + - + @@ -777,25 +808,25 @@ - - - + + + - - - + + + - - + + - + @@ -805,15 +836,15 @@ - - - + + + - + @@ -826,25 +857,25 @@ - - - + + + - - - + + + - - + + - + @@ -854,15 +885,15 @@ - - - + + + - + @@ -875,31 +906,31 @@ - - - + + + - - - + + + - - + + - + - + @@ -911,46 +942,34 @@ - + - + - + - + - + - + - + - - - - - - - - - - - - - + @@ -959,55 +978,55 @@ - + - + - + - + - + - + - + - + - + - + - + - + @@ -1019,10 +1038,10 @@ - + - + @@ -1031,7 +1050,7 @@ - + @@ -1043,7 +1062,7 @@ - + @@ -1055,30 +1074,42 @@ - + - + - + - + - + - + + + + + + + + + + + + + @@ -1091,7 +1122,7 @@ - + @@ -1099,6 +1130,10 @@ + + + + @@ -1107,7 +1142,7 @@ - + @@ -1119,48 +1154,90 @@ - - - - + + + + - - + + - + + + + - - + + - - - + + + - - + + + + + + - - + + + + + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1168,18 +1245,18 @@ - + - - + + - + @@ -1194,26 +1271,26 @@ - + - - - + + + - - - + + + - - + + - + @@ -1229,22 +1306,22 @@ - - + + - - + + - + - + @@ -1259,32 +1336,32 @@ - - + + - + - - + + - + - - - + + + - + @@ -1299,32 +1376,32 @@ - - + + - + - - + + - + - - - + + + - + @@ -1335,11 +1412,11 @@ - + - + @@ -1354,14 +1431,14 @@ - - - - + + + + - - + + @@ -1372,16 +1449,16 @@ - + - - - - + + + + - + @@ -1391,24 +1468,24 @@ - - - - + + + + - + - + - + @@ -1440,46 +1517,46 @@ - + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - - + + - - - + + + - + @@ -1487,27 +1564,27 @@ - + - + - - - + + + - + @@ -1518,11 +1595,11 @@ - + - + @@ -1543,35 +1620,35 @@ - - - - - - + + + + + + - - + + - + - - + + - + - + @@ -1588,33 +1665,33 @@ - - - - - - + + + + + + - + - - - + + + - - - + + + - + @@ -1625,14 +1702,14 @@ - - - + + + - + @@ -1649,33 +1726,33 @@ - - - - - - + + + + + + - + - - - + + + - - - + + + - + @@ -1686,14 +1763,14 @@ - - - + + + - + @@ -1705,23 +1782,23 @@ - + - - - + + + - - + + - + @@ -1733,18 +1810,18 @@ - + - - - + + + - + @@ -1756,23 +1833,23 @@ - + - - - + + + - - + + - + @@ -1784,18 +1861,18 @@ - + - - - + + + - + @@ -1810,26 +1887,26 @@ - + - - - + + + - + - - - + + + - + @@ -1850,48 +1927,48 @@ - + - - + + - - + + - - - + + + - + - - - + + + - - + + - + - - + + - + @@ -1903,18 +1980,18 @@ - + - - - + + + - + @@ -1922,13 +1999,13 @@ - + - + @@ -1943,31 +2020,31 @@ - + - + - - + + - - - + + + - - + + - + @@ -1975,13 +2052,13 @@ - + - + @@ -1993,31 +2070,31 @@ - + - + - + - + - + - + @@ -2036,7 +2113,7 @@ - + @@ -2045,59 +2122,62 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + - - - + + + + + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/init.partialmodel b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/init.partialmodel index 6589a3ca..f7827e03 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/init.partialmodel +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/outputs/debug/init.partialmodel @@ -1,5 +1,5 @@ - + @@ -55,6 +55,11 @@ + + + + + @@ -63,11 +68,11 @@ - - + + - + @@ -76,8 +81,8 @@ - - + + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml index 5d75b948..d019e891 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml @@ -1,15 +1,19 @@ - - - + + + + + + - + + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore index 6f361334..4354da2c 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/.gitignore @@ -23,3 +23,5 @@ /.SpacecraftOfKind.java._trace /.NoPotentialLinkToGroundStation.java._trace /.SmallSat.java._trace +/.CommunicationLinkOfElement.java._trace +/.MultipleCommunicationLinks.java._trace diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java deleted file mode 100644 index dde3c20f..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkDoesNotStartAtContainingElement.java +++ /dev/null @@ -1,579 +0,0 @@ -/** - * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql - */ -package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; - -import hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink; -import java.util.Arrays; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.Set; -import java.util.function.Consumer; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.apache.log4j.Logger; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.viatra.query.runtime.api.IPatternMatch; -import org.eclipse.viatra.query.runtime.api.IQuerySpecification; -import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; -import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; -import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; -import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; -import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; -import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; -import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; -import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; -import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; -import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; -import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; -import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; -import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; -import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; -import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; - -/** - * A pattern-specific query specification that can instantiate Matcher in a type-safe way. - * - *

Original source: - *

- *         {@literal @}Constraint(severity = "error", key = {Link},
- *         	message = "Communication links must start from the containing element.")
- *         pattern communicationLinkDoesNotStartAtContainingElement(Link : DirectedCommunicationLink) {
- *         	CommunicatingElement.communicationLink(Element, Link);
- *         	DirectedCommunicationLink.source(Link, SourceComm);
- *         	CommunicatingElement.commSubsystem(SourceElement, SourceComm);
- *         	Element != SourceElement;
- *         }
- * 
- * - * @see Matcher - * @see Match - * - */ -@SuppressWarnings("all") -public final class CommunicationLinkDoesNotStartAtContainingElement extends BaseGeneratedEMFQuerySpecification { - /** - * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement pattern, - * to be used in conjunction with {@link Matcher}. - * - *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. - * Each instance is a (possibly partial) substitution of pattern parameters, - * usable to represent a match of the pattern in the result of a query, - * or to specify the bound (fixed) input parameters when issuing a query. - * - * @see Matcher - * - */ - public static abstract class Match extends BasePatternMatch { - private DirectedCommunicationLink fLink; - - private static List parameterNames = makeImmutableList("Link"); - - private Match(final DirectedCommunicationLink pLink) { - this.fLink = pLink; - } - - @Override - public Object get(final String parameterName) { - if ("Link".equals(parameterName)) return this.fLink; - return null; - } - - public DirectedCommunicationLink getLink() { - return this.fLink; - } - - @Override - public boolean set(final String parameterName, final Object newValue) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - if ("Link".equals(parameterName) ) { - this.fLink = (DirectedCommunicationLink) newValue; - return true; - } - return false; - } - - public void setLink(final DirectedCommunicationLink pLink) { - if (!isMutable()) throw new java.lang.UnsupportedOperationException(); - this.fLink = pLink; - } - - @Override - public String patternName() { - return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement"; - } - - @Override - public List parameterNames() { - return CommunicationLinkDoesNotStartAtContainingElement.Match.parameterNames; - } - - @Override - public Object[] toArray() { - return new Object[]{fLink}; - } - - @Override - public CommunicationLinkDoesNotStartAtContainingElement.Match toImmutable() { - return isMutable() ? newMatch(fLink) : this; - } - - @Override - public String prettyPrint() { - StringBuilder result = new StringBuilder(); - result.append("\"Link\"=" + prettyPrintValue(fLink)); - return result.toString(); - } - - @Override - public int hashCode() { - return Objects.hash(fLink); - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) { - return false; - } - if ((obj instanceof CommunicationLinkDoesNotStartAtContainingElement.Match)) { - CommunicationLinkDoesNotStartAtContainingElement.Match other = (CommunicationLinkDoesNotStartAtContainingElement.Match) obj; - return Objects.equals(fLink, other.fLink); - } else { - // this should be infrequent - if (!(obj instanceof IPatternMatch)) { - return false; - } - IPatternMatch otherSig = (IPatternMatch) obj; - return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); - } - } - - @Override - public CommunicationLinkDoesNotStartAtContainingElement specification() { - return CommunicationLinkDoesNotStartAtContainingElement.instance(); - } - - /** - * Returns an empty, mutable match. - * Fields of the mutable match can be filled to create a partial match, usable as matcher input. - * - * @return the empty match. - * - */ - public static CommunicationLinkDoesNotStartAtContainingElement.Match newEmptyMatch() { - return new Mutable(null); - } - - /** - * Returns a mutable (partial) match. - * Fields of the mutable match can be filled to create a partial match, usable as matcher input. - * - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @return the new, mutable (partial) match object. - * - */ - public static CommunicationLinkDoesNotStartAtContainingElement.Match newMutableMatch(final DirectedCommunicationLink pLink) { - return new Mutable(pLink); - } - - /** - * Returns a new (partial) match. - * This can be used e.g. to call the matcher with a partial match. - *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @return the (partial) match object. - * - */ - public static CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final DirectedCommunicationLink pLink) { - return new Immutable(pLink); - } - - private static final class Mutable extends CommunicationLinkDoesNotStartAtContainingElement.Match { - Mutable(final DirectedCommunicationLink pLink) { - super(pLink); - } - - @Override - public boolean isMutable() { - return true; - } - } - - private static final class Immutable extends CommunicationLinkDoesNotStartAtContainingElement.Match { - Immutable(final DirectedCommunicationLink pLink) { - super(pLink); - } - - @Override - public boolean isMutable() { - return false; - } - } - } - - /** - * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement pattern, - * providing pattern-specific query methods. - * - *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, - * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. - * - *

Matches of the pattern will be represented as {@link Match}. - * - *

Original source: - *

-   * {@literal @}Constraint(severity = "error", key = {Link},
-   * 	message = "Communication links must start from the containing element.")
-   * pattern communicationLinkDoesNotStartAtContainingElement(Link : DirectedCommunicationLink) {
-   * 	CommunicatingElement.communicationLink(Element, Link);
-   * 	DirectedCommunicationLink.source(Link, SourceComm);
-   * 	CommunicatingElement.commSubsystem(SourceElement, SourceComm);
-   * 	Element != SourceElement;
-   * }
-   * 
- * - * @see Match - * @see CommunicationLinkDoesNotStartAtContainingElement - * - */ - public static class Matcher extends BaseMatcher { - /** - * Initializes the pattern matcher within an existing VIATRA Query engine. - * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. - * - * @param engine the existing VIATRA Query engine in which this matcher will be created. - * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation - * - */ - public static CommunicationLinkDoesNotStartAtContainingElement.Matcher on(final ViatraQueryEngine engine) { - // check if matcher already exists - Matcher matcher = engine.getExistingMatcher(querySpecification()); - if (matcher == null) { - matcher = (Matcher)engine.getMatcher(querySpecification()); - } - return matcher; - } - - /** - * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation - * @return an initialized matcher - * @noreference This method is for internal matcher initialization by the framework, do not call it manually. - * - */ - public static CommunicationLinkDoesNotStartAtContainingElement.Matcher create() { - return new Matcher(); - } - - private static final int POSITION_LINK = 0; - - private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CommunicationLinkDoesNotStartAtContainingElement.Matcher.class); - - /** - * Initializes the pattern matcher within an existing VIATRA Query engine. - * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. - * - * @param engine the existing VIATRA Query engine in which this matcher will be created. - * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation - * - */ - private Matcher() { - super(querySpecification()); - } - - /** - * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @return matches represented as a Match object. - * - */ - public Collection getAllMatches(final DirectedCommunicationLink pLink) { - return rawStreamAllMatches(new Object[]{pLink}).collect(Collectors.toSet()); - } - - /** - * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. - *

- * NOTE: It is important not to modify the source model while the stream is being processed. - * If the match set of the pattern changes during processing, the contents of the stream is undefined. - * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @return a stream of matches represented as a Match object. - * - */ - public Stream streamAllMatches(final DirectedCommunicationLink pLink) { - return rawStreamAllMatches(new Object[]{pLink}); - } - - /** - * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. - * Neither determinism nor randomness of selection is guaranteed. - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @return a match represented as a Match object, or null if no match is found. - * - */ - public Optional getOneArbitraryMatch(final DirectedCommunicationLink pLink) { - return rawGetOneArbitraryMatch(new Object[]{pLink}); - } - - /** - * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, - * under any possible substitution of the unspecified parameters (if any). - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @return true if the input is a valid (partial) match of the pattern. - * - */ - public boolean hasMatch(final DirectedCommunicationLink pLink) { - return rawHasMatch(new Object[]{pLink}); - } - - /** - * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @return the number of pattern matches found. - * - */ - public int countMatches(final DirectedCommunicationLink pLink) { - return rawCountMatches(new Object[]{pLink}); - } - - /** - * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. - * Neither determinism nor randomness of selection is guaranteed. - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @param processor the action that will process the selected match. - * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked - * - */ - public boolean forOneArbitraryMatch(final DirectedCommunicationLink pLink, final Consumer processor) { - return rawForOneArbitraryMatch(new Object[]{pLink}, processor); - } - - /** - * Returns a new (partial) match. - * This can be used e.g. to call the matcher with a partial match. - *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. - * @param pLink the fixed value of pattern parameter Link, or null if not bound. - * @return the (partial) match object. - * - */ - public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final DirectedCommunicationLink pLink) { - return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch(pLink); - } - - /** - * Retrieve the set of values that occur in matches for Link. - * @return the Set of all values or empty set if there are no matches - * - */ - protected Stream rawStreamAllValuesOfLink(final Object[] parameters) { - return rawStreamAllValues(POSITION_LINK, parameters).map(DirectedCommunicationLink.class::cast); - } - - /** - * Retrieve the set of values that occur in matches for Link. - * @return the Set of all values or empty set if there are no matches - * - */ - public Set getAllValuesOfLink() { - return rawStreamAllValuesOfLink(emptyArray()).collect(Collectors.toSet()); - } - - /** - * Retrieve the set of values that occur in matches for Link. - * @return the Set of all values or empty set if there are no matches - * - */ - public Stream streamAllValuesOfLink() { - return rawStreamAllValuesOfLink(emptyArray()); - } - - @Override - protected CommunicationLinkDoesNotStartAtContainingElement.Match tupleToMatch(final Tuple t) { - try { - return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((DirectedCommunicationLink) t.get(POSITION_LINK)); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in tuple not properly typed!",e); - return null; - } - } - - @Override - protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatch(final Object[] match) { - try { - return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((DirectedCommunicationLink) match[POSITION_LINK]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - @Override - protected CommunicationLinkDoesNotStartAtContainingElement.Match arrayToMatchMutable(final Object[] match) { - try { - return CommunicationLinkDoesNotStartAtContainingElement.Match.newMutableMatch((DirectedCommunicationLink) match[POSITION_LINK]); - } catch(ClassCastException e) { - LOGGER.error("Element(s) in array not properly typed!",e); - return null; - } - } - - /** - * @return the singleton instance of the query specification of this pattern - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static IQuerySpecification querySpecification() { - return CommunicationLinkDoesNotStartAtContainingElement.instance(); - } - } - - private CommunicationLinkDoesNotStartAtContainingElement() { - super(GeneratedPQuery.INSTANCE); - } - - /** - * @return the singleton instance of the query specification - * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded - * - */ - public static CommunicationLinkDoesNotStartAtContainingElement instance() { - try{ - return LazyHolder.INSTANCE; - } catch (ExceptionInInitializerError err) { - throw processInitializerError(err); - } - } - - @Override - protected CommunicationLinkDoesNotStartAtContainingElement.Matcher instantiate(final ViatraQueryEngine engine) { - return CommunicationLinkDoesNotStartAtContainingElement.Matcher.on(engine); - } - - @Override - public CommunicationLinkDoesNotStartAtContainingElement.Matcher instantiate() { - return CommunicationLinkDoesNotStartAtContainingElement.Matcher.create(); - } - - @Override - public CommunicationLinkDoesNotStartAtContainingElement.Match newEmptyMatch() { - return CommunicationLinkDoesNotStartAtContainingElement.Match.newEmptyMatch(); - } - - @Override - public CommunicationLinkDoesNotStartAtContainingElement.Match newMatch(final Object... parameters) { - return CommunicationLinkDoesNotStartAtContainingElement.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink) parameters[0]); - } - - /** - * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement (visibility: PUBLIC, simpleName: CommunicationLinkDoesNotStartAtContainingElement, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created - * not at the class load time of the outer class, - * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement (visibility: PUBLIC, simpleName: CommunicationLinkDoesNotStartAtContainingElement, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. - * - *

This workaround is required e.g. to support recursion. - * - */ - private static class LazyHolder { - private static final CommunicationLinkDoesNotStartAtContainingElement INSTANCE = new CommunicationLinkDoesNotStartAtContainingElement(); - - /** - * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. - * This initialization order is required to support indirect recursion. - * - *

The static initializer is defined using a helper field to work around limitations of the code generator. - * - */ - private static final Object STATIC_INITIALIZER = ensureInitialized(); - - public static Object ensureInitialized() { - INSTANCE.ensureInitializedInternal(); - return null; - } - } - - private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { - private static final CommunicationLinkDoesNotStartAtContainingElement.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - - private final PParameter parameter_Link = new PParameter("Link", "hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); - - private final List parameters = Arrays.asList(parameter_Link); - - private GeneratedPQuery() { - super(PVisibility.PUBLIC); - } - - @Override - public String getFullyQualifiedName() { - return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement"; - } - - @Override - public List getParameterNames() { - return Arrays.asList("Link"); - } - - @Override - public List getParameters() { - return parameters; - } - - @Override - public Set doGetContainedBodies() { - setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); - Set bodies = new LinkedHashSet<>(); - { - PBody body = new PBody(this); - PVariable var_Link = body.getOrCreateVariableByName("Link"); - PVariable var_Element = body.getOrCreateVariableByName("Element"); - PVariable var_SourceComm = body.getOrCreateVariableByName("SourceComm"); - PVariable var_SourceElement = body.getOrCreateVariableByName("SourceElement"); - new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); - body.setSymbolicParameters(Arrays.asList( - new ExportedParameter(body, var_Link, parameter_Link) - )); - // CommunicatingElement.communicationLink(Element, Link) - new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); - PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); - new TypeConstraint(body, Tuples.flatTupleOf(var_Element, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "communicationLink"))); - new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); - new Equality(body, var__virtual_0_, var_Link); - // DirectedCommunicationLink.source(Link, SourceComm) - new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); - PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); - new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source"))); - new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); - new Equality(body, var__virtual_1_, var_SourceComm); - // CommunicatingElement.commSubsystem(SourceElement, SourceComm) - new TypeConstraint(body, Tuples.flatTupleOf(var_SourceElement), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); - PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); - new TypeConstraint(body, Tuples.flatTupleOf(var_SourceElement, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); - new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); - new Equality(body, var__virtual_2_, var_SourceComm); - // Element != SourceElement - new Inequality(body, var_Element, var_SourceElement); - bodies.add(body); - } - { - PAnnotation annotation = new PAnnotation("Constraint"); - annotation.addAttribute("severity", "error"); - annotation.addAttribute("key", Arrays.asList(new Object[] { - new ParameterReference("Link") - })); - annotation.addAttribute("message", "Communication links must start from the containing element."); - addAnnotation(annotation); - } - return bodies; - } - } -} diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkOfElement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkOfElement.java new file mode 100644 index 00000000..1327c6bf --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLinkOfElement.java @@ -0,0 +1,705 @@ +/** + * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql + */ +package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.CommunicatingElement; +import satellite.DirectedCommunicationLink; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         {@literal @}QueryBasedFeature(feature = "communicationLink")
+ *         pattern communicationLinkOfElement(Element : CommunicatingElement, Link : DirectedCommunicationLink) {
+ *         	CommunicatingElement.commSubsystem.communicationLink(Element, Link);
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class CommunicationLinkOfElement extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkOfElement pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private CommunicatingElement fElement; + + private DirectedCommunicationLink fLink; + + private static List parameterNames = makeImmutableList("Element", "Link"); + + private Match(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + this.fElement = pElement; + this.fLink = pLink; + } + + @Override + public Object get(final String parameterName) { + if ("Element".equals(parameterName)) return this.fElement; + if ("Link".equals(parameterName)) return this.fLink; + return null; + } + + public CommunicatingElement getElement() { + return this.fElement; + } + + public DirectedCommunicationLink getLink() { + return this.fLink; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("Element".equals(parameterName) ) { + this.fElement = (CommunicatingElement) newValue; + return true; + } + if ("Link".equals(parameterName) ) { + this.fLink = (DirectedCommunicationLink) newValue; + return true; + } + return false; + } + + public void setElement(final CommunicatingElement pElement) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fElement = pElement; + } + + public void setLink(final DirectedCommunicationLink pLink) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fLink = pLink; + } + + @Override + public String patternName() { + return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkOfElement"; + } + + @Override + public List parameterNames() { + return CommunicationLinkOfElement.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fElement, fLink}; + } + + @Override + public CommunicationLinkOfElement.Match toImmutable() { + return isMutable() ? newMatch(fElement, fLink) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"Element\"=" + prettyPrintValue(fElement) + ", "); + result.append("\"Link\"=" + prettyPrintValue(fLink)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fElement, fLink); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof CommunicationLinkOfElement.Match)) { + CommunicationLinkOfElement.Match other = (CommunicationLinkOfElement.Match) obj; + return Objects.equals(fElement, other.fElement) && Objects.equals(fLink, other.fLink); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public CommunicationLinkOfElement specification() { + return CommunicationLinkOfElement.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static CommunicationLinkOfElement.Match newEmptyMatch() { + return new Mutable(null, null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static CommunicationLinkOfElement.Match newMutableMatch(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + return new Mutable(pElement, pLink); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @return the (partial) match object. + * + */ + public static CommunicationLinkOfElement.Match newMatch(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + return new Immutable(pElement, pLink); + } + + private static final class Mutable extends CommunicationLinkOfElement.Match { + Mutable(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + super(pElement, pLink); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends CommunicationLinkOfElement.Match { + Immutable(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + super(pElement, pLink); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkOfElement pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * {@literal @}QueryBasedFeature(feature = "communicationLink")
+   * pattern communicationLinkOfElement(Element : CommunicatingElement, Link : DirectedCommunicationLink) {
+   * 	CommunicatingElement.commSubsystem.communicationLink(Element, Link);
+   * }
+   * 
+ * + * @see Match + * @see CommunicationLinkOfElement + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static CommunicationLinkOfElement.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static CommunicationLinkOfElement.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_ELEMENT = 0; + + private static final int POSITION_LINK = 1; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CommunicationLinkOfElement.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + return rawStreamAllMatches(new Object[]{pElement, pLink}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + return rawStreamAllMatches(new Object[]{pElement, pLink}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + return rawGetOneArbitraryMatch(new Object[]{pElement, pLink}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + return rawHasMatch(new Object[]{pElement, pLink}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + return rawCountMatches(new Object[]{pElement, pLink}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final CommunicatingElement pElement, final DirectedCommunicationLink pLink, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pElement, pLink}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param pLink the fixed value of pattern parameter Link, or null if not bound. + * @return the (partial) match object. + * + */ + public CommunicationLinkOfElement.Match newMatch(final CommunicatingElement pElement, final DirectedCommunicationLink pLink) { + return CommunicationLinkOfElement.Match.newMatch(pElement, pLink); + } + + /** + * Retrieve the set of values that occur in matches for Element. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfElement(final Object[] parameters) { + return rawStreamAllValues(POSITION_ELEMENT, parameters).map(CommunicatingElement.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for Element. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfElement() { + return rawStreamAllValuesOfElement(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for Element. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfElement() { + return rawStreamAllValuesOfElement(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for Element. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfElement(final CommunicationLinkOfElement.Match partialMatch) { + return rawStreamAllValuesOfElement(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for Element. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfElement(final DirectedCommunicationLink pLink) { + return rawStreamAllValuesOfElement(new Object[]{null, pLink}); + } + + /** + * Retrieve the set of values that occur in matches for Element. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfElement(final CommunicationLinkOfElement.Match partialMatch) { + return rawStreamAllValuesOfElement(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for Element. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfElement(final DirectedCommunicationLink pLink) { + return rawStreamAllValuesOfElement(new Object[]{null, pLink}).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for Link. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfLink(final Object[] parameters) { + return rawStreamAllValues(POSITION_LINK, parameters).map(DirectedCommunicationLink.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for Link. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfLink() { + return rawStreamAllValuesOfLink(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for Link. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfLink() { + return rawStreamAllValuesOfLink(emptyArray()); + } + + /** + * Retrieve the set of values that occur in matches for Link. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfLink(final CommunicationLinkOfElement.Match partialMatch) { + return rawStreamAllValuesOfLink(partialMatch.toArray()); + } + + /** + * Retrieve the set of values that occur in matches for Link. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * + * @return the Stream of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfLink(final CommunicatingElement pElement) { + return rawStreamAllValuesOfLink(new Object[]{pElement, null}); + } + + /** + * Retrieve the set of values that occur in matches for Link. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfLink(final CommunicationLinkOfElement.Match partialMatch) { + return rawStreamAllValuesOfLink(partialMatch.toArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for Link. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfLink(final CommunicatingElement pElement) { + return rawStreamAllValuesOfLink(new Object[]{pElement, null}).collect(Collectors.toSet()); + } + + @Override + protected CommunicationLinkOfElement.Match tupleToMatch(final Tuple t) { + try { + return CommunicationLinkOfElement.Match.newMatch((CommunicatingElement) t.get(POSITION_ELEMENT), (DirectedCommunicationLink) t.get(POSITION_LINK)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected CommunicationLinkOfElement.Match arrayToMatch(final Object[] match) { + try { + return CommunicationLinkOfElement.Match.newMatch((CommunicatingElement) match[POSITION_ELEMENT], (DirectedCommunicationLink) match[POSITION_LINK]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected CommunicationLinkOfElement.Match arrayToMatchMutable(final Object[] match) { + try { + return CommunicationLinkOfElement.Match.newMutableMatch((CommunicatingElement) match[POSITION_ELEMENT], (DirectedCommunicationLink) match[POSITION_LINK]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return CommunicationLinkOfElement.instance(); + } + } + + private CommunicationLinkOfElement() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static CommunicationLinkOfElement instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected CommunicationLinkOfElement.Matcher instantiate(final ViatraQueryEngine engine) { + return CommunicationLinkOfElement.Matcher.on(engine); + } + + @Override + public CommunicationLinkOfElement.Matcher instantiate() { + return CommunicationLinkOfElement.Matcher.create(); + } + + @Override + public CommunicationLinkOfElement.Match newEmptyMatch() { + return CommunicationLinkOfElement.Match.newEmptyMatch(); + } + + @Override + public CommunicationLinkOfElement.Match newMatch(final Object... parameters) { + return CommunicationLinkOfElement.Match.newMatch((satellite.CommunicatingElement) parameters[0], (satellite.DirectedCommunicationLink) parameters[1]); + } + + /** + * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkOfElement (visibility: PUBLIC, simpleName: CommunicationLinkOfElement, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkOfElement, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkOfElement (visibility: PUBLIC, simpleName: CommunicationLinkOfElement, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkOfElement, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final CommunicationLinkOfElement INSTANCE = new CommunicationLinkOfElement(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final CommunicationLinkOfElement.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + + private final PParameter parameter_Link = new PParameter("Link", "satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_Element, parameter_Link); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkOfElement"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("Element","Link"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_Element = body.getOrCreateVariableByName("Element"); + PVariable var_Link = body.getOrCreateVariableByName("Link"); + new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); + new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_Element, parameter_Element), + new ExportedParameter(body, var_Link, parameter_Link) + )); + // CommunicatingElement.commSubsystem.communicationLink(Element, Link) + new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_Element, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); + PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "communicationLink"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); + new Equality(body, var__virtual_1_, var_Link); + bodies.add(body); + } + { + PAnnotation annotation = new PAnnotation("QueryBasedFeature"); + annotation.addAttribute("feature", "communicationLink"); + addAnnotation(annotation); + } + return bodies; + } + } +} diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java index f5835baf..ede57df8 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CommunicationLoop.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink; import java.util.Arrays; import java.util.Collection; @@ -39,6 +38,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.CommunicatingElement; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -472,7 +472,7 @@ public final class CommunicationLoop extends BaseGeneratedEMFQuerySpecification< @Override public CommunicationLoop.Match newMatch(final Object... parameters) { - return CommunicationLoop.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement) parameters[0]); + return CommunicationLoop.Match.newMatch((satellite.CommunicatingElement) parameters[0]); } /** @@ -504,7 +504,7 @@ public final class CommunicationLoop extends BaseGeneratedEMFQuerySpecification< private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final CommunicationLoop.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Element = new PParameter("Element", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Element); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java index ba69943a..b73cb23f 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CubeSatWithKaAntenna.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat; import java.util.Arrays; import java.util.Collection; @@ -44,6 +43,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.Spacecraft; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -477,7 +477,7 @@ public final class CubeSatWithKaAntenna extends BaseGeneratedEMFQuerySpecificati @Override public CubeSatWithKaAntenna.Match newMatch(final Object... parameters) { - return CubeSatWithKaAntenna.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft) parameters[0]); + return CubeSatWithKaAntenna.Match.newMatch((satellite.Spacecraft) parameters[0]); } /** @@ -509,7 +509,7 @@ public final class CubeSatWithKaAntenna extends BaseGeneratedEMFQuerySpecificati private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final CubeSatWithKaAntenna.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); + private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Spacecraft); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java index 4cacc34b..f2713f45 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetBand.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBand; import java.util.Arrays; import java.util.Collection; @@ -43,6 +42,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.DirectedCommunicationLink; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -480,7 +480,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery @Override public IncompatibleSourceAndTargetBand.Match newMatch(final Object... parameters) { - return IncompatibleSourceAndTargetBand.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink) parameters[0]); + return IncompatibleSourceAndTargetBand.Match.newMatch((satellite.DirectedCommunicationLink) parameters[0]); } /** @@ -512,7 +512,7 @@ public final class IncompatibleSourceAndTargetBand extends BaseGeneratedEMFQuery private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final IncompatibleSourceAndTargetBand.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Link = new PParameter("Link", "hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); + private final PParameter parameter_Link = new PParameter("Link", "satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Link); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetGain.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetGain.java index 3f247613..33a4b067 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetGain.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/IncompatibleSourceAndTargetGain.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemGain; import java.util.Arrays; import java.util.Collection; @@ -43,6 +42,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.DirectedCommunicationLink; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -476,7 +476,7 @@ public final class IncompatibleSourceAndTargetGain extends BaseGeneratedEMFQuery @Override public IncompatibleSourceAndTargetGain.Match newMatch(final Object... parameters) { - return IncompatibleSourceAndTargetGain.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink) parameters[0]); + return IncompatibleSourceAndTargetGain.Match.newMatch((satellite.DirectedCommunicationLink) parameters[0]); } /** @@ -508,7 +508,7 @@ public final class IncompatibleSourceAndTargetGain extends BaseGeneratedEMFQuery private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final IncompatibleSourceAndTargetGain.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Link = new PParameter("Link", "hu.bme.mit.inf.dslreasoner.domains.satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); + private final PParameter parameter_Link = new PParameter("Link", "satellite.DirectedCommunicationLink", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "DirectedCommunicationLink")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Link); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/KaAntennaGainLow.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/KaAntennaGainLow.java index 18f6c32f..37c35bfe 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/KaAntennaGainLow.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/KaAntennaGainLow.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem; import java.util.Arrays; import java.util.Collection; import java.util.LinkedHashSet; @@ -42,6 +41,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.CommSubsystem; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -475,7 +475,7 @@ public final class KaAntennaGainLow extends BaseGeneratedEMFQuerySpecification parameters = Arrays.asList(parameter_Comm); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/MultipleCommunicationLinks.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/MultipleCommunicationLinks.java new file mode 100644 index 00000000..ad82ead9 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/MultipleCommunicationLinks.java @@ -0,0 +1,576 @@ +/** + * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql + */ +package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; + +import java.util.Arrays; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.function.Consumer; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import org.apache.log4j.Logger; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.viatra.query.runtime.api.IPatternMatch; +import org.eclipse.viatra.query.runtime.api.IQuerySpecification; +import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; +import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; +import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; +import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; +import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; +import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; +import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; +import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; +import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; +import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; +import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; +import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; +import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; +import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.CommunicatingElement; + +/** + * A pattern-specific query specification that can instantiate Matcher in a type-safe way. + * + *

Original source: + *

+ *         {@literal @}Constraint(severity = "error", key = {Element},
+ *         	message = "Only one communication link is allowed per element.")
+ *         pattern multipleCommunicationLinks(Element : CommunicatingElement) {
+ *         	CommunicatingElement.commSubsystem.communicationLink(Element, Link1);
+ *         	CommunicatingElement.commSubsystem.communicationLink(Element, Link2);
+ *         	Link1 != Link2;
+ *         }
+ * 
+ * + * @see Matcher + * @see Match + * + */ +@SuppressWarnings("all") +public final class MultipleCommunicationLinks extends BaseGeneratedEMFQuerySpecification { + /** + * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.multipleCommunicationLinks pattern, + * to be used in conjunction with {@link Matcher}. + * + *

Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. + * Each instance is a (possibly partial) substitution of pattern parameters, + * usable to represent a match of the pattern in the result of a query, + * or to specify the bound (fixed) input parameters when issuing a query. + * + * @see Matcher + * + */ + public static abstract class Match extends BasePatternMatch { + private CommunicatingElement fElement; + + private static List parameterNames = makeImmutableList("Element"); + + private Match(final CommunicatingElement pElement) { + this.fElement = pElement; + } + + @Override + public Object get(final String parameterName) { + if ("Element".equals(parameterName)) return this.fElement; + return null; + } + + public CommunicatingElement getElement() { + return this.fElement; + } + + @Override + public boolean set(final String parameterName, final Object newValue) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + if ("Element".equals(parameterName) ) { + this.fElement = (CommunicatingElement) newValue; + return true; + } + return false; + } + + public void setElement(final CommunicatingElement pElement) { + if (!isMutable()) throw new java.lang.UnsupportedOperationException(); + this.fElement = pElement; + } + + @Override + public String patternName() { + return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.multipleCommunicationLinks"; + } + + @Override + public List parameterNames() { + return MultipleCommunicationLinks.Match.parameterNames; + } + + @Override + public Object[] toArray() { + return new Object[]{fElement}; + } + + @Override + public MultipleCommunicationLinks.Match toImmutable() { + return isMutable() ? newMatch(fElement) : this; + } + + @Override + public String prettyPrint() { + StringBuilder result = new StringBuilder(); + result.append("\"Element\"=" + prettyPrintValue(fElement)); + return result.toString(); + } + + @Override + public int hashCode() { + return Objects.hash(fElement); + } + + @Override + public boolean equals(final Object obj) { + if (this == obj) + return true; + if (obj == null) { + return false; + } + if ((obj instanceof MultipleCommunicationLinks.Match)) { + MultipleCommunicationLinks.Match other = (MultipleCommunicationLinks.Match) obj; + return Objects.equals(fElement, other.fElement); + } else { + // this should be infrequent + if (!(obj instanceof IPatternMatch)) { + return false; + } + IPatternMatch otherSig = (IPatternMatch) obj; + return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); + } + } + + @Override + public MultipleCommunicationLinks specification() { + return MultipleCommunicationLinks.instance(); + } + + /** + * Returns an empty, mutable match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @return the empty match. + * + */ + public static MultipleCommunicationLinks.Match newEmptyMatch() { + return new Mutable(null); + } + + /** + * Returns a mutable (partial) match. + * Fields of the mutable match can be filled to create a partial match, usable as matcher input. + * + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @return the new, mutable (partial) match object. + * + */ + public static MultipleCommunicationLinks.Match newMutableMatch(final CommunicatingElement pElement) { + return new Mutable(pElement); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @return the (partial) match object. + * + */ + public static MultipleCommunicationLinks.Match newMatch(final CommunicatingElement pElement) { + return new Immutable(pElement); + } + + private static final class Mutable extends MultipleCommunicationLinks.Match { + Mutable(final CommunicatingElement pElement) { + super(pElement); + } + + @Override + public boolean isMutable() { + return true; + } + } + + private static final class Immutable extends MultipleCommunicationLinks.Match { + Immutable(final CommunicatingElement pElement) { + super(pElement); + } + + @Override + public boolean isMutable() { + return false; + } + } + } + + /** + * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.multipleCommunicationLinks pattern, + * providing pattern-specific query methods. + * + *

Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, + * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. + * + *

Matches of the pattern will be represented as {@link Match}. + * + *

Original source: + *

+   * {@literal @}Constraint(severity = "error", key = {Element},
+   * 	message = "Only one communication link is allowed per element.")
+   * pattern multipleCommunicationLinks(Element : CommunicatingElement) {
+   * 	CommunicatingElement.commSubsystem.communicationLink(Element, Link1);
+   * 	CommunicatingElement.commSubsystem.communicationLink(Element, Link2);
+   * 	Link1 != Link2;
+   * }
+   * 
+ * + * @see Match + * @see MultipleCommunicationLinks + * + */ + public static class Matcher extends BaseMatcher { + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + public static MultipleCommunicationLinks.Matcher on(final ViatraQueryEngine engine) { + // check if matcher already exists + Matcher matcher = engine.getExistingMatcher(querySpecification()); + if (matcher == null) { + matcher = (Matcher)engine.getMatcher(querySpecification()); + } + return matcher; + } + + /** + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * @return an initialized matcher + * @noreference This method is for internal matcher initialization by the framework, do not call it manually. + * + */ + public static MultipleCommunicationLinks.Matcher create() { + return new Matcher(); + } + + private static final int POSITION_ELEMENT = 0; + + private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(MultipleCommunicationLinks.Matcher.class); + + /** + * Initializes the pattern matcher within an existing VIATRA Query engine. + * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. + * + * @param engine the existing VIATRA Query engine in which this matcher will be created. + * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation + * + */ + private Matcher() { + super(querySpecification()); + } + + /** + * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @return matches represented as a Match object. + * + */ + public Collection getAllMatches(final CommunicatingElement pElement) { + return rawStreamAllMatches(new Object[]{pElement}).collect(Collectors.toSet()); + } + + /** + * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. + *

+ * NOTE: It is important not to modify the source model while the stream is being processed. + * If the match set of the pattern changes during processing, the contents of the stream is undefined. + * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @return a stream of matches represented as a Match object. + * + */ + public Stream streamAllMatches(final CommunicatingElement pElement) { + return rawStreamAllMatches(new Object[]{pElement}); + } + + /** + * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @return a match represented as a Match object, or null if no match is found. + * + */ + public Optional getOneArbitraryMatch(final CommunicatingElement pElement) { + return rawGetOneArbitraryMatch(new Object[]{pElement}); + } + + /** + * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, + * under any possible substitution of the unspecified parameters (if any). + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @return true if the input is a valid (partial) match of the pattern. + * + */ + public boolean hasMatch(final CommunicatingElement pElement) { + return rawHasMatch(new Object[]{pElement}); + } + + /** + * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @return the number of pattern matches found. + * + */ + public int countMatches(final CommunicatingElement pElement) { + return rawCountMatches(new Object[]{pElement}); + } + + /** + * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. + * Neither determinism nor randomness of selection is guaranteed. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @param processor the action that will process the selected match. + * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked + * + */ + public boolean forOneArbitraryMatch(final CommunicatingElement pElement, final Consumer processor) { + return rawForOneArbitraryMatch(new Object[]{pElement}, processor); + } + + /** + * Returns a new (partial) match. + * This can be used e.g. to call the matcher with a partial match. + *

The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. + * @param pElement the fixed value of pattern parameter Element, or null if not bound. + * @return the (partial) match object. + * + */ + public MultipleCommunicationLinks.Match newMatch(final CommunicatingElement pElement) { + return MultipleCommunicationLinks.Match.newMatch(pElement); + } + + /** + * Retrieve the set of values that occur in matches for Element. + * @return the Set of all values or empty set if there are no matches + * + */ + protected Stream rawStreamAllValuesOfElement(final Object[] parameters) { + return rawStreamAllValues(POSITION_ELEMENT, parameters).map(CommunicatingElement.class::cast); + } + + /** + * Retrieve the set of values that occur in matches for Element. + * @return the Set of all values or empty set if there are no matches + * + */ + public Set getAllValuesOfElement() { + return rawStreamAllValuesOfElement(emptyArray()).collect(Collectors.toSet()); + } + + /** + * Retrieve the set of values that occur in matches for Element. + * @return the Set of all values or empty set if there are no matches + * + */ + public Stream streamAllValuesOfElement() { + return rawStreamAllValuesOfElement(emptyArray()); + } + + @Override + protected MultipleCommunicationLinks.Match tupleToMatch(final Tuple t) { + try { + return MultipleCommunicationLinks.Match.newMatch((CommunicatingElement) t.get(POSITION_ELEMENT)); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in tuple not properly typed!",e); + return null; + } + } + + @Override + protected MultipleCommunicationLinks.Match arrayToMatch(final Object[] match) { + try { + return MultipleCommunicationLinks.Match.newMatch((CommunicatingElement) match[POSITION_ELEMENT]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + @Override + protected MultipleCommunicationLinks.Match arrayToMatchMutable(final Object[] match) { + try { + return MultipleCommunicationLinks.Match.newMutableMatch((CommunicatingElement) match[POSITION_ELEMENT]); + } catch(ClassCastException e) { + LOGGER.error("Element(s) in array not properly typed!",e); + return null; + } + } + + /** + * @return the singleton instance of the query specification of this pattern + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static IQuerySpecification querySpecification() { + return MultipleCommunicationLinks.instance(); + } + } + + private MultipleCommunicationLinks() { + super(GeneratedPQuery.INSTANCE); + } + + /** + * @return the singleton instance of the query specification + * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded + * + */ + public static MultipleCommunicationLinks instance() { + try{ + return LazyHolder.INSTANCE; + } catch (ExceptionInInitializerError err) { + throw processInitializerError(err); + } + } + + @Override + protected MultipleCommunicationLinks.Matcher instantiate(final ViatraQueryEngine engine) { + return MultipleCommunicationLinks.Matcher.on(engine); + } + + @Override + public MultipleCommunicationLinks.Matcher instantiate() { + return MultipleCommunicationLinks.Matcher.create(); + } + + @Override + public MultipleCommunicationLinks.Match newEmptyMatch() { + return MultipleCommunicationLinks.Match.newEmptyMatch(); + } + + @Override + public MultipleCommunicationLinks.Match newMatch(final Object... parameters) { + return MultipleCommunicationLinks.Match.newMatch((satellite.CommunicatingElement) parameters[0]); + } + + /** + * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.MultipleCommunicationLinks (visibility: PUBLIC, simpleName: MultipleCommunicationLinks, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.MultipleCommunicationLinks, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created + * not at the class load time of the outer class, + * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.MultipleCommunicationLinks (visibility: PUBLIC, simpleName: MultipleCommunicationLinks, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.MultipleCommunicationLinks, deprecated: ) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. + * + *

This workaround is required e.g. to support recursion. + * + */ + private static class LazyHolder { + private static final MultipleCommunicationLinks INSTANCE = new MultipleCommunicationLinks(); + + /** + * Statically initializes the query specification after the field {@link #INSTANCE} is assigned. + * This initialization order is required to support indirect recursion. + * + *

The static initializer is defined using a helper field to work around limitations of the code generator. + * + */ + private static final Object STATIC_INITIALIZER = ensureInitialized(); + + public static Object ensureInitialized() { + INSTANCE.ensureInitializedInternal(); + return null; + } + } + + private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { + private static final MultipleCommunicationLinks.GeneratedPQuery INSTANCE = new GeneratedPQuery(); + + private final PParameter parameter_Element = new PParameter("Element", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + + private final List parameters = Arrays.asList(parameter_Element); + + private GeneratedPQuery() { + super(PVisibility.PUBLIC); + } + + @Override + public String getFullyQualifiedName() { + return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.multipleCommunicationLinks"; + } + + @Override + public List getParameterNames() { + return Arrays.asList("Element"); + } + + @Override + public List getParameters() { + return parameters; + } + + @Override + public Set doGetContainedBodies() { + setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); + Set bodies = new LinkedHashSet<>(); + { + PBody body = new PBody(this); + PVariable var_Element = body.getOrCreateVariableByName("Element"); + PVariable var_Link1 = body.getOrCreateVariableByName("Link1"); + PVariable var_Link2 = body.getOrCreateVariableByName("Link2"); + new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); + body.setSymbolicParameters(Arrays.asList( + new ExportedParameter(body, var_Element, parameter_Element) + )); + // CommunicatingElement.commSubsystem.communicationLink(Element, Link1) + new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); + PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_Element, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); + PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "communicationLink"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); + new Equality(body, var__virtual_1_, var_Link1); + // CommunicatingElement.commSubsystem.communicationLink(Element, Link2) + new TypeConstraint(body, Tuples.flatTupleOf(var_Element), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement"))); + PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); + new TypeConstraint(body, Tuples.flatTupleOf(var_Element, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem"))); + PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "communicationLink"))); + new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink"))); + new Equality(body, var__virtual_3_, var_Link2); + // Link1 != Link2 + new Inequality(body, var_Link1, var_Link2); + bodies.add(body); + } + { + PAnnotation annotation = new PAnnotation("Constraint"); + annotation.addAttribute("severity", "error"); + annotation.addAttribute("key", Arrays.asList(new Object[] { + new ParameterReference("Element") + })); + annotation.addAttribute("message", "Only one communication link is allowed per element."); + addAnnotation(annotation); + } + return bodies; + } + } +} diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java index 598f3a6b..45952f33 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoLinkToGroundStation.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink; import java.util.Arrays; import java.util.Collection; @@ -41,6 +40,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.Spacecraft; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -476,7 +476,7 @@ public final class NoLinkToGroundStation extends BaseGeneratedEMFQuerySpecificat @Override public NoLinkToGroundStation.Match newMatch(final Object... parameters) { - return NoLinkToGroundStation.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft) parameters[0]); + return NoLinkToGroundStation.Match.newMatch((satellite.Spacecraft) parameters[0]); } /** @@ -508,7 +508,7 @@ public final class NoLinkToGroundStation extends BaseGeneratedEMFQuerySpecificat private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final NoLinkToGroundStation.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); + private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Spacecraft); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java index 1e8f8502..3366de46 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NoPotentialLinkToGroundStation.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed; import java.util.Arrays; import java.util.Collection; @@ -41,6 +40,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.Spacecraft; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -472,7 +472,7 @@ public final class NoPotentialLinkToGroundStation extends BaseGeneratedEMFQueryS @Override public NoPotentialLinkToGroundStation.Match newMatch(final Object... parameters) { - return NoPotentialLinkToGroundStation.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft) parameters[0]); + return NoPotentialLinkToGroundStation.Match.newMatch((satellite.Spacecraft) parameters[0]); } /** @@ -504,7 +504,7 @@ public final class NoPotentialLinkToGroundStation extends BaseGeneratedEMFQueryS private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final NoPotentialLinkToGroundStation.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); + private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Spacecraft); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java index d75dea5f..bdd97100 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/NotEnoughInterferometryPayloads.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads; import java.util.Arrays; import java.util.Collection; @@ -39,6 +38,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.InterferometryMission; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -472,7 +472,7 @@ public final class NotEnoughInterferometryPayloads extends BaseGeneratedEMFQuery @Override public NotEnoughInterferometryPayloads.Match newMatch(final Object... parameters) { - return NotEnoughInterferometryPayloads.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission) parameters[0]); + return NotEnoughInterferometryPayloads.Match.newMatch((satellite.InterferometryMission) parameters[0]); } /** @@ -504,7 +504,7 @@ public final class NotEnoughInterferometryPayloads extends BaseGeneratedEMFQuery private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final NotEnoughInterferometryPayloads.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Mission = new PParameter("Mission", "hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT); + private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Mission); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java index c86761ce..d7378783 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java @@ -3,12 +3,13 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement; +import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkOfElement; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetGain; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.KaAntennaGainLow; +import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.MultipleCommunicationLinks; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads; @@ -28,7 +29,8 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; * in order to achieve better performance than one-by-one on-demand matcher initialization. * *

From package hu.bme.mit.inf.dslreasoner.domains.satellite.queries, the group contains the definition of the following patterns:

    - *
  • communicationLinkDoesNotStartAtContainingElement
  • + *
  • multipleCommunicationLinks
  • + *
  • communicationLinkOfElement
  • *
  • notEnoughInterferometryPayloads
  • *
  • noLinkToGroundStation
  • *
  • noPotentialLinkToGroundStation
  • @@ -66,7 +68,8 @@ public final class SatelliteQueries extends BaseGeneratedPatternGroup { private static SatelliteQueries INSTANCE; private SatelliteQueries() { - querySpecifications.add(CommunicationLinkDoesNotStartAtContainingElement.instance()); + querySpecifications.add(MultipleCommunicationLinks.instance()); + querySpecifications.add(CommunicationLinkOfElement.instance()); querySpecifications.add(NotEnoughInterferometryPayloads.instance()); querySpecifications.add(NoLinkToGroundStation.instance()); querySpecifications.add(NoPotentialLinkToGroundStation.instance()); @@ -82,12 +85,20 @@ public final class SatelliteQueries extends BaseGeneratedPatternGroup { querySpecifications.add(SpacecraftOfKind.instance()); } - public CommunicationLinkDoesNotStartAtContainingElement getCommunicationLinkDoesNotStartAtContainingElement() { - return CommunicationLinkDoesNotStartAtContainingElement.instance(); + public MultipleCommunicationLinks getMultipleCommunicationLinks() { + return MultipleCommunicationLinks.instance(); } - public CommunicationLinkDoesNotStartAtContainingElement.Matcher getCommunicationLinkDoesNotStartAtContainingElement(final ViatraQueryEngine engine) { - return CommunicationLinkDoesNotStartAtContainingElement.Matcher.on(engine); + public MultipleCommunicationLinks.Matcher getMultipleCommunicationLinks(final ViatraQueryEngine engine) { + return MultipleCommunicationLinks.Matcher.on(engine); + } + + public CommunicationLinkOfElement getCommunicationLinkOfElement() { + return CommunicationLinkOfElement.instance(); + } + + public CommunicationLinkOfElement.Matcher getCommunicationLinkOfElement(final ViatraQueryEngine engine) { + return CommunicationLinkOfElement.Matcher.on(engine); } public NotEnoughInterferometryPayloads getNotEnoughInterferometryPayloads() { diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java index 7bc497ab..4791740e 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SmallSat.java @@ -64,11 +64,11 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification parameterNames = makeImmutableList("Sat"); - private Match(final hu.bme.mit.inf.dslreasoner.domains.satellite.SmallSat pSat) { + private Match(final satellite.SmallSat pSat) { this.fSat = pSat; } @@ -78,7 +78,7 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification getAllMatches(final hu.bme.mit.inf.dslreasoner.domains.satellite.SmallSat pSat) { + public Collection getAllMatches(final satellite.SmallSat pSat) { return rawStreamAllMatches(new Object[]{pSat}).collect(Collectors.toSet()); } @@ -296,7 +296,7 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification streamAllMatches(final hu.bme.mit.inf.dslreasoner.domains.satellite.SmallSat pSat) { + public Stream streamAllMatches(final satellite.SmallSat pSat) { return rawStreamAllMatches(new Object[]{pSat}); } @@ -307,7 +307,7 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification getOneArbitraryMatch(final hu.bme.mit.inf.dslreasoner.domains.satellite.SmallSat pSat) { + public Optional getOneArbitraryMatch(final satellite.SmallSat pSat) { return rawGetOneArbitraryMatch(new Object[]{pSat}); } @@ -318,7 +318,7 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification processor) { + public boolean forOneArbitraryMatch(final satellite.SmallSat pSat, final Consumer processor) { return rawForOneArbitraryMatch(new Object[]{pSat}, processor); } @@ -352,7 +352,7 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification rawStreamAllValuesOfSat(final Object[] parameters) { - return rawStreamAllValues(POSITION_SAT, parameters).map(hu.bme.mit.inf.dslreasoner.domains.satellite.SmallSat.class::cast); + protected Stream rawStreamAllValuesOfSat(final Object[] parameters) { + return rawStreamAllValues(POSITION_SAT, parameters).map(satellite.SmallSat.class::cast); } /** @@ -370,7 +370,7 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification getAllValuesOfSat() { + public Set getAllValuesOfSat() { return rawStreamAllValuesOfSat(emptyArray()).collect(Collectors.toSet()); } @@ -379,14 +379,14 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification streamAllValuesOfSat() { + public Stream streamAllValuesOfSat() { return rawStreamAllValuesOfSat(emptyArray()); } @Override protected SmallSat.Match tupleToMatch(final Tuple t) { try { - return SmallSat.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.SmallSat) t.get(POSITION_SAT)); + return SmallSat.Match.newMatch((satellite.SmallSat) t.get(POSITION_SAT)); } catch(ClassCastException e) { LOGGER.error("Element(s) in tuple not properly typed!",e); return null; @@ -396,7 +396,7 @@ public final class SmallSat extends BaseGeneratedEMFQuerySpecification parameters = Arrays.asList(parameter_Sat); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SpacecraftOfKind.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SpacecraftOfKind.java index 52602bb5..ed0bd7dc 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SpacecraftOfKind.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SpacecraftOfKind.java @@ -3,8 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft; -import hu.bme.mit.inf.dslreasoner.domains.satellite.SpacecraftKind; import java.util.Arrays; import java.util.Collection; import java.util.LinkedHashSet; @@ -41,6 +39,8 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.Spacecraft; +import satellite.SpacecraftKind; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -628,7 +628,7 @@ public final class SpacecraftOfKind extends BaseGeneratedEMFQuerySpecification parameters = Arrays.asList(parameter_Spacecraft, parameter_Kind); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java index 6408033b..51b224b1 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/ThreeUCubeSatWithNonUhfCrossLink.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.CubeSat3U; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork; import java.util.Arrays; @@ -42,6 +41,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.CubeSat3U; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -485,7 +485,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer @Override public ThreeUCubeSatWithNonUhfCrossLink.Match newMatch(final Object... parameters) { - return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.CubeSat3U) parameters[0]); + return ThreeUCubeSatWithNonUhfCrossLink.Match.newMatch((satellite.CubeSat3U) parameters[0]); } /** @@ -517,7 +517,7 @@ public final class ThreeUCubeSatWithNonUhfCrossLink extends BaseGeneratedEMFQuer private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final ThreeUCubeSatWithNonUhfCrossLink.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Sat = new PParameter("Sat", "hu.bme.mit.inf.dslreasoner.domains.satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT); + private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Sat); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/UhfAntennaGainNotLow.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/UhfAntennaGainNotLow.java index 62222ded..99e472ea 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/UhfAntennaGainNotLow.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/UhfAntennaGainNotLow.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemGainLow; import java.util.Arrays; import java.util.Collection; @@ -44,6 +43,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.CommSubsystem; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -483,7 +483,7 @@ public final class UhfAntennaGainNotLow extends BaseGeneratedEMFQuerySpecificati @Override public UhfAntennaGainNotLow.Match newMatch(final Object... parameters) { - return UhfAntennaGainNotLow.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem) parameters[0]); + return UhfAntennaGainNotLow.Match.newMatch((satellite.CommSubsystem) parameters[0]); } /** @@ -515,7 +515,7 @@ public final class UhfAntennaGainNotLow extends BaseGeneratedEMFQuerySpecificati private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final UhfAntennaGainNotLow.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Comm = new PParameter("Comm", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); + private final PParameter parameter_Comm = new PParameter("Comm", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Comm); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/XAntennaGainNotMedium.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/XAntennaGainNotMedium.java index dbe6d26e..b50962c5 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/XAntennaGainNotMedium.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/XAntennaGainNotMedium.java @@ -3,7 +3,6 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries; -import hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemGainMedium; import java.util.Arrays; import java.util.Collection; @@ -44,6 +43,7 @@ import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; +import satellite.CommSubsystem; /** * A pattern-specific query specification that can instantiate Matcher in a type-safe way. @@ -477,7 +477,7 @@ public final class XAntennaGainNotMedium extends BaseGeneratedEMFQuerySpecificat @Override public XAntennaGainNotMedium.Match newMatch(final Object... parameters) { - return XAntennaGainNotMedium.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem) parameters[0]); + return XAntennaGainNotMedium.Match.newMatch((satellite.CommSubsystem) parameters[0]); } /** @@ -509,7 +509,7 @@ public final class XAntennaGainNotMedium extends BaseGeneratedEMFQuerySpecificat private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final XAntennaGainNotMedium.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Comm = new PParameter("Comm", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); + private final PParameter parameter_Comm = new PParameter("Comm", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Comm); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java index d560ac93..58e7e183 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AtLeastTwoInterferometryPayloads.java @@ -88,7 +88,7 @@ public final class AtLeastTwoInterferometryPayloads extends BaseGeneratedEMFQuer private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final AtLeastTwoInterferometryPayloads.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Mission = new PParameter("Mission", "hu.bme.mit.inf.dslreasoner.domains.satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT); + private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Mission); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBand.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBand.java index a0009587..609e0b93 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBand.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBand.java @@ -87,9 +87,9 @@ public final class CommSubsystemBand extends BaseGeneratedEMFQuerySpecificationW private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final CommSubsystemBand.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Comm = new PParameter("Comm", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); + private final PParameter parameter_Comm = new PParameter("Comm", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); - private final PParameter parameter_Band = new PParameter("Band", "hu.bme.mit.inf.dslreasoner.domains.satellite.TransceiverBand", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "TransceiverBand")), PParameterDirection.INOUT); + private final PParameter parameter_Band = new PParameter("Band", "satellite.TransceiverBand", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "TransceiverBand")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Comm, parameter_Band); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java index 51175ce3..bc25ea59 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemBandUhf.java @@ -88,7 +88,7 @@ public final class CommSubsystemBandUhf extends BaseGeneratedEMFQuerySpecificati private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final CommSubsystemBandUhf.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Comm = new PParameter("Comm", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); + private final PParameter parameter_Comm = new PParameter("Comm", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Comm); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGain.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGain.java index e2e0e2a1..69793a96 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGain.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGain.java @@ -87,9 +87,9 @@ public final class CommSubsystemGain extends BaseGeneratedEMFQuerySpecificationW private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final CommSubsystemGain.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Comm = new PParameter("Comm", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); + private final PParameter parameter_Comm = new PParameter("Comm", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); - private final PParameter parameter_Gain = new PParameter("Gain", "hu.bme.mit.inf.dslreasoner.domains.satellite.AntennaGain", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "AntennaGain")), PParameterDirection.INOUT); + private final PParameter parameter_Gain = new PParameter("Gain", "satellite.AntennaGain", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "AntennaGain")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Comm, parameter_Gain); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGainLow.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGainLow.java index 04ee67da..fd24f163 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGainLow.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGainLow.java @@ -88,7 +88,7 @@ public final class CommSubsystemGainLow extends BaseGeneratedEMFQuerySpecificati private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final CommSubsystemGainLow.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Comm = new PParameter("Comm", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); + private final PParameter parameter_Comm = new PParameter("Comm", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Comm); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGainMedium.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGainMedium.java index 4b3bc03b..82b77bbc 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGainMedium.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CommSubsystemGainMedium.java @@ -88,7 +88,7 @@ public final class CommSubsystemGainMedium extends BaseGeneratedEMFQuerySpecific private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final CommSubsystemGainMedium.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Comm = new PParameter("Comm", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); + private final PParameter parameter_Comm = new PParameter("Comm", "satellite.CommSubsystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommSubsystem")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Comm); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java index fe789893..acc60475 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/CubeSat3U.java @@ -83,7 +83,7 @@ public final class CubeSat3U extends BaseGeneratedEMFQuerySpecificationWithGener private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final CubeSat3U.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Sat = new PParameter("Sat", "hu.bme.mit.inf.dslreasoner.domains.satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT); + private final PParameter parameter_Sat = new PParameter("Sat", "satellite.CubeSat3U", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CubeSat3U")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Sat); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java index d6f5c53b..a2123354 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/DirectCommunicationLink.java @@ -88,9 +88,9 @@ public final class DirectCommunicationLink extends BaseGeneratedEMFQuerySpecific private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final DirectCommunicationLink.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Source = new PParameter("Source", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + private final PParameter parameter_Source = new PParameter("Source", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); - private final PParameter parameter_Target = new PParameter("Target", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + private final PParameter parameter_Target = new PParameter("Target", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Source, parameter_Target); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java index 93b1a01b..606cdfed 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/GroundStationNetwork.java @@ -83,7 +83,7 @@ public final class GroundStationNetwork extends BaseGeneratedEMFQuerySpecificati private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final GroundStationNetwork.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Network = new PParameter("Network", "hu.bme.mit.inf.dslreasoner.domains.satellite.GroundStationNetwork", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "GroundStationNetwork")), PParameterDirection.INOUT); + private final PParameter parameter_Network = new PParameter("Network", "satellite.GroundStationNetwork", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "GroundStationNetwork")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Network); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectCommunicationLink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectCommunicationLink.java index 6d5e475c..dee8a83c 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectCommunicationLink.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectCommunicationLink.java @@ -85,9 +85,9 @@ public final class IndirectCommunicationLink extends BaseGeneratedEMFQuerySpecif private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final IndirectCommunicationLink.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Source = new PParameter("Source", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + private final PParameter parameter_Source = new PParameter("Source", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); - private final PParameter parameter_Target = new PParameter("Target", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + private final PParameter parameter_Target = new PParameter("Target", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Source, parameter_Target); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectLinkAllowed.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectLinkAllowed.java index 27648bf3..31381a09 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectLinkAllowed.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IndirectLinkAllowed.java @@ -85,9 +85,9 @@ public final class IndirectLinkAllowed extends BaseGeneratedEMFQuerySpecificatio private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final IndirectLinkAllowed.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_From = new PParameter("From", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); + private final PParameter parameter_From = new PParameter("From", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); - private final PParameter parameter_To = new PParameter("To", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + private final PParameter parameter_To = new PParameter("To", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_From, parameter_To); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/LinkAllowed.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/LinkAllowed.java index e7529aa2..7118d657 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/LinkAllowed.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/LinkAllowed.java @@ -96,9 +96,9 @@ public final class LinkAllowed extends BaseGeneratedEMFQuerySpecificationWithGen private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final LinkAllowed.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_From = new PParameter("From", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); + private final PParameter parameter_From = new PParameter("From", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); - private final PParameter parameter_To = new PParameter("To", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + private final PParameter parameter_To = new PParameter("To", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_From, parameter_To); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingAntenna.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingAntenna.java index b4f0d9e9..3a52ad1d 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingAntenna.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MatchingAntenna.java @@ -90,11 +90,11 @@ public final class MatchingAntenna extends BaseGeneratedEMFQuerySpecificationWit private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final MatchingAntenna.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_From = new PParameter("From", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); + private final PParameter parameter_From = new PParameter("From", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); - private final PParameter parameter_To = new PParameter("To", "hu.bme.mit.inf.dslreasoner.domains.satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); + private final PParameter parameter_To = new PParameter("To", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT); - private final PParameter parameter_Band = new PParameter("Band", "hu.bme.mit.inf.dslreasoner.domains.satellite.TransceiverBand", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "TransceiverBand")), PParameterDirection.INOUT); + private final PParameter parameter_Band = new PParameter("Band", "satellite.TransceiverBand", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "TransceiverBand")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_From, parameter_To, parameter_Band); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java index 36fa4557..591215cd 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java @@ -3,12 +3,13 @@ */ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal; -import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement; +import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkOfElement; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetGain; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.KaAntennaGainLow; +import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.MultipleCommunicationLinks; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoLinkToGroundStation; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NoPotentialLinkToGroundStation; import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferometryPayloads; @@ -39,7 +40,8 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; *

    A private group that includes private patterns as well. Only intended use case is for pattern testing. * *

    From package hu.bme.mit.inf.dslreasoner.domains.satellite.queries, the group contains the definition of the following patterns:

      - *
    • communicationLinkDoesNotStartAtContainingElement
    • + *
    • multipleCommunicationLinks
    • + *
    • communicationLinkOfElement
    • *
    • notEnoughInterferometryPayloads
    • *
    • atLeastTwoInterferometryPayloads
    • *
    • spacecraftWithInterferometryPayload
    • @@ -91,7 +93,8 @@ public final class SatelliteQueriesAll extends BaseGeneratedPatternGroup { private static SatelliteQueriesAll INSTANCE; private SatelliteQueriesAll() { - querySpecifications.add(CommunicationLinkDoesNotStartAtContainingElement.instance()); + querySpecifications.add(MultipleCommunicationLinks.instance()); + querySpecifications.add(CommunicationLinkOfElement.instance()); querySpecifications.add(NotEnoughInterferometryPayloads.instance()); querySpecifications.add(AtLeastTwoInterferometryPayloads.instance()); querySpecifications.add(SpacecraftWithInterferometryPayload.instance()); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithInterferometryPayload.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithInterferometryPayload.java index f8e6ca4f..9566c4c5 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithInterferometryPayload.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithInterferometryPayload.java @@ -87,9 +87,9 @@ public final class SpacecraftWithInterferometryPayload extends BaseGeneratedEMFQ private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { private static final SpacecraftWithInterferometryPayload.GeneratedPQuery INSTANCE = new GeneratedPQuery(); - private final PParameter parameter_Mission = new PParameter("Mission", "hu.bme.mit.inf.dslreasoner.domains.satellite.ConstellationMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "ConstellationMission")), PParameterDirection.INOUT); + private final PParameter parameter_Mission = new PParameter("Mission", "satellite.ConstellationMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "ConstellationMission")), PParameterDirection.INOUT); - private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "hu.bme.mit.inf.dslreasoner.domains.satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); + private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT); private final List parameters = Arrays.asList(parameter_Mission, parameter_Spacecraft); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql index 40553e29..edffd941 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql @@ -2,13 +2,17 @@ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries import "http://www.example.org/satellite" -@Constraint(severity = "error", key = {Link}, - message = "Communication links must start from the containing element.") -pattern communicationLinkDoesNotStartAtContainingElement(Link : DirectedCommunicationLink) { - CommunicatingElement.communicationLink(Element, Link); - DirectedCommunicationLink.source(Link, SourceComm); - CommunicatingElement.commSubsystem(SourceElement, SourceComm); - Element != SourceElement; +@Constraint(severity = "error", key = {Element}, + message = "Only one communication link is allowed per element.") +pattern multipleCommunicationLinks(Element : CommunicatingElement) { + CommunicatingElement.commSubsystem.communicationLink(Element, Link1); + CommunicatingElement.commSubsystem.communicationLink(Element, Link2); + Link1 != Link2; +} + +@QueryBasedFeature(feature = "communicationLink") +pattern communicationLinkOfElement(Element : CommunicatingElement, Link : DirectedCommunicationLink) { + CommunicatingElement.commSubsystem.communicationLink(Element, Link); } // At least two spacecraft must have the interferometry payload configured -- cgit v1.2.3-70-g09d2