Towards Type Safety
- f
Aspect-Oriented Languages
by Florian Kammüller & Matthias Vösgen TU Berlin Software Engineering Group
Towards Type Safety of Aspect-Oriented Languages by Florian - - PowerPoint PPT Presentation
Software Engineering Group TU Berlin Towards Type Safety of Aspect-Oriented Languages by Florian Kammller & Matthias Vsgen Outline Introduction Featherweight Java and formalization Formalization of aspects Formalization
by Florian Kammüller & Matthias Vösgen TU Berlin Software Engineering Group
Towards Type Safety of Aspect-Oriented Languages
2
Towards Type Safety of Aspect-Oriented Languages
3
Project Bali: Verification of the Java specification using the prover Isabelle.
Towards Type Safety of Aspect-Oriented Languages
4
Isabelle Coq PVS ACL 2 HOL 4 TWELF
Towards Type Safety of Aspect-Oriented Languages
5
Coq is a constructive theorem prover Constructive proofs can be interpreted as algorithms (Curry-Howard Isomorphism)
safety
Towards Type Safety of Aspect-Oriented Languages
6
“Well Typed terms never get stuck.”
Progress: Well-typed terms can be evaluated
Preservation: The evaluation of a well-typed term leads to a another well-typed term.
Towards Type Safety of Aspect-Oriented Languages
7
Towards Type Safety of Aspect-Oriented Languages
8
Towards Type Safety of Aspect-Oriented Languages
9
Towards Type Safety of Aspect-Oriented Languages
10
class Pair extends Object { Object fst; Object snd; Pair(Object fst, Object snd) { super(); this.fst = fst; this.snd = snd; } Pair setfst(Object newfst) { return new Pair(newfst, this.snd); } }
Towards Type Safety of Aspect-Oriented Languages
11
Towards Type Safety of Aspect-Oriented Languages
12
Lemma type_soundness : forall CT: classTable e:expression e':expression, class_table_typing CT // All classes well typed
Towards Type Safety of Aspect-Oriented Languages
13
Towards Type Safety of Aspect-Oriented Languages
14
Aspect Advice Pointcut Advice Expression
Class Pointcut Selection
(...)
Towards Type Safety of Aspect-Oriented Languages
15
Aspect
Inductive aspectDef : Set := | Aspect : aspectName -> aspectName -> list fieldDef -> methodTable ->pointcutTable -> adviceTable -> aspectDef.
Name Superaspect-Name {Fields} {Pointcuts} {Advice} {Methods}
Towards Type Safety of Aspect-Oriented Languages
16
Execution Pointcut Name {Selections}
Inductive pointcutDef: Set := | Execution : pointcutName -> pointcutSelectionList
Towards Type Safety of Aspect-Oriented Languages
17
Pointcut Selection Classname Methodname
Inductive pointcutSelection : Set := | methodSel: className -> methodName -> pointcutSelection.
Towards Type Safety of Aspect-Oriented Languages
18
Inductive adviceDef: Set := | aroundAdvice: pointcutName -> adviceExp -> adviceDef.
Advice Pointcutname Advice expression
Towards Type Safety of Aspect-Oriented Languages
19
Inductive adviceExp : Set := | proceed: adviceExp | adVar : varName -> adviceExp | adFieldProj : adviceExp -> fieldName -> adviceExp | adMethodInvk : adviceExp -> methodName -> list adviceExp -> adviceExp | adNew : className -> list adviceExp -> adviceExp | adCast : className -> adviceExp -> adviceExp.
Towards Type Safety of Aspect-Oriented Languages
20
Towards Type Safety of Aspect-Oriented Languages
21
{Aspects} {Classes}
Definition wv_AT_CT (CT: classTable) (AT: aspectTable) : classTable := MapCollect _ _ (fun _ asp => wv_asp_CT CT asp) AT.
Towards Type Safety of Aspect-Oriented Languages
22
Advice Expression Method Expression
Fixpoint merge_expr (mExpr: exp) (aExpr: adviceExp) {struct aExpr}: exp := match aExpr with proceed => mExpr | adVar v => Var v | adFieldProj aExpr2 fieldN => FieldProj (merge_expr mExpr aExpr2) fieldN (...) end.
Towards Type Safety of Aspect-Oriented Languages
23
Towards Type Safety of Aspect-Oriented Languages
24
Axiom type_soundness_woven: forall (AT:aspectTable) (CT:classTable), class_table_typing CT
Parameter asp_table_typing: aspectTable -> Prop.
Towards Type Safety of Aspect-Oriented Languages
25
Lemma weave_type_soundness: forall (CT0 CT: classTable)(e e': exp)(AT: aspectTable), CT = wv_AT_CT CT0 AT
Towards Type Safety of Aspect-Oriented Languages
26
Towards Type Safety of Aspect-Oriented Languages
27
Towards Type Safety of Aspect-Oriented Languages
28