24
Simulation and Analysis of Simulation and Analysis of Simulation and Analysis of Simulation and Analysis of Domain Specific Languages Domain Specific Languages Domain Specific Languages Domain Specific Languages José E. Rivera, Francisco Durán, Antonio Vallecillo Universidad de Málaga (2) Complexity (essential) Complexity (essential) Complexity (essential) Complexity (essential) Complexity (essential) Complexity (essential) Complexity (essential) Complexity (essential) [Borrowed from Dov Dori’s Tutorial on SysML Modeling at TOOLS 2008]

Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

Simulation and Analysis of Simulation and Analysis of Simulation and Analysis of Simulation and Analysis of Domain Specific LanguagesDomain Specific LanguagesDomain Specific LanguagesDomain Specific Languages

José E. Rivera, Francisco Durán, Antonio Vallecillo

Universidad de Málaga

(2)

Complexity (essential)Complexity (essential)Complexity (essential)Complexity (essential)Complexity (essential)Complexity (essential)Complexity (essential)Complexity (essential)

[Borrowed from Dov Dori’s Tutorial on SysML Modeling at TOOLS 2008]

Page 2: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(3)

E01-EDI

Data Warehouse(Interfaces to and from theData Warehouse are not

displayed on this diagram)

G02 - GeneralLedger

A05 - AP

S01 - SalesCorrections

I01 POReceiving

I03 Return toVendor

I06 WarehouseManagement

MaininframePC/NT apps Unix apps3rd Party Interface

S06 - Credit App

P15 EES EmployeeChange Notice

OTHER A PPS - PCAP - Collection s/Credit

TM - Credit C ard D B

ACCT S R EC A PPS - PC990C ORBad D ebt

Ben eficial F eesBen eficial R econ cile

JEAXFJEBF AJEBK AJEDVAJESOAJEVSAJEVSFNSF

TeleCredit F ees

INVENT ORY CON TROL APPS - PCCode Alarm

Debit R eceivin gsDevo Sales

Display InventoryIn HomeJun kout s

Merch an dise W ithdrawalPromo CreditsRTV Accru al

Shrin kAP R esearch - Inv CntrlAP R esearch- Addl Rpts

Book to Perp etual InventoryClose Out R ep orting

Computer Intell igence D ataCount Corrections

Cross R ef for VCB Dn ldsDamag e W rite OffDebit R eceivin gs

DFI Vend or D atab aseDisplay Inventory Recon cile

Display Inventory Reporting

INVENT ORY CON TROL APPS - PCDPI/C PI

IC Bat chingInventory Adj/Count CorrectInventory Control Reports

Inventory Lev elsInventory Roll

Merch an dise W ithdrawalOpen Receiving sPI Co unt Result s

PI Time Results from InvPrice Prot ectio n

Sales Flash R eportin gShrin k R epo rting

SKU Gro ss M arginSKU Shrink Lev el D etail

USMVCB Do wnload s

Journal Entry Tool Kit

Scorecard - HR

L02-ResourceScheduling

P09 - P17Cyborg

M02 - Millennium

M03 - Millennium 3.0

Banks - ACH and Pos toPay

Cobra

B01 - StockStatus

S03-Polling

P14 On-line NewHire Entry

CTS

Plan Administrators(401K, PCS, Life,

Unicare, SolomonSmith Barney)

D01 Post LoadBilling

I04 HomeDeliveries

I02 -Transfers

Arthur Planning

I07 PurchaseOrder

I12 EntertainmentSoftware

I05Inventory Info

E13E3 Interface

S04 - Sales Posting

V01-Price ManagementSystem

I10 Cycle PhysicalInventory

I55 SKUInformation

K02Customer Repair

Tracking I35 Early WarningSystem

B02 MerchandiseAnalysis

I13- AutoReplenishment

U18 - CTO

Intercept

I09 Cycle Counts

E02-EmployeePurchase

Texlon 3.5

ACH

Stock Options

I17 Customer PerceivedIn-Stock

U16-Texlon

SiteSeer

C02 - CapitalProjects

F06 - FixedAssets

US Bank ReconFile

Star Repair

EDICoordinator

Mesa D ata

NEW Sound scanNPD Group

AIG W arrant y Gu ard

Resumix

Optika

Store BudgetReporting

P16 - Tally Sheet

Cash Receipts/Credit

S05 - HouseCharges

Ad Expense

L01-PromoAnalysis

V02-PriceMarketingSupport

BMP - Busperformance Mngt

StoreScorecard

I11 PriceTesting

Valley Media

P09Bonus/HR

I15 Hand ScanApps

Roadshow

POS

S08 - VertexSalesTax

