Add 'cloner'. Example also uses concrete syntax for LHS and RHS. Renders all possible rewrites and morphisms with LHS and RHS.

This commit is contained in:
Joeri Exelmans 2024-10-08 12:22:37 +02:00
parent e875821e70
commit c351649d23
3 changed files with 129 additions and 93 deletions

8
transformation/cloner.py Normal file
View file

@ -0,0 +1,8 @@
from uuid import UUID
from concrete_syntax.textual_od import parser, renderer
# Clones an object diagram
def clone_od(state, m: UUID, mm: UUID):
# cheap-ass implementation: render and parse
cs = renderer.render_od(state, m, mm, hide_names=False)
return parser.parse_od(state, cs, mm)