constraint-aware schema transformation tiago alves (uminho & sig) joint work with: paulo f....
TRANSCRIPT
Constraint-awareSchema Transformation
Constraint-awareSchema Transformation
Tiago Alves (UMinho & SIG)Joint work with:
Paulo F. Silva & Joost Visser
Tiago Alves (UMinho & SIG)Joint work with:
Paulo F. Silva & Joost Visser
RULE 2008
About meAbout me
PhD Student Software Improvement Group, Amsterdam University of Minho, Braga
Supervisors José Nuno Oliveira Joost Visser
PhD Student Software Improvement Group, Amsterdam University of Minho, Braga
Supervisors José Nuno Oliveira Joost Visser
Software Improvement GroupSoftware Improvement Group
Company Spin-off from CWI in 2000, self-owned, independent Management consultancy grounded in source code analysis
Services Software Risk Assessments (snapshot) and Software Monitoring
(continuous) Toolset enables to analyze source code in an automated manner Experienced staff transforms analysis data into recommendations Focus on technical quality, primarily maintainability / evolvability
Company Spin-off from CWI in 2000, self-owned, independent Management consultancy grounded in source code analysis
Services Software Risk Assessments (snapshot) and Software Monitoring
(continuous) Toolset enables to analyze source code in an automated manner Experienced staff transforms analysis data into recommendations Focus on technical quality, primarily maintainability / evolvability
Observation...Observation...
A large proportion of the costs and failures in software engineering derive from the profoundly ad-hoc approach to the preservation of consistency between software artifacts as they undergo change.
This talk: Important instance of general problem Constraint-aware schema transformations
A large proportion of the costs and failures in software engineering derive from the profoundly ad-hoc approach to the preservation of consistency between software artifacts as they undergo change.
This talk: Important instance of general problem Constraint-aware schema transformations
2LT: Coupled transformations2LT: Coupled transformations
A BT
from
to
€
if A ≤ B and B ≈ C then A ≤ Cto
from
to’
from’
to’ . to
from . from’
to:
from:
surjectivecan be partialinjectivetotal
from . to = id
Example ProblemExample Problem
€
A → B → C( ) ≤ A → ()( ) × A × B → C( )
€
Java →McCabe → 3,
LOC → 20
⎧ ⎨ ⎩
⎫ ⎬ ⎭
,
C#→FanIn → 3,
FanOut → 0
⎧ ⎨ ⎩
⎫ ⎬ ⎭
⎧
⎨
⎪ ⎪
⎩
⎪ ⎪
⎫
⎬
⎪ ⎪
⎭
⎪ ⎪€
Java → (),
C# → ()
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪×
Java × McCabe → 3,
Java × LOC → 20,
C#×FanIn → 3,
C#×FanOut → 0
⎧
⎨ ⎪ ⎪
⎩ ⎪ ⎪
⎫
⎬ ⎪ ⎪
⎭ ⎪ ⎪
€
Java → (),
C# → ()
⎧ ⎨ ⎪
⎩ ⎪
⎫ ⎬ ⎪
⎭ ⎪×
Java × McCabe → 3,
Java × LOC → 20,
C#×FanIn → 3,
C#×FanOut → 0,
C × NPath → 4
⎧
⎨
⎪ ⎪ ⎪
⎩
⎪ ⎪ ⎪
⎫
⎬
⎪ ⎪ ⎪
⎭
⎪ ⎪ ⎪
Example SolutionExample Solution
€
A → B → C( ) ≤ A → ()( ) × A × B → C( )
€
A → B → C( ) ≈ A → ()( ) × A × B → C( )ϕ
ϕ = set π1 oδ oπ 2 ⊆δ oπ1
Rules catalogue (augmented)Rules catalogue (augmented)
€
A + B ≈ A? × B?ϕ 1
ϕ1 = ∈ oπ1( )⊕ ∈ oπ 2( )
€
A → B + C( ) ≈ A →1( ) × A → B( ) × A → C( )ϕ 2
ϕ 2 = δ oπ 2 ⊆δ oπ1( )∧ δ oπ 3 ⊆δ oπ1( )
€
A → B → C( ) ≈ A →1( ) × A × B → C( )ϕ 3
A → B × C → D( )( ) ≈ A → B( ) × A × C → D( )ϕ 3
ϕ 3 = δ oπ 2 ⊆δ oπ1( )∧ δ oπ 3 ⊆δ oπ1( )
ChallengesChallenges
Constraints Representation Constraint Transformation
Constraint Composition
Constraints Representation Constraint Transformation
Constraint Composition
€
Aψ ≤ Bφ
€
Aψ ≈ Bφ∧θ
IngredientsIngredients
Data refinement
Point-free programtransformation
Generalized algebraic datatypes
Strategic termrewriting
Type representation (augmented)Type representation (augmented)
data Type t where One :: Type () List :: Type a -> Type [a] Set :: Type a -> Type (Set a) Map :: Type a -> Type b -> Type (Map a b) Either :: Type a -> Type b -> Type (Either a b) Prod :: Type a -> Type b -> Type (a,b) String :: Type String ... Tinv :: Type a -> PF (Pred a) -> Type a ...
type Pred a = a -> Bool
PF representation (augmented)PF representation (augmented)
data R f where ID :: PF (a -> a) COMP :: Type b -> PF (b -> c) -> PF (a -> b) -> PF (a -> c) FST :: PF ((a,b) -> a) AND :: PF (Pred a) -> PF (Pred a) -> PF (Pred a) InSet :: PF (a -> Set b) -> PF (a -> Set b) -> PF (Pred a) ...
ContributionsContributions
Type theory enhanced with constraints Enhanced refinement rules Extended 2LT rewrite system
Constraints introduction Constraints propagation Constraints simplification
Type theory enhanced with constraints Enhanced refinement rules Extended 2LT rewrite system
Constraints introduction Constraints propagation Constraints simplification
What needs to be done...What needs to be done...
Consolidate work Proper evaluation of PF representations
Eq, Ord instances problems Revisit rules & constraints “Backwards transformation”
Constraints pattern-matching Constraints proof
Develop further front-ends Put on practice Extend application fields (MDE)
Consolidate work Proper evaluation of PF representations
Eq, Ord instances problems Revisit rules & constraints “Backwards transformation”
Constraints pattern-matching Constraints proof
Develop further front-ends Put on practice Extend application fields (MDE)