A04 - CustRefund Chks

Equifax

ICMS Credit

CellularRollover

S09 - DigitalSatelliteSystem

NPD,SoundScan

Sterling VANMailbox (Value)

I18SKU Rep

X92-X96Host to AS400

Communication

S02 -Layaways

Washington,RGIS,

Ntl Bus Systems

V04-SignSystem

I14 Count CorrectionsNARM

P01-EmployeeMasterfile

I06 - CustomerOrder

FrickCo

UAR - Universal AccountReconciliation

DepositoryBanks

S07 - CellPhones

S11 - ISPTracking

AAS

Fringe PO

Cash Over/Short

L60 MDFCoop SKU Selection

Tool

SKUPerformance

SupplierCompliance

1

I35 - CEI

ASIS

Misc Accounting/Finance Apps - PC/NTCOBA (Corp office Budget Assistant)

PCBS(Profit Center Budget System)Merchandising Budget

AIMSMerch Mngr Approval

Batch ForecastingAd Measurement

AIMS Admin

AIMSReportingAd

Launcher

V03- MktReactions

SpecSource

CTO2

RebateTransfer

SignSystem

CopyWriter'sWorkspace

ELTPowerSuite

StoreMonitor

AIS Calendar

Stores & Mrkts

Due Dates

Smart Plus

InsertionsOrders

BudgetAnalysis Tool

Print CostingInvoice App

AIS Reports

BroadcastFilter

Smart PlusLauncher

GeneralMaintenance

Printer PO

PrinterMaintenance

VendorMaintenance

Vendor Setup

Connect 3

Connect 3Reports

Connect 3PDF Transfer

Spec SourceSKU Tracking

S20-SalesPolling

Prodigy

PSP

In-HomeRepair

WarrantyBillingSystem

Process Servers(Imaging)

Design of a real Retail application

Complexity (accidental)Complexity (accidental)Complexity (accidental)Complexity (accidental)Complexity (accidental)Complexity (accidental)Complexity (accidental)Complexity (accidental)

(4)

How do we deal with that?How do we deal with that?How do we deal with that?How do we deal with that?How do we deal with that?How do we deal with that?How do we deal with that?How do we deal with that?

� We need to break this Gordian Knot● We should not center in PROGRAMMING

● We need to raise the level of abstraction

� What happens in the rest of the Engineering disciplines?● Civil Enginneering

● Civil Architecture

● Avionics and aerospace

● …

Page 3: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(5)

Traditional Engineers use Traditional Engineers use Traditional Engineers use Traditional Engineers use Traditional Engineers use Traditional Engineers use Traditional Engineers use Traditional Engineers use ““““““““ModelsModelsModelsModelsModelsModelsModelsModels””””””””

� Specify the system● Structure, behaviour, ...● Separate concepts at different conceptual levels

● Communicate with stakeholders

� Understand the system● If existing (legacy applications)

� Validate the model● Detect errors and omissions in design ASAP

� Mistakes are cheaper at this stage

● Prototype the system (execution of the model)● Formal analysis of system properties

� Drive implementation● Code skeleton and templates, complete programs (?)

[Borrowed from Bran Selic Tutorial at JISBD 2008]

(6)

ModelModelModelModelModelModelModelModel CharacteristicsCharacteristicsCharacteristicsCharacteristicsCharacteristicsCharacteristicsCharacteristicsCharacteristics [[[[[[[[SelicSelicSelicSelicSelicSelicSelicSelic, 2003], 2003], 2003], 2003], 2003], 2003], 2003], 2003]

� AbstractAbstractAbstractAbstract● Emphasize certain aspects…● And hide others

� UnderstandableUnderstandableUnderstandableUnderstandable● Expressed in a languagethat can be understood byusers and stakeholders

� PrecisePrecisePrecisePrecise● Faithful representations ofthe system being modeled

� PredictivePredictivePredictivePredictive● To infer correct conclusions

� CheapCheapCheapCheap● Easier and cheaper to build andanalyse than the whole system

Page 4: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(7)

What is a Model?What is a Model?What is a Model?What is a Model?What is a Model?What is a Model?What is a Model?What is a Model?

� A descriptiondescriptiondescriptiondescription of (part of) a system written in a well-defined language. (=specification.) [Kleppe, 2003]

� A representationrepresentationrepresentationrepresentation of a part of the function, structure and/or behavior of a system [MDA, 2001]

� A descriptiondescriptiondescriptiondescription or specificationspecificationspecificationspecification of the system and its environment for some certain purpose. A model is often presented as a combination of drawings and text. [MDA Guide, 2003]

� A set ofset ofset ofset of statementsstatementsstatementsstatements about the system. [Seidewitz, 2003] (Statement: expression about the system that can be true or false.)

