Language-Independent Model Transformation Verification K. Lano, S. Kolahdouz-Rahimi, T. Clark King s College London; University of Middlesex



Similar documents
DSL Design. Model Transformations. Model Transformations. Language g Implementation Strategies

Coverability for Parallel Programs

UML TUTORIALS THE USE CASE MODEL

Model Checking: An Introduction

Formal Engineering for Industrial Software Development

CHAPTER 7 GENERAL PROOF SYSTEMS

Automated Program Behavior Analysis

Formal Verification Coverage: Computing the Coverage Gap between Temporal Specifications

TECH. Requirements. Why are requirements important? The Requirements Process REQUIREMENTS ELICITATION AND ANALYSIS. Requirements vs.

Modelling the Railway Control Domain rigorously with a UML 2.0 Profile

Static Program Transformations for Efficient Software Model Checking

Specification and Analysis of Contracts Lecture 1 Introduction

Chair of Software Engineering. Software Verification. Assertion Inference. Carlo A. Furia

Model Driven Security: Foundations, Tools, and Practice

System modeling. Budapest University of Technology and Economics Department of Measurement and Information Systems

Rigorous Software Development CSCI-GA

A UML Profile for Dynamic Execution Persistence with Monitoring Purposes. MiSE 13 May 19 th, San Francisco, CA

Policy Modeling and Compliance Verification in Enterprise Software Systems: a Survey

HECTOR a software model checker with cooperating analysis plugins. Nathaniel Charlton and Michael Huth Imperial College London

Generating Enterprise Applications from Models

The ProB Animator and Model Checker for B

MDA and Analysis of Web Applications

A Classification of Model Checking-based Verification Approaches for Software Models

Verification of Network Management System Configurations

Formal Verification of Software

Design by Contract beyond class modelling

VDM vs. Programming Language Extensions or their Integration

A Classification of Model Checking-Based Verification Approaches for Software Models

i. Node Y Represented by a block or part. SysML::Block,

How To Write A Test Engine For A Microsoft Microsoft Web Browser (Php) For A Web Browser For A Non-Procedural Reason)

Relationship-Based Change Propagation: A Case Study

Analyzing and Managing Role-Based Access Control Policies

Introducing Formal Methods. Software Engineering and Formal Methods

Safe Object-Oriented Software: The Verified Design-By-Contract Paradigm

Model Transformation by Graph Transformation: A Comparative Study

InvGen: An Efficient Invariant Generator

PROPERTECHNIQUEOFSOFTWARE INSPECTIONUSING GUARDED COMMANDLANGUAGE

Investigating a File Transfer Protocol Using CSP and B

Sofware Requirements Engineeing

Software Engineering

A Framework for the Semantics of Behavioral Contracts

Mapping between Levels in the Metamodel Architecture

Appendix... B. The Object Constraint

ML for the Working Programmer

3 Extending the Refinement Calculus

Automated Theorem Proving - summary of lecture 1

Software Engineering Reference Framework

Big Data looks Tiny from the Stratosphere

StaRVOOrS: A Tool for Combined Static and Runtime Verification of Java

A Semantical Perspective on Verification of Knowledge

Information Technology Topic Maps Part 2: Data Model

Automatic Generation of Consistency-Preserving Edit Operations for MDE Tools

Statically Checking API Protocol Conformance with Mined Multi-Object Specifications Companion Report

WESTMORELAND COUNTY PUBLIC SCHOOLS Integrated Instructional Pacing Guide and Checklist Computer Math

Handout #1: Mathematical Reasoning

Verifying Semantic of System Composition for an Aspect-Oriented Approach

Data Model Bugs. Ivan Bocić and Tevfik Bultan

Scenario-driven Testing of Security-related Domain-specific Language Models

Jairson Vitorino. PhD Thesis, CIn-UFPE February Supervisor: Prof. Jacques Robin. Ontologies Reasoning Components Agents Simulations

Formally speaking: How to apply OCL

LiveWeb Core Language for Web Applications. CITI Departamento de Informática FCT/UNL

Mathematical Reasoning in Software Engineering Education. Peter B. Henderson Butler University

