SlideShare une entreprise Scribd logo
1  sur  29
Télécharger pour lire hors ligne
An OCL-based bridge
from concrete to abstract
syntax
Adolfo Sánchez-Barbudo Herrera, Edward D. Willink
and Richard F. Paige
Agenda
● Motivation & Problem
● Challenges & Proposed Solutions
○ CS2AS Mappings
○ Name Resolution
○ CS Disambiguation
● On going and future work
2
Motivation: Example
● Sequence {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
● Sequence {1, 1+1, 3..9+1}
3
Motivation: CS to AS
CollectionLiteralPartCS:
OclExpressionCS | CollectionRangeCS
CollectionRangeCS:
OclExpressionCS ’..’ OclExpressionCS
CS2AS
4
Motivation: CS to AS
5
OMG
AS
Meta-model
CS
Grammar
CS
Metamodel
CS2AS
Bridge
Motivation: CS to AS in OCL
● Attribute grammars
○ Synthesized attributes
○ Inherited attributes
● OCL Expressions
6
Motivation: CS to AS in OCL
CollectionRangeCS.ast
Another way of AS
mapping description?
.oclAsType(CollectionItem).item
7
Problem: CS to AS in OCL
● It’s not really formal
● Typos and inconsistencies
● It is not checked/validated
○ No tool can understand the semi-formal descriptions
● Implementors can’t benefit from automation
We need models to formalize
CS2AS 8
Solution: OCL-based DSL
● OCL-based internal DSL
○ Complete OCL documents
● CS2AS bridge:
○ CS2AS mappings
○ Name resolution
○ CS Disambiguation
● Existing OCL tools can be used
● Implementors can exploit CS2AS bridges
9
Solution: CS2AS mappings
context CollectionLiteralPartCS
def : ast() : ocl::CollectionLiteralPart =
ocl::CollectionItem {
item = first.ast(),
type = first.ast().type }
10
Solution: CS2AS mappings
context CollectionRangeCS
def : ast() : ocl::CollectionRange =
ocl::CollectionRange {
first = first.ast(),
last = last.ast(),
type = first.ast().type.commonType(last.ast().type) }
11
Challenge: Name Resolution
let var : String = 'something' in var
Name resolution
based cross-reference
12
Name Resolution: Roles
Environment
(named elements)
Producer
Consumer
Named Elements
Name Named Elements
nestedEnvironment
● Nested Environments (lookup scopes)
● Namespaces & qualified names
● Name visibility rules
13
Name Resolution:Environment
Er
= env::Environment{} -- Empty Environment
NE C
NP P
R
Ep
= ErEnp
= Er
Ene
= Ep Ec
= Ep
including NE
R Root node
NP Non-producer node
P Producer node
NE Named-element node
C Consumer node 14
Solution: Environment def
context OclAny
def : env : env::Environment =
if oclContainer() <> null
then oclContainer().childEnv(self)
else env::Environment{} -- empty environment
endif
def : childEnv(child : OclAny) : env::Environment =
env
NP NP
NP NP
R
15
Solution: Producers
context LetExp
def : childEnv(child : OclAny) : env::Environment =
if child = variable
then -- the owned let variable
env
else -- the owned in expression
env.nestedEnv().addElement(variable)
endif
16
Solution: Consumers
context OclAny
def : lookupVariable(varName : String) : Variable =
env.namedElements->selectOfKind(Variable)
->select(v | v.name = varName)->first()
context VariableExpCS
def : ast () : ocl::VariableExp =
let referredVar = ast().lookupVariable(varName)
in ocl::VariableExp {
name = varName,
referredVariable = referredVar ,
type = if referredVar = null then null else referredVar.type endif }
17
Challenge: CS Disambiguation
let … in x.y
● y is a PropertyCallExp
● x ?
○ VariableExp-if x is a let variable, or operation param
○ PropertyCallExp i.e. self.x.y
18
Challenge: CS Disambiguation
“Some of the production rules are syntactically
ambiguous. For such productions disambiguating
rules have been defined. Using these rules, each
production and thus the complete grammar
becomes non-ambiguous."
19
Solution: CS Disambiguation
NameExpCS:
simpleName isMarkedPre?
● Disambiguation rules:
○ should NameExpCS produce a VariableExp
○ should NameExpCS produce a PropertyCallExp
○ should NameExpCS produce …
● In a CS2AS activity
○ Syntactic information from CS meta-model
○ Semantic information from AS meta-model 20
Unified NameExpCS
Solution: CS Disambiguation
context NameExpCS
def : ast() : ocl::OclExpression =
if isAVariableExp()
then let variable = ast().lookupVariable(name)
in ocl::VariableExp {
name = name,
referredVariable = variable,
type = if variable = null then null else variable.type endif }
else
…
endif
21
Solution: CS Disambiguation
context NameExpCS
-- Disambiguation rule from NameExpCS to VariableExp
def : isAVariableExp() : Boolean =
let variable = ast().lookupVariable(name)
in variable <> null
-- Disambiguation rule from NameExpCS to PropertyCallExp
def : isAPropertyCallExp() : Boolean =
let property = ast().lookupProperty(name)
in property <> null
22
Ongoing & Future work
● Executable CS2AS transformation generation
23
CS AS
OCL-based
CS2AS
AS
Model
OCL OCL
CS’ AS’
CS
Model
M2M tx’
OCL-based
CS2AS’
M2M tx
CS
Model’
AS
Model’
QVT QVT
High Quality
IDE
Ongoing & Future work
● Xtext integration
Xtext
Grammar
CS
OCL-based
CS2AS AS
AS-based
Outline
Name Reso-
based
Content
Assistant 24
Ongoing & Future work
● External CS2AS DSL
25
Now OCL-based
Internal DSL
Future
OCL-embedded
External DSL
Thank you very much !!!
26
asbh500@york.ac.uk / adolfosbh@gmail.com
@adolfosbh
Yet another M2M tx language
27
● Yes, it’s another M2M tx language, but …
● It’s a Domain Specific Transformation
Language
○ e.g (Name resolution)...
● One input model, one output model
○ We don’t need support to more
● Suitable for OMG specifications
○ OCL is more widespread than QVT
Just for textual CS
28
● Not researched, but …
● As long the CS is represented by an Ecore
metamodel, it sounds feasible:
○ Eg: A square is mapped to a concept ‘X’ in the AS
○ Disambiguation rules to disambiguate a CS element (e.g.
a blue-coloured square is ‘X’ and a red one is ‘Y’)
● We can’t have a well-designed AS with a
concise grammar (unless the language is
simple)
● If the language is not simple:
○ Either we don’t care about a well designed AS
○ or, we don’t care about how big is the grammar*
Why do we need a CS mm ?
29
Language
Capabilities
CS Grammar
Conciseness
Good AS
design

Contenu connexe

Similaire à OCL-based bridge from concrete to abstract syntax

A DSTL to bridge concrete and abstract syntax
A DSTL to bridge concrete and abstract syntaxA DSTL to bridge concrete and abstract syntax
A DSTL to bridge concrete and abstract syntaxUniversity of York
 
Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5SAP Concur
 
TDC2016SP - Trilha Frameworks JavaScript
TDC2016SP - Trilha Frameworks JavaScriptTDC2016SP - Trilha Frameworks JavaScript
TDC2016SP - Trilha Frameworks JavaScripttdc-globalcode
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaLisa Hua
 
Uncovering Performance Problems in Java Applications with Reference Propagati...
Uncovering Performance Problems in Java Applications with Reference Propagati...Uncovering Performance Problems in Java Applications with Reference Propagati...
Uncovering Performance Problems in Java Applications with Reference Propagati...Dacong (Tony) Yan
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018artgillespie
 
Why re-use core classes?
Why re-use core classes?Why re-use core classes?
Why re-use core classes?Levi Waldron
 
ScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyTypesafe
 
Object Oriented Programming in Matlab
Object Oriented Programming in Matlab Object Oriented Programming in Matlab
Object Oriented Programming in Matlab AlbanLevy
 
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016Holden Karau
 
CLaSH HIW 2014
CLaSH HIW 2014CLaSH HIW 2014
CLaSH HIW 2014baaijcpr
 
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...Alessandro Confetti
 
Project seminar ppt_steelcasting
Project seminar ppt_steelcastingProject seminar ppt_steelcasting
Project seminar ppt_steelcastingRudra Narayan Paul
 
Bridging Proprietary Modelling and Open-Source Model Management Tools: The Ca...
Bridging Proprietary Modelling and Open-Source Model Management Tools: The Ca...Bridging Proprietary Modelling and Open-Source Model Management Tools: The Ca...
Bridging Proprietary Modelling and Open-Source Model Management Tools: The Ca...Thanos Zolotas
 
Swift - One step forward from Obj-C
Swift -  One step forward from Obj-CSwift -  One step forward from Obj-C
Swift - One step forward from Obj-CNissan Tsafrir
 

Similaire à OCL-based bridge from concrete to abstract syntax (20)

A DSTL to bridge concrete and abstract syntax
A DSTL to bridge concrete and abstract syntaxA DSTL to bridge concrete and abstract syntax
A DSTL to bridge concrete and abstract syntax
 
Slides
SlidesSlides
Slides
 
Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5Unlocking Your Hadoop Data with Apache Spark and CDH5
Unlocking Your Hadoop Data with Apache Spark and CDH5
 
TDC2016SP - Trilha Frameworks JavaScript
TDC2016SP - Trilha Frameworks JavaScriptTDC2016SP - Trilha Frameworks JavaScript
TDC2016SP - Trilha Frameworks JavaScript
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
 
EdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for JavaEdSketch: Execution-Driven Sketching for Java
EdSketch: Execution-Driven Sketching for Java
 
Uncovering Performance Problems in Java Applications with Reference Propagati...
Uncovering Performance Problems in Java Applications with Reference Propagati...Uncovering Performance Problems in Java Applications with Reference Propagati...
Uncovering Performance Problems in Java Applications with Reference Propagati...
 
CL-NLP
CL-NLPCL-NLP
CL-NLP
 
PostgreSQL Open SV 2018
PostgreSQL Open SV 2018PostgreSQL Open SV 2018
PostgreSQL Open SV 2018
 
Why re-use core classes?
Why re-use core classes?Why re-use core classes?
Why re-use core classes?
 
ScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin Odersky
 
DL for molecules
DL for moleculesDL for molecules
DL for molecules
 
Object Oriented Programming in Matlab
Object Oriented Programming in Matlab Object Oriented Programming in Matlab
Object Oriented Programming in Matlab
 
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
Apache Spark Structured Streaming for Machine Learning - StrataConf 2016
 
modeling.ppt
modeling.pptmodeling.ppt
modeling.ppt
 
CLaSH HIW 2014
CLaSH HIW 2014CLaSH HIW 2014
CLaSH HIW 2014
 
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
XConf 2022 - Code As Data: How data insights on legacy codebases can fill the...
 
Project seminar ppt_steelcasting
Project seminar ppt_steelcastingProject seminar ppt_steelcasting
Project seminar ppt_steelcasting
 
Bridging Proprietary Modelling and Open-Source Model Management Tools: The Ca...
Bridging Proprietary Modelling and Open-Source Model Management Tools: The Ca...Bridging Proprietary Modelling and Open-Source Model Management Tools: The Ca...
Bridging Proprietary Modelling and Open-Source Model Management Tools: The Ca...
 
Swift - One step forward from Obj-C
Swift -  One step forward from Obj-CSwift -  One step forward from Obj-C
Swift - One step forward from Obj-C
 

Dernier

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Dernier (20)

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

OCL-based bridge from concrete to abstract syntax

  • 1. An OCL-based bridge from concrete to abstract syntax Adolfo Sánchez-Barbudo Herrera, Edward D. Willink and Richard F. Paige
  • 2. Agenda ● Motivation & Problem ● Challenges & Proposed Solutions ○ CS2AS Mappings ○ Name Resolution ○ CS Disambiguation ● On going and future work 2
  • 3. Motivation: Example ● Sequence {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} ● Sequence {1, 1+1, 3..9+1} 3
  • 4. Motivation: CS to AS CollectionLiteralPartCS: OclExpressionCS | CollectionRangeCS CollectionRangeCS: OclExpressionCS ’..’ OclExpressionCS CS2AS 4
  • 5. Motivation: CS to AS 5 OMG AS Meta-model CS Grammar CS Metamodel CS2AS Bridge
  • 6. Motivation: CS to AS in OCL ● Attribute grammars ○ Synthesized attributes ○ Inherited attributes ● OCL Expressions 6
  • 7. Motivation: CS to AS in OCL CollectionRangeCS.ast Another way of AS mapping description? .oclAsType(CollectionItem).item 7
  • 8. Problem: CS to AS in OCL ● It’s not really formal ● Typos and inconsistencies ● It is not checked/validated ○ No tool can understand the semi-formal descriptions ● Implementors can’t benefit from automation We need models to formalize CS2AS 8
  • 9. Solution: OCL-based DSL ● OCL-based internal DSL ○ Complete OCL documents ● CS2AS bridge: ○ CS2AS mappings ○ Name resolution ○ CS Disambiguation ● Existing OCL tools can be used ● Implementors can exploit CS2AS bridges 9
  • 10. Solution: CS2AS mappings context CollectionLiteralPartCS def : ast() : ocl::CollectionLiteralPart = ocl::CollectionItem { item = first.ast(), type = first.ast().type } 10
  • 11. Solution: CS2AS mappings context CollectionRangeCS def : ast() : ocl::CollectionRange = ocl::CollectionRange { first = first.ast(), last = last.ast(), type = first.ast().type.commonType(last.ast().type) } 11
  • 12. Challenge: Name Resolution let var : String = 'something' in var Name resolution based cross-reference 12
  • 13. Name Resolution: Roles Environment (named elements) Producer Consumer Named Elements Name Named Elements nestedEnvironment ● Nested Environments (lookup scopes) ● Namespaces & qualified names ● Name visibility rules 13
  • 14. Name Resolution:Environment Er = env::Environment{} -- Empty Environment NE C NP P R Ep = ErEnp = Er Ene = Ep Ec = Ep including NE R Root node NP Non-producer node P Producer node NE Named-element node C Consumer node 14
  • 15. Solution: Environment def context OclAny def : env : env::Environment = if oclContainer() <> null then oclContainer().childEnv(self) else env::Environment{} -- empty environment endif def : childEnv(child : OclAny) : env::Environment = env NP NP NP NP R 15
  • 16. Solution: Producers context LetExp def : childEnv(child : OclAny) : env::Environment = if child = variable then -- the owned let variable env else -- the owned in expression env.nestedEnv().addElement(variable) endif 16
  • 17. Solution: Consumers context OclAny def : lookupVariable(varName : String) : Variable = env.namedElements->selectOfKind(Variable) ->select(v | v.name = varName)->first() context VariableExpCS def : ast () : ocl::VariableExp = let referredVar = ast().lookupVariable(varName) in ocl::VariableExp { name = varName, referredVariable = referredVar , type = if referredVar = null then null else referredVar.type endif } 17
  • 18. Challenge: CS Disambiguation let … in x.y ● y is a PropertyCallExp ● x ? ○ VariableExp-if x is a let variable, or operation param ○ PropertyCallExp i.e. self.x.y 18
  • 19. Challenge: CS Disambiguation “Some of the production rules are syntactically ambiguous. For such productions disambiguating rules have been defined. Using these rules, each production and thus the complete grammar becomes non-ambiguous." 19
  • 20. Solution: CS Disambiguation NameExpCS: simpleName isMarkedPre? ● Disambiguation rules: ○ should NameExpCS produce a VariableExp ○ should NameExpCS produce a PropertyCallExp ○ should NameExpCS produce … ● In a CS2AS activity ○ Syntactic information from CS meta-model ○ Semantic information from AS meta-model 20 Unified NameExpCS
  • 21. Solution: CS Disambiguation context NameExpCS def : ast() : ocl::OclExpression = if isAVariableExp() then let variable = ast().lookupVariable(name) in ocl::VariableExp { name = name, referredVariable = variable, type = if variable = null then null else variable.type endif } else … endif 21
  • 22. Solution: CS Disambiguation context NameExpCS -- Disambiguation rule from NameExpCS to VariableExp def : isAVariableExp() : Boolean = let variable = ast().lookupVariable(name) in variable <> null -- Disambiguation rule from NameExpCS to PropertyCallExp def : isAPropertyCallExp() : Boolean = let property = ast().lookupProperty(name) in property <> null 22
  • 23. Ongoing & Future work ● Executable CS2AS transformation generation 23 CS AS OCL-based CS2AS AS Model OCL OCL CS’ AS’ CS Model M2M tx’ OCL-based CS2AS’ M2M tx CS Model’ AS Model’ QVT QVT
  • 24. High Quality IDE Ongoing & Future work ● Xtext integration Xtext Grammar CS OCL-based CS2AS AS AS-based Outline Name Reso- based Content Assistant 24
  • 25. Ongoing & Future work ● External CS2AS DSL 25 Now OCL-based Internal DSL Future OCL-embedded External DSL
  • 26. Thank you very much !!! 26 asbh500@york.ac.uk / adolfosbh@gmail.com @adolfosbh
  • 27. Yet another M2M tx language 27 ● Yes, it’s another M2M tx language, but … ● It’s a Domain Specific Transformation Language ○ e.g (Name resolution)... ● One input model, one output model ○ We don’t need support to more ● Suitable for OMG specifications ○ OCL is more widespread than QVT
  • 28. Just for textual CS 28 ● Not researched, but … ● As long the CS is represented by an Ecore metamodel, it sounds feasible: ○ Eg: A square is mapped to a concept ‘X’ in the AS ○ Disambiguation rules to disambiguate a CS element (e.g. a blue-coloured square is ‘X’ and a red one is ‘Y’)
  • 29. ● We can’t have a well-designed AS with a concise grammar (unless the language is simple) ● If the language is not simple: ○ Either we don’t care about a well designed AS ○ or, we don’t care about how big is the grammar* Why do we need a CS mm ? 29 Language Capabilities CS Grammar Conciseness Good AS design