Stephanie Weirich's Publications
Copyright Information
|
Works in Progress
|
[1]
|
Brian E. Aydemir, Aaron Bohannon, Matthew Fairbairn, J. Nathan Foster,
Benjamin C. Pierce, Peter Sewell, Dimitrios Vytiniotis, Geoffrey Washburn,
Stephanie Weirich, and Steve Zdancewic.
Mechanized metatheory for the masses: The POPLmark challenge.
Submitted for publication, February 2005.
PDF
PS
How close are we to a world where every paper on
programming languages is accompanied by an electronic appendix with
machine-checked proofs?
We propose a concrete set of benchmarks for measuring progress in this
area. Based on the metatheory of System , a typed
lambda-calculus with second-order polymorphism, subtyping, and
records, these benchmarks embody many aspects of programming languages
that are challenging to formalize: variable binding at both the term
and type levels, syntactic forms with variable numbers of components
(including binders), and proofs demanding complex induction
principles. We hope that these benchmarks will help clarify the
current state of the art, provide a basis for comparing competing
technologies, and motivate further research.
|
|
[2]
|
Geoffrey Washburn and Stephanie Weirich.
Generalizing parametricity using information flow.
January 2005.
PDF
PS
Run-time type analysis allows programmers to easily and
concisely define many operations based upon type structure, such as
serialization, iterators, and structural equality. However, when
types can be inspected at run time, nothing is secret. A module
writer cannot use type abstraction to hide implementation details from
clients: those clients can use type analysis to determine the
structure of these supposedly ``abstract'' data types. Furthermore,
access control mechanisms do not help in isolating the implementation
of abstract datatypes from their clients. Buggy or malicious
authorized modules may simply leak type information to unauthorized
clients, so module implementors cannot reliably tell which parts of a
program rely on their type definitions and which parts do not.
Currently, module implementors rely on parametric polymorphism to
provide guarantees about the use of their abstract datatypes.
Standard type parametricity does not hold for a language with run-time
type analysis, but in this paper we show how to generalize the
statement of parametricity so that it does hold in the presence of
type analysis and still encompasses the integrity and confidentiality
policies that are normally derived from parametricity. The key is to
augment the type system with annotations about information flow.
Because the type system tracks the flow of dynamic type information,
the implementor of an abstract data type can easily see what parts of
the program depend on the implementation of a given type.
|
|
[3]
|
Dan S. Dantas, David Walker, Geoffrey Washburn, and Stephanie Weirich.
Analyzing polymorphic advice.
25 pages., October 2004.
PDF
PS
|
|
[4]
|
Geoffrey Washburn and Stephanie Weirich.
Boxes go bananas: Encoding higher-order abstract syntax with
parametric polymorphism.
64 pages. Submitted for publication to Journal of Functional
Programming, October 2004.
|
|
[5]
|
Simon Peyton Jones, Geoffrey Washburn, and Stephanie Weirich.
Wobbly types: Practical type inference for generalised algebraic
dataypes.
15 pages, July 2004.
PDF
PS
|
|
[6]
|
Stephanie Weirich.
Higher-order intensional type analysis in type erasure semantics.
29 pages. Accepted to Journal of Functional Programming,
pending revision, 2004.
|
|
Conferences and Workshops
|
[1]
|
Dimtrios Vytiniotis, Geoffrey Washburn, and Stephanie Weirich.
An open and shut typecase.
In ACM SIGPLAN Workshop on Types in Language Design and
Implementation (TLDI), Long Beach, CA, USA, January 2005.
15 pages. An extended version of this paper (50 pages) is University
of Pennsylvania Technical Computer and Information Science Report
MS-CIS-04-26.
PS
Two different ways of defining ad-hoc polymorphic operations commonly
occur in programming languages. With the first form polymorphic
operations are defined inductively on the structure of types while
with the second form polymorphic operations are defined for specific
sets of types.
In intensional type analysis operations are defined by induction on
the structure of types. Therefore no new cases are necessary for
user-defined types, because these types are equivalent to their
underlying structure. However, intensional type analysis is
``closed'' to extension, as the behavior of the operations cannot be
differentiated for the new types, thus destroying the distinctions
that these types are designed to express.
Haskell type classes on the other hand define polymorphic operations
for sets of types. Operations defined by class instances are
considered ``open''-the programmer can add instances for new types
without modifying existing code. Howe ver, the operations must be
extended with specialized code for each new type, and it may be
tedious or even impossible to add extensions that apply to a large
universe of new types.
Both approaches have their benefits, so it is important to let
programmers decide which is most appropriate for their needs. In this
paper, we define a language that supports both forms of ad-hoc
polymorphism, using the same basic constructs.
|
|
[2]
|
Stephanie Weirich and Liang Huang.
A design for type-directed Java.
In Viviana Bono, editor, Workshop on Object-Oriented
Developments, ENTCS, 2004.
20 pages. An extended version (49 pages) of this paper is University
of Pennsylvania Computer and Information Science Technical Report
MS-CIS-04-11.
PDF
PS
Type-directed programming is an important and widely used
paradigm in the design of software. With this form of programming,
an application may analyze type information to determine its
behavior. By analyzing the structure of data, many operations, such
as serialization, cloning, adaptors and iterators may be defined
once, for all types of data. That way, as the program evolves, these
operations need not be updated-they will automatically adapt to
new data forms. Otherwise, each of these operations must be
individually redefined for each type of data, forcing programmers to
revisit the same program logic many times during a program's
lifetime.
The Java language supports type directed programming with the
instanceof operator and the Java Reflection API. These
mechanisms allow Java programs to depend on the name and structure
of the run-time classes of objects. However, the Java mechanisms
for type-directed programming are difficult to use. They also do not
integrate well with generics, an important new feature of the Java
language.
In this paper, we describe the design of several expressive new
mechanisms for type-directed programming in Java, and show that
these mechanisms are sound when included in a language similar to
Featherweight Java. Basically, these new mechanisms pattern-match
the name and structure of the type parameters of generic code,
instead of the run-time classes of objects. Therefore, they
naturally integrate with generics and provide strong guarantees
about program correctness. As these mechanisms are based on pattern
matching, they naturally and succinctly express many operations that
depend on type information. Finally, they provide programmers with
some degree of protection for their abstractions. Whereas
instanceof and reflection can determine the exact run-time type
of an object, our mechanisms allow any supertype to be supplied for
analysis, hiding its precise structure.
|
|
[3]
|
Geoffrey Washburn and Stephanie Weirich.
Boxes go bananas: Encoding higher-order abstract syntax with
parametric polymorphism.
In ACM SIGPLAN International Conference on Functional
Programming (ICFP), pages 249-262, Uppsala, Sweden, August 2003.
PDF
PS
Higher-order abstract syntax is a simple technique for
implementing languages with functional programming. Object variables
and binders are implemented by variables and binders in the host
language. By using this technique, one can avoid implementing common
and tricky routines dealing with variables, such as capture-avoiding
substitution. However, despite the advantages this technique
provides, it is not commonly used because it is difficult to write
sound elimination forms (such as folds or catamorphisms) for
higher-order abstract syntax. To fold over such a datatype, one must
either simultaneously define an inverse operation (which may not
exist) or show that all functions embedded in the datatype are
parametric.
In this paper, we show how first-class polymorphism can be used to
guarantee the parametricity of functions embedded in higher-order
abstract syntax. With this restriction, we implement a library of
iteration operators over data-structures containing functionals. From
this implementation, we derive ``fusion laws'' that functional
programmers may use to reason about the iteration operator. Finally,
we show how this use of parametric polymorphism corresponds to the
Schürmann, Despeyroux and Pfenning method of enforcing
parametricity through modal types. We do so by using this library to
give a sound and complete encoding of their calculus into System .
This encoding can serve as a starting point for reasoning about
higher-order structures in polymorphic languages.
|
|
[4]
|
Stephanie Weirich.
Higher-order intensional type analysis.
In Daniel Le Métayer, editor, 11th European Symposium on
Programming (ESOP), pages 98-114, Grenoble, France, April 2002.
PDF
PS
Intensional type analysis provides the ability to
analyze abstracted types at run time. In this paper, we extend
that ability to higher-order and kind-polymorphic type
constructors. The resulting language is elegant and expressive:
we show through examples how it extends the repertoire of
polytypic functions that may be defined.
|
|
[5]
|
Stephanie Weirich.
Encoding intensional type analysis.
In D. Sands, editor, 10th European Symposium on Programming
(ESOP), pages 92-106, Genova, Italy, April 2001.
PDF
PS
http
Languages for intensional type analysis permit ad-hoc
polymorphism, or run-time analysis of types. However, such
languages require complex, specialized constructs to support this
operation, which hinder optimization and complicate the
meta-theory of these languages. In this paper, we observe that
such specialized operators need not be intrinsic to the language,
and in fact, their operation may be simulated through standard
encodings of iteration in the polymorphic lambda
calculus. Therefore, we may more easily add intensional analysis
operators to complicated languages via a translation semantics,
instead of through language extension.
|
|
[6]
|
Stephanie Weirich.
Type-safe cast: Functional pearl.
In Proceedings of the Fifth ACM SIGPLAN International
Conference on Functional Programming (ICFP), pages 58-67, Montreal, Canada,
September 2000.
PDF
PS
In a language with non-parametric or ad-hoc
polymorphism, it is possible to determine the identity of a type
variable at run time. With this facility, we can write a function
to convert a term from one abstract type to another, if the two
hidden types are identical. However, the naive implementation of
this function requires that the term be destructed and rebuilt. In
this paper, we show how to eliminate this overhead using
higher-order type abstraction. We demonstrate this solution in two
frameworks for ad-hoc polymorphism: intensional type analysis and
type classes.
|
|
[7]
|
Karl Crary and Stephanie Weirich.
Resource bound certification.
In Twenty-Seventh ACMSIGPLAN-SIGACT Symposium on
Principles of Programming Languages (POPL), pages 184-198, Boston, MA, USA,
January 2000.
PDF
PS
Various code certification systems allow the
certification and static verification of a variety of important
safety properties such as memory safety and control-flow
safety. These systems provide valuable tools for verifying that
untrusted and potentially malicious code is safe before execution.
However, one important safety property that is not usually
included is that programs adhere to specific bounds on resource
consumption, such as running time.
We present a decidable type system capable of specifying and
certifying bounds on resource consumption. Our system makes two
advances over previous resource bound certification systems, both
of which are necessary for a practical system: we allow the
execution time of programs and their subroutines to vary,
depending on their arguments, and we provide a fully automatic
compiler generating certified executables from source-level
programs. The principal device in our approach is a strategy for
simulating dependent types using sum and inductive kinds.
|
|
[8]
|
Karl Crary and Stephanie Weirich.
Flexible type analysis.
In Proceedings of the Fourth ACM SIGPLAN International
Conference on Functional Programming (ICFP), pages 233-248, Paris, France,
September 1999.
PDF
PS
Run-time type dispatch enables a variety of advanced
optimization techniques for polymorphic languages, including
tag-free garbage collection, unboxed function arguments, and
flattened data structures. However, modern type-preserving
compilers transform types between stages of compilation, making
type dispatch prohibitively complex at low levels of typed
compilation. It is crucial therefore for type analysis at these
low levels to refer to the types of previous
stages. Unfortunately, no current intermediate language supports
this facility.
To fill this gap, we present the language LX, which provides a
rich language of type constructors supporting type analysis
(possibly of previous-stage types) as a programming idiom. This
language is quite flexible, supporting a variety of other
applications such as analysis of quantified types, analysis with
incomplete type information, and type classes. We also show that
LX is compatible with a type-erasure semantics.
|
|
[9]
|
Greg Morrisett, Karl Crary, Neal Glew, Dan Grossman, Richard Samuels, Frederick
Smith, David Walker, Stephanie Weirich, and Steve Zdancewic.
TALx86: A realistic typed assembly language.
In Second ACMSIGPLAN Workshop on Compiler Support for System
Software, pages 25-35, Atlanta, GA, USA, May 1999.
Published as INRIA research report number 0228, March 1999.
PS
The goal of typed assembly language (TAL) is to provide
a low-level, statically typed target language that is better
suited than Java bytecodes for supporting a wide variety of
source languages and a number of important optimizations. In
previous work, we formalized idealized versions of TAL and proved
important safety properties about them. In this paper, we present
our progress in defining and implementing a realistic typed
assembly language called TALx86. The TALx86 instructions comprise
a relatively complete fragment of the Intel IA32 (32-bit 80x86
flat model) assembly language and are thus executable on
processors such as the Intel Pentium. The type system for the
language incorporates a number of advanced features necessary for
safely compiling large programs to good code.
To motivate the design of the type system, we demonstrate how
various high-level language features are compiled to TALx86. For
this purpose, we present a type-safe C-like language called
Popcorn.
|
|
[10]
|
Karl Crary, Stephanie Weirich, and Greg Morrisett.
Intensional polymorphism in type erasure semantics.
In Proceedings of the Third ACM SIGPLAN International
Conference on Functional Programming (ICFP), pages 301-313, Baltimore, MD,
USA, September 1998.
PDF
PS
Intensional polymorphism, the ability to dispatch to
different routines based on types at run time, enables a variety of
advanced implementation techniques for polymorphic languages,
including tag-free garbage collection, unboxed function arguments,
polymorphic marshalling, and flattened data structures. To date,
languages that support intensional polymorphism have required a
type-passing (as opposed to type-erasure) interpretation where types
are constructed and passed to polymorphic functions at run
time. Unfortunately, type-passing suffers from a number of
drawbacks; it requires duplication of constructs at the term and
type levels, it prevents abstraction, and it severely complicates
polymorphic closure conversion. We present a type-theoretic
framework that supports intensional polymorphism, but avoids many of
the disadvantages of type passing. In our approach, run-time type
information is represented by ordinary terms. This avoids the
duplication problem, allows us to recover abstraction, and avoids
complications with closure conversion. In addition, our type system
provides another improvement in expressiveness; it allows unknown
types to be refined in place thereby avoiding certain
beta-expansions required by other frameworks.
|
|
[11]
|
Cormac Flanagan, Matthew Flatt, Shriram Krishnamurthi, Stephanie Weirich, and
Matthias Felleisen.
Catching bugs in the web of program invariants.
In Proceedings of the ACM SIGPLAN Conference on Programming
Language Design and Implementation (PLDI), pages 23-32, 1996.
PS
MrSpidey is a user-friendly, interactive static
debugger for Scheme. A static debugger supplements the standard
debugger by analyzing the program and pinpointing those program
operations tha may cause run-time errors suce as dereferencing
the null pointer or applying non-functions. The program analysis
of MrSpidey computes value set descriptions for each term in the
program and constructs a value flow graph connecting the set
descriptions. Using the set descriptions, MrSpidey can identify
and highlight potentially erroneous program operations, whose
cause the programmer can the explore by selectively exposing
portions of the value flow graph.
|
|
Journal Articles
|
[1]
|
Stephanie Weirich.
Type-safe cast.
Journal of Functional Programming, 14(6):681-695, November
2004.
PDF
Comparing two types for equality is an essential ingredient for an
implementation of dynamic types. Once equality has been established,
it is safe to cast a value from one type to another. In a language
with run-time type analysis, implementing such a procedure is fairly
straightforward. Unfortunately, this naive implementation destructs
and rebuilds the argument while iterating over its type structure.
However, by using higher-order polymorphism, a casting function can
treat its argument parametrically. We demonstrate this solution in
two frameworks for ad-hoc polymorphism: intensional type analysis
and Haskell type classes.
|
|
[2]
|
Karl Crary, Stephanie Weirich, and Greg Morrisett.
Intensional polymorphism in type erasure semantics.
Journal of Functional Programming, 12(6):567-600, November
2002.
PDF
Intensional polymorphism, the ability to dispatch to
different routines based on types at run time, enables a variety
of advanced implementation techniques for polymorphic languages,
including tag-free garbage collection, unboxed function
arguments, polymorphic marshalling, and flattened data
structures. To date, languages that support intensional
polymorphism have required a type-passing (as opposed to
type-erasure) interpretation where types are constructed and
passed to polymorphic functions at run time. Unfortunately,
type-passing suffers from a number of drawbacks; it requires
duplication of constructs at the term and type levels, it
prevents abstraction, and it severely complicates polymorphic
closure conversion. We present a type-theoretic framework that
supports intensional polymorphism, but avoids many of the
disadvantages of type passing. In our approach, run-time type
information is represented by ordinary terms. This avoids the
duplication problem, allows us to recover abstraction, and avoids
complications with closure conversion. In addition, our type
system provides another improvement in expressiveness; it allows
unknown types to be refined in place thereby avoiding certain
beta-expansions required by other frameworks.
|
|
[3]
|
Michael Hicks, Stephanie Weirich, and Karl Crary.
Safe and flexible dynamic linking of native code.
In R. Harper, editor, Types in Compilation: Third International
Workshop, TIC 2000; Montreal, Canada, September 21, 2000; Revised Selected
Papers, volume 2071 of Lecture Notes in Computer Science, pages
147-176. Springer, 2001.
Related technical report: Michael Hicks and Stephanie Weirich. A
calculus for dynamic loading. University of Pennsylvania Computer and
Information Science Technical Report, MS-CIS-00-07, April 2000.
PDF
PS
http
We present the design and implementation of the first
complete framework for flexible and safe dynamic linking of
native code. Our approach extends Typed Assembly Language with a
primitive for loading and typechecking code, which is flexible
enough to support a variety of linking strategies, but simple
enough that it does not significantly expand the trusted
computing base. Using this primitive, along with the ability to
compute with types, we show that we can program many existing
dynamic linking approaches. As a concrete demonstration, we have
used our framework to implement dynamic linking for a type-safe
dialect of C, closely modeled after the standard linking facility
for Unix C programs. Aside from the unavoidable cost of
verification, our implementation performs comparably with the
standard, untyped approach.
|
|
Thesis
|
[1]
|
Stephanie Weirich.
Programming With Types.
PhD thesis, Cornell University, August 2002.
238 pages.
PDF
PS
Run-time type analysis is an increasingly important linguistic
mechanism in modern programming languages. Language runtime
systems use it to implement services such as accurate garbage
collection, serialization, cloning and structural
equality. Component frameworks rely on it to provide reflection
mechanisms so they may discover and interact with program
interfaces dynamically. Run-time type analysis is also crucial
for large, distributed systems that must be dynamically extended,
because it allows those systems to check program invariants when
new code and new forms of data are added. Finally, many generic
user-level algorithms for iteration, pattern matching, and
unification can be defined through type analysis mechanisms.
However, existing frameworks for run-time type analysis were
designed for simple type systems. They do not scale well to the
sophisticated type systems of modern and next-generation
programming languages that include complex constructs such as
first-class abstract types, recursive types, objects, and type
parameterization. In addition, facilities to support type
analysis often require complicated language semantics that allow
little freedom in their implementation. This dissertation
investigates the foundations of run-time type analysis in the
context of statically-typed, polymorphic programming languages.
Its goal is to show how such a language may support
type-analyzing operations in a way that balances expressiveness,
safety and simplicity.
|
|
Technical Reports
|
[1]
|
Dan S. Dantas, David Walker, Geoffrey Washburn, and Stephanie Weirich.
Analyzing polymorphic advice.
Technical Report TR-717-04, Princeton University Computer Science,
December 2004.
24 pages.
PDF
We take one of the first steps towards developing a
practical, statically-typed, functional, aspect-oriented
programming language by showing how to integrate polymorphism and
type analysis with aspect-oriented programming features. In
particular, we demonstrate how to define type-safe polymorphic
advice using pointcuts that unify a collection of polymorphic join
points. We also introduce a new mechanism for specifying
context-sensitive advice that involves pattern matching against the
current stack of activation records, and meshes well with
functional programming idioms. We give our language meaning via a
type-directed translation into an expressive, but fairly simple,
type-safe intermediate language. Many complexities of the source
language are eliminated in this translation, leading to a modular
specification of its semantics. One of the novelties of the
intermediate language is the definition of polymorphic labels for
marking control-flow points. These labels are organized in a tree
structure such that a parent in the tree serves as a representative
for the collection of all its children. Type safety requires that
the type of each child is a generic instance of the type of the
polymorphic parent. Similarly, when a set of labels is assembled
as a pointcut, the type of each label is an instance of the type of
the pointcut.
|
|
[2]
|
Liang Huang and Stephanie Weirich.
A design for type-directed programming in Java (extended version).
Technical Report MS-CIS-04-11, University of Pennsylvania, Computer
and Information Science, October 2004.
PDF
PS
|
|
[3]
|
Dimtrios Vytiniotis, Geoffrey Washburn, and Stephanie Weirich.
An open and shut typecase (extended version).
Technical Report MS-CIS-04-26, University of Pennsylvania, Computer
and Information Science, October 2004.
PS
|
|
[4]
|
Geoffrey Washburn and Stephanie Weirich.
Boxes go bananas: Encoding higher-order abstract syntax with
parametric polymorphism (extended version).
Technical Report MS-CIS-03-26, University of Pennsylvania, Computer
and Information Science, September 2003.
PDF
PS
|
|
[5]
|
Michael Hicks and Stephanie Weirich.
A calculus for dynamic loading.
Technical Report MS-CIS-00-07, University of Pennsylvania, April
2000.
PDF
|
|
[6]
|
Karl Crary, Stephanie Weirich, and Greg Morrisett.
Intensional polymorphism in type erasure semantics (extended
version).
Technical Report TR98-1721, Cornell University, Computer Science,
November 1998.
PS
|
|
Copyright Information
The documents contained in these directories are included by the
contributing authors as a means to ensure timely dissemination of
scholarly and technical work on a non-commercial basis. Copyright and
all rights therein are maintained by the authors or by other copyright
holders, notwithstanding that they have offered their works here
electronically. It is understood that all persons copying this
information will adhere to the terms and constraints invoked by each
author's copyright. These works may not be reposted without the
explicit permission of the copyright holder.
|
|
Parts of this page were generated by
bibtex2html
|
Last modified:
Wed Mar 2 13:07:30 EST 2005
| |