Towards Domain Completeness for Model Transformations Based on - - PowerPoint PPT Presentation

towards domain completeness for model transformations
SMART_READER_LITE
LIVE PREVIEW

Towards Domain Completeness for Model Transformations Based on - - PowerPoint PPT Presentation

Towards Domain Completeness for Model Transformations Based on Triple Graph Grammars VOLT 2014 21-JULY-2014 Nico Nachtigall, Frank Hermann, Benjamin Braatz, Thomas Engel (University of Luxembourg) Source: SES - www.ses.com Industrial Project:


slide-1
SLIDE 1

Nico Nachtigall, Frank Hermann, Benjamin Braatz, Thomas Engel (University of Luxembourg)

Towards Domain Completeness for Model Transformations Based on Triple Graph Grammars

VOLT 2014

21-JULY-2014

Source: SES - www.ses.com

slide-2
SLIDE 2

Industrial Project: PIL2SPELL

21-JULY-2014 Domain Completeness for TGGs 2

Source: SES - www.ses.com

ASTRA fleet

  • f SES

Partner SES: 55 satellites Aim: Automated generation of test cases for static simulator Requirements: (1) Fully automated (2) Full coverage (3) High level of reliability: fidelity/precision, correctness, completeness

slide-3
SLIDE 3

1. Symbolic execution 2. Model Transformation: Generation of test cases – inputs for each execution path: TM values, user inputs – automatic path traversal 3. Execution of test cases in simulator

Scenario for testing – static simulator

21-JULY-2014 Domain Completeness for TGGs 3

Control procedure 1

def lift(target): current = GetTM('TM_HEIGHT') if current-target > 500: return False elif current-target < -500: Send('C_LIFT') return lift(target) else: return True while True: if Prompt('Abort?', YES_NO) break target=Prompt('Height:', NUM) if not lift(target): #Alert ...

SPELL Test input 2

<Test name="Lift Satellite"> <Test Case> <User> False, 23000 </User> <Telemetry name="TM_HEIGHT"> <Values> 22000,24000 </Values> </Telemetry> </Test Case> ... <Test>

XML Static simulator 3

slide-4
SLIDE 4
  • Challenge: Domain Completeness
  • Conceptual Overview and TGGs
  • Solution: C-Extension Completeness
  • Evaluation
  • Conclusion and Future Work

Outline

21-JULY-2014 Domain Completeness for TGGs 4

slide-5
SLIDE 5

Challenge: Domain Completeness

21-JULY-2014 Domain Completeness for TGGs 5

A model transformation 𝑵𝑼: 𝑴𝑻 ⇛ 𝑴𝑼 from source language (DSL) 𝑀𝑇 to target language 𝑀𝑈 is a relation 𝑵𝑼 ⊆ 𝑴𝑻 × 𝑴𝑼.

Model Transformation (MT)

𝑁𝑈 is domain complete, if ∀𝑁𝑇 ∈ 𝑀𝑇: ∃ 𝑵𝑻, 𝑵𝑼 ∈ 𝑵𝑼 .

Domain Completeness

𝑀𝑇 𝑀𝑈

slide-6
SLIDE 6
  • DSL is specified by meta model (type graph) and constraints C1:

𝑀 = ℒ(𝐵𝑈𝐻𝐽, 𝐷)

  • Source language: class diagrams
  • Target language: data base models

Example: CD2RDBM

21-JULY-2014 Domain Completeness for TGGs 6

[1]

  • U. Golas, L. Lambers, H. Ehrig, F. Orejas: Attributed graph transformation with inheritance: Efficient conflict

detection and local confluence analysis using abstract critical pairs. Theor. Comput. Sci. 424: 46-68 (2012).

slide-7
SLIDE 7
  • Challenge: Domain Completeness
  • Conceptual Overview and TGGs
  • Solution: C-Extension Completeness
  • Evaluation
  • Conclusion and Future Work

Outline

21-JULY-2014 Domain Completeness for TGGs 7

slide-8
SLIDE 8

Translation Concept

  • 3. Serialisation
  • 1. Parsing

L1 Source Code L2 Source Code

  • 2. TGGs

L1 EMF L2 EMF

General Concept: Language Conversion

21-JULY-2014 Domain Completeness for TGGs 8

slide-9
SLIDE 9

Key Idea of Triple Graph Grammars (TGGs)

21-JULY-2014 Domain Completeness for TGGs 9

Translation (TGGs, Henshin)

Henshin

slide-10
SLIDE 10

