semantics for dsl group members: ritu arora, diyang chu, zekai demirezen, jeff gray, jacob gulotta,...

9
Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

Upload: erika-watts

Post on 14-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

Semantics for DSL

Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen,

Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

Page 2: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

What do semantics mean for a modeling language?

• The details about the concepts that are in the mind of the domain-experts should be written formally.

• The semantics represent the meaning of the phrases and sentences that the domain expert may express.– Box: Represents a State? Class? Foo?

Page 3: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

Why do we want a clear and precise representation of model semantics?

• A clean formalism enables reasoning about desired properties– Analysis

• deadlock analysis • ambiguity? • consistency?

• Generation of associated tools from the semantics definition– Code generators– Debugging tools– Test cases– Visualization of execution/animation

Page 4: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

How to define the semantics for DSL?

• The state of the art represents model semantics at a low-level– Defined in model interpreters

• Emerging approaches– …

Page 5: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

Domain-Specific Semantics• Are the semantics of the DSL actually domain-

specific? – Lack of a standard for defining semantics for DSLs– The notion of static semantics is easy and already

defined in many tools; dynamic semantics represent the clear challenge

– Proving properties of a GPL is challenging, but should be easier for DSLs (e.g., behavioral preservation of transformations, ambiguity)

– Domain-specific properties • would be helpful if semantics are defined in a formal,

declarative language

Page 6: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

Concerns for defining DSLs

• Concern: – separate syntax & semantics– define roles (language engineer, end-user)– define appropriate semantic domain• Document object model• Abstract state machine

Page 7: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

Current Approaches 1

• Graph rewriting– ATOM3 (multi -formalism approach)

• Any thing that can be defined as a model can be used as a meta-model

• Subset of Python, OCL to define pre and post conditions• Used for simulation purposes

• Combine Syntax and Semantic definition formalisms in one language.– Kermeta

• Extends EMOF to enable behavior definitions of meta-elements

Page 8: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

Current Approaches 2

• Semantic Anchoring through transformation• Mapping meta elements in to semantic elements in

another formalism with well-defined semantics• Example

– Finite State Machine can be used along to define the semantics of the DSL

– Transformation view on the next slide

Page 9: Semantics for DSL Group Members: Ritu Arora, Diyang Chu, Zekai Demirezen, Jeff Gray, Jacob Gulotta, Luis Pedro, Arturo Sanchez, Greg Sullivan,Ximing Yu

M3

M2

M1

myDSLMetamodel

myDSL.dsl

EBNFEBNF

myDSL.gGrammar

myDSL Model

KM3

myDSL Technical Space Model-Driven Engineering Technical Space

FSMDSLMetamodel

FSMDSL.gGrammar

FSM.fsmdslExtractionInjection

Legend:M1 = Terminal model level M2 = Metamodel levelM3 = Meta- metamodel level

Anchor FSM Technical Space

myDSL to FSMDSLTransformation

Conforms to

Conforms to

Conforms to

Conforms to

Conforms to

Conforms to

Conforms to

FSMDSL Model

Operational Semantics