� M is a model of S if M can be used to answer questionsto answer questionsto answer questionsto answer questionsabout S [D.T. Ross and M. Minsky, 1960]

(8)

What is a Metamodel?What is a Metamodel?What is a Metamodel?What is a Metamodel?What is a Metamodel?What is a Metamodel?What is a Metamodel?What is a Metamodel?

� A model of a well-defined language [Kleppe, 2003]

� A model of models [MDA, 2001]

� A model that defines the language for expressing a model [MOF, 2000]

● A meta-metamodel is a model that defines the language for expressing a metamodel. The relationship between a meta-metamodel and a metamodel is analogous to the relationship between a metamodel and a model.

� A model of a modelling language [Seidewitz, 2003]

● That is, a metamodel makes statements about what can be expressed in the valid models of a certain modelling language.

Page 5: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(9)

OMGOMGOMGOMGOMGOMGOMGOMG’’’’’’’’ssssssss fourfourfourfourfourfourfourfour--------layers metamodel layers metamodel layers metamodel layers metamodel layers metamodel layers metamodel layers metamodel layers metamodel

hierarchyhierarchyhierarchyhierarchyhierarchyhierarchyhierarchyhierarchy

the MOF

MMM

the UML

MM

a UMLmodel m

a particularuse of m

the SPEM

MM

the CWM

MM

another UMLmodel m’

anotheruse of m

Level M3

Level M2

Level M1

Level M0

EBNF

the Pascal

grammar

a Pascalprogram

Pan ex

ecutionX of

program P

(10)

MOF Metamodel (simplified)MOF Metamodel (simplified)MOF Metamodel (simplified)MOF Metamodel (simplified)MOF Metamodel (simplified)MOF Metamodel (simplified)MOF Metamodel (simplified)MOF Metamodel (simplified)

Page 6: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(11)

Domain Specific Languages (DSL)Domain Specific Languages (DSL)Domain Specific Languages (DSL)Domain Specific Languages (DSL)Domain Specific Languages (DSL)Domain Specific Languages (DSL)Domain Specific Languages (DSL)Domain Specific Languages (DSL)

� Languages for representing different viewsviewsviewsviews of a system in terms of models

� Higher-level abstractionabstractionabstractionabstraction than general purpose languages

� Closer to the problemproblemproblemproblem domaindomaindomaindomain than to the implementation domain

� Closer to the domaindomaindomaindomain expertsexpertsexpertsexperts, allowing modelers to perceive themselves as working directly with domain concepts

� Domain rules can be included into the languagerules can be included into the languagerules can be included into the languagerules can be included into the language as constraints, disallowing the specification of illegal or incorrect models

(12)

DSLsDSLsDSLsDSLsDSLsDSLsDSLsDSLs

� DSLs are defined in terms of ●Abstract syntax (domain concepts and rules)

●Concrete syntax (language representation)

� Metamodels used to represent the abstract syntax●Models “conform to” metamodels

� Metamodels are models, too●A metamodel conforms to its meta-metamodel

� This tower usually ends at level 4

the MOF

MMM

the UML

MM

a UMLmodel m

a particularuse of m

the SPEM

MM

the CWM

MM

another UMLmodel m’

anotheruse of m

Level M3

Level M2

Level M1

Level M0

EBNF

the Pascal

grammar

a Pascalprogram

Pan ex

ecutionX of

program P

Page 7: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(13)

AnAnAnAnAnAnAnAn exampleexampleexampleexampleexampleexampleexampleexample ofofofofofofofof a DSLa DSLa DSLa DSLa DSLa DSLa DSLa DSL

(14)

Domain Specific ModelingDomain Specific ModelingDomain Specific ModelingDomain Specific ModelingDomain Specific ModelingDomain Specific ModelingDomain Specific ModelingDomain Specific Modeling

� Several notations for Domain Specific Modeling (DSM) already available● Abstract and concrete syntaxes for the definition of models, metamodels and their representations

● Enable the rapid and inexpensive development of DSLs and associated tools (e.g., model editors)

� Repositories of metamodels and model transformations already in place● Eclipse/GMT/AM3 project

● MDWEnet initiative

● …

Page 8: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(15)

KM3KM3KM3KM3KM3KM3KM3KM3

� Specialized textual language for specifying metamodels● Abstract syntax based on Ecore and MOF 2.0

� Notions of package, class, attribute, reference, data type

● Simple and easy to work with

● Possible conversions to/from MOF, Ecore

● Good tool support

● Integrated with MDD development environments (AMMA)

● Growing interest and adoption

(16)

