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: PIL2SPELL 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, ASTRA fleet correctness, completeness of SES Source: SES - www.ses.com 21-JULY-2014 Domain Completeness for TGGs 2
Scenario for testing – static simulator 1 1. Symbolic execution SPELL XML 2. Model Transformation: def lift(target): <Test name="Lift Satellite"> current = GetTM ( 'TM_HEIGHT' ) <Test Case> Generation of test if current-target > 500: <User> return False False, 23000 elif current-target < -500: cases </User> Send( 'C_LIFT' ) <Telemetry name="TM_HEIGHT"> return lift(target) <Values> – else : inputs for each 22000,24000 2 return True </Values> </Telemetry> execution path: while True : </Test Case> if Prompt ( 'Abort?' , YES_NO) ... break TM values, user <Test> target= Prompt ( 'Height:' , NUM) if not lift(target): inputs #Alert ... Control procedure Test input – automatic path traversal 3. Execution of test cases 3 in simulator Static simulator 21-JULY-2014 Domain Completeness for TGGs 3
Outline • Challenge: Domain Completeness • Conceptual Overview and TGGs • Solution: C-Extension Completeness • Evaluation • Conclusion and Future Work 21-JULY-2014 Domain Completeness for TGGs 4
Challenge: Domain Completeness Model Transformation (MT) 𝑀 𝑇 𝑀 𝑈 A model transformation 𝑵𝑼: 𝑴 𝑻 ⇛ 𝑴 𝑼 from source language (DSL) 𝑀 𝑇 to target language 𝑀 𝑈 is a relation 𝑵𝑼 ⊆ 𝑴 𝑻 × 𝑴 𝑼 . Domain Completeness 𝑁𝑈 is domain complete , if ∀𝑁 𝑇 ∈ 𝑀 𝑇 : ∃ 𝑵 𝑻 , 𝑵 𝑼 ∈ 𝑵𝑼 . 21-JULY-2014 Domain Completeness for TGGs 5
Example: CD2RDBM • DSL is specified by meta model (type graph) and constraints C 1 : 𝑀 = ℒ(𝐵𝑈𝐻𝐽, 𝐷) • Source language: class diagrams • Target language: data base models [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). 21-JULY-2014 Domain Completeness for TGGs 6
Outline • Challenge: Domain Completeness • Conceptual Overview and TGGs • Solution: C-Extension Completeness • Evaluation • Conclusion and Future Work 21-JULY-2014 Domain Completeness for TGGs 7
General Concept: Language Conversion Translation Concept L1 Source Code 1. Parsing L1 EMF 2. TGGs L2 EMF 3. Serialisation L2 Source Code 21-JULY-2014 Domain Completeness for TGGs 8
Key Idea of Triple Graph Grammars (TGGs) Henshin Translation (TGGs, Henshin) 21-JULY-2014 Domain Completeness for TGGs 9
Key Idea of Triple Graph Grammars (TGGs) • Specify pattern by pattern how consistent integrated models can be constructed simultaneously Source Correspondence Target Model Model Model Triple Graph 21-JULY-2014 Domain Completeness for TGGs 10
Key Idea of Triple Graph Grammars (TGGs) • Specify pattern by pattern how consistent integrated models can be constructed simultaneously • Generate operations for interoperability: Model Translation/Integration/Synchronisation Source Correspondence Target Model Model Model Triple Graph 21-JULY-2014 Domain Completeness for TGGs 11
Key Idea of Triple Graph Grammars (TGGs) • Specify pattern by pattern how consistent integrated models can be constructed simultaneously • Generate operations for interoperability: Model Translation/Integration/Synchronisation Source Correspondence Target Model Model Model Triple Graph 21-JULY-2014 Domain Completeness for TGGs 12
Example: Type graph of TGG Triple type graph TG TG S TG TG C TG T TG NamedElement {abstract} name:String type Classifier Column Attribute AC name:String {abstract} 1 * * cols ref type attrs pkey 1 Table Class CT name:String ColumnType PrimitiveType TT name:String Data base model Class diagram 21-JULY-2014 Domain Completeness for TGGs 13
Example: Triple Rule for CD2RDBM Triple Rule 3: A2C = Attribute2Column(n:String) :Class :Table :CT :cols :attrs ++ :cols NAC ++ ++ ++ ++ ++ ++ :Attribute :Column :AC :Column name = n ++ name = n name = n ++ Source Rule 3: A2C S = Attribute2Column S (n:String) :attrs :Class ++ ++ :Attribute name = n ++ 21-JULY-2014 Domain Completeness for TGGs 14
Results for MTs via TGGs Theorem (Correctness, Completeness and Termination) 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 [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). 21-JULY-2014 Domain Completeness for TGGs 15
Challenge: Domain Completeness Theorem (Completeness) Each TGG-model transformation 𝑁𝑈 is • complete : for each source model 𝐻 𝑇 ∈ 𝑀(𝑈𝐻𝐻) 𝑇 there is an 𝑁𝑈 -sequence [1,2] Domain Completeness Need for 𝑁𝑈 is domain complete , if extended ∀𝑁 𝑇 ∈ 𝑀 𝑇 : ∃ 𝑵 𝑻 , 𝑵 𝑼 ∈ 𝑵𝑼 . results Challenge This talk 𝑀 𝑇 ⊆ 𝑀 𝑈𝐻𝐻 𝑇 𝑴 𝑻 ⊆ 𝑴 𝑼𝑯𝑯 𝑻 ⊆ 𝑀 𝑈𝐻𝐻 𝑇 21-JULY-2014 Domain Completeness for TGGs 16
Outline • Challenge: Domain Completeness • Conceptual Overview and TGGs • Solution: C-Extension Completeness • Evaluation • Conclusion and Future Work 21-JULY-2014 Domain Completeness for TGGs 17
C-extensions 𝐵𝑢𝑝𝑛𝑡(𝐻 𝑇 ) 𝑀 𝑇 𝐻 𝑇 𝑭 𝟐 𝑭 𝟑 • 𝑀 𝑇 = 𝑀 𝐵𝑈𝐻𝐽, 𝐷 , 𝐵𝑢𝑝𝑛𝑡 𝐻 𝑇 • Show that ∀𝑏 ∈ 𝐵𝑢𝑝𝑛𝑡 𝐵𝑈𝐻𝐽 : 𝑏 can be constructed via 𝑈𝐻𝐻 𝑇 - either directly or for 𝐷 -extension all extensions 𝐹 𝑗 required by constraints 𝐷 completeness • Ensure that creation sequences can be Conflict freeness merged to a single one for 𝐻 21-JULY-2014 Domain Completeness for TGGs 18
Formal Result: C-Extension Completeness Main result for verifying language inclusion 𝑀 𝐵𝑈𝐻𝐽, 𝐷 ⊆ 𝑀 𝐵𝑈𝐻𝐽, 𝑈𝐻𝐻 𝑇 : Theorem (Language Inclusion) Let 𝑀 1 = 𝑀 𝐵𝑈𝐻𝐽, 𝐷 , 𝑀 2 = 𝑀 𝐵𝑈𝐻𝐽, 𝐻𝐻 with grammar 𝐻𝐻 = 𝐵𝑈𝐻𝐽, 𝑇𝐻, 𝑄 , non-deleting rules 𝑄 , 𝑇𝐻 = ∅ . If marking rules 𝑛(𝐻𝐻) are 𝑫 -conflict-free and 𝑀 2 is 𝑫 -extension complete , then 𝑴 𝟐 ⊆ 𝑴 𝟑 . Tool Support encoding of rules with markers 21-JULY-2014 Domain Completeness for TGGs 19
Marking rules Grammar Rule Marking Rule :Class :Class :attrs ++ mark= T ++ :Attribute :attrs mark= [F => T] name = n ++ :Attribute name = n mark= [F => T] mark_name= [F => T] 21-JULY-2014 Domain Completeness for TGGs 20
Outline • Challenge: Domain Completeness • Conceptual Overview and TGGs • Solution: C-Extension Completeness • Evaluation • Conclusion and Future Work 21-JULY-2014 Domain Completeness for TGGs 21
Limitations 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 21-JULY-2014 Domain Completeness for TGGs 22
Recommend
More recommend