Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Lecture 2: Domain-Specific Logic Languages (DSLL) or Logic-based Domain-Specific Languages (LDSL)
Prof. Uwe Aßmann Christian Wende Technische Universität Dresden Software Engineering Group http://st.inf.tu-dresden.de Version 0.3 Dresden, Aug. 27, 2013
Literature
[ODSD] Jeff Pan, Steffen Staab, Uwe Aßmann, Jürgen Ebert, Yuting Zhao. Ontology-Driven Software Development. Springer, 2013
[Walter] Tobias Walter. Bridging Technological Spaces: Towards the Combination of Model-Driven Engineering and Ontology Technologies. Dissertation. Universität Koblenz-Landau, 2011
[RW2010] Uwe Aßmann, Andreas Bartho, and Christian Wende, editors. Reasoning Web. Semantic Technologies for Software Engineering, 6th International Summer School 2010, Dresden, Germany, August 30 - September 3, 2010. Tutorial Lectures, volume 6325 of Lecture Notes in Computer Science. Springer, 2010.
OWLText URL http://www.emftext.org/index.php/OWLText
2
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• 2.1 Why do we need DSL? • 2.2 The historical development of DSL environments • 2.2.1. Abstract Syntax Toolkit EMFText • 2.3 We need semantics... But there is the problem of
technical spaces • 2.4 OWLText: a tool for textual LDSL • 2.5 A graphical LDSL: Feature model with ontology semantics • 2.6 Families of LDSD • 2.7. Outlook: LDSL as Language Families
Logic-Based DSL 3
Contents
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
2.1 Why do we need Domain-Specific Logic Languages = Logic-Based Domain-Specific Languages?
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
In Dresden, we work on the eternal problems...
Logic-Based DSL 5
Coffee admins
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 6
Recently, we got a NAO Robot „Chuck“
Chuck could fetch coffee!
www.resubic.org
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 7
Well, I like to teach
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
But, how do I teach Chuck to bring me a coffee?
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Pros: + Use the concepts and idioms of a domain
+ DSL embody domain knowledge (concepts and constraints) + Make domain modeling easy
+ Grandmothers (.. Domain experts ..) can understand and write DSL programs + Higher level of abstraction + Concise and self-documenting + Can enhance productivity, reliability, maintainability and portability
But: - Costs of design, implementation and maintenance - Costs of education for users - Limited availability of DSLs
• From: http://homepages.cwi.nl/~arie/papers/dslbib/ 9 / 28
Why Domain-Specific Languages (DSL)?
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Network Device Specification (DSL for Comarch)
10 Logic-Based DSL K. Miksa, COMARCH
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Graphic DSLs in Device Modeling
11 Logic-Based DSL K. Miksa, COMARCH
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Ex.: Graphic DSL for Process Guidance Ontologies in MOST Project
12 Logic-Based DSL K. Miksa, COMARCH
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Ex.: Guidance Task List During BPMN Process Refinement (SAP)
13 Logic-Based DSL [A. Friesen, SAP Research, MOST Project]
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
2.2 The Historical Development of DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
DSLs and Logic-Based DSLs
15
Hand implementation of DSL
Parsing environments for DSL
Attribute-Grammar based
Compiler environments
Product families Logic-Based DSL
1950
1960
1980
2010
1990
2000
2012
2015
1970
LDSL Families
Lex, yacc
ELI Cocktail JastAdd
OWLText
Family LDSL
Eclipse based toolkits
EMFText XText
DCG
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Backend ontologies may be: – Domain ontologies with the vocabulary of the domain – Static semantic ontologies with other static constraints of the language,
such as naming rules, wellformedness constraints
Logic-Based DSL 16
A Logic-Based Domain-Specific Language employs a reasoner, perhaps an ontology
reasoner, as backend service for static semantics
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
2.3 Abstract Syntax Toolkit EMFText
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• EMFText is based on Eclipse Modeling Tramework (EMF) • Generates editors, parsers, printers for a EMOF metamodel • www.emftext.org
• (Florian Heidenreich, Jendrik Johannes, Sven Karol, Mirko Seifert, Christian Wende)
Example: Building textual DSLs using EMFText
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 18
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
What’s in a DSL?
19 / 28
DSL
MetaModel(Structure)
ConcreteSyntax
Sta5cSeman5cs
DynamicSeman5cs
Symbols, shapes Domain concepts, Language concepts, relations, attributes
Typing, use-definition relationships
Behavior, meaning
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
20 / 28
How to build a DSL with EMFText
Ecore Metamodel
ConcreteSyntax Specification
EMFText Parser Generator (ANTLR)
Static Semantic Resolvers
EMFText Resource
Printer Parser
derived from input for generates
Grammar
Editor
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
21 / 28
How to build a DSL - Overview
Ecore Metamodel
CS Specification
EMFText Parser Generator (ANTLR)
Static Semantic Resolvers
EMFText Resource
Printer Parser
derived from input for generates
Grammar
a)
b)
Editor
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Creating a new meta model: • Define concepts, relations and
properties in an EMOF/Ecore model
• Meta model elements: • Classes, Data Types • Enumerations • Attributes • References (Containment,
Non-containment) • Cardinalities • Inheritance
• Very similar to the T-Box of a restricted RDFS
• Existing meta models can be imported (e.g., UML, Ecore, …)
22 / 28
How to build a DSL – Meta model in EMOF
a)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Meta model elements:
• Classes • Data Types • Enumerations
• Attributes • References (Containment, Non-containment) • Cardinalities
• Inheritance
• Very similar to the T-Box of a restricted RDFS
23 / 28
How to build a DSL – Meta model
a)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
24 / 28
Derive initial syntax of the DSL in HUTN (Human Usable Text Notation)
b)a)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Generated Grammar of Initial HUTN syntax
25 / 28
b)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Initial HUTN syntax – Example Document
26 / 28
b)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Structure of a .cs file based on EBNF: • Header
• File extension • Meta model namespace URI, location • Start element(s) • Imports (meta models, other syntax definitions)
• Options • Token Definitions • Syntax Rules
27 / 28
Syntax Customization – The Concrete Syntax language
b)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• One per meta class • Syntax: MetaClassName ::= Syntax Definition ;
• Definition elements: • Static strings (keywords) “public” • Choices a|b • Multiplicities +,* • Compounds (ab) • Terminals a[] • Non-terminals a
28 / 28
Syntax refinement by changing the ENBF Syntax rules
b)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
29 / 28
Syntax rules - Examples
OfficeModel ::= "officemodel" name[] "{" elements* "}" ; officemodel SoftwareTechnology { ...
}
b)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Syntax rules - Examples
30 / 28
OfficeModel ::= "officemodel" name[] "{" elements* "}" ; Employee ::= "employee" name[] "works" "in" worksIn[] "works" "with" worksWith[] ("," worksWith[])* ; Office ::= "office" name[]; officemodel SoftwareTechnology { office INF2080 employee Florian works in INF2080 }
b)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Complete Customized Syntax
31 / 28
b)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
32 / 28
Generic Syntax vs. Custom Syntax
b)
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Import meta models optionally with syntax • Extend and combine existing DSLs • Create embedded DSLs (e.g., for Java) • Create a template language from your DSL • ...
33 / 28
DSL Syntax Modules for DSL Families
c)
Logic-Based DSL
The EMFText Syntax Zoo (~100 residents)
• Ecore, KM3 (Kernel Meta Meta Model) • Quick UML, UML Statemachines • Java 5 (complete), C# (in progress) • Feature Models • Regular Expressions • natSpec controlled natural language • DOT (Graphviz language) …and lots of example DSLs
http://www.emftext.org/index.php/EMFText_Concrete_Syntax_Zoo#Ontology_Languages
Ontology-related languages: • OWL2 Manchester Syntax* • OWL2 Functional-Style Syntax • OWLCL* • SPARQL* • SPARQL-DL Abstract Syntax • SWRL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Metamodel-based, typed environment – Generation of tools – Statically typed – Integration with application software – Integration with many other tools – Modularity – Integration with software process
Logic-Based DSL 35
I have DCGs, so why should I want EMFText?
Software Process
Tools for management and guidance of the software development process
Methodology
Tools for supporting the software development methodology
Automation
Tools for automating repetitive validation and transformation tasks
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
2.4 We need Static Semantics – Why not try Ontologies?
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
What’s in a DSL?
37 / 28
DSL
MetaModel(Structure)
ConcreteSyntax
Sta5cSeman5cs
DynamicSeman5cs
Symbols, shapes Domain concepts, relations, attributes
Typing, use-definition relationships
Behavior, meaning
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Static Semantic World
Attributed Grammars
Abstract Interpretation Model checking
Ontologies
Structural (syntactic) Modeling World
Structure
Hierarchies Graphs
Static Semantic
Expert
Software Engineer
Dynamic Semantic World
Interpretation
State systems
Simulation
Dynamics Semantic
Expert
EMOF UML-CD
MOF
OWL CTL
Petri nets SOS
Natural Semantics
Domain world
Ontologies
Domain models
Domain Expert
OWL
Language Semantics and Technical Spaces
Logic-Based DSL 38
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Static Semantic World
Attributed Grammars
Abstract Interpretation Model checking
Ontologies
Structural (syntactic) Modeling World
Structure
Hierarchies Graphs
Static Semantic
Expert
Software Engineer
Dynamic Semantic World
Interpretation
State systems
Simulation
Dynamics Semantic
Expert
EMOF UML-CD
MOF
OWL CTL
Petri nets SOS
Natural Semantics
Domain world
Ontologies
Domain models
Domain Expert
OWL
Language Semantics and Technical Spaces
Logic-Based DSL 39
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
2.3.2 ... But there is the problem of technical spaces
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Static Semantic World
Attributed Grammars
Abstract Interpretation Model checking
Ontologies
Structural (syntactic) Modeling World
Structure
Hierarchies Graphs
Static Semantic
Expert
Software Engineer
Dynamic Semantic World
Interpretation
State systems
Simulation
Dynamics Semantic
Expert
EMOF UML-CD
MOF
OWL CTL
Petri nets SOS
Natural Semantics
Domain world
Ontologies
Domain models
Domain Expert
OWL
Language Semantics and Technical Spaces
Logic-Based DSL 41
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Ontology World
(OntologyWare)
Software Modeling
World (ModelWare)
Ontology Expert
Software Engineer
EMOF UML-CD
MOF OWL RDFS
Bridging Ontologies and Software Technology
Logic-Based DSL 42
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
OntowareTS ModelwareTS
BridgingTechnology
EcoreMetametamodel
DSLMetamodel
Model Model
OntologyTBox
OWL2Metamodel
ABox M1
M2
M3
QueryingReasoningTechnology
ValidaDonConstraintTechnology
• Transformation bridge (physical transport of models to the other space)
• Integration bridge integrating metalanguages
Bridgingtechnologies
conformsTo
conformsTo
Tools
Tools
transformation
integration
query language
Logic-Based DSL 43 [T. Walter, S. Staab, U Koblenz, MOST Project]
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
OntowareTS ModelwareTS
BridgingTechnology-TransformaDon-
EcoreMetametamodel
DSLMetamodel
Model Model
OntologyTBox
OWL2Metamodel
ABox M1
M2
M3
targetmodel source
model
TransformaDonDefiniDon
targetmodel
sourcemodel
sourcemetamodel
targetmetamodel
QueryingReasoningTechnology
ValidaDonConstraintTechnology
TransformaDonBridge
conformsTo
conformsTo
Tools
Tools
TransformaDonEngine
Logic-Based DSL 44 [T. Walter, S. Staab, U Koblenz, MOST Project]
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Language mapping generates model bridges (same L)
45
Transformation Bridges
Models Models
OWL EMOF/ECore M3
M2
M1
L L
TS Ontology-
ware TS
EclipseWare
Transformer Generator/ Interpreter
Transformer
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Language mapping can result from composition, integration, and extension of L+E1 and L+E2
46
Transformation Bridge for Languages with Differences
Models Models
OWL EMOF/ECore M3
M2
M1
L+E2 L+E1
TS Ontology-
ware TS
EclipseWare
Mapping
Transformer Generator
Transformer
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Language mapping can result from extension by constraints • Models have more semantics in semantic space
47
Transformation Bridge for More Semantics
Models Models
OWL EMOF/ECore M3
M2
M1
L+C1 L(+C1)
TS Ontology-
ware TS
EclipseWare
extension
Transformer Generator
Checker Generator/ Reasoner
Transformer
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
OntowareTS ModelwareTS
BridgingTechnology-IntegraDon-
EcoreMetametamodel
DSLMetamodel
Model Model
OntologyTBox
OWL2Metamodel
ABox M1
M2
Hybrid(Meta-)model
M3
ontoware
modelware
projecDonprojecDon
Integrated(Meta-)Metamodel
ModelprojecDon projecDon
integraDonintegraDon
QueryingReasoningTechnology
ValidaDonConstraintTechnology
2.3.2LanguageIntegraDonwithMM-IntegraDonBridges
conformsTo
conformsTo
Tools
Tools
Logic-Based DSL 48 [T. Walter, S. Staab, U Koblenz, MOST Project]
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Ex.: OntoDSL: Integration Bridge
• [Tobias Walter, Steffen Staab, Uni Koblenz]
Integrated Metametamodel
:M3
:M2Integrated Model(Abstract Syntax)
Domain Model
instanceOf
instanceOf
KM3Metametamodel
OWL Metamodel
Constraints / AxiomsOWL
Ontology
instanceOf
ABox
TBox
Reasoning Service
M2':
M1':
Domain Definition Metamodel
(Concrete Syntax)transform
transform
Development Environment
Ontology Definition
Visualization
DSL User
DSL Designer
Framework Developer
Logic-Based DSL 49
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
2.4 OWLText – A tool for textual LDSL, automatically bridging technical spaces
Courtesy: Christian Wende, TU Dresden Tobias Walter, U Koblenz
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• From textual DSL to OWL constraint checking
51
Ex.: OWLText Transformation Bridge Chain, with Integration
Models Models Models
OWL-CL EBNF EMOF/ECore
Printer
Parser
M3
M2
M1
L L L
TS Ontology-ware
TS Grammar
-ware TS
EclipseWare
Printer
Parser
OWLizer transformer
EMFText Generator
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• From textual DSL to OWL constraint checking
52
Ex.: OWLText Transformation Bridge Chain, with Integration
Models Models Models
OWL EBNF EMOF/ECore
Transf. 1
Transf. 2
M3
M2
M1
L L L
TS OWL-ware
TS Grammar
-ware TS
EclipseWare
Printer
Parser
OWLizer transformer
EMFText Generator
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Technology Space Bridging
• Metamodelling Space: • Comprehensible infrastructure with tools for metamodelling, modelling,
persistence, transformation, code generation • Generated API for model manipulation • Plethora of integrated tools that share repository
• => Metamodelling is a syntactic island for technology space bridges
• Interesting Bridges: • Other Syntactical Spaces – EMFText, XText, GMF
• Grammarware, Parsing and Printing • Semantic technical spaces (static and dynamic)
• Ontologies • Attribute Grammars (JASTEMF)
53
Motivation
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
OWLText technology space bridging for LDSL
Ontology
Space Metamodelling
Space
Logic-Based DSL 54
Design
EMF
EMOF
Pellet
OWL
Grammar Space
ANTLR
EBNF
Syntactic Repository
Textual Syntax Semantic Classification and Validation
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 55
Design
EMF
EMOF
Pellet
OWL
ANTLR
EBNF EMFText
+
OWLText technology space bridging for LDSL
Syntactic Repository
Textual Syntax Semantic Classification and Validation
Ontology Space
Metamodelling Space
Grammar Space
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 56
EMF
EMOF
Pellet
OWL
ANTLR
EBNF EMFText
+
OWLlizer +
OWLText
Syntactic Repository
Textual Syntax Semantic Classification and Validation
Ontology Space
Metamodelling Space
Grammar Space
Design
OWLText technology space bridging for LDSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 57
OWLText Architecture
EMFText
OWLizer CS Language
EMOF
OWLCL
EBNF
OWL
refines
refines
references
references
ANTLR Parser OWLizing Printer deOWLizing
customises
customises
parse
classify
validate
code
model
ontology
OWLText technology space bridging for LDSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Generalised Architecture of Technical Space Bridges
Logic-Based DSL 58
EMFText
OWLizer CS Language
EMOF
OWLCL
EBNF
OWL
refines
refines
references
references
ANTLR Parser OWLizing Printer deOWLizing
customises
customises
parse
classify
validate
code
model
ontology
Modell Integration (Transformation Briges)
Metamodell Integration (Integration Bridges)
Metalanguage Integration
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 59
Example: Office LDSL
office 2080
employee Prof. Assmannworks in 2087
works with Wende
office 2087
employee Wende
Office DSLL • Tutorial language to model offices, employees, and their interaction • Employees work in offices, there are co-working relationships
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 60
Example: Office LDSL
OfficeModel := (employees:Employee*, offices:Office*);
Office:= (name: String); Employee: (name: String,
title: String, worksIn: Office, worksWith: Employee*);
Metamodelling Space
office 2080
employee Prof. Assmannworks in 2087
office 2087
Textual Syntax
Model Level Metamodel Level
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 61
Example: Office LDSL
OfficeModel := (employees:Employee*, offices:Office*);
Office:= (name: String); Employee: (name: String,
title: String, worksIn: Office, worksWith: Employee*);
OfficeModel:= (employees|offices)*;
Office:= “office“ name; Employee:= ‘‘employee“ title name
“works in“ worksIn “works with“ worksWith*;
Metamodelling Space Grammar Space
office 2080
employee Prof. Assmannworks in 2087
office 2087
Textual Syntax
Model Level Metamodel Level
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 62
Example: Office
OfficeModel := (employees:Employee*, offices:Office*);
Office:= (name: String); Employee: (name: String,
title: String, worksIn: Office, worksWith: Employee*);
OfficeModel:= (employees|offices)*;
Office:= “office“ name; Employee:= ‘‘employee“ title name
“works in“ worksIn “works with“ worksWith*;
Constraints ProfessorsRoom ProfessorsAssistants PhDCoworkers
Ontology Space Metamodelling Space Grammar Space
office 2080
employee Prof. Assmannworks in 2087
office 2087
Textual Syntax
Model Level Metamodel Level
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 63
Example: PetriNets LDSL
Graphical Syntax Textual Syntax
PetriNets DSLL • Language to describe the dynamic semantics of distributed systems • Places and transistions connected by arcs • Consuming arcs take tokens from places • Producing arcs put tokens to places • Transition fires if all incomming arcs have tokens
place P1; place P2; place P3; place P4;transition T1; transition T2;
from P1 to T1 {...};from T1 to P2 {...};from T1 to P3 {...};...from T2 to P4 {...};from T2 to P1 {...};
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 64
Example: PetriNets LDSL
Nameables := (name: String); Components : Nameable := (in: Arc*, out: Arc*); Transition : Component; Place : Component (type: EClass); Arcs := (from:Component, to:Component)
Metamodelling Space
Graphical Syntax Textual Syntax
Model Level Metamodel Level
place P1; place P2; place P3; place P4;transition T1; transition T2;
from P1 to T1 {...};from T1 to P2 {...};from T1 to P3 {...};...from T2 to P4 {...};from T2 to P1 {...};
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Example: PetriNets LDSL
Logic-Based DSL 65
Nameables := (name: String); Components : Nameable := (in: Arc*, out: Arc*); Transition : Component; Place : Component (type: EClass); Arcs := (from:Component, to:Component)
Arc := from ‘‘->“ to Transition := ‘‘transition“ name;
Place := ‘‘place“ place “:“type;
Metamodelling Space Grammar Space
Graphical Syntax Textual Syntax
Model Level Metamodel Level
place P1; place P2; place P3; place P4;transition T1; transition T2;
from P1 to T1 {...};from T1 to P2 {...};from T1 to P3 {...};...from T2 to P4 {...};from T2 to P1 {...};
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 66
Example: PetriNets LDSL
Nameables := (name: String); Components : Nameable := (in: Arc*, out: Arc*); Transition : Component; Place : Component (type: EClass); Arcs := (from:Component, to:Component)
Arc := from ‘‘->“ to Transition := ‘‘transition“ name;
Place := ‘‘place“ place “:“type;
Global Constraints Invalid Arcs Consuming Arcs Producing Arcs Domain Specific Constraints
Start Places Disallow Parallelism
Ontology Space Metamodelling Space Grammar Space
Graphical Syntax Textual Syntax
Model Level Metamodel Level
place P1; place P2; place P3; place P4;transition T1; transition T2;
from P1 to T1 {...};from T1 to P2 {...};from T1 to P3 {...};...from T2 to P4 {...};from T2 to P1 {...};
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 67
Screencast
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
2.5 Example of a Graphical LDSL: Feature Models for Tool Families
Christian Wende, Uwe Aßmann
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL
69
Challenges for Product Families
• Build many tools with common platform • Strengthen reuse by sharing commonalities
• Control by configuration ontology
MOST TOPF (Tool Product Family)
-> Ontology-controlled tool configuration
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Development Process in MOST TOPF Tool Family
MOST%TOPF%Engineering%
MOST%TOPF%Instan2a2on%
MOST%TOPF%architecture%
Feature%model%for%Most%TOPF%
MOST%TOPF%mapping%model%
(S1)%Variability%Specifica@on%
(S2)%Feature%Realisa@on%
(S3)%Feature%Mapping%
(S4)%Variant%Specifica@on%
Variant%model%for%concrete%
product%
(S5)%Variant%Deriva@on%
Concrete%MOST%TOPF%product%FeatureIdriven%
Deriva@on%
Input%for%Relates%to%
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
(S1) Variabilty Specification
MOST TOPF Graphic Feature Model • Enables systematic classification and documentation of commonalities and variability • Enables explicit management of feature dependencies • Enables easy and systematic configuration of generic tools • Propositional logic, translates to ontology
MEDSL
Modelling Language
PDDSL
PDIDSL
MOST TOPF Variability
Ontology Language
OWL Full
OWL Lite
OWL FA
Reasoner
Pellet
Fact+
TrOWL
REL
Ontology Technology
Development Method
BEDSL
Software Process Guidance
MDSD Process
Comarch Network Configuration
Comarch OSS Development
Business Process Development
DBDSL
BPMN
Automation
Specification Validation
Specification Transformation
OWL DL
BPMN → (Specification Validation and OWL DL) or not (Specification Validation)
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
(S2) Feature Realisation
MOST TOPF Architecture
Persistency Services
Semantic Modelling Infrastructure Bridge / MOST Bridge
Ontology Infrastructure Modelling Infrastructure
Ontology-based Services
Ontology-based Process Guidance
Security and U
ser Managem
ent
Versioning and C
ollaboration
Validation Querying Explanation Other…
Model & Metamodel Repository Management
Ontology Repository
Semantic Reasoner
Import/E
xport Interfaces
Database Persistency
Views Editors
Specification Validation
Task Management
Model Querying
Properties Editor
Project Explorer
Graphical Editor
Textual Model Editor
Tree-based Editor
Vertical Services
Integration Infrastructure
Other…
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
MOST TOPF Architecture • Component-based
architecture modelled using UML
• Defines blue-print for layered ODSD tool architecture
• Platform-independent – can be implemented using various tool platforms (e.g. AdoXX, Eclipse)
(S2) Feature Realisation
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
*Featuremodelexcerpt
Variant Model for Concrete Demonstrator • Variant Editor guides tool customisation • Interactively checks and annotates consistency w.r.t. feature model and constraints • Provides repair suggestions
(S4) Variant Selection
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Manualfeaturemapping
MOST TOPF mapping model • Interactive, graphical mapping approach • Mapping of boolean feature terms to elements of Ecore-based models • Mapping stored in a dedicated, external mapping model
(S3) Feature Mapping
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
(S3) Feature Mapping
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Feature-Driven Demonstrator Derivation • Variant model is used together with feature mapping and component diagram to
derive variant specific component diagram
(S5) Variant Derivation
AutomaDcVariantDerivaDon
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Lessons Learned
Feature models form a graphical, logic-based DSL (LDSL) for specification of software product lines • Conciseness: Concise feature model (DSL, boolean expressions) • Automatic checking • Communicative: Unified and clarified terminology used in communication • Interactivity: Interactive and graphical tooling helped visualising the mapping without
interfering with UML syntax Logic-based DSL provide simple configurability • Uniformity: Extension of feature model were quite similar for each demonstrator • Harmlessness: Component-based infrastructure reduced threat of feature interaction • Evolvability: External mapping model helped extending the architecture without breaking
the mapping • Stability: Unique identifier for solution space elements required to provide stable mapping • Complexity: Complex mappings with terms hard to visualise
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
2.6 A Feature-Modeled Family of Ontology Languages Christian Wende and Florian Heidenreich, TU Dresden (MDPLE Workshop, Twente, 2009)
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Combined Data Complexity • facts size • axioms size • queries complexity
Computational Complexity • language expressiveness • language features
Logic-Based DSL 80
Causes of the Scalability Problem
Ontology Language
Knowledge Base
uses
Queries
uses
implies
Language Customisation
Use Case
?
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 81
Existing Approaches to Achieve Scalability
Language Design Reasoning Infrastructure
EL++ OWL-Lite
OWL-Full
OWL-DL
OWL-FA
RDF(S)
SHOQ(D) Pellet
RACER
FaCT++
TrOWL
Sesame
Minerva
Syntactic Approximation
Semantic Approximation
OWL2
DL-Lite
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Solution Space
Problem Space
Current Status: An Ontology Language Hierarchy
• Subset-of relationships w.r.t syntax and semantics • Trade-off between expressiveness and reasoning
complexity • Implemented mostly independent
Goal: An Ontology Language Family • Systematic organisation of family members • Specific expressiveness and reasoning requirements
can be addressed by recombining existing language features
• Systematic reuse of common language features • Generating language tooling (e.g., dedicated
parsers, printers, editors, and reasoners) • Language evolution by contributing new features
Logic-Based DSL
Existing Approaches to Address Complexity
EL++ OWL-Lite
OWL-Full
OWL-DL
OWL-FA
DL-Lite
RDF(S)
OWL2
Most Expressive
Most Efficient
82
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 83
Feature-based Family Specification
Model-Based Language Specification
Feature-based Variant
Selection
Transformation of Language Specification
Use Case Requirements
Requirements Specific
Language
Language Family Engineering
Language Instantiation
Language Customisation
Mapping
Realising an Ontology Language Family
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 84
Feature Model to specify Ontology Language Families
• Ontology languages are classified by logical constructors (language features) they provide
• Feature Model restricts combinatorial variability to valid variation space (language family)
• Expressiveness and Computational Complexity (Scalability) can be derived from used constructors
• Reduced feature models describe specific ontology language family member
Problem Space of Ontology Language Family
SHOIN(D+) == OWL DL
ALCR+ == S
AL
DescriptionLogics Concepts
Minimal
Roles R
Top Bottom
Intersection ValueRestriction
TransitiveRoles R+
ConceptNegation C RoleHierarchy H
Nominals O
InverseProperties I
FunctionalProperties F
ExistentialQualification E
Union U
CardinalityRestriction N QualifiedCardinalityRestriction Q
Datatypes (D+)
AtomicNegation
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Solution Space of Ontology Language Family
Dimensions of a Language Specification • Abstract Syntax – domain concepts relations and properties (OWL
metamodel) • Concrete Syntax (OWL parser) • Language Semantics (OWL reasoner)
Benefits of a Model-based Approach • Provides means for transformation (Variant Refinement) • Provides means for code generation (Tool Generation) • Provides infrastructure based on metamodels (Tool
Interoperability)
Semantics Abstact Syntax Concrete Syntax
Ontology: http://ex.org//pizza.owl Class: Pizza Class: Spiciness ObjectProperty: hasSpiciness Range: Spiciness
OWL
Property
Ontology
Frame
OWLClass
frames
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
ObjectProperty ::= "ObjectProperty:" iri[IRI] !1 ((annotations !1)
| ...
| ( "InverseOf:" inverseProperties ("," inverseProperties)* !1) )*;
Mapping Features to Language Specifications
• During Family Engineering single Ontology features are mapped to artefacts in the language specification models
• This mapping is stored in a Mapping Model
Logic-Based DSL 86 86 Christian Wende, TU Dresden
Mapping between Problem and Solution Space
DescriptionLogics Concepts
Minimal
Roles R
Top Bottom
Intersection ValueRestriction
AtomicNegation
ObjectProperty
InverseProperties I
ObjectPropertyReference
inverse
property
OWL Metamodel
OWL Syntax Specification
OWL Featuremodel
Problem Space Solution Space
OWL Mapping Model
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
FeatureMapper: Tool Support for Mapping
Logic-Based DSL 87 87 Christian Wende, TU Dresden
Mapping between Problem and Solution Space
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 88
Transformation Process for Language Instantiation
Language Instantiation
OWL Metamodel
OWL Textual Syntax
OWL Feature Model
OWL Variant Model
OWL Variant
Metamodel
OWL Variant Concrete Syntax
OWL Variant Parser
OWL Variant Printer
OWL Variant Editor
FeatureMapper Model Transformation
EMFText Code Generation
< variant of >
< refers to > < refers to >
< maps to >
< maps to >
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
89 Logic-Based DSL
Conclusion
Feature-Based Customisation for Families of Ontology Languages
• Ontology Languages are used for different Use Cases • Use Cases imply data complexity • Use Cases should also guide computation complexity • Feature-Based Customisation provides means for
• Use Case driven language customisation
• Feature-Based Customisation is also supports • Ontology Language Extension • Ontology Language Evolution • Ontology Language Integration
• Research Questions • How can we compose reasoners w.r.t. language features? • How to get from Use Case to required features?
2.7 LDSL as Language Families
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
How do I teach Chuck to bring me a coffee?
Logic-Based DSL 91
with a family of Gesture-LDSD
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSL 92
Gestures in Cars
Gestures in Public
Gestures in Factories
User editable
Context modeling
Semantics
Gesture DSL will be Domain-Specifc and should be Logic Based
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Logic-Based DSLs
93
Hand implementation of DSL
Parsing environments for DSL
Attribute-Grammar based
Compiler environments
Product families Logic-Based DSL
1950
1960
1980
2010
1990
2000
2012
2015
1970
LDSL Families
OWLText
Family LDSL
Eclipse based toolkits
OWLGraphics
OWLGestures
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
Engineering LDSL Families
Logic-Based DSL 94
Ontology-controlled Product families
Textual Logic-Based DSL
Logic-Based DSL Families
Gestural Logic-Based DSL
Graphical Logic-Based DSL
Technical Space Bridging
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
LDSL need Bridging between Logics and Software Engineering
Logic-Based DSL 95
LDSL Families
DSL
Product family
engineering Logic-based Semantics
Adequate Logic
languages
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
• Many slides are courtesy to the MOST project • www.most-project.eu
– Tobias Walter (U Koblenz) – Srdjan Zivkovic, Harald Kühn (BOC Information
Systems GmbH) – Krzystof Miksa (Comarch) – And many others..
• Book with Springer “Ontology-Driven Software Development”
96
End
Logic-Based DSL
Fakultät Informatik Institut Software- und Multimediatechnik, Lehrstuhl Softwaretechnologie
The End