21-JULY-2014 Domain Completeness for TGGs 10

Source Model Target Model Correspondence Model

Triple Graph

  • Specify pattern by pattern how consistent integrated

models can be constructed simultaneously

Key Idea of Triple Graph Grammars (TGGs)

slide-11
SLIDE 11

21-JULY-2014 Domain Completeness for TGGs 11

Source Model Target Model Correspondence Model

Triple Graph

  • Specify pattern by pattern how consistent integrated

models can be constructed simultaneously

  • Generate operations for interoperability:

Model Translation/Integration/Synchronisation

Key Idea of Triple Graph Grammars (TGGs)

slide-12
SLIDE 12

21-JULY-2014 Domain Completeness for TGGs 12

Source Model Target Model Correspondence Model

Triple Graph

  • Specify pattern by pattern how consistent integrated

models can be constructed simultaneously

  • Generate operations for interoperability:

Model Translation/Integration/Synchronisation

Key Idea of Triple Graph Grammars (TGGs)

slide-13
SLIDE 13

Triple type graph

Example: Type graph of TGG

21-JULY-2014 Domain Completeness for TGGs 13 TG TGS TG TGC TG TGT Attribute attrs type Table name:String

CT

ColumnType name:String

TT

Column name:String

AC

type colsref Classifier {abstract} Class PrimitiveType NamedElement {abstract} name:String 1 1 * * pkey

Class diagram Data base model

slide-14
SLIDE 14

Example: Triple Rule for CD2RDBM

21-JULY-2014 Domain Completeness for TGGs 14

Triple Rule

3: A2C = Attribute2Column(n:String)

:AC

:cols ++ :attrs ++ :Class :Table

:CT

:Attribute name = n ++ ++ :Column name = n ++ ++ ++ ++ ++ :Column name = n :cols NAC

Source Rule

3: A2CS = Attribute2ColumnS(n:String) :attrs ++ :Class :Attribute name = n ++ ++

slide-15
SLIDE 15

Each TGG-model transformation 𝑁𝑈 is

  • syntactically correct: for each 𝑁𝑈-sequence

there is 𝐻 = (𝐻𝑇 ← 𝐻𝐷 → 𝐻𝑈) ∈ 𝑀(𝑈𝐻𝐻)

  • complete: for each source model 𝐻𝑇 ∈ 𝑀(𝑈𝐻𝐻)𝑇 there is an

𝑁𝑈-sequence

  • terminating, if all rules are source creating

Theorem (Correctness, Completeness and Termination)

Results for MTs via TGGs

21-JULY-2014 Domain Completeness for TGGs 15

[1,2]

[1]

  • H. Ehrig, K. Ehrig, C. Ermel, F. Hermann, and G. Taentzer: Information Preserving Bidirectional

Model

  • Transformations. Proc. FASE‘07. Springer (2007).

[2]

  • F. Hermann, H. Ehrig, U. Golas, F. Orejas: Formal Analysis of Model Transformations Based on Triple Graph
  • Grammars. MSCS (to appear 2014).
slide-16
SLIDE 16

Each TGG-model transformation 𝑁𝑈 is

  • complete: for each source model 𝐻𝑇 ∈ 𝑀(𝑈𝐻𝐻)𝑇 there is an

𝑁𝑈-sequence Theorem (Completeness)

Challenge: Domain Completeness

21-JULY-2014 Domain Completeness for TGGs 16

[1,2]

𝑁𝑈 is domain complete, if ∀𝑁𝑇 ∈ 𝑀𝑇: ∃ 𝑵𝑻, 𝑵𝑼 ∈ 𝑵𝑼 .

Domain Completeness Need for extended results

𝑀𝑇 ⊆ 𝑀 𝑈𝐻𝐻 𝑇

Challenge

𝑴𝑻 ⊆ 𝑴 𝑼𝑯𝑯𝑻 ⊆ 𝑀 𝑈𝐻𝐻 𝑇

This talk

slide-17
SLIDE 17
  • Challenge: Domain Completeness
  • Conceptual Overview and TGGs
  • Solution: C-Extension Completeness
  • Evaluation
  • Conclusion and Future Work

Outline

21-JULY-2014 Domain Completeness for TGGs 17

slide-18
SLIDE 18
  • 𝑀𝑇 = 𝑀 𝐵𝑈𝐻𝐽, 𝐷 , 𝐵𝑢𝑝𝑛𝑡 𝐻𝑇
  • Show that ∀𝑏 ∈ 𝐵𝑢𝑝𝑛𝑡 𝐵𝑈𝐻𝐽 : 𝑏 can be

