Rename matcher modules to make more sense

This commit is contained in:
Joeri Exelmans 2024-11-13 11:10:31 +01:00
parent 42757ddc4f
commit 1845c3deb9
6 changed files with 15 additions and 10 deletions

View file

@ -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.make_url import make_url as make_graphviz_url
from concrete_syntax.graphviz import renderer as graphviz 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.rewriter import rewrite
from transformation.cloner import clone_od from transformation.cloner import clone_od
from transformation.ramify import ramify from transformation.ramify import ramify

View file

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

View file

@ -2,7 +2,7 @@
from concrete_syntax.textual_od.parser import parse_od from concrete_syntax.textual_od.parser import parse_od
from transformation.rule import Rule, RuleMatcherRewriter, PriorityActionGenerator 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 from util import loader
import os import os

View file

@ -6,7 +6,7 @@ from uuid import UUID
from services.bottom.V0 import Bottom from services.bottom.V0 import Bottom
from services.scd import SCD from services.scd import SCD
from services import od as services_od 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 from transformation import ramify
import itertools import itertools
import re import re
@ -14,8 +14,6 @@ import functools
from util.timer import Timer from util.timer import Timer
from services.primitives.integer_type import Integer
class _is_edge: class _is_edge:
def __repr__(self): def __repr__(self):
return "EDGE" return "EDGE"

View file

@ -5,7 +5,7 @@ import functools
from api.od import ODAPI from api.od import ODAPI
from concrete_syntax.common import indent 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.rewriter import rewrite
from transformation.cloner import clone_od from transformation.cloner import clone_od

View file

@ -1,4 +1,5 @@
# This module contains a VF2-inspired graph matching algorithm # 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 # Author: Joeri Exelmans
import itertools import itertools