aboutsummaryrefslogtreecommitdiffstats
path: root/Domains/simpleScenario/src/simpleScenario/run/QueryDebug.java
diff options
context:
space:
mode:
Diffstat (limited to 'Domains/simpleScenario/src/simpleScenario/run/QueryDebug.java')
-rw-r--r--Domains/simpleScenario/src/simpleScenario/run/QueryDebug.java73
1 files changed, 73 insertions, 0 deletions
diff --git a/Domains/simpleScenario/src/simpleScenario/run/QueryDebug.java b/Domains/simpleScenario/src/simpleScenario/run/QueryDebug.java
new file mode 100644
index 00000000..816a258d
--- /dev/null
+++ b/Domains/simpleScenario/src/simpleScenario/run/QueryDebug.java
@@ -0,0 +1,73 @@
1package simpleScenario.run;
2
3public class QueryDebug {
4// public static void main(String[] args) {
5// Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put("*", new XMIResourceFactoryImpl());
6// EPackage.Registry.INSTANCE.put(SimpleScenarioPackage.eNS_URI, SimpleScenarioPackage.eINSTANCE);
7// ResourceSet rs = new ResourceSetImpl();
8// rs.getResource(URI.createFileURI("inputs/sample.xmi"), true);
9//
10// ViatraQueryEngine engine = ViatraQueryEngine.on(new EMFScope(rs));
11// // Access pattern matcher
12//
13//
14//
15// SimpleScenarioQueries.instance().prepare(engine);
16// RefSpec.Matcher matcher = RefSpec.Matcher.on(engine);
17// // Get and iterate over all matches
18// for (RefSpec.Match match : matcher.getAllMatches()) {
19// // Print all the matches to the standard output
20// System.out.println(match.getL());
21// }
22// }
23
24 public static void main(String[] args) {
25// //Add xmi resource
26// Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put("*", new XMIResourceFactoryImpl());
27// //Add required EPackages
28//// EPackage.Registry.INSTANCE.put(SimpleScenarioPackage.eNS_URI, SimpleScenarioPackage.eINSTANCE);
29// EPackage.Registry.INSTANCE.put(LogiclanguagePackage.eNS_URI, LogiclanguagePackage.eINSTANCE);
30// EPackage.Registry.INSTANCE.put(LogicproblemPackage.eNS_URI, LogicproblemPackage.eINSTANCE);
31// EPackage.Registry.INSTANCE.put(PartialinterpretationPackage.eNS_URI, PartialinterpretationPackage.eINSTANCE);
32// EPackage.Registry.INSTANCE.put(Ecore2logicannotationsPackage.eNS_URI, Ecore2logicannotationsPackage.eINSTANCE);
33// EPackage.Registry.INSTANCE.put(Partial2logicannotationsPackage.eNS_URI, Partial2logicannotationsPackage.eINSTANCE);
34// EPackage.Registry.INSTANCE.put(Viatra2LogicAnnotationsPackage.eNS_URI, Viatra2LogicAnnotationsPackage.eINSTANCE);
35// EPackage.Registry.INSTANCE.put(LogicresultPackage.eNS_URI, LogicresultPackage.eINSTANCE);
36//
37// //Get res
38// ResourceSet rs = new ResourceSetImpl();
39// rs.getResource(URI.createFileURI("inputs/partial-int.xmi"), true);
40//
41// ViatraQueryEngine engine = ViatraQueryEngine.on(new EMFScope(rs));
42// // Access pattern matcher
43//
44//
45//
46// LogProb.instance().prepare(engine);
47// // Get and iterate over all matches
48// System.out.println("UPMUST:");
49// for (UPMUSTPropagateConstraint0_pattern_queries_refSpec.Match match :
50// UPMUSTPropagateConstraint0_pattern_queries_refSpec.Matcher.on(engine).getAllMatches()) {
51// // Print all the matches to the standard output
52// System.out.println(match.getVar_l());
53// }
54//
55// System.out.println("mustIn:");
56// for (MustInRelationreferenceCoord_attribute_Lane.Match match :
57// MustInRelationreferenceCoord_attribute_Lane.Matcher.on(engine).getAllMatches()) {
58// // Print all the matches to the standard output
59// DefinedElement de = match.getTarget();
60// System.out.println(de);
61// System.out.println("--set?: " + ((PrimitiveElement) de).isValueSet());
62// System.out.println("--val?: " + ((IntegerElement) de).getValue());
63//
64// }
65//
66// System.out.println("interp:");
67// for (Interpretation.Match match :
68// Interpretation.Matcher.on(engine).getAllMatches()) {
69// // Print all the matches to the standard output
70// System.out.println(match.getProblem());
71// }
72 }
73}