constructed via 𝑈𝐻𝐻𝑇 - either directly or for all extensions 𝐹𝑗 required by constraints 𝐷

  • Ensure that creation sequences can be

merged to a single one for 𝐻

C-extensions

21-JULY-2014 Domain Completeness for TGGs 18

𝑀𝑇 𝑭𝟐 𝑭𝟑 𝐻𝑇 𝐵𝑢𝑝𝑛𝑡(𝐻𝑇) 𝐷-extension completeness Conflict freeness

slide-19
SLIDE 19

Main result for verifying language inclusion 𝑀 𝐵𝑈𝐻𝐽, 𝐷 ⊆ 𝑀 𝐵𝑈𝐻𝐽, 𝑈𝐻𝐻𝑇 :

Formal Result: C-Extension Completeness

21-JULY-2014 Domain Completeness for TGGs 19

Let 𝑀1 = 𝑀 𝐵𝑈𝐻𝐽, 𝐷 , 𝑀2 = 𝑀 𝐵𝑈𝐻𝐽, 𝐻𝐻 with grammar 𝐻𝐻 = 𝐵𝑈𝐻𝐽, 𝑇𝐻, 𝑄 , non-deleting rules 𝑄, 𝑇𝐻 = ∅. If marking rules 𝑛(𝐻𝐻) are 𝑫-conflict-free and 𝑀2 is 𝑫-extension complete, then 𝑴𝟐 ⊆ 𝑴𝟑. Theorem (Language Inclusion) encoding of rules with markers

Tool Support

slide-20
SLIDE 20

Marking rules

21-JULY-2014 Domain Completeness for TGGs 20

Grammar Rule :attrs ++ :Class :Attribute name = n ++ ++ Marking Rule :attrs mark=[F => T] :Class mark=T :Attribute name = n mark=[F => T] mark_name=[F => T]

slide-21
SLIDE 21
  • Challenge: Domain Completeness
  • Conceptual Overview and TGGs
  • Solution: C-Extension Completeness
  • Evaluation
  • Conclusion and Future Work

Outline

21-JULY-2014 Domain Completeness for TGGs 21

slide-22
SLIDE 22
  • 1. Conditions are sufficient, not necessary
  • 2. Grammar 𝐻𝐻 is non-deleting
  • 3. Start graph 𝑇𝐻 is empty
  • 4. Morphisms in conditions have to be ℳ-morphisms

𝑏: 𝑄 → 𝐷

  • 1. Merge of attribute values via 𝑏 is not allowed
  • 2. Reason: check is performed on 𝐵𝑢𝑝𝑛𝑡(𝐵𝑈𝐻𝐽) to

ensure termination → no concrete attribute values, only terms

  • 5. Conflict-freeness of marking rules:

sufficient, but not necessary to ensure confluence

Limitations

21-JULY-2014 Domain Completeness for TGGs 22

slide-23
SLIDE 23
  • Term rewriting: DMS [1], TXL [2], Rascal [3], Spoofax [4]

→ standard approach to AST conversion – restriction to tree structures limits flexibility in preprocessing PIL2SPELL: non-treelike helper structures (simpler TGG) – Matching order of nodes: top-down/bottom up PIL2SPELL: manual search tree + automatic heuristic – Extended control structures to ensure efficiency → potential to extend TGG theory and tools

Related Work

21-JULY-2014 Domain Completeness for TGGs 23

[1] Baxter, I., Pidgeon, P., Mehlich, M.: DMS: Program transformations for practical scalable software evolution. In: Software Engineering (ICSE 2004). IEEE Press (2004) [2] Cordy, J.R.: The TXL source transformation language. Science of Computer Programming 61(3), 190–210 (2006) [3] Klint, P., Vinju, J.J., van der Storm, T.: RASCAL: A domain specific language for source code analysis and

  • manipulation. In: Source Code Analysis and Manipulation. pp. 168–177. IEEE Computer Society (2009)

[4] Kats, L.C.L., Visser, E.: The Spoofax language workbench. rules for declarative specification of languages and IDEs. In: Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010 (2010)

slide-24
SLIDE 24
  • Extension of existing results for TGGs concerning

completeness: first of two steps for domain completeness 𝑴𝒕 ⊆ 𝑴 𝑼𝑯𝑯𝑻 ⊆ 𝑀 𝑈𝐻𝐻 𝑇

  • General result for graph grammars: Checkig language

