diff --git a/examples/cbd/fibonacci_runner.py b/examples/cbd/fibonacci_runner.py index ac82969..62f689d 100644 --- a/examples/cbd/fibonacci_runner.py +++ b/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 diff --git a/examples/model_transformation/woods.py b/examples/model_transformation/woods.py index 688ac33..55c61a6 100644 --- a/examples/model_transformation/woods.py +++ b/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") diff --git a/examples/semantics/operational/port/rulebased_sem.py b/examples/semantics/operational/port/rulebased_sem.py index afa5d50..8ff41b5 100644 --- a/examples/semantics/operational/port/rulebased_sem.py +++ b/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 diff --git a/transformation/matcher/mvs_adapter.py b/transformation/matcher.py similarity index 99% rename from transformation/matcher/mvs_adapter.py rename to transformation/matcher.py index d9fd076..ef40cb3 100644 --- a/transformation/matcher/mvs_adapter.py +++ b/transformation/matcher.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" diff --git a/transformation/rule.py b/transformation/rule.py index 090ce83..36d6dbd 100644 --- a/transformation/rule.py +++ b/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 diff --git a/transformation/matcher/matcher.py b/transformation/vf2.py similarity index 99% rename from transformation/matcher/matcher.py rename to transformation/vf2.py index 48d9286..987b084 100644 --- a/transformation/matcher/matcher.py +++ b/transformation/vf2.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