KM3KM3KM3KM3KM3KM3KM3KM3

package Very SimpleStateMachine {class StateMachine {

reference initialState [0-1] : State;reference containedState [*] container : State oppositeOf stateMachine;

}class State {

attribute name : String;reference stateMachine : StateMachine

oppositeOf containedState;reference incoming [*] : Transition oppositeOf target;reference outgoing [*] : Transition oppositeOf src;

}class Transition {

attribute name : String;reference target : State oppositeOf incoming;reference src : State oppositeOf outgoing;

}

}

� Very Simple State Machine

Page 9: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(17)

What is in a metamodel?What is in a metamodel?What is in a metamodel?What is in a metamodel?What is in a metamodel?What is in a metamodel?What is in a metamodel?What is in a metamodel?

� A metamodel describes ● the concepts of the language,

● the relationships between them, and

● the structuring rules that constrain the model elements and combinations in order to respect the domain rules

(18)

Is that all?Is that all?Is that all?Is that all?Is that all?Is that all?Is that all?Is that all?

� These descriptions only capture the “static” specification of the language…● It is not clear from the metamodel what happens if an event occurs and there is no transition that can be triggered.

� Is the event lost, or is it held until the state machine reaches a state with a transition that can be triggered by the event?

● What is the behavior of the system when it contains internal transitions? How do they exactly behave?

� [Robin Milner]:[Robin Milner]:[Robin Milner]:[Robin Milner]: “A (meta)model consists of some concepts, and a description of permissible activity in terms of these concepts.”

� [Chen [Chen [Chen [Chen et alet alet alet al]:]:]:]: Metamodel “semantics”● Structural semantics: describe the meaning of models in terms of the structure of model instances: all of the possible sets of components and their relationships, which are consistent with the well-formedness rules

● Behavioral semantics: describe the evolution of the state of the modeled artifacts along some time model

Page 10: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(19)

An example of a (more useful) DSLAn example of a (more useful) DSLAn example of a (more useful) DSLAn example of a (more useful) DSLAn example of a (more useful) DSLAn example of a (more useful) DSLAn example of a (more useful) DSLAn example of a (more useful) DSL

http://www.youtube.com/watch?v=NZNTgglPbUA

(20)

MDE MDE MDE MDE MDE MDE MDE MDE isisisisisisisis more more more more more more more more thanthanthanthanthanthanthanthan Conceptual Conceptual Conceptual Conceptual Conceptual Conceptual Conceptual Conceptual ModelingModelingModelingModelingModelingModelingModelingModeling!!!!!!!!

� Current DSLs● Toy-ish● Unanimated (mostly static)

● Limited analysis capabilities

� Several notations proposed for DSM

…but formal and tool support is quite limited:● Most efforts focused on definition of models, metamodels and transformations between them

● Other operations (e.g., model subtyping, difference, versioning) are also needed in industrial MDD practices

� Almost inexistent tool support for● Simulation, Analysis, Estimation, Quality evaluation and control, ...

� Almost inexistent proven engineering methodologies● For neither development nor modernization

Page 11: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(21)

We need to be able (at least) to:We need to be able (at least) to:We need to be able (at least) to:We need to be able (at least) to:We need to be able (at least) to:We need to be able (at least) to:We need to be able (at least) to:We need to be able (at least) to:

� Deal with both the accidentalaccidentalaccidentalaccidental and the essential complexity essential complexity essential complexity essential complexity of complex systems● Use separate viewpoints to specify systems (each viewpoint uses its corresponding DSL)

● Check the consistency of multi-viewpont specifications

� AnimateAnimateAnimateAnimate models ● Explicitly define behavioral semantics of DSLs so that models can be understood, manipulated and maintained by both users and machines

● Define different semantics (separate concerns)

� AnalyzeAnalyzeAnalyzeAnalyze models● Add Non-Functional Properties to DSLs

● Connect DSLs to Analysis tools

(22)

Definition of a DSLDefinition of a DSLDefinition of a DSLDefinition of a DSLDefinition of a DSLDefinition of a DSLDefinition of a DSLDefinition of a DSL

Page 12: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(23)

How to implement the Mappings?How to implement the Mappings?How to implement the Mappings?How to implement the Mappings?How to implement the Mappings?How to implement the Mappings?How to implement the Mappings?How to implement the Mappings?

�As Model Transformations!!!

�Types● Domestic

● Horizontal

● Vertical

● Abstracting

● Refining

● Pruning

● Forgetful

● …

(24)

� Maudeling● Use of Maude as underlying platform (logic)

� Semantic Mappings from EMF

● Model Management� Model Difference

� Model subtyping

� Type Inference, Evaluating model metrics…

