Browse Source

Rename matcher modules to make more sense

Joeri Exelmans 1 year ago
parent
commit
1845c3deb9

+ 1 - 1
examples/cbd/fibonacci_runner.py

@@ -10,7 +10,7 @@ from concrete_syntax.plantuml.make_url import make_url as make_plantuml_url
 from concrete_syntax.graphviz.make_url import make_url as make_graphviz_url
 from concrete_syntax.graphviz import renderer as graphviz
 
-from transformation.matcher.mvs_adapter import match_od
+from transformation.matcher import match_od
 from transformation.rewriter import rewrite
 from transformation.cloner import clone_od
 from transformation.ramify import ramify

+ 10 - 4
examples/model_transformation/woods.py

@@ -166,6 +166,10 @@ def main():
             + plantuml.render_trace_ramifies(state, int_mm_id, ramified_int_mm_id)
         )
 
+        return uml
+
+    def render_lhs_rhs():
+        uml = render_ramification()
         # Render pattern
         uml += plantuml.render_package("LHS", plantuml.render_object_diagram(state, lhs_id, ramified_mm_id))
         uml += plantuml.render_trace_conformance(state, lhs_id, ramified_mm_id)
@@ -175,8 +179,9 @@ def main():
         uml += plantuml.render_trace_conformance(state, rhs_id, ramified_mm_id)
         return uml
 
+
     def render_all_matches():
-        uml = render_ramification()
+        uml = render_lhs_rhs()
         # Render host graph (before rewriting)
         uml += plantuml.render_package("Model (before rewrite)", plantuml.render_object_diagram(state, dsl_m_id, dsl_mm_id))
         # Render conformance
@@ -194,7 +199,7 @@ def main():
         return uml
 
     def render_rewrite():
-        uml = render_ramification()
+        uml = render_lhs_rhs()
 
         # Render host graph (before rewriting)
         uml += plantuml.render_package("Model (before rewrite)", plantuml.render_object_diagram(state, dsl_m_id, dsl_mm_id))
@@ -219,8 +224,9 @@ def main():
             # Render conformance
             uml += plantuml.render_trace_conformance(state, snapshot_dsl_m_id, dsl_mm_id)
 
-        return make_plantuml_url(uml)
+        return uml
 
+    # plantuml_str = render_ramification()
     # plantuml_str = render_all_matches()
     plantuml_str = render_rewrite()
 
@@ -229,7 +235,7 @@ def main():
     print("BEGIN PLANTUML")
     print("==============================================")
 
-    print(plantuml_str)
+    print(make_plantuml_url(plantuml_str))
 
     print("==============================================")
     print("END PLANTUML")

+ 1 - 1
examples/semantics/operational/port/rulebased_sem.py

@@ -2,7 +2,7 @@
 
 from concrete_syntax.textual_od.parser import parse_od
 from transformation.rule import Rule, RuleMatcherRewriter, PriorityActionGenerator
-from transformation.matcher.mvs_adapter import match_od
+from transformation.matcher import match_od
 from util import loader
 
 import os

+ 1 - 3
transformation/matcher/mvs_adapter.py

@@ -6,7 +6,7 @@ from uuid import UUID
 from services.bottom.V0 import Bottom
 from services.scd import SCD
 from services import od as services_od
-from transformation.matcher.matcher import Graph, Edge, Vertex, MatcherVF2
+from transformation.vf2 import Graph, Edge, Vertex, MatcherVF2
 from transformation import ramify
 import itertools
 import re
@@ -14,8 +14,6 @@ import functools
 
 from util.timer import Timer
 
-from services.primitives.integer_type import Integer
-
 class _is_edge:
     def __repr__(self):
         return "EDGE"

+ 1 - 1
transformation/rule.py

@@ -5,7 +5,7 @@ import functools
 
 from api.od import ODAPI
 from concrete_syntax.common import indent
-from transformation.matcher.mvs_adapter import match_od
+from transformation.matcher import match_od
 from transformation.rewriter import rewrite
 from transformation.cloner import clone_od
 

+ 1 - 0
transformation/matcher/matcher.py

@@ -1,4 +1,5 @@
 # This module contains a VF2-inspired graph matching algorithm
+# It defines its own Graph type, and can be used standalone (no dependencies on the rest of muMLE framework)
 # Author: Joeri Exelmans
 
 import itertools