Directory structure =================== /Users/USERNAME/ Formalisms/ MyFSA/ MyFSA.model (user-created) = meta-model of abstract syntax, instance of SimpleClassDiagram MyFSA.metamodel (generated from above) = meta-model of abstract syntax MyFSA.defaultIcons.model (user-created) = meta-model of concrete syntax, instance of ConcreteSyntax MyFSA.defaultIcons.metamodel (generated from above) = meta-model of concrete syntax MyFSA.pattern.metamodel (generated from above) MyFSA.defaultIcons.pattern.metamodel (generated from above) = meta-model of concrete syntax of pattern language OperationalSemantics/ = just a directory, auto-created (convention = use this to define an operational semantics) T_OperationalSemantics.model = transformation model (initially empty), instance of MoTif scheduling language refers (by filename) to rules ('R_xxx.model') below R_SomeRule1.model R_SomeRule2.model = a transformation rule, instance of pattern language TranslationalSemantics/ = just a directory, auto-created (convention = use this to define a translational semantics) (same structure as ../OperationalSemantics/) (you can add more directories, with more model transformations) __LanguageSyntax__/ SimpleClassDiagram/ SimpleClassDiagram.metamodel SimpleClassDiagram.defaultIcons.metamodel ... ConcreteSyntax/ ... __Transformations__/ Transformation/ MoTif.metamodel MoTif.defaultIcons.metamodel ... Models/ MyFSA/ SomeFSA.model = instance of MyFSA's concrete syntax Workflow ======== Part 1: Create formalism's AS and CS, and create an instance of your formalism ------------------------------------------------------------------------------ 1. create new formalism (toolbar button F+) 2. create abstract syntax (+ constraints) (by editing MyFormalism.model) 2.1 'compile' abstract syntax: .model -> .metamodel 3. create concrete syntax (+ mappers/parsers) (by editing MyFormalism.defaultIcons.model) 3.1 'compile' concrete syntax: .defaultIcons.model -> defaultIcons.metamodel 4. open new window, and load your MyFormalism.defaultIcons.metamodel as a toolbar 4.1 create an instance of your formalism's concrete syntax save as new file Models/MyFormalism/SomeInstance.model 4.2 check constraints Part 2: Define an operational semantics with rule-based graph transformations ----------------------------------------------------------------------------- 1. generate pattern language (toolbar button 'compile AS (...) into pattern metamodel') .metamodel ----> .pattern.metamodel .defaultIcons.metamodel ----> .defaultIcons.pattern.metamodel 2. define transformation rules (click toolbar button R+ for every new rule) save them as new files OperationalSemantics/R_SomeRule1.model OperationalSemantics/R_SomeRule2.model DON'T FORGET TO DELETE THE NAC if the NAC is empty!! ... 3. define transformation schedule (just open and edit OperationalSemantics/T_OperationalSemantics.model) refer to rules from step 2. above by filename 4. open an instance of your formalism (e.g. Models/MyFormalism/SomeInstance.model) open browser's console (F12 shortcut) to observe what is going on and load your transformation schedule ('eject' toolbar button: ⏏) then, execute transformations stepwise (toolbar button: ⏭) 5. to run transformation again, load instance & schedule again in NEW ATOMPM WINDOW TIPS! ===== (*) get the latest release from github https://github.com/AToMPM/atompm/releases follow these instructions: https://github.com/AToMPM/atompm (*) SAVE OFTEN! (*) It is good practice to always open a new AToMPM window when opening an existing model or creating a new model. (*) AToMPM has a multi-process "architecture". If AToMPM crashes, check if there are still 'node' processes running on your computer. You will have to end/kill these before restarting AToMPM. Likewise, with a crash/restart, it's a good idea to also restart the python model transformation server process. (*) AToMPM has a weird multi-process "architecture": multiple NodeJS processes one Python "model transformation" process Sometimes, when AToMPM crashes, some NodeJS processes are still running, and you must manually kill them first before re-starting AToMPM. (*) Mouse/keyboard peculiarities: Edit object properties: - select object and press 'Insert' key Draw edge between two objects: - make sure no object is selected - right mouse button DOWN on SOURCE, release on TARGET - to create intermediate 'waypoints', click left mouse button (while still holding right mouse button) (*) After modifying AS model: - recompile AS - recompile CS - re-create all instances - re-generate pattern language - re-create all rules (no need to re-create schedule) (*) After modifying CS model: - recompile CS - re-create all instances - re-generate pattern language - re-create all rules (no need to re-create schedule) (*) Use JavaScript to: - define constraints on your AS model - define mappers+parsers on your CS model NOTE: correctly escape JS when embedded into JSON! NOTE: console.log() output is printed by your NodeJS process, not in the browser's console (*) Use Python to: - define LHS conditions (=boolean expressions) - define RHS values (=expressions) NOTE: print() statements are printed by your Python script (mt/main.py) (*) Save your instance before executing a transformation on it. (*) After executing a transformation, if you want to execute a new transformation, open your model again first in a new window. (*) Graph rule fails to match? - if NAC is empty, delete the NAC element - check all conditions