� Model Simulation and Analysis● e-Motions

� Specification of the dynamic behavior of DSLs

● Semantic Mappings from EMF, Graph Transformationsto Maude� Simulation

� Reachability Analysis

� Model Checking

OurOurOurOurOurOurOurOur approachapproachapproachapproachapproachapproachapproachapproachMAUDELINMAUDELIN

GG

Page 13: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(25)

A A A A A A A A ProductionProductionProductionProductionProductionProductionProductionProduction SystemSystemSystemSystemSystemSystemSystemSystem ExampleExampleExampleExampleExampleExampleExampleExample

conformsTo

(26)

ModelModelModelModelModelModelModelModel SimulationSimulationSimulationSimulationSimulationSimulationSimulationSimulation andandandandandandandand AnalysisAnalysisAnalysisAnalysisAnalysisAnalysisAnalysisAnalysis

● Specification of the dynamic behavior of a DSL

● Simulation

● Reachability Analysis

● Model Checking

Page 14: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(27)

SpecifyingSpecifyingSpecifyingSpecifyingSpecifyingSpecifyingSpecifyingSpecifying dynamicdynamicdynamicdynamicdynamicdynamicdynamicdynamic behaviorbehaviorbehaviorbehaviorbehaviorbehaviorbehaviorbehavior ((((((((withwithwithwithwithwithwithwith eeeeeeee--------MotionsMotionsMotionsMotionsMotionsMotionsMotionsMotions))))))))

� Use In-place Transformation Rules (e.g., graph transformations)

� Completely Independent from the underlyingsemantic framework (e.g., Maude)

(28)

� Part of the e-Motions modeling notation

� Rule duration

� Access to the Global Time Elapse● Time stamps, scheduled actions

AddingAddingAddingAddingAddingAddingAddingAdding TimeTimeTimeTimeTimeTimeTimeTime totototototototo BehavioralBehavioralBehavioralBehavioralBehavioralBehavioralBehavioralBehavioral SpecificationsSpecificationsSpecificationsSpecificationsSpecificationsSpecificationsSpecificationsSpecifications

Carry [5]

c t

p

c t

p xPos = t.xPosyPos = t.yPos

Page 15: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(29)

AddingAddingAddingAddingAddingAddingAddingAdding ActionActionActionActionActionActionActionAction ExecutionsExecutionsExecutionsExecutionsExecutionsExecutionsExecutionsExecutions totototototototo BehavioralBehavioralBehavioralBehavioralBehavioralBehavioralBehavioralBehavioral SpecsSpecsSpecsSpecsSpecsSpecsSpecsSpecs

� Specification of action properties● Withouth the need of unnaturally modifying themetamodel

(30)

Bridges between Semantic DomainsBridges between Semantic DomainsBridges between Semantic DomainsBridges between Semantic DomainsBridges between Semantic DomainsBridges between Semantic DomainsBridges between Semantic DomainsBridges between Semantic Domains

� Precise semantics

� A set of Analysis Tools

� Underlying logic

++++++++Structure

(Metamodel)Behavior

(In-place transformations)

Rewriting Logic

(Reachability analysis, model checking…)

Petri Nets

(Termination, Confluence…)

SemanticDomain N

………………………

Model Transformation (MT1) MT2 MT3 MTN

MAUDE

MAUDELINMAUDELINGG

Page 16: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(31)

GRAPH TRANSF. …

ATOM3

ECLIPSE

SemanticSemanticSemanticSemanticSemanticSemanticSemanticSemantic MappingsMappingsMappingsMappingsMappingsMappingsMappingsMappings

MAUDE

TargetDomains

PETRI NETS

mOdCL Maudeling

e-Motions

ATL

SemanticMappings

EMF