Z Styles for Security Properties and Modern User Interfaces

Rigorous Software Engineering Hoare Logic and Design by Contracts

AN AI PLANNING APPROACH FOR GENERATING BIG DATA WORKFLOWS

Best of Both Worlds - A Mapping from EXPRESS-G to UML

Lehrstuhl für Informatik 2

Lecture 2: Universality

A Logic Approach for LTL System Modification

Tool Support for Invariant Based Programming

SysML Vad och varför. Varför Vad. Diskussion. Relation till UML Innehåll Struktur Beteende Krav Cross cutting constructs. Allocations Profiles

Abstract Data Types in Event-B An Application of Generic Instantiation

Enforcement of Purpose Based Access Control within Relational Database Management Systems

Part 5: Model Transformations and Agile Development We go in more detail into Model-driven development, and introduce Agile development techniques.

! " # The Logic of Descriptions. Logics for Data and Knowledge Representation. Terminology. Overview. Three Basic Features. Some History on DLs

Thomas Jefferson High School for Science and Technology Program of Studies Foundations of Computer Science. Unit of Study / Textbook Correlation

Department of Computer Science, Institute for Software and Multimedia Technology OCL. by Example

CS510 Software Engineering

Chapter II. Controlling Cars on a Bridge

Lecture 3 Topics on Requirements Engineering

Uncovering errors in ATL model transformations using static analysis and constraint solving

Loop Invariants and Binary Search

Internal Quality Management System Audit Checklist (ISO9001:2015) Q# ISO 9001:2015 Clause Audit Question Audit Evidence 4 Context of the Organization

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

CS 389 Software Engineering. Lecture 2 Chapter 2 Software Processes. Adapted from: Chap 1. Sommerville 9 th ed. Chap 1. Pressman 6 th ed.

UML PROFILING AND DSL

Software Testing & Analysis (F22ST3): Static Analysis Techniques 2. Andrew Ireland

Application Notes for Configuring Dorado Software Redcell Enterprise Bundle using SNMP with Avaya Communication Manager - Issue 1.

Object Invariants in Dynamic Contexts

Cassandra. References:

Structural Detection of Deadlocks in Business Process Models

Glossary of Object Oriented Terms

Traceability for Maintenance of Secure Software Systems

SCADE SUITE SOFTWARE VERIFICATION PLAN FOR DO-178B LEVEL A & B

Journal of Mathematics Volume 1, Number 1, Summer 2006 pp

Constructing Contracts: Making Discrete Mathematics Relevant to Beginning Programmers

Elena Baralis, Silvia Chiusano Politecnico di Torino. Pag. 1. Physical Design. Phases of database design. Physical design: Inputs.

An MDA Approach for the Development of Web applications

mdwfs Model-driven Schema Translation for Integrating Heterogeneous Geospatial Data

Component Approach to Software Development for Distributed Multi-Database System

Transcription:

Language-Independent Model Transformation Verification K. Lano, S. Kolahdouz-Rahimi, T. Clark King s College London; University of Middlesex 1

Language-independent MT verification One hinderance to MT verification is large number of different MT languages which exist. Instead of language-specific analysis, we define analysis process applicable to multiple MTLs, via common intermediate representation. Illustrate approach by applying it to ATL. 2

Verification process 3

Metamodels for MTLs Based on transml specification, implementation metamodels Provide semantic representations of transformations MT representations in metamodels can be mapped to verification formalisms (such as theorem provers or constraint satisfaction checkers). 4

Metamodel (LMM) for modelling languages 5

Formal semantics for languages Metaclass Language representing languages has set entitytypes of EntityType, set features of DataFeature, and set constraints of Constraint Set of expressions over base language L (a class diagram) is Exp(L) To support verification, define proof theory and (logical) model theory wrt language L, by associating formal 1st-order language/logic L L to L (of LMM). 6

Modelling concept LMM rep. Formal semantics Entity type E EntityType element Type symbol E, extent of E Single-valued DataFeature element Function symbol attribute att : Typ mult2upper = 1, att : E Typ of E mult2lower = 1, type PrimitiveDataType Single-valued role DataFeature element Function symbol r of E with mult2upper = 1, r : E E1 target type E1 mult2lower = 1, type EntityType 7

