Outline Java JavaFun Semantical properties Type system Towards soundness proof Functional Java Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw Poland November 24, 2008 Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw Poland Functional Java
134
Embed
Functional Java - mimuw.edu.plczarnik/sliwowica/... · Outline Java JavaFun Semantical properties Type system Towards soundness proof Motivations I Problems with applications in Java:
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Functional Java
Aleksy Schubert and Jacek ChrząszczInstitute of InformaticsWarsaw Universityul. Banacha 202–097 WarsawPoland
November 24, 2008
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:
I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I
A
Solution:
I state changes done in a small fragment of the applicationI the rest of the application must be “functional”
— impractical
I but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the program
I unpredictable state changesI frequent state inconsistencies
I
A
Solution:
I state changes done in a small fragment of the applicationI the rest of the application must be “functional”
— impractical
I but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changes
I frequent state inconsistenciesI
A
Solution:
I state changes done in a small fragment of the applicationI the rest of the application must be “functional”
— impractical
I but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I
A
Solution:
I state changes done in a small fragment of the applicationI the rest of the application must be “functional”
— impractical
I but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I
A
Solution:
I state changes done in a small fragment of the applicationI the rest of the application must be “functional”
— impractical
I but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I
A
Solution:I state changes done in a small fragment of the application
I the rest of the application must be “functional”
— impractical
I but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I
A
Solution:I state changes done in a small fragment of the applicationI the rest of the application must be “functional”
— impracticalI but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I
A
Solution:I state changes done in a small fragment of the applicationI the rest of the application must be “functional” — impractical
I but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I
A
Solution:I state changes done in a small fragment of the applicationI the rest of the application must be “functional” — impracticalI but functional programs can internally use imperative features
— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I
A
Solution:I state changes done in a small fragment of the applicationI the rest of the application must be “functional” — impracticalI but functional programs can internally use imperative features— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I A Solution:I state changes done in a small fragment of the applicationI the rest of the application must be “functional” — impracticalI but functional programs can internally use imperative features— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Motivations
I Problems with applications in Java:I state scattered through the programI unpredictable state changesI frequent state inconsistencies
I A Solution:I state changes done in a small fragment of the applicationI the rest of the application must be “functional” — impracticalI but functional programs can internally use imperative features— practical
I We want to prove that these parts are “functional”
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial language
I Requires modellingI We model
I classes and inheritanceI protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modelling
I We model
I classes and inheritanceI protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modellingI We model
I classes and inheritanceI protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modellingI We model
I classes and inheritance
I protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modellingI We model
I classes and inheritanceI protected fields
I named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modellingI We model
I classes and inheritanceI protected fieldsI named public constructors
I named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modellingI We model
I classes and inheritanceI protected fieldsI named public constructorsI named public methods
I control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modellingI We model
I classes and inheritanceI protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)
I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modellingI We model
I classes and inheritanceI protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modelling of sublanguagesI We do not model
I packagesI interfacesI visibility featuresI static membersI dynamic loadingI multithreading
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modelling of sublanguagesI We do not model
I packages
I interfacesI visibility featuresI static membersI dynamic loadingI multithreading
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modelling of sublanguagesI We do not model
I packagesI interfaces
I visibility featuresI static membersI dynamic loadingI multithreading
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modelling of sublanguagesI We do not model
I packagesI interfacesI visibility features
I static membersI dynamic loadingI multithreading
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modelling of sublanguagesI We do not model
I packagesI interfacesI visibility featuresI static members
I dynamic loadingI multithreading
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modelling of sublanguagesI We do not model
I packagesI interfacesI visibility featuresI static membersI dynamic loading
I multithreading
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Java
I Huge industrial languageI Requires modelling of sublanguagesI We do not model
I packagesI interfacesI visibility featuresI static membersI dynamic loadingI multithreading
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - Goal
I We want a formal definition of “functional”
I of “local-state”I both syntactic — type system, and semantic — with heaps,locations and values
I and a proof that our type system yields “local-state” and“functional” methods
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - Goal
I We want a formal definition of “functional”I of “local-state”
I both syntactic — type system, and semantic — with heaps,locations and values
I and a proof that our type system yields “local-state” and“functional” methods
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - Goal
I We want a formal definition of “functional”I of “local-state”I both syntactic — type system, and semantic — with heaps,locations and values
I and a proof that our type system yields “local-state” and“functional” methods
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - Goal
I We want a formal definition of “functional”I of “local-state”I both syntactic — type system, and semantic — with heaps,locations and values
I and a proof that our type system yields “local-state” and“functional” methods
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - a bit of “history”
I Genrap developed in Comarch R&D Center (AGS and friends)
I ad hoc syntactic rulesI a checker which enforced these rules in the build processI no proofsI Kotek project Comarch-UW-EU (SPO WKP)I start of formalization (syntactic rules −→ a type system),semantics
I now: (beginning of) proof
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - a bit of “history”
I Genrap developed in Comarch R&D Center (AGS and friends)I ad hoc syntactic rules
I a checker which enforced these rules in the build processI no proofsI Kotek project Comarch-UW-EU (SPO WKP)I start of formalization (syntactic rules −→ a type system),semantics
I now: (beginning of) proof
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - a bit of “history”
I Genrap developed in Comarch R&D Center (AGS and friends)I ad hoc syntactic rulesI a checker which enforced these rules in the build process
I no proofsI Kotek project Comarch-UW-EU (SPO WKP)I start of formalization (syntactic rules −→ a type system),semantics
I now: (beginning of) proof
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - a bit of “history”
I Genrap developed in Comarch R&D Center (AGS and friends)I ad hoc syntactic rulesI a checker which enforced these rules in the build processI no proofs
I Kotek project Comarch-UW-EU (SPO WKP)I start of formalization (syntactic rules −→ a type system),semantics
I now: (beginning of) proof
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - a bit of “history”
I Genrap developed in Comarch R&D Center (AGS and friends)I ad hoc syntactic rulesI a checker which enforced these rules in the build processI no proofsI Kotek project Comarch-UW-EU (SPO WKP)
I start of formalization (syntactic rules −→ a type system),semantics
I now: (beginning of) proof
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - a bit of “history”
I Genrap developed in Comarch R&D Center (AGS and friends)I ad hoc syntactic rulesI a checker which enforced these rules in the build processI no proofsI Kotek project Comarch-UW-EU (SPO WKP)I start of formalization (syntactic rules −→ a type system),semantics
I now: (beginning of) proof
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun - a bit of “history”
I Genrap developed in Comarch R&D Center (AGS and friends)I ad hoc syntactic rulesI a checker which enforced these rules in the build processI no proofsI Kotek project Comarch-UW-EU (SPO WKP)I start of formalization (syntactic rules −→ a type system),semantics
I now: (beginning of) proof
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun
I Fragment of Java, including:
I classes and inheritanceI protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun
I Fragment of Java, including:I classes and inheritance
I protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun
I Fragment of Java, including:I classes and inheritanceI protected fields
I named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun
I Fragment of Java, including:I classes and inheritanceI protected fieldsI named public constructors
I named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun
I Fragment of Java, including:I classes and inheritanceI protected fieldsI named public constructorsI named public methods
I control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun
I Fragment of Java, including:I classes and inheritanceI protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)
I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
JavaFun
I Fragment of Java, including:I classes and inheritanceI protected fieldsI named public constructorsI named public methodsI control flow (including recursion, but no loops)I exceptions
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Syntax of JavaFunSemantics of JavaFun
Grammar of JavaFun
C ::= cdecl+
cdecl ::= class [cmod] C1 [ext C2] {F K M}cmod ::= immutable | funcmmod ::= lstate | funckmod ::= lstatefmod ::= repC ::= . . . class name . . .
F ::= [F ; ]∗
F ::= C [fmod] xK ::= [K ; ]∗
K ::= [kmod] k(args) [throws Exc] {E}args ::= ε | C x | C x , argsExc ::= C | C ,Exc
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
m is local-state, whenI for all locations l , l1, . . . , ln, l ′ ∈ Loc of appropriate types in hI each sequence of contexts C :: CJK∅ such that
C , h1, C :: CJl .m(l1, . . . , ln)K∅ →(∗) h2, C :: CJl .m(l1, . . . , ln)K∅ :: Jl ′K,
we have h1 vR h2 whereR = Rep(h1, l , l1, . . . , ln)
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Different kinds of rules
I cok rulesI mok rulesI type rules
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
An example of a typing rule: constructors
C1 ∈ C x : 〈D, τ, nthis〉 ∈ Locxi : 〈Di , τi , nthis〉 ∈ Loc dla i = 1, . . . , kC ; C : cmod; Ex ; Loc ` x .m(x1, . . . , xk) : C1C ; C : func; Ex ; Loc ` x .m(x1, . . . , xk) : cok
(methodfun cok)
C1 ∈ C cmod 6= funcC ; C : cmod; Ex ; Loc ` x .m(x1, . . . , xk) : C1C ; C : cmod; Ex ; Loc ` x .m(x1, . . . , xk) : cok
(methodnfun cok)
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
An example of a typing rule: constructors
C1 ∈ C x : 〈D, τ, nthis〉 ∈ Locxi : 〈Di , τi , nthis〉 ∈ Loc dla i = 1, . . . , kC ; C : cmod; Ex ; Loc ` x .m(x1, . . . , xk) : C1C ; C : func; Ex ; Loc ` x .m(x1, . . . , xk) : cok
(methodfun cok)
C1 ∈ C cmod 6= funcC ; C : cmod; Ex ; Loc ` x .m(x1, . . . , xk) : C1C ; C : cmod; Ex ; Loc ` x .m(x1, . . . , xk) : cok
(methodnfun cok)
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
An example of a typing rule: methods
modifier(C ,D, k) = lstate∀y ∈ x .Loc `local y : local
C ; C : cmod, k : ∅; Ex ; Loc ` new D.k(x) : D
C ; C : cmod,m : func; Ex ; Loc ` new D.k(x) : mok(funcnew mok)
C1,C2 ∈ C x : 〈C1, τ1, τ2〉 ∈ Locmodifier(C ,C1,m′) = func
C ; C : cmod,m : func; Ex ; Loc ` x .m′(x1, . . . , xk) : C2C ; C : cmod,m : func; Ex ; Loc ` x .m′(x1, . . . , xk) : mok
(funcmeth mok)
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
An example of a typing rule: methods
modifier(C ,D, k) = lstate∀y ∈ x .Loc `local y : local
C ; C : cmod, k : ∅; Ex ; Loc ` new D.k(x) : D
C ; C : cmod,m : func; Ex ; Loc ` new D.k(x) : mok(funcnew mok)
C1,C2 ∈ C x : 〈C1, τ1, τ2〉 ∈ Locmodifier(C ,C1,m′) = func
C ; C : cmod,m : func; Ex ; Loc ` x .m′(x1, . . . , xk) : C2C ; C : cmod,m : func; Ex ; Loc ` x .m′(x1, . . . , xk) : mok
(funcmeth mok)
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Soundness proof
I difficult because longI problems with formulation
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Related work
I “immutability” of objects (e.g. C. Haack, E. Poll, J. Schafer,A. Schubert, Immutable Objects for a Java-like Language,ESOP’2007. (ETAPS BEST PAPER AWARD!)
I “who can modify what” approach UTT (e.g. P. Muller,A. Poetzsch-Heffter Universes: A Type System for Alias andDependency Control, 2001
I “how to write a lambda in Java” (a few)
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Related work
I “immutability” of objects (e.g. C. Haack, E. Poll, J. Schafer,A. Schubert, Immutable Objects for a Java-like Language,ESOP’2007. (ETAPS BEST PAPER AWARD!)
I “who can modify what” approach UTT (e.g. P. Muller,A. Poetzsch-Heffter Universes: A Type System for Alias andDependency Control, 2001
I “how to write a lambda in Java” (a few)
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Related work
I “immutability” of objects (e.g. C. Haack, E. Poll, J. Schafer,A. Schubert, Immutable Objects for a Java-like Language,ESOP’2007. (ETAPS BEST PAPER AWARD!)
I “who can modify what” approach UTT (e.g. P. Muller,A. Poetzsch-Heffter Universes: A Type System for Alias andDependency Control, 2001
I “how to write a lambda in Java” (a few)
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java
OutlineJava
JavaFunSemantical properties
Type systemTowards soundness proof
Thank you!
Aleksy Schubert and Jacek Chrząszcz Institute of Informatics Warsaw University ul. Banacha 2 02–097 Warsaw PolandFunctional Java