rule AnEventOccurs {from

s: StateMachine,t: Transition,x : EventOcurrence

tos’: StateMachine(…)

DSL Behavior

DSL Structure

Extraction/injectionATL

Transformations

SourceDomain

DSL Semantics

(32)

ProductionSystem {< 'p : Plant | els : 'heg 'hag 'c1 'c2 't1 'a 'c3 't2 'u >< 'hag : HandleGen | in : null, out : 'c2, xPos : 1, yPos : 1 >< 'heg : HeadGen | in : null, out : 'c1, xPos : 1, yPos : 3 >< 'c1 : Conveyor | parts : nil, out : 't1, xPos : 2, yPos : 3 >< 'c2 : Conveyor | parts : nil, out : 't1, xPos : 2, yPos : 1 >< 't1 : Tray | parts : nil, capacity : 4, xPos : 3, yPos : 2 >< 'a : Assembler | in : 't1, out : 'c3, xPos : 4, yPos : 2 >< 'c3 : Conveyor | parts : nil, out : 't2, xPos : 5, yPos : 2 >< 't2 : Tray | parts : nil, capacity : 4, xPos : 6, yPos : 2 >< 'u : User | parts : nil, xPos : 6, yPos : 3 >}

Representing Representing Representing Representing Representing Representing Representing Representing ModelsModelsModelsModelsModelsModelsModelsModels with Maudewith Maudewith Maudewith Maudewith Maudewith Maudewith Maudewith Maude

Page 17: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(33)

op ProductionSystem : -> @Metamodel .

op PS : -> @Package .

sort PositionedEl .subsort PositionedEl < @Class .op PositionedEl : -> PositionedEl .op xPos : -> @Attribute .op yPos : -> @Attribue .

sort Container .subsort Container < PositionedEl .op Container : -> Container .op parts : -> @Reference .

sort Machine .subsort Machine < PositionedEl .op Machine : -> Machine .op in : -> @Reference .op out : -> @Reference .

Representing Representing Representing Representing Representing Representing Representing Representing MetamodelsMetamodelsMetamodelsMetamodelsMetamodelsMetamodelsMetamodelsMetamodels with Maudewith Maudewith Maudewith Maudewith Maudewith Maudewith Maudewith Maude

eq isAbstract(Machine) = true ....eq type(in) = Tray .eq lowerBound(in) = 0 .eq upperBound(in) = 1 ....eq type(out) = Conveyor .eq opposite(out) = null .eq lowerBound(out) = 1 .eq upperBound(out) = 1 .

(34)

Representing Representing Representing Representing Representing Representing Representing Representing BehaviorBehaviorBehaviorBehaviorBehaviorBehaviorBehaviorBehavior with Maudewith Maudewith Maudewith Maudewith Maudewith Maudewith Maudewith Maude

rl [Carry] :ProductionSystem {< p : P:Part | xPos : XPOS, yPos : YPOS, SFS >< c : Conveyor | parts : (p PARTS), out : t, SFS’ >< t : Tray | xPos : XPOS’, yPos : YPOS’, parts : PARTS’ , SFS’’ >OBJSET }

=>ProductionSystem{< p : P:Part | xPos : XPOS’, yPos : YPOS’,SFS >< c : Conveyor | parts : PARTS, out : t, SFS’ >< t : Tray | xPos : XPOS’, yPos : YPOS’, parts : (p PAR TS’), SFS’’ >OBJSET }

.

Page 18: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(35)

● Real-Time Maude used to provide semantics to E-Motions

● System behavior: instantaneous transitions

● Time elapse: Tick rule

� Defined over clocks and Action Executions

Time Time Time Time Time Time Time Time andandandandandandandand ActionActionActionActionActionActionActionAction ExecutionsExecutionsExecutionsExecutionsExecutionsExecutionsExecutionsExecutions in in in in in in in in MaudeMaudeMaudeMaudeMaudeMaudeMaudeMaude

(36)

Model Simulation and Analysis with Model Simulation and Analysis with Model Simulation and Analysis with Model Simulation and Analysis with Model Simulation and Analysis with Model Simulation and Analysis with Model Simulation and Analysis with Model Simulation and Analysis with MaudelingMaudelingMaudelingMaudelingMaudelingMaudelingMaudelingMaudeling

� Simulation/Execution of specifications

� Reachability Analysis● Deadlock

● Invariants

● Others

� LTL Model checking● Liveness properties

search [10] initModel =>!ProductionSystem {

< ’t2 : Tray | parts : empty, SFS >OBJSET } .

(trew initModel in time <= 20 .)

reduce modelCheck(initModel,[](exist(’he10) -> ~exist(’he10)) .

search initModel =>*ProductionSystem {

< O : Tray | capacity : CAP, parts : PARTS, SFS >OBJSET }

such that | PARTS | > CAP .

(mc {initModel} |=t[](ensembled(’he10.ha10) -> collected(’he10.ha10))

in time <= 100 .)

(find earliest {initModel} =>* {ProductionSystem {< T : ActionExec | rule : "Collect", value : null, SFS@T > OBJSET }} .)

Page 19: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(37)

ModelModelModelModelModelModelModelModel ManagementManagementManagementManagementManagementManagementManagementManagement

● Model Difference

● Model subtyping

● Type Inference,

● Model metrics…MAUDELINMAUDELIN

GG

(38)

ModelModelModelModelModelModelModelModel differencedifferencedifferencedifferencedifferencedifferencedifferencedifference: : : : : : : : ComparisonComparisonComparisonComparisonComparisonComparisonComparisonComparison processprocessprocessprocessprocessprocessprocessprocess

� Matching● Finding different objects from both models thatrepresent the same element

● Model as a result :

● Persistent identifiers VS structural similarities

� Differencing:● Makes use of matching models to detect modifiedelements

● Model as a result:

�Self-contained�Compact�Independent of the metamodel

of the source models

Page 20: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(39)

ModelModelModelModelModelModelModelModel DifferenceDifferenceDifferenceDifferenceDifferenceDifferenceDifferenceDifference: : : : : : : : AnAnAnAnAnAnAnAn ExampleExampleExampleExampleExampleExampleExampleExample

< ’SM : StateMachine | initialState : ’ST1, containedStates : (’ST1, ’ST2) >< ’ST1 : State | name : "St1", stateMachine : ’SM, outgoing : ’TR, incoming : empty >< ’ST2 : State | name : "St2", stateMachine : ’SM, outgoing : empty, incoming : ’TR >< ’TR : Transition | name : "Tr", src : ’ST1, target : ’ST2 >

< ’SM : StateMachine | initialState : ’ST1, containedState : (’ST1, ’ST2) >< ’ST1 : State | name : "St1", stateMachine : ’SM, outgoing : ’TR, incoming : ‘TR2 >< ’ST2 : State | name : "St2", stateMachine : ’SM, outgoing : ’TR2, incoming : TR >< ’TR : Transition | name : "Tr", src : ’ST1 , target : ’ST2 >< ’TR2 : Transition | name : "Tr2", src : ’ST2 , targe t : ’ST1 >

(Minuend Model)

(Subtrahend Model)

Tr2

< 'ST1@MOD : ModifiedElement | element : 'ST1@NEW, old Element : 'ST1@OLD>< 'ST1@NEW : State | incoming : 'TR2 >< 'ST1@OLD : State | incoming : empty >

< 'ST2@MOD : ModifiedElement | element : 'ST2@NEW, old Element : 'ST2@OLD >< 'ST2@NEW : State | outgoing : 'TR2 >< 'ST2@OLD : State | outgoing : empty >

< 'TR2@ADD : AddedElement | element : 'TR2@NEW >< 'TR2@NEW : Transition | name : "Tr2", src : 'ST2, tar get : 'ST1 >

(Difference Model)

(40)

DifferenceDifferenceDifferenceDifferenceDifferenceDifferenceDifferenceDifference relatedrelatedrelatedrelatedrelatedrelatedrelatedrelated operationsoperationsoperationsoperationsoperationsoperationsoperationsoperations

� Operation dodododo● do(Ms, Md) = Mm

● Applies to a model all the changes specified in a difference model

� Operation undoundoundoundo● undo(Mm, Md) = Ms.

● Reverts all the changes specified in a difference model

� Sequential composition of differences● “Optimize" the process of applying successivemodifications to the same model

undo(do(Ms, Md), Md) = Ms do(undo(Mm, Md), Md) = Mm.

Page 21: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(41)

ModelModelModelModelModelModelModelModel subtypingsubtypingsubtypingsubtypingsubtypingsubtypingsubtypingsubtyping

� Model type● Essentially its metamodel

� Model subtyping● Model operations reuse● Type safety● Polimorphism in MDSD● Model bus, metamodel matchmaking, metamodel evolution

(42)

ModelModelModelModelModelModelModelModel subtypingsubtypingsubtypingsubtypingsubtypingsubtypingsubtypingsubtyping� Metamodels M’, M: M’ ≤ M ↔ :

∀K є {M.package} ∃K' є {M‘.package} ● (K' ≤ K)

� Packages K’, K: K’ ≤ K ↔ :isRelated(K‘.name, K.name) & ∀C є {K.class} ∃C' є {K‘.class} ● (C’ ≤ C)

� Classes C’, C: C’ ≤ C ↔ :isRelated(C‘.name, C.name) & (C’.isAbstract → C.isAbstract) & ∀C є {C.superTypes} ∃C' є {C‘.superTypes} ● (C’ ≤ C)∀S є {C.structuralFeatures} ∃S' є {C‘. structuralFeatures} ● (S' ≤ S)

� Attributes P’, P: P’ ≤ P ↔ :isRelated(P‘.name, P.name) & (P‘.type ≤ P.type) & (P‘.isUnique = P.isUnique) & (P.lower ≤ P’.lower) & (P‘.isOrdered = P.isOrdered)((P.upper = P’. upper) v (2 ≤ P.upper ≤ P’.upper ))

� References R’, R: R’ ≤ R ↔ :isRelated(R‘.name, R.name) & (R‘.type ≤ R.type) &

(R‘.isUnique = R.isUnique) & (R.lower ≤ R’.lower) & (R‘.isOrdered = R.isOrdered)((R.upper = R’. upper) v (2 ≤ R.upper ≤ R’.upper )) & (R‘.opposite ≤ R.opposite)

Accesing elements:1. Variation2. No variationMetamodel evolution:1. Additions2. Modifications

Page 22: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(43)

� mOdCL is a tool to● Evaluate OCL expressions in general

● Validate OCL constrains on UML models

� Static and dynamic validation● Static validation of system states

● Dynamic validation (using execution strategies)

� mOdCL can be used as back-end● From Maude based tools requiring OCL expressionsevaluation

mOdCLmOdCLmOdCLmOdCLmOdCLmOdCLmOdCLmOdCL: our (Maude: our (Maude: our (Maude: our (Maude: our (Maude: our (Maude: our (Maude: our (Maude--------based) OCL tool based) OCL tool based) OCL tool based) OCL tool based) OCL tool based) OCL tool based) OCL tool based) OCL tool

eval(OCL-expr, state)

(44)

� mOdCL to validate UML models● System states represented as objects configurations

● System behavior representation

� Some rules regarding operation calls representation

� The rest of the system can be represented according to the userpreferences

� Future tools on mOdCL● System behavior skeleton generator

● UML model -> mOdCL using model transformation tools (ATL)

mOdCLmOdCLmOdCLmOdCLmOdCLmOdCLmOdCLmOdCL

Page 23: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(45)

ConclusionsConclusionsConclusionsConclusionsConclusionsConclusionsConclusionsConclusions

� Formal support for MDE is required● For building tools

● To explicitly and completely describe behavior● To disambiguate semantic variation points

� We make use of Maude:

● To specify models, metamodels and their behavior● To make use of its analysis tools● To provide formal semantics to other visual approaches (based on Eclipse, Graph grammars,…)

� Current Tools: Maudeling, E-Motions, mOdCL

� Future work:● Including further related time aspects: periodicity…

● Specification of non-functional properties of DSLs● Inverse transformations for analysis results● Connection with more analysis tools

(46)

Use of models to connect the toolsUse of models to connect the toolsUse of models to connect the toolsUse of models to connect the toolsUse of models to connect the toolsUse of models to connect the toolsUse of models to connect the toolsUse of models to connect the tools

Simulation Templatesof Diverse Behavior & Fidelity

ECAD & MCAD Tools

Libraries & DatabasesClassification Codes, Materials,

Personnel, Procedures, …

CFDFlotherm, Fluent, …

General MathMathematica,

Maple, Matlab,…

Augmented Descriptive Models

Evacuation

Mgt.

Damaged

Stability

2D

Simulation Building Blocks

Tribon, CATIA, NX, Cadence, ...

Simulation Solvers

System DescriptionTools & Resources

3D

FEAAbaqus, Ansys,

Nastran, …

Operation Mgt. Systems …

Propeller

Hydro-

dynamics

Evacuation CodesEgress, Exodus, …

Navigation

Accuracy

Systems & Software Tools

DOORS,

Studio,

MagicDraw,

Eclipse, …

Optimization Templates

Discrete EventArena, Quest, …

Tool Associativity

Object Re-useLegend

Tool Associativity

Object Re-useLegend

[Borrowed from Russell Peak presentation at OMG, 2007]

Page 24: Simulation and Analysis of Domain Specific Languagesav/misConfs/EHU-Dec08/EHU-Dec08.pdf · Data Warehouse (Interfaces to and from the Data Warehouse are not displayed on this diagram)

(47)

Basic Basic Basic Basic Basic Basic Basic Basic ReferencesReferencesReferencesReferencesReferencesReferencesReferencesReferences andandandandandandandand ResourcesResourcesResourcesResourcesResourcesResourcesResourcesResources

� MDD, MDE, MDA, DSM

● http://planet-mde.org

● http://www.omg.org/mda

● http://www.eclipse.org/gmt/

● http://www.eclipse.org/emf/

● http://www.visualmodeling.com/DSM.htm

● http://www.dsmforum.org

● http://www.sysmlforum.com

● http://en.wikipedia.org/wiki/Domain-Specific_Modeling

� Atenea Tools

● http://atenea.lcc.uma.es/index.php/Main_Page/Resources/Maudeling

● http://atenea.lcc.uma.es/index.php/Main_Page/Resources/E-motions

Simulation and Analysis of Simulation and Analysis of Simulation and Analysis of Simulation and Analysis of Domain Specific LanguagesDomain Specific LanguagesDomain Specific LanguagesDomain Specific Languages

José E. Rivera, Francisco Durán, Antonio Vallecillo

Universidad de Málaga