William J. Bowman  Home
William J. Bowman is an Assistant Professor of computer science in the Software Practices Lab at University of British Columbia. Broadly speaking, he is interested in making it easier for programmers to communicate their intent to machines, and preserving that intent through compilation. More specifically, his research interests include secure and verified compilation, dependently typed programming, verification, metaprogramming, and interoperability. His recent work examines typepreserving compilation of dependently typed programming language like Coq, a technique that can enable preserving security and correctness invariants of verified software through compilation and statically enforcing those invariants in the lowlevel (assemblylike) code generated by compilers.
Coordinates

In Cyberspace: wjb

In Space:
ICICS/CS Building Room 389
201 Main Mall
Vancouver, BC V6T 1Z4 Canada

In Time:
Group
Current Members

Paulette Koronkevich – MSc (toward PhD)
Dependenttypepreserving compilation.

Adam Geller – PhD.
Indextyped Web Assembly for safety and performance.

Jonathan Chan – MSc.
Sized dependent types.

Lily Bryant – MSc (toward PhD)
Compilation as Multilanguage Semantics.

Junfeng Xu – MSc.
Formal semantics of PL metanotation.
Former Members

Justin Frank – PostBSc.
Now at Ph.D. student at University of Maryland.
Indextyped Web Assembly for safety and performance.

Ramon Rakow – BSc.
Now a Firmware Engineer at Intel.
Dependenttypepreserving compilation for ANF.