Unordered many- DataFeature element Function symbol valued role r of E mult2upper 1 or r : E F(E1 ) with target mult2lower 1, entity type E 1 isordered = false, type EntityType Supertype E1 of E E1 E.general Type E1, E E1 8

Transformation representation A transformation τ characterised by collection of mapping specifications, define intended relationships τ should establish between input (source) and output (target) models, at termination. Postconditions Post of τ. Each mapping has corresponding computation step, defines application of mapping to specific source elements that satisfy its condition. 9

Transformation specification metamodel T MM 10

Transformation metamodel rules.relation constraints express postconditions Post of transformation. The assumptions express preconditions Asm of transformation. The invariants define properties Inv true initially, and preserved by each computation step. 11

Verification techniques Verification techniques can be applied to T MM representation: Syntactic analysis to identify definedness conditions def (Cn), determinacy conditions det(cn) of each mapping Cn. Data dependency analysis, to compute read-frame rd(cn) and write-frame wr(cn) for each Cn, to identify cases of invalid data-dependency and data-use. Syntactic analysis to establish confluence and termination in case of transformations not involving fixed-point iteration. Translation to B AMN, to verify transformation invariants, syntactic correctness (conformance of target models to target language) and model-level semantic preservation (source and target models have equivalent semantics). Translation to Z3, to identify counter-examples to syntactic correctness. 12

Data dependency analysis example 13

Mapping from ATL to transformation metamodel Assume that rule inheritance has been statically expanded out so only leaf rules exist. Denote T MM expression equivalent of an ATL expression e by e. 14

ATL element Module Matched rule Lazy rule Unique lazy rule Implicit rule invocation Using variable Functional helper Attribute helper Action blocks Transformation metamodel representation TransformationSpecification Mapping(s) Operation invoked from mapping constraint Operation using caching to avoid re-application Object lookup using object indexing or traces Variable defined in mapping condition Query operation Operation defining navigation expression Operation with activity, invoked from mapping constraint 15

Mapping from ATL to transformation metamodel Given an ATL module module M; create OUT : T from IN : S; rule r1 { from s1 : S1,..., sm : Sm (SCond) using { v1 : Typ1 = val1;... } to t1 : T1 (TCond1),..., tk : Tk (TCondk) do (Stat) }... rule rn {... } T MM representation of M is a transformation specification M, each matched rule r i is represented by mappings r i Matching and r i Initialisation of M. 16

Input conditions SCond translated to condition conjunct SCond of r i Matching and r i Initialisation. using variables are expressed by conjunct vt = valt of condition. If an action block Stat, new update operation opri(s2 : S2,..., sm : Sm, t1 : T 1,..., tk : Tk) is introduced, with activity given by Stat (Stat as a UML activity). Relation of r i Matching has context S1 and predicate T 1 exists(t1 t1.$id = $id) and... and Tk exists(tk tk.$id = $id) Creates target model elements corresponding to source model elements that satisfy SCond, establishes tracing relations from s1 to t1,..., tk. 17

Relation of r i Initialisation has context S1 and predicate T 1 exists(t1 t1.$id = $id and... and Tk exists(tk tk.$id = $id and TCond1 and... and TCondk and s1.opri(s2,..., tk))...) The tj corresponding to s1 are looked-up and their features initialised. Lazy rules r with first input entity type S1 translated to operations rop of S1. Calls thismodule.r(v1,..., vm) to rule interpreted as calls v1.rop(v2,..., vm). rop stereotyped as cached for unique lazy rules. All r i Matching rules are listed before all r i Initialisation rules in M.rules. Translation from ATL to T MM can be extended to update-in-place transformations, i.e., to refining mode of ATL. 18

Translated transformation represents usual execution semantics of ATL: target objects are created in first phase, followed by links between objects. Computation steps (rule applications) of translation correspond to original specification steps; an invariant of translation is also invariant of original. Syntactic correctness proof using invariants of transformation also demonstrates syntactic correctness for original transformation. Similarly, for model-level semantic preservation. Counter-example (sourcem, targetm) from satisfaction-checking tool for translated transformation, also counter-example for original ATL transformation. For refining mode transformations, termination and confluence of translated specification establishes these properties for original specification. 19

