model transformation for systematic development of actor models

1
http://chess.eecs.berkeley.edu/ February 21, 2008 Center for Hybrid and Embedded Software Systems Motivation Model Transformation for Systematic Development of Actor Models Thomas H. Feng Edward A. Lee Traffic Light Model Hierarchical Heterogeneous MoCs (Models of Computation) NAOMI Project Lockheed Martin ATL UC Berkeley UIUC Vanderbilt Demos in Ptolemy 7.0 Const Optimization Demonstrate model transformation for behavior- preserving optimization. Modes First Transform the first match Random Transform a random match Repeated Transform until inapplicable Advance d Let user to manually control Model Transformation Goal Facilitate the design of complex actor models. Specification A TransformationRule actor contains an atomic transformation designed by the user. For example: Replacement Pattern Correspondence Pattern Replacement Correspondence Startw ith <Rule, Source > Redex found? Y es Notapplicable No Constraints satisfied? Rem ove deleted objects Y es No Exitw ith resultm odel A dd new objects Perform operations Subgraph isomorphism (an extension to the backtracking algorithms by Ullmann) Generated XML change requests: <deleteEntity name=“actor1”/> <deleteRelation name=“relation1”/> Generated XML change requests: <entity name=“C” class= “ptolemy.actor.lib.Const”> <property name=“value” class=“ptolemy.data.expr.Paramete r” value=“1”/> </entity> Replacement Pattern Correspondence Pattern Replacement Correspondence Input Output Replacement Pattern Correspondence Pattern Replacement Correspondence A hierarchical Ptolemy model for U.S. traffic light. The light cycles through 3 stages: red (3 time units) → green (2) → yellow (1) 2) Add a pedestrian light to either the U.S. model or the European model: (Here, entities in Pattern implicitly correspond to those in Replacement with the same name.) Algorithm Atomic Transformation Actor Statically evaluate arithmetic operations on pairs of Const actors to reduce model size, until no further optimization is possible. Dining Philosophers Demonstrate model generation and higher-order composition. 1. ModelGenerator outputs an empty model. 2. The CreateFirst transformation rule generates the first philosopher and the first fork. 3. The CreateOne transformation rule is applied n-1 times, generating one philosopher and one fork each time. Hierarchy Flattening Demonstrate pattern searching, replacing and model refactoring. Match a level of the model hierarchy, and flatten it by moving the contents within the matched CompositeActor to the outside. 1) To create a European traffic light, we need a traffic controller with 4 stages instead: red (2) → red & yellow (1) → green (2) → yellow (1)

Upload: ria-knapp

Post on 30-Dec-2015

21 views

Category:

Documents


0 download

DESCRIPTION

Thomas H. Feng Edward A. Lee. Subgraph isomorphism (an extension to the backtracking algorithms by Ullmann ). Model Transformation for Systematic Development of Actor Models. Replacement. Replacement. Replacement. Pattern. Correspondence. Pattern. Correspondence. Pattern. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Model Transformation for Systematic Development of Actor Models

http://chess.eecs.berkeley.edu/

February 21, 2008 Center for Hybrid and Embedded Software Systems

Motivation

Model Transformation for Systematic Development of Actor Models

Thomas H. Feng

Edward A. Lee

Traffic Light ModelHierarchical

HeterogeneousMoCs (Models of Computation)

NAOMI ProjectLockheed Martin ATL UC Berkeley

UIUC Vanderbilt

Demos in Ptolemy 7.0Const OptimizationDemonstrate model transformation for behavior-preserving optimization.

Modes

First Transform the first match

Random Transform a random match

Repeated

Transform until inapplicable

Advanced

Let user to manually control

Model TransformationGoalFacilitate the design of complex actor models.

SpecificationA TransformationRule actor contains an atomic transformation designed by the user. For example:

ReplacementPattern Correspondence Pattern Replacement Correspondence

Start with<Rule, Source>

Redex found?

YesNot applicable

No

Constraints satisfied?

Remove deleted objects

Yes

No

Exit withresult model

Add new objects

Perform operations

Subgraph isomorphism(an extension to the backtracking

algorithms by Ullmann)

Generated XML change requests:<deleteEntity name=“actor1”/><deleteRelation name=“relation1”/>

Generated XML change requests:<entity name=“C” class=

“ptolemy.actor.lib.Const”><property name=“value”

class=“ptolemy.data.expr.Parameter”value=“1”/>

</entity>

ReplacementPattern Correspondence Pattern Replacement Correspondence

Input

Output

ReplacementPattern Correspondence Pattern Replacement Correspondence

A hierarchical Ptolemy model for U.S. traffic light. The light cycles through 3 stages:

red (3 time units) → green (2) → yellow (1)

2) Add a pedestrian light to either the U.S. model or the European model:

(Here, entities in Pattern implicitly correspond to those in Replacement with the same name.)

Algorithm

Atomic Transformation Actor

Statically evaluate arithmetic operations on pairs of Const actors to reduce model size, until no further optimization is possible.

Dining PhilosophersDemonstrate model generation and higher-order composition.

1. ModelGenerator outputs an empty model.

2. The CreateFirst transformation rule generates the first philosopher and the first fork.

3. The CreateOne transformation rule is applied n-1 times, generating one philosopher and one fork each time.

Hierarchy FlatteningDemonstrate pattern searching, replacing and model

refactoring.

Match a level of the model hierarchy, and flatten it by moving the contents within the matched CompositeActor to the outside.

1) To create a European traffic light, we need a traffic controller with 4 stages instead:

red (2) → red & yellow (1) → green (2) → yellow (1)