12854
|
1 |
|
|
2 |
\documentclass[11pt,a4paper]{book}
|
|
3 |
\usepackage{isabelle,isabellesym}
|
|
4 |
\usepackage{latexsym}
|
12856
|
5 |
\usepackage{graphicx}
|
12854
|
6 |
\usepackage{pdfsetup}
|
|
7 |
|
|
8 |
\urlstyle{rm}
|
|
9 |
\isabellestyle{it}
|
|
10 |
|
|
11 |
\pagestyle{myheadings}
|
|
12 |
|
|
13 |
\addtolength{\hoffset}{-1,5cm}
|
|
14 |
\addtolength{\textwidth}{4cm}
|
|
15 |
\addtolength{\voffset}{-2cm}
|
|
16 |
\addtolength{\textheight}{4cm}
|
|
17 |
|
|
18 |
%subsection instead of section to make the toc readable
|
|
19 |
\renewcommand{\thesubsection}{\arabic{subsection}}
|
|
20 |
\renewcommand{\isamarkupheader}[1]{\newpage\markright{Theory~\isabellecontext}\subsection{#1}}
|
|
21 |
\renewcommand{\isamarkupsection}[1]{\subsubsection{#1}}
|
|
22 |
|
|
23 |
%remove spaces from the isabelle environment (trivlist makes them too large)
|
|
24 |
\renewenvironment{isabelle}
|
|
25 |
{\begin{isabellebody}}
|
|
26 |
{\end{isabellebody}}
|
|
27 |
|
12856
|
28 |
|
12854
|
29 |
\begin{document}
|
|
30 |
|
12856
|
31 |
\title{Java Source and Bytecode Formalizations in Isabelle: Bali}
|
12854
|
32 |
\author{Gerwin Klein \and Tobias Nipkow \and David von Oheimb \and
|
|
33 |
Leonor Prensa Nieto \and Norbert Schirmer \and Martin Strecker}
|
|
34 |
\maketitle
|
|
35 |
|
|
36 |
\tableofcontents
|
|
37 |
|
12856
|
38 |
\begin{center}
|
|
39 |
\includegraphics[scale=0.7]{session_graph}
|
|
40 |
\end{center}
|
|
41 |
|
12854
|
42 |
\parindent 0pt\parskip 0.5ex
|
|
43 |
\chapter{Overview}
|
|
44 |
These theories, called Bali, model and analyse different aspects of the
|
|
45 |
JavaCard \textbf{source language}.
|
|
46 |
The basis is an abstract model of the JavaCard source language.
|
|
47 |
On it, a type system, an operational semantics and an axiomatic semantics
|
|
48 |
(Hoare logic) are built. The execution of a wellformed program (with respect to
|
|
49 |
the type system) according to the operational semantics is proved to be
|
|
50 |
typesafe. The axiomatic semantics is proved to be sound and relative complete
|
|
51 |
with respect to the operational semantics.
|
|
52 |
|
|
53 |
We have modelled large parts of the original JavaCard source language. It models
|
|
54 |
features such as:
|
|
55 |
\begin{itemize}
|
|
56 |
\item The basic ``primitive types'' of Java
|
|
57 |
\item Classes and related concepts
|
|
58 |
\item Class fields and methods
|
|
59 |
\item Instance fields and methods
|
|
60 |
\item Interfaces and related concepts
|
|
61 |
\item Arrays
|
|
62 |
\item Static initialisation
|
|
63 |
\item Static overloading of fields and methods
|
|
64 |
\item Inheritance, overriding and hiding of methods, dynamic binding
|
|
65 |
\item All cases of abrupt termination
|
|
66 |
\begin{itemize}
|
|
67 |
\item Exception throwing and handling
|
|
68 |
\item \texttt{break}, \texttt{continue} and \texttt{return}
|
|
69 |
\end{itemize}
|
|
70 |
\item Packages
|
|
71 |
\item Access Modifiers (\texttt{private}, \texttt{protected}, \texttt{public})
|
|
72 |
\end{itemize}
|
|
73 |
|
|
74 |
The following features are missing in Bali wrt.{} JavaCard:
|
|
75 |
\begin{itemize}
|
|
76 |
\item Some primitive types (\texttt{byte, short})
|
|
77 |
\item Most numeric operations, syntactic variants of statements
|
|
78 |
(\texttt{do}-loop, \texttt{for}-loop)
|
|
79 |
\item A ``definite assignment'' check
|
|
80 |
\end{itemize}
|
|
81 |
|
|
82 |
In addition, features are missing that are not part of the JavaCard
|
|
83 |
language, such as multithreading and garbage collection. No attempt
|
|
84 |
has been made to model peculiarities of JavaCard such as the applet
|
|
85 |
firewall or the transaction mechanism.
|
|
86 |
|
|
87 |
|
|
88 |
Overview of the theories:
|
|
89 |
\begin{description}
|
12856
|
90 |
\item[Basis]
|
12854
|
91 |
Some basic definitions and settings not specific to JavaCard but missing in HOL.
|
|
92 |
|
12856
|
93 |
\item[Table]
|
12854
|
94 |
Definition and some properties of a lookup table to map various names
|
|
95 |
(like class names or method names) to some content (like classes or methods).
|
|
96 |
|
12856
|
97 |
\item[Name]
|
12854
|
98 |
Definition of various names (class names, variable names, package names,...)
|
|
99 |
|
12856
|
100 |
\item[Value]
|
12854
|
101 |
JavaCard expression values (Boolean, Integer, Addresses,...)
|
|
102 |
|
12856
|
103 |
\item[Type]
|
12854
|
104 |
JavaCard types. Primitive types (Boolean, Integer,...) and reference types
|
|
105 |
(Classes, Interfaces, Arrays,...)
|
|
106 |
|
12856
|
107 |
\item[Term]
|
12854
|
108 |
JavaCard terms. Variables, expressions and statements.
|
|
109 |
|
12856
|
110 |
\item[Decl]
|
12854
|
111 |
Class, interface and program declarations. Recursion operators for the
|
|
112 |
class and the interface hierarchy.
|
|
113 |
|
12856
|
114 |
\item[TypeRel]
|
12854
|
115 |
Various relations on types like the subclass-, subinterface-, widening-,
|
|
116 |
narrowing- and casting-relation.
|
|
117 |
|
12856
|
118 |
\item[DeclConcepts]
|
12854
|
119 |
Advanced concepts on the class and interface hierarchy like inheritance,
|
|
120 |
overriding, hiding, accessibility of types and members according to the access
|
|
121 |
modifiers, method lookup.
|
|
122 |
|
12856
|
123 |
\item[WellType]
|
12854
|
124 |
Typesystem on the JavaCard term level.
|
|
125 |
|
12856
|
126 |
\item[WellForm]
|
12854
|
127 |
Typesystem on the JavaCard class, interface and program level.
|
|
128 |
|
12856
|
129 |
\item[State]
|
12854
|
130 |
The program state (like object store) for the execution of JavaCard.
|
|
131 |
Abrupt completion (exceptions, break, continue, return) is modelled as flag
|
|
132 |
inside the state.
|
|
133 |
|
12856
|
134 |
\item[Eval]
|
12854
|
135 |
Operational (big step) semantics for JavaCard.
|
|
136 |
|
12856
|
137 |
\item[Example]
|
12854
|
138 |
An concrete example of a JavaCard program to validate the typesystem and the
|
|
139 |
operational semantics.
|
|
140 |
|
12856
|
141 |
\item[Conform]
|
12854
|
142 |
Conformance predicate for states. When does an execution state conform to the
|
|
143 |
static types of the program given by the typesystem.
|
|
144 |
|
12856
|
145 |
\item[TypeSafe]
|
12854
|
146 |
Typesafety proof of the execution of JavaCard. ''Welltyped programs don't go
|
|
147 |
wrong'' or more technical: The execution of a welltyped JavaCard program
|
|
148 |
preserves the conformance of execution states.
|
|
149 |
|
12856
|
150 |
\item[Evaln]
|
|
151 |
Copy of the operational semantics given in theory Eval expanded with an annotation
|
12854
|
152 |
for the maximal recursive depth. The semantics is not altered. The annotation
|
|
153 |
is needed for the soundness proof of the axiomatic semantics.
|
|
154 |
|
12856
|
155 |
\item[AxSem]
|
12854
|
156 |
An axiomatic semantics (Hoare logic) for JavaCard.
|
|
157 |
|
12856
|
158 |
\item[AxSound]
|
12854
|
159 |
The soundness proof of the axiomatic semantics with respect to the operational
|
|
160 |
semantics.
|
|
161 |
|
12856
|
162 |
\item[AxCompl]
|
12854
|
163 |
The proof of (relative) completeness of the axiomatic semantics with respect
|
|
164 |
to the operational semantics.
|
|
165 |
|
12856
|
166 |
\item[AxExample]
|
12854
|
167 |
An concrete example of the axiomatic semantics at work, applied to prove
|
12856
|
168 |
some properties of the JavaCard example given in theory Example.
|
12854
|
169 |
\end{description}
|
|
170 |
|
12856
|
171 |
|
|
172 |
\chapter{Basis}
|
|
173 |
\input{Basis}
|
|
174 |
\chapter{Table}
|
|
175 |
\input{Table}
|
12854
|
176 |
|
12856
|
177 |
\chapter{Name}
|
|
178 |
\input{Name}
|
|
179 |
\chapter{Value}
|
|
180 |
\input{Value}
|
|
181 |
\chapter{Type}
|
|
182 |
\input{Type}
|
|
183 |
\chapter{Term}
|
|
184 |
\input{Term}
|
|
185 |
\chapter{Decl}
|
|
186 |
\input{Decl}
|
|
187 |
\chapter{TypeRel}
|
|
188 |
\input{TypeRel}
|
|
189 |
\chapter{DeclConcepts}
|
|
190 |
\input{DeclConcepts}
|
12854
|
191 |
|
12856
|
192 |
\chapter{WellType}
|
|
193 |
\input{WellType}
|
|
194 |
\chapter{WellForm}
|
|
195 |
\input{WellForm}
|
12854
|
196 |
|
12856
|
197 |
\chapter{State}
|
|
198 |
\input{State}
|
|
199 |
\chapter{Eval}
|
|
200 |
\input{Eval}
|
12854
|
201 |
|
12856
|
202 |
\chapter{Example}
|
|
203 |
\input{Example}
|
12854
|
204 |
|
12856
|
205 |
\chapter{Conform}
|
|
206 |
\input{Conform}
|
|
207 |
\chapter{TypeSafe}
|
|
208 |
\input{TypeSafe}
|
12854
|
209 |
|
12856
|
210 |
\chapter{Evaln}
|
|
211 |
\input{Evaln}
|
|
212 |
\chapter{AxSem}
|
|
213 |
\input{AxSem}
|
|
214 |
\chapter{AxSound}
|
|
215 |
\input{AxSound}
|
|
216 |
\chapter{AxCompl}
|
|
217 |
\input{AxCompl}
|
|
218 |
\chapter{AxExample}
|
|
219 |
\input{AxExample}
|
12854
|
220 |
|
|
221 |
%\bibliographystyle{abbrv}
|
|
222 |
%\bibliography{root}
|
|
223 |
|
|
224 |
\end{document}
|