Evaluation (1) UML to relational database ATL transformation, three lazy rules and one matched rule with action block: rule maketable { from c : Entity ( c.generalisation->size() = 0 ) to t : Table ( rdbname <- c.name ) do { for ( att in c.ownedattribute ) { if ( att.isprimary ) { t.tcols->includes(thismodule.makeprimarykeycolumn(att)); } } for ( att in c.ownedattribute ) { if ( att.type.ocliskindof(entity) ) { t.tcols->includes(thismodule.makeforeignkeycolumn(att)); } } for ( att in c.ownedattribute ) { if ( att.type.ocliskindof(primitivetype) or 20

} } } att.isprimary = false ) { t.tcols->includes(thismodule.makecolumn(att)); } } lazy rule makeprimarykeycolumn { from p : Property ( p.isprimary ) to c : Column ( rdbname <- p.name, type <- p.type.name ) } lazy rule makeforeignkeycolumn { from p : Property ( p.type.ocliskindof(entity) ) to c : Column ( rdbname <- p.name, type <- "String" ), f : FKey 21

} ( references <- p.type, fcols <- Set{ c } ) lazy rule makecolumn { from p : Property ( true ) to c : Column ( rdbname <- p.name, type <- p.type.name ) } Matched rule translated to constraints C 0 and C 1 with context Entity: generalisation.size = 0 implies Table->exists( t t.$id = $id and t.rdbname = name ) generalisation.size = 0 implies Table->exists( t t.$id = $id and self.maketable1op(t) ) 22

C 1 has condition and relation of maketablematching, creates table objects. C 2 has condition and relation of maketableinitialisation, creates and links columns to tables. maketable1op(t) represents maketable s action block, invoking operations makeprimarykeycolumnop, makeforeignkeycolumnop and makecolumnop of Property corresponding to lazy rules: makecolumnop(): Column post: Column->exists( c c.$id = $id and c.rdbname = name and c.type = type.name and result = c ) 23

Evaluation Verification properties for case study include: (i) termination; (ii) confluence; (iii) columns of foreign keys are always contained in set of columns of tables: fcols Table.tcols on FKey. (i) can be shown by data-dependency analysis that bounded iteration implementation is sufficient for C 0 and C 1. (ii) fails because Table :: tcols is ordered. Proof of (iii) by establishing it as a transformation invariant. Property Termination Foreign key columns contained in table columns ATL via T MM By data-dependency analysis 20 proof obligations, 15 automatically proved 24

Evaluation (2) Refactoring transformation operating on class diagrams. Applies pull up feature refactorings. ATL refining mode solution with a single rule: rule r1 { from c : Entity, p : Property (c.specialisation->size() > 1 and c.specialisation.specific.ownedattribute->includes(p) and c.ownedattribute.name->excludes(p.name) and c.specialisation.specific->forall( g g.ownedattribute->exists( q q.name = p.name and q.type = p.type ) ) ) to c : Entity ( ownedattribute <- c.ownedattribute->including(p) ) do { for ( p1 in c.specialisation.specific.ownedattribute ) { if (p1.name = p.name) 25

} } } { p1->isdeleted(); } No Matching phase required in semantic representation. Mapping ends (here c : Entity) in both from and to clauses are updated by rule. 26

Required correctness properties: (i) termination; (ii) preservation of single inheritance: invariant generalisation size() 1 on Entity; (iii) preservation of no attribute name conflicts within classes: invariant ownedattribute isunique(name) of Entity. Termination shown by proving that Property.allInstances() size() is a variant, i.e., number of Property instances in model strictly decreased by applying the rule. Property Termination Single inheritance No name conflicts ATL via T MM 6 proof obligations, 5 automatically proved 13 proof obligations, all automatically proved 15 proof obligations, 13 automatically proved 27

Conclusions Previous work on MT verification has been language-specific. We provide general process for MT verification by expressing MTL semantics in T MM, reverse-engineering transformations to this semantic representation, and analysis techniques on T MM. Currently working on ETL and Flock. 28