Constraint-aware Schema Transformation Tiago Alves (UMinho & SIG) Joint work with: Paulo F. Silva & Joost Visser RULE 2008
About me § Ph. D Student § Software Improvement Group, Amsterdam § University of Minho, Braga § Supervisors § José Nuno Oliveira § Joost Visser
Software 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
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
2 LT: Two Level Transformation
2 LT: Coupled transformations to A B T from to: surjective can be partial from: injective total from. to = id to to’. to from’
Example Problem
Example Solution
Rules catalogue (augmented)
Challenges § Constraints Representation § Constraint Transformation § Constraint Composition
The Solution to A T from 2 B
Ingredients Data refinement Point-free program transformation Generalized algebraic datatypes Strategic term rewriting
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) 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) In. Set : : PF (a -> Set b) -> PF (Pred a). . .
Constraint-aware rewriting to A T from 2 B
PF simplification (augmented)
Contributions § Type theory enhanced with constraints § Enhanced refinement rules § Extended 2 LT rewrite system § Constraints introduction § Constraints propagation § Constraints simplification
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)
Thank you questions?