inclusion 𝑀1 ⊆ 𝑀 𝐻𝐻 for non-deleting 𝐻𝐻 Future Work

  • Second step: 𝑴 𝑼𝑯𝑯𝑻 ⊆ 𝑀 𝑈𝐻𝐻 𝑇 or adaptation
  • Investigate possible extensions concerning “deleting”

grammars

Conclusion and Future Work

21-JULY-2014 Domain Completeness for TGGs 24

slide-25
SLIDE 25

Thank You! Questions …

21-JULY-2014 Domain Completeness for TGGs 25

slide-26
SLIDE 26

References

21-JULY-2014 Domain Completeness for TGGs 26

  • Baxter, I., Pidgeon, P., Mehlich, M.: DMS: Program transformations for practical

scalable software evolution. In: Software Engineering (ICSE 2004). IEEE Press (2004)

  • Bergmann, G., Horváth, Á., Ráth, I., Varró, D.: Incremental Evaluation of Model

Queries over EMF Models: A Tutorial on EMF-IncQuery. In: Proc. ECMFA 2011. (2011)

  • Cordy, J.R.: The TXL source transformation language. Science of Computer

Programming 61(3), 190–210 (2006)

  • H. Ehrig, K. Ehrig, C. Ermel, F. Hermann, and G. Taentzer: Information Preserving

Bidirectional Model Transformations. Proc. FASE‘07. Springer (2007).

  • H. Ehrig, K. Ehrig, U. Prange, and G. Taentzer: Fundamentals of Algebraic Graph
  • Transformation. EATCS Monographs in Theoretical Computer Science. Springer

(2006).

  • Giese, H., Wagner, R.: From model transformation to incremental bidirectional

model synchronization. Software and Systems Modeling 8(1), Springer (2009).

  • Hildebrandt, S., Lambers, L., Giese, H., Rieke, J., Greenyer, J., Schäfer, W., Lauder,

M., Anjorin, A., Schürr, A.: A survey of triple graph grammar tools. In: Proc. BX

  • 2013. ECEASST, vol. 57. (2013)
slide-27
SLIDE 27

References

21-JULY-2014 Domain Completeness for TGGs 27

  • Kats, L.C.L., Visser, E.: The Spoofax language workbench - rules for declarative

specification of languages and IDEs. In: Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA 2010 (2010)

  • Klint, P., Vinju, J.J., van der Storm, T.: RASCAL: A domain specific language for

source code analysis and manipulation. In: Source Code Analysis and

  • Manipulation. pp. 168–177. IEEE Computer Society (2009)
  • Lauder, M., Anjorin, A., Varró, G., Schürr, A.: Bidirectional model transformation

with precedence triple graph grammars. In: Proc. ECMFA 2012. (2012)

  • Plump, D.: Checking Graph-Transformation Systems for Confluence. ECEASST 26

(2010).

  • Tichy, M., Krause, C., Liebel, G.: Detecting performance bad smells for Henshin

model transformations. In: Proc. AMT 2013 (2013)

slide-28
SLIDE 28

Background Slides

slide-29
SLIDE 29

Constraints

21-JULY-2014 Domain Completeness for TGGs 29

A condition 𝑏𝑑𝑄 over graph 𝑄 is inductively defined by:

  • true,
  • ∃ 𝑏, 𝑏𝑑𝐷 , for morphism 𝑏: 𝑄 → 𝐷 and condition

𝑏𝑑𝐷 (P=Premise & C=Conclusion),

  • ¬𝑏𝑑𝑄,∨𝑗∈ 𝐽 𝑏𝑑𝑄,𝑗 ,∧𝑗∈𝐽 𝑏𝑑𝑄,𝑗 , for conditions 𝑏𝑑𝑄 and

𝑏𝑑𝑄,𝑗 𝑗 ∈ 𝐽 , Graph Conditions

slide-30
SLIDE 30

Constraints

21-JULY-2014 Domain Completeness for TGGs 30

𝐻 ⊨ 𝑏𝑑𝑄, if:

  • 𝑏𝑑𝑄 = true
  • 𝑏𝑑𝑄 = ∃ 𝑏: 𝑄 → 𝐷, 𝑏𝑑𝐷 , for all occurrences 𝑞 ∶ 𝑄 →

𝐻 of 𝑄 in 𝐻 with 𝑞 ∈ 𝒫, also 𝐷 occurs in 𝐻 (∃𝑟 ∶ 𝐷 → Satisfaction