11\chapter {Evaluation }
22\label {cha:evaluation }
33In this chapter we present three type system specifications, discuss
4- how the specification language effected the formulation of typing
4+ how the specification language affected the formulation of typing
55rules, and which optimization strategies are successful.
66\section {SytemF }
77\label {sec:sytemf }
@@ -10,7 +10,7 @@ \section{SytemF}
1010~\cite {Pierce:2002:TPL:509043 }. The complete implementation can be
1111found in Appendix~\ref {appendix:systemf }. There are three notable
1212differences between the version in~\cite {Pierce:2002:TPL:509043 } and
13- our implementation, that we describe in the following.
13+ our implementation, which we will describe in the following.
1414
1515In~\cite {Pierce:2002:TPL:509043 } term and type variable bindings are
1616collected in a single context. We need two separate contexts, one for
@@ -24,13 +24,13 @@ \section{SytemF}
2424\end {lstlisting }
2525
2626Context \code |TermBinding| is the term variable binding and associates
27- identifier with types. \code |TypeBinding| binds type variables,
28- because we have no notion of kinds in SystemF type variables are
29- associated to nothing . In our implementation variable and type
30- identifiers are build from the same set of identifiers.
27+ identifier with types. \code |TypeBinding| binds type variables. Type
28+ variables are associated to nothing because we have no notion of kinds
29+ in SystemF . In our implementation variable and type identifiers are
30+ build from the same set of identifiers.
3131
3232The typing judgment has to reflect that we have two
33- contexts. Therefore our typing judgment is defined as follows.
33+ contexts. Therefore our typing judgment is defined as follows:
3434
3535\ begin{lstlisting} [language=sltc]
3636judgments
@@ -79,7 +79,7 @@ \section{SytemF}
7979mechanism. However type substitution is implemented in the same
8080fashion like in a functional programming language with pattern
8181matching. Substitution is also implemented as a separate module and
82- imported into the SystemF specification.
82+ then imported into the SystemF specification.
8383
8484\ begin{lstlisting} [language=sltc]
8585judgments
@@ -128,11 +128,13 @@ \section{Lambda-Calculus with Subtyping}
128128in~\cite {Pierce:2002:TPL:509043 }. The specification for this type
129129system is divided into two modules. One module specifies the type
130130system without subtyping and the other module extends the first module
131- with subtyping. The implementation of the type system without differs
132- in two aspects from the text book formalization. First, we have to
133- implement the freshness condition explicitly, as in the previous
134- section. Second, we have to model rules that talk about all elements
135- of a record inductively. Formula~\ref {formula:record-typing } shows the
131+ with subtyping. The implementation of the type system without
132+ subtyping differs in two aspects from the text book
133+ formalization. First, we have to implement the freshness condition
134+ explicitly, as in the previous section. Second, we have to model rules
135+ that talk about all elements of a record inductively.
136+
137+ Formula~\ref {formula:record-typing } shows the
136138formalization of the record typing rule
137139from~\cite {Pierce:2002:TPL:509043 }. This rule says that a record is
138140well-typed if all its elements are
@@ -147,7 +149,7 @@ \section{Lambda-Calculus with Subtyping}
147149\label {formula:record-typing }
148150\end {align }
149151
150- That quantification is not possible in our specification
152+ This quantification is not possible in our specification
151153language. Therefore we model this condition inductively as shown in
152154the following.
153155
@@ -169,10 +171,10 @@ \section{Lambda-Calculus with Subtyping}
169171Here we ensure with rule \code |step| that the first element is
170172well-typed and the record without the first element is well
171173typed. Rule \code |base| is the base case for this definition and
172- assigns the empty record the empty type. Note that we support in
173- contrast to~\cite {Pierce:2002:TPL:509043 } the empty record. We
174+ assigns the empty record the empty record type. Note that we support
175+ in contrast to~\cite {Pierce:2002:TPL:509043 } the empty record. We
174176included the empty record in our definition to demonstrate a top rule
175- for records in the subtyping module. We have implement the membership
177+ for records in the subtyping module. We have implemented the membership
176178test for the projection typing rule \code |T-proj| in a similar way.
177179
178180The module implementing subtyping for this lambda calculus contains a
@@ -224,10 +226,10 @@ \section{Lambda-Calculus with Subtyping}
224226\end {lstlisting }
225227\end {minipage }
226228
227- The subtyping relations has further a rule that defines the empty
229+ The subtyping relations have a further rule that defines the empty
228230record \code |{}| to be the top element of records, as well as rules
229231for with and depth subtyping and permutation of record elements. In
230- conclusion we could specify a variant of the simply typed lambda
232+ conclusion we can specify a variant of the simply typed lambda
231233calculus with an intuitive subtyping relation and reduce the
232234non-determinism in the type system.
233235
0 commit comments