"Michael" Yufeng Li – BSc.
Sized types for Coq.
Manuscripts
Practical Sized Types for Coq.
Jonathan Chan and William J. Bowman
2019.
Termination of recursive functions and productivity of corecursive functions are important for maintaining logical consistency in proof assistants. However, contemporary proof assistants, such as Coq, rely on syntactic criteria that prevent users from easily writing obviously terminating or productive programs, such as quicksort. This is troublesome, since there exist theories for typebased termination and productivitychecking.
In this paper, we present a design and implementation of sized type checking and inference for Coq. We extend past work on sized types for the Calculus of (Co)\Inductive Constructions (CIC) with support for global definitions found in Gallina, and extend the sizedtype inference algorithm to support completely unannotated Gallina terms. This allows our design to maintain complete backwards compatibility with existing Coq developments. We provide an implementation that extends the Coq kernel with optional support for sized types.Abstract 
arXiv 
Artifact 
GitHub
Compiling Dependent Types Without Continuations.
William J. Bowman and Amal Ahmed
2019.
Programmers rely on dependently typed languages, such as Coq, to machineverify
highassurance software, but get no guarantees after compiling or when linking
after compilation.
We could provide guarantees after compiling and linking by building
typepreserving compilers, which preserve specifications encoded
in types and use type checking to verify code after compilation and to ensure
safety when linking with unverified code.
Unfortunately, standard typepreserving translations do not scale to dependently
typed languages for two key reasons: assumptions valid in simpler type systems
no longer hold, and checking dependent types relies strongly on the syntax
of programs, which compilers change.
We extend the Anormal form (ANF) translation—
Conference Publications
Dependent Type Systems as Macros.
Stephen Chang, Michael Ballantyne, Milo Turner, William J. Bowman
In Proc. of the Symposium on Principles of Programming
Languages (POPL 2020).
We present Turnstile+, a highlevel, macrosbased metaDSL for building
dependently typed languages.
With it, programmers may rapidly prototype and iterate on the design of new
dependently typed features and extensions.
Or they may create entirely new DSLs whose dependent type “power” is tailored
to a specific domain.
Our framework’s support of languageoriented programming also makes it suitable
for experimenting with systems of interacting components, e.g., a proof
assistant and its companion DSLs.
This paper explains the implementation details of Turnstile+, as well as how it
may be used to create a widevariety of dependently typed languages, from a
lightweight one with indexed types, to a full spectrum proof assistant, complete
with a tactic system and extensions for features like sized types and SMT
interaction.Abstract 
Paper 
Artifact 
GitHub (Turnstile+) 
GitHub (Cur)
Typed Closure Conversion of the Calculus of Constructions.
William J. Bowman and Amal Ahmed
In Proc. of the Conference on Programming Language Implementation and
Design (PLDI 2018).
Dependently typed languages such as Coq are used to specify and verify the full functional
correctness of source programs.
Typepreserving compilation can be used to preserve these specifications and proofs of correctness
through compilation into the generated targetlanguage programs.
Unfortunately, typepreserving compilation of dependent types is hard.
In essence, the problem is that dependent type systems are designed around highlevel compositional abstractions
to decide type checking, but compilation interferes with the typesystem rules for reasoning about
runtime terms.
We develop a typepreserving closureconversion translation from the Calculus of Constructions
(CC) with strong dependent pairs (Σ types)—
TypePreserving CPS Translation of Σ and Π Types is Not Not Possible.
William J. Bowman, Youyou Cong, Nick Rioux, and Amal Ahmed
In Proc. of the Symposium on Principles of Programming Languages (POPL 2018)
Dependently typed languages such as Coq are used to specify and prove functional correctness of source
programs, but what we ultimately need are guarantees about correctness of compiled code.
By preserving dependent types through each compiler pass, we could preserve sourcelevel
specifications and correctness proofs into the generated targetlanguage programs.
Unfortunately, typepreserving compilation of dependent types is a challenging problem.
In 2002, Barthe and Uustalu showed that typepreserving CPS is \emph{not possible} for languages such as
Coq.
Specifically, they showed that for strong dependent pairs ($\Sigma$ types), the standard typed
callbyname CPS is \emph{not type preserving}.
They further proved that for dependent case analysis on sums, a class of typed CPS
translations—
In this paper, we prove that typepreserving CPS translation for dependently typed languages is
\emph{not} not possible.
We develop both callbyname and callbyvalue CPS translations from the Calculus of Constructions
with both $\Pi$ and $\Sigma$ types (CC) to a dependently typed target language, and prove type
preservation and compiler correctness of each translation.
Our target language is CC extended with an additional equivalence rule and an additional typing rule,
which we prove consistent by giving a model in the extensional Calculus of Constructions.
Our key observation is that we can use a CPS translation that employs \emph{answertype polymorphism},
where CPStranslated computations have type $\forall \alpha. (A \rightarrow \alpha) \rightarrow
\alpha$.
This type justifies, by a \emph{free theorem}, the new equality rule in our target language and allows
us to recover the term/type equivalences that CPS translation disrupts.
Finally, we conjecture that our translation extends to dependent case analysis on sums, despite the
impossibility result, and provide a proof sketch.
Fully Abstract Compilation via Universal Embedding.
Max New, William J. Bowman, and Amal Ahmed.
In Proc. of the International Conference on Functional
Programming (ICFP 2016)
A fully abstract compiler guarantees that two source components
are observationally equivalent in the source language if and only if
their translations are observationally equivalent in the target.
Full abstraction implies the translation is secure: targetlanguage
attackers can make no more observations of a compiled component than a
sourcelanguage attacker interacting with the original source
component.
Proving full abstraction for realistic compilers is challenging because
realistic target languages contain features (such as control effects)
unavailable in the source, while proofs of full abstraction require showing
that every target context to which a compiled component may be linked can be
backtranslated to a behaviorally equivalent source context.
We prove the first full abstraction result for a translation whose target
language contains exceptions, but the source does not.
Our translation—
Noninterference for Free.
William J. Bowman, and Amal Ahmed.
In Proc. of the International Conference on Functional
Programming (ICFP 2015)
Abadi et. al. (1999) introduced the dependency core calculus
(DCC) as a framework for studying a variety of dependency analyses
(e.g., secure information flow). The key property provided by DCC is
noninterference, which guarantees that a lowlevel observer
(attacker) cannot distinguish highlevel (protected) computations.
The proof of noninterference for DCC suggests a connection to
parametricity in System F, which suggests that it should be possible
to implement dependency analyses in languages with parametric
polymorphism.
In this paper, we present a translation from DCC into Fω and
prove that the translation preserves noninterference. To express
noninterference in Fω we define a notion of observersensitive
equivalence that makes essential use of both firstorder and
higherorder polymorphism. Our translation provides insights into
DCC’s type system and shows how DCC can be implemented in a
polymorphic language without loss of the security/noninterference
guarantees available in DCC. Our contributions include proof
techniques that should be valuable when proving other secure
compilation or full abstraction results.Abstract 
Paper 
Technical Appendix 
ICFP 2015 Talk (by me) 
Slides 
AuthorIzer
ProfileGuided MetaProgramming.
William J. Bowman, Swaha Miller, Vincent StAmour, and R. Kent Dybvig.
In Proc. of the Conference on Programming Language Implementation and
Design (PLDI 2015).
Contemporary compiler systems such as GCC, .NET, and LLVM incorporate
profileguided optimizations (PGOs) on lowlevel intermediate code and
basic blocks, with impressive results over purely static heuristics.
Recent work shows that profile information is also useful for performing
sourcetosource optimizations via metaprogramming.
For example, using profiling information to inform decisions about data
structures and algorithms can potentially lead to asymptotic
improvements in performance.
We present a design for profileguided metaprogramming in a
generalpurpose metaprogramming system.
Our design is parametric over the particular profiler and
metaprogramming system.
We implement this design in two different metaprogramming systems—
Workshop Publications
Compilation as MultiLanguage Semantics
William J. Bowman.
Talk at the Workshop on Principles of Secure Compilation (PriSC 2021).
Modeling interoperability between programs in different languages is a key
problem when modeling compositional and secure compilation, which has been
successfully addressed using multilanguage semantics.
Unfortunately, existing models of compilation using multilanguage semantics
define two variants of each compiler pass: a syntactic translation
on open terms, and a runtime translation of closed terms at multilanguage
boundaries
We introduce a novel workinprogress approach to uniformly model a compiler
entirely as a reduction system on open term in a multilanguage semantics,
rather than as a syntactic translation.
This simultaneously defines the compiler and the interoperability semantics,
reducing duplication.
It also provides interesting semantic insights.
Normalization of the crosslanguage redexes performs aheadoftime (AOT)
compilation.
Evaluation in the multilanguage models justintime (JIT) compilation.
Confluence of multilanguage reduction implies compiler correctness.
Subject reduction of the multilanguage reduction implies typepreservation of
the compiler.
This model provides a strong attacker model through contextual equivalence,
retaining its usefulness for modeling secure compilation as full abstraction.Abstract 
PriSC 2021 Talk 
Extended Abstract
Dependently Typed Assembly and Secure Linking (short talk)
William J. Bowman.
Talk at the Workshop on Principles of Secure Compilation (PriSC 2018).
Typepreserving compilation is used to statically enforce safety and security properties through
type checking.
The idea is to design strongly typed compiler target languages, preserve type information through the
compiler, then use the types in the target language to enforce invariants when linking with untrusted
code.
Unfortunately, this technique is limited by the expressiveness of the target type system, and existing
simple and polymorphic typed assembly languages cannot express all security invariants we wish to
enforce.
Dependent types could be used to express safety, security, and full functional correctness invariants.
In this talk, I briefly describe workinprogress on developing a dependently typed assembly, and how
it could be used to statically enforce security guarantees when linking.Abstract 
Slides
Only Control Effects and Dependent Types.
Youyou Cong, William J. Bowman.
Talk at the Workshop on Higherorder Programming with Effects (HOPE
2017).
Abstract 
GitHub
Growing a Proof Assistant.
William J. Bowman.
Talk at the Workshop on Higherorder Programming with Effects (HOPE
2016).
Sophisticated domainspecific and userdefined notation is widely used in
formal models, but is poorly supported by proof assistants.
Many proof assistants support simple notation definitions, but no proof
assistant enables users to conveniently define sophisticated
notation.
For instance, in modeling a programming language, we often define infix
relations such as Γ ⊢ e : t and use BNF notation to specify the syntax
of the language.
In a proof assistant like Coq or Agda, users can easily define the notation
for Γ ⊢ e : t, but to use BNF notation the user must use a preprocessing
tool external to the proof assistant, which is cumbersome.
To support sophisticated userdefined notation, we propose to use
language extension as a fundamental part of the design of a proof
assistant.
We describe how to design a languageextension systems that support safe,
convenient, and sophisticated userdefined extensions, and how to design a
proof assistant based on language extension.
We evaluate this design by building a proof assistant that features a small
dependent type theory as the core language and implementing the following
extensions in small userdefined libraries: pattern matching for inductive
types, dependentlytyped staged metaprogramming, a tacticbased proof
language, and BNF and inferencerule notation for inductive type definitions.Abstract 
Draft Paper 
HOPE 2016 Talk (by me) 
GitHub
Dagger Traced Symmetric Monoidal Categories and Reversible Programming.
William J. Bowman, Roshan P. James, and Amr Sabry.
In Proc. of the 4th Workshop on Reversible Computation (RC
2011).
Paper 
Code
Talks
Compilation as MultiLanguage Semantics
William J. Bowman
Modeling interoperability between programs in different languages is a key
problem when modeling verified and secure compilation, which has been
successfully addressed using multilanguage semantics.
Unfortunately, existing models of compilation using multilanguage semantics
define two variants of each compiler pass: a syntactic translation
on open terms to model compilation, and a runtime translation of closed terms
at multilanguage boundaries to model interoperability.
In this talk, I discuss workinprogress approach to uniformly model a compiler
entirely as a reduction system on open term in a multilanguage semantics,
rather than as a syntactic translation.
This simultaneously defines the compiler and the interoperability semantics,
reducing duplication.
It also provides interesting semantic insights.
Normalization of the crosslanguage redexes performs aheadoftime (AOT)
compilation.
Evaluation in the multilanguage models justintime (JIT) compilation.
Confluence of multilanguage reduction implies compiler correctness, and
part of the secure compilation proof (full abstraction), enabling focus on the difficult part of the proof.
Subject reduction of the multilanguage reduction implies typepreservation of
the compiler.Abstract 
Video 
Slides (PDF) 
GitHub Repository
Cur: Designing a Less Devious Proof
Assistant
William J. Bowman
Dijkstra said that our tools can have a profound and devious influence on our
thinking. I find this especially true of modern proof assistants, with "devious"
outweighing "profound". Cur is an experiment in design that aims to be less
devious. The design emphasizes language extension, syntax manipulation, and DSL
construction and integration. This enables the user to be in charge of how they
think, rather than requiring the user to contort their thinking to that of the
proof assistant. In this talk, my goal is to convince you that you want similar
capabilities in a proof assistant, and explain and demonstrate Cur’s attempt at
solving the problem.Abstract 
Video 
Slides (ODP) 
Slides (Google Slides) 
Demo Code 
Cur GitHub
Do Compilers Respect Programmers?
William J. Bowman
Video 
Keynote 
PDF
Other
Toward Type Preserving Compilation of Coq.
William J. Bowman.
POPL 2017 Student Research Competition
Extended Abstract 
Poster
Dissertation
Compiling with Dependent Types.
William J. Bowman.
Northeastern University, Feb. 2019.
Dependently typed languages have proven useful for developing largescale fully
verified software, but we do not have any guarantees after compiling that
verified software.
A verified program written in a dependently typed language, such as Coq, can be
type checked to ensure that the program meets its specification.
Similarly, type checking prevents us from importing a library and
violating the specification declared by its types.
Unfortunately, we cannot perform either of these checks after compiling a
dependently typed program, since all current implementations erase types before
compiling the program.
Instead, we must trust the compiler to not introduce errors into the
verified code, and, after compilation, trust the programmer to never introduce
errors by linking two incompatible program components.
As a result, the compiled and linked program is
not verified—
In this dissertation, I develop a theory for preserving dependent types through
compilation so that we can use type checking after compilation to check that no
errors are introduced by the compiler or by linking.
Typepreserving compilation is a wellknown technique that has been used to
design compilers for nondependently typed languages, such as ML, that
statically enforce safety and security guarantees in compiled code.
But there are many open challenges in scaling type preservation to dependent
types.
The key problems are adapting syntactic type systems to interpret lowlevel
representations of code, and breaking the complex mutually recursive structure
of dependent type systems to make proving type preservation and compiler
correctness feasible.
In this dissertation, I explain the concepts required to scale type preservation
to dependent types, present a proof architecture and language design that
support type preservation, and prove type preservation and compiler correctness
for four earlystage compiler translations of a realistic dependently typed
calculus.
These translations include an Anormal form (ANF), a continuationpassing style
(CPS), an abstract closure conversion, and a parametric closure conversion
translation.