Programming Languages and Systems Amal Ahmed download
Programming Languages and Systems Amal Ahmed download
download
https://textbookfull.com/product/programming-languages-and-
systems-amal-ahmed/
https://textbookfull.com/product/programming-languages-and-
systems-1st-edition-nobuko-yoshida/
https://textbookfull.com/product/foundations-of-programming-
languages-kent-d-lee/
https://textbookfull.com/product/foundations-of-programming-
languages-second-edition-lee/
https://textbookfull.com/product/concepts-of-programming-
languages-twelfth-edition-sebesta/
Concepts of programming languages 11th Edition Sebesta
https://textbookfull.com/product/concepts-of-programming-
languages-11th-edition-sebesta/
https://textbookfull.com/product/energy-internet-systems-and-
applications-ahmed-f-zobaa/
https://textbookfull.com/product/understanding-programming-
languages-1st-edition-cliff-b-jones/
https://textbookfull.com/product/programming-languages-and-
systems-16th-asian-symposium-aplas-2018-wellington-new-zealand-
december-2-6-2018-proceedings-sukyoung-ryu/
https://textbookfull.com/product/practical-foundations-for-
programming-languages-2nd-edition-robert-harper/
ARCoSS Amal Ahmed (Ed.)
Programming
LNCS 10801
Languages
and Systems
27th European Symposium on Programming, ESOP 2018
Held as Part of the European Joint Conferences
on Theory and Practice of Software, ETAPS 2018
Thessaloniki, Greece, April 14–20, 2018, Proceedings
Lecture Notes in Computer Science 10801
Commenced Publication in 1973
Founding and Former Series Editors:
Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen
Editorial Board
David Hutchison, UK Takeo Kanade, USA
Josef Kittler, UK Jon M. Kleinberg, USA
Friedemann Mattern, Switzerland John C. Mitchell, USA
Moni Naor, Israel C. Pandu Rangan, India
Bernhard Steffen, Germany Demetri Terzopoulos, USA
Doug Tygar, USA Gerhard Weikum, Germany
Programming
Languages
and Systems
27th European Symposium on Programming, ESOP 2018
Held as Part of the European Joint Conferences
on Theory and Practice of Software, ETAPS 2018
Thessaloniki, Greece, April 14–20, 2018
Proceedings
Editor
Amal Ahmed
Northeastern University
Boston, MA
USA
© The Editor(s) (if applicable) and The Author(s) 2018. This book is an open access publication.
Open Access This book is licensed under the terms of the Creative Commons Attribution 4.0 International
License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution
and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and
the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this book are included in the book’s Creative Commons license,
unless indicated otherwise in a credit line to the material. If material is not included in the book’s Creative
Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use,
you will need to obtain permission directly from the copyright holder.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are
believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors
give a warranty, express or implied, with respect to the material contained herein or for any errors or
omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in
published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer International Publishing AG
part of Springer Nature
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
ETAPS Foreword
Welcome to the proceedings of ETAPS 2018! After a somewhat coldish ETAPS 2017
in Uppsala in the north, ETAPS this year took place in Thessaloniki, Greece. I am
happy to announce that this is the first ETAPS with gold open access proceedings. This
means that all papers are accessible by anyone for free.
ETAPS 2018 was the 21st instance of the European Joint Conferences on Theory
and Practice of Software. ETAPS is an annual federated conference established in
1998, and consists of five conferences: ESOP, FASE, FoSSaCS, TACAS, and POST.
Each conference has its own Program Committee (PC) and its own Steering Com-
mittee. The conferences cover various aspects of software systems, ranging from
theoretical computer science to foundations to programming language developments,
analysis tools, formal approaches to software engineering, and security. Organizing
these conferences in a coherent, highly synchronized conference program facilitates
participation in an exciting event, offering attendees the possibility to meet many
researchers working in different directions in the field, and to easily attend talks of
different conferences. Before and after the main conference, numerous satellite work-
shops take place and attract many researchers from all over the globe.
ETAPS 2018 received 479 submissions in total, 144 of which were accepted,
yielding an overall acceptance rate of 30%. I thank all the authors for their interest in
ETAPS, all the reviewers for their peer reviewing efforts, the PC members for their
contributions, and in particular the PC (co-)chairs for their hard work in running this
entire intensive process. Last but not least, my congratulations to all authors of the
accepted papers!
ETAPS 2018 was enriched by the unifying invited speaker Martin Abadi (Google
Brain, USA) and the conference-specific invited speakers (FASE) Pamela Zave (AT &
T Labs, USA), (POST) Benjamin C. Pierce (University of Pennsylvania, USA), and
(ESOP) Derek Dreyer (Max Planck Institute for Software Systems, Germany). Invited
tutorials were provided by Armin Biere (Johannes Kepler University, Linz, Austria) on
modern SAT solving and Fabio Somenzi (University of Colorado, Boulder, USA) on
hardware verification. My sincere thanks to all these speakers for their inspiring and
interesting talks!
ETAPS 2018 took place in Thessaloniki, Greece, and was organised by the
Department of Informatics of the Aristotle University of Thessaloniki. The university
was founded in 1925 and currently has around 75,000 students; it is the largest uni-
versity in Greece. ETAPS 2018 was further supported by the following associations
and societies: ETAPS e.V., EATCS (European Association for Theoretical Computer
Science), EAPLS (European Association for Programming Languages and Systems),
and EASST (European Association of Software Science and Technology). The local
organization team consisted of Panagiotis Katsaros (general chair), Ioannis Stamelos,
VI ETAPS Foreword
This volume contains the papers presented at the 27th European Symposium on Pro-
gramming (ESOP 2018) held April 16–19, 2018, in Thessaloniki, Greece. ESOP is one
of the European Joint Conferences on Theory and Practice of Software (ETAPS). It is
devoted to fundamental issues in the specification, design, analysis, and implementa-
tion of programming languages and systems.
The 36 papers in this volume were selected from 114 submissions based on origi-
nality and quality. Each submission was reviewed by three to six Program Committee
(PC) members and external reviewers, with an average of 3.3 reviews per paper.
Authors were given a chance to respond to these reviews during the rebuttal period
from December 6 to 8, 2017. All submissions, reviews, and author responses were
considered during the online discussion, which identified 74 submissions to be dis-
cussed further at the physical PC meeting held at Inria Paris, December 13–14, 2017.
Each paper was assigned a guardian, who was responsible for making sure that external
reviews were solicited if there was not enough non-conflicted expertise among the PC,
and for presenting a summary of the reviews and author responses at the PC meeting.
All non-conflicted PC members participated in the discussion of a paper’s merits. PC
members wrote reactions to author responses, including summaries of online discus-
sions and discussions during the physical PC meeting, so as to help the authors
understand decisions. Papers co-authored by members of the PC were held to a higher
standard and discussed toward the end of the physical PC meeting. There were ten such
submissions and five were accepted. Papers for which the program chair had a conflict
of interest were kindly handled by Fritz Henglein.
My sincere thanks to all who contributed to the success of the conference. This
includes the authors who submitted papers for consideration; the external reviewers,
who provided timely expert reviews, sometimes on short notice; and the PC, who
worked hard to provide extensive reviews, engaged in high-quality discussions about
the submissions, and added detailed comments to help authors understand the PC
discussion and decisions. I am grateful to the past ESOP PC chairs, particularly Jan
Vitek and Hongseok Yang, and to the ESOP SC chairs, Giuseppe Castagna and Peter
Thiemann, who helped with numerous procedural matters. I would like to thank the
ETAPS SC chair, Joost-Pieter Katoen, for his amazing work and his responsiveness.
HotCRP was used to handle submissions and online discussion, and helped smoothly
run the physical PC meeting. Finally, I would like to thank Cătălin Hriţcu for spon-
soring the physical PC meeting through ERC grant SECOMP, Mathieu Mourey and the
Inria Paris staff for their help organizing the meeting, and William Bowman for
assisting with the PC meeting.
Program Committee
Amal Ahmed Northeastern University, USA and Inria, France
Nick Benton Facebook, UK
Josh Berdine Facebook, UK
Viviana Bono Università di Torino, Italy
Dominique Devriese KU Leuven, Belgium
Marco Gaboardi University at Buffalo, SUNY, USA
Roberto Giacobazzi Università di Verona, Italy and IMDEA Software Institute,
Spain
Philipp Haller KTH Royal Institute of Technology, Sweden
Matthew Hammer University of Colorado Boulder, USA
Fritz Henglein University of Copenhagen, Denmark
Jan Hoffmann Carnegie Mellon University, USA
Cătălin Hriţcu Inria Paris, France
Suresh Jagannathan Purdue University, USA
Limin Jia Carnegie Mellon University, USA
Naoki Kobayashi University of Tokyo, Japan
Xavier Leroy Inria Paris, France
Aleksandar Nanevski IMDEA Software Institute, Spain
Michael Norrish Data61 and CSIRO, Australia
Andreas Rossberg Google, Germany
Davide Sangiorgi Università di Bologna, Italy and Inria, France
Peter Sewell University of Cambridge, UK
Éric Tanter University of Chile, Chile
Niki Vazou University of Maryland, USA
Steve Zdancewic University of Pennsylvania, USA
Additional Reviewers
Derek Dreyer
Language Design
Probabilistic Programming
Concurrency
Security
Program Verification
Compiler Verification
1 Introduction
Gradual typing [21] is an increasingly popular topic in both programming
language practice and theory. On the practical side there is a growing num-
ber of programming languages adopting gradual typing. Those languages include
Clojure [6], Python [27], TypeScript [5], Hack [26], and the addition of Dynamic to
C# [4], to cite a few. On the theoretical side, recent years have seen a large body of
research that defines the foundations of gradual typing [8,9,13], explores their use
for both functional and object-oriented programming [21,22], as well as its appli-
cations to many other areas [3,24].
A key concept in gradual type systems is consistency [21]. Consistency weak-
ens type equality to allow for the presence of unknown types. In some gradual
type systems with subtyping, consistency is combined with subtyping to give
rise to the notion of consistent subtyping [22]. Consistent subtyping is employed
by gradual type systems to validate type conversions arising from conventional
subtyping. One nice feature of consistent subtyping is that it is derivable from
the more primitive notions of consistency and subtyping. As Siek and Taha [22]
put it this shows that “gradual typing and subtyping are orthogonal and can be
combined in a principled fashion”. Thus consistent subtyping is often used as a
guideline for designing gradual type systems with subtyping.
c The Author(s) 2018
A. Ahmed (Ed.): ESOP 2018, LNCS 10801, pp. 3–30, 2018.
https://doi.org/10.1007/978-3-319-89884-1_1
4 N. Xie et al.
With the insights gained from our work, we argue that, for implicit polymor-
phism, Ahmed et al.’s [1] notion of compatibility is too permissive (i.e. too many
programs are allowed to type-check), and that Igarashi et al.’s [14] notion of type
consistency is too conservative. As a step towards an algorithmic version of con-
sistent subtyping, we present a syntax-directed version of consistent subtyping
that is sound and complete with respect to our formal definition of consistent
subtyping. The syntax-directed version of consistent subtyping is remarkably
simple and well-behaved, without the ad-hoc restriction operator [22]. More-
over, to further illustrate the generality of our consistent subtyping definition,
we show that it can also account for top types, which cannot be dealt with by
Siek and Taha’s [22] definition either.
The second goal of this paper is to present a (source-level) gradually typed
calculus for (predicative) implicit higher-rank polymorphism that uses our new
notion of consistent subtyping. As far as we are aware, there is no work on
bridging the gap between implicit higher-rank polymorphism and gradual typing,
which is interesting for two reasons. On one hand, modern functional languages
(such as Haskell) employ sophisticated type-inference algorithms that, aided by
type annotations, can deal with implicit higher-rank polymorphism. So a natural
question is how gradual typing can be integrated in such languages. On the other
hand, there is several existing work on integrating explicit polymorphism into
gradual typing [1,14]. Yet no work investigates how to move such expressive
power into a source language with implicit polymorphism. Therefore as a step
towards gradualizing such type systems, this paper develops both declarative
and algorithmic versions for a gradual type system with implicit higher-rank
polymorphism. The new calculus brings the expressive power of full implicit
higher-rank polymorphic into a gradually typed source language. We prove that
our calculus satisfies all of the static aspects of the refined criteria for gradual
typing [25], while discussing some issues related with the dynamic guarantee.
In summary, the contributions of this paper are:
1
Note here that we borrow Siek and Taha’s [22] motto mostly to talk about the
static semantics. As Ahmed et al. [1] show there are several non-trivial interactions
between polymorphism and casts at the level of the dynamic semantics.
6 N. Xie et al.
A <: B
Int <: Int Bool <: Bool Float <: Float Int <: Float
B1 <: A1 A2 <: B2
[li : Aii∈1...n+m ] <: [li : Ai∈1...n
i ] <:
A1 → A2 <: B1 → B2
A∼B
A1 ∼ B1 A2 ∼ B2 Ai ∼ Bi
A∼A A∼ ∼A
A1 → A2 ∼ B1 → B2 [li : Ai ] ∼ [li : Bi ]
Siek and Taha [22] developed a gradual typed system for object-oriented lan-
guages that they call FOb?<: . Central to gradual typing is the concept of con-
sistency (written ∼) between gradual types, which are types that may involve
the unknown type . The intuition is that consistency relaxes the structure of a
type system to tolerate unknown positions in a gradual type. They also defined
the subtyping relation in a way that static type safety is preserved. Their key
2
All supplementary materials are available at https://bitbucket.org/xieningning/
consistent-subtyping.
Consistent Subtyping for All 7
insight is that the unknown type is neutral to subtyping, with only <: .
Both relations are found in Fig. 1.
A primary contribution of their work is to show that consistency and subtyp-
ing are orthogonal. To compose subtyping and consistency, Siek and Taha [22]
defined consistent subtyping (written ) in two equivalent ways:
The calculus we are combining gradual typing with is the well-established pred-
icative type system for higher-rank types proposed by Odersky and Läufer [17].
One difference is that, for simplicity, we do not account for a let expression,
as there is already existing work about gradual type systems with let expres-
sions and let generalization (for example, see Garcia and Cimini [12]). Similar
techniques can be applied to our calculus to enable let generalization.
The syntax of the type system, along with the typing and subtyping judg-
ments is given in Fig. 2. An implicit assumption throughout the paper is that
variables in contexts are distinct. We save the explanations for the static seman-
tics to Sect. 4, where we present our gradually typed version of the calculus.
Ψ OL e : A
x:A∈Ψ Ψ, x : A OL e : B
OL
Var OL
Nat LamAnn
Ψ x:A Ψ n : Int Ψ OL λx : A. e : A → B
Ψ, x : τ OL e : B Ψ, a OL e : A
Lam Gen
Ψ OL λx. e : τ → B Ψ OL e : ∀a.A
Ψ A <: B
A∼B
A1 ∼ B1 A2 ∼ B2 A∼B
A∼A A∼ ∼A
A1 → A2 ∼ B1 → B2 ∀a.A ∼ ∀a.B
Ψ A <: B
Ψ B1 <: A1 Ψ A2 <: B2
S-Int S-Fun S-Unknown
Ψ Int <: Int Ψ A1 → A2 <: B1 → B2 Ψ <:
more static safety. In this paper, we envision such a language that combines the
benefits of both implicit higher-rank polymorphism and gradual typing.
A≺B A[X → ] ≺ B
Comp-AllR Comp-AllL
A ≺ ∀X.B ∀X.A ≺ B
∼ ∼
⊥ ( → Int) → Int
Int → Int Int →
<: <: <: <:
(∀a.a → Int) → Int ∼ (∀a. → Int) → Int ∀a.a ⊥
∼
(a) (b)
∼
⊥ ((( → Int) → Int) → Bool) → (Int → )
<: <:
(((∀a.a → Int) → Int) → Bool) → (∀a.a) ∼ ⊥
(c)
Igarashi et al. [14] introduced the so-called quasi-polymorphic types for types
that may be used where a ∀-type is expected, which is important for their pur-
pose of conservativity over System F. Their type consistency relation, involving
polymorphism, is defined as follows3 :
Compared with our consistency definition in Fig. 3, their first rule is the same
as ours. The second rule says that a non ∀-type can be consistent with a ∀-type
only if it contains . In this way, their type system is able to reject ∀a.a → a ∼
Int → Bool. However, in order to keep conservativity, they also reject ∀a.a → a ∼
Int → Int, which is perfectly sensible in their setting (i.e., explicit polymorphism).
However with implicit polymorphism, we would expect ∀a.a → a to be related
with Int → Int, since a can be instantiated to Int.
Nonetheless, when it comes to interactions between dynamically typed and
polymorphically typed terms, both relations allow ∀a.a → Int to be related with
→ Int for example, which in our view, is some sort of (implicit) polymorphic
subtyping combined with type consistency, and that should be derivable by the
more primitive notions in the type system (instead of inventing new relations).
One of our design principles is that subtyping and consistency is orthogonal, and
can be naturally superimposed, echoing the same opinion of Siek and Taha [22].
Unfortunately, the original definition of Siek and Taha [22] (Definition 1) does
not work well with our definitions of consistency and subtyping for polymorphic
types. Consider two types: (∀a.a → Int) → Int, and ( → Int) → Int. The first
type can only reach the second type in one way (first by applying consistency,
then subtyping), but not the other way, as shown in Fig. 4a. We use ⊥ to mean
that we cannot find such a type. Similarly, there are situations where the first
type can only reach the second type by the other way (first applying subtyping,
and then consistency), as shown in Fig. 4b.
What is worse, if those two examples are composed in a way that those types
all appear co-variantly, then the resulting types cannot reach each other in either
way. For example, Fig. 4c shows such two types by putting a Bool type in the
middle, and neither definition of consistent subtyping works.
From the above observations, we see what the problem is with the original
definition. In Fig. 5a, if B can reach C by T1 , then by subtyping transitivity, A
can reach C by T1 . However, if B can only reach C by T2 , then A cannot reach
C through the original definition. A similar problem is shown in Fig. 5b.
However, it turns out that those two problems can be fixed using the same
strategy: instead of taking one-step subtyping and one-step consistency, our def-
inition of consistent subtyping allows types to take one-step subtyping, one-step
consistency, and one more step subtyping. Specifically, A <: B ∼ T2 <: C (in
Fig. 5a) and C <: T1 ∼ B <: A (in Fig. 5b) have the same relation chain:
subtyping, consistency, and subtyping.
Consistent Subtyping for All 13
∼
T1 C A
<: <: <:
∼
B T2 T1 B
∼
<: <: <:
A C ∼ T2
(a) (b)
∼
A2 A3 A1 = (((∀a.a → Int) → Int) → Bool) → (∀a.a)
<: <: A2 = ((∀a.a → Int) → Int) → Bool) → (Int → Int)
A3 = ((∀a. → Int) → Int) → Bool) → (Int → )
A1 A4
A4 = ((( → Int) → Int) → Bool) → (Int → )
With Definition 2, Fig. 6 illustrates the correct relation chain for the broken
example shown in Fig. 4c. At first sight, Definition 2 seems worse than the origi-
nal: we need to guess two types! It turns out that Definition 2 is a generalization
of Definition 1, and they are equivalent in the system of Siek and Taha [22].
However, more generally, Definition 2 is compatible with polymorphic types.
Garcia et al. [13] presented a new foundation for gradual typing that they
call the Abstracting Gradual Typing (AGT) approach. In the AGT approach,
gradual types are interpreted as sets of static types, where static types refer
to types containing no unknown types. In this interpretation, predicates and
14 N. Xie et al.
functions on static types can then be lifted to apply to gradual types. Central
to their approach is the so-called concretization function. For simple types, a
concretization γ from gradual types to a set of static types4 is defined as follows:
Definition 3 (Concretization)
γ(Int) = {Int} γ(A → B) = γ(A) → γ(B) γ() = {All static types}
Based on the concretization function, subtyping between static types can be
lifted to gradual types, resulting in the consistent subtyping relation:
: B if and only if A1 <:
Definition 4 (Consistent Subtyping in AGT). A <
B1 for some A1 ∈ γ(A), B1 ∈ γ(B).
Later they proved that this definition of consistent subtyping coincides with
that of Siek and Taha [22] (Definition 1). By Proposition 1, we can directly con-
clude that our definition coincides with AGT:
Proposition 2 (Equivalence to AGT on Simple Types). A B iff
A<: B.
However, AGT does not show how to deal with polymorphism (e.g. the inter-
pretation of type variables) yet. Still, as noted by Garcia et al. [13], it is a promis-
ing line of future work for AGT, and the question remains whether our definition
would coincide with it.
Another note related to AGT is that the definition is later adopted by
Castagna and Lanvin [7], where the static types A1 , B1 in Definition 4 can be
algorithmically computed by also accounting for top and bottom types.
It may seem that precision is a more atomic relation, since consistency can be
derived from precision. However, recall that consistency is in fact an equivalence
relation lifted from static types to gradual types. Therefore defining consistency
independently is straightforward, and it is theoretically viable to validate the
definition of consistency directly. On the other hand, precision is usually con-
nected with the gradual criteria [25], and finding a correct partial order that
adheres to the criteria is not always an easy task. For example, Igarashi et al.
[14] argued that term precision for System FG is actually nontrivial, leaving
the gradual guarantee of the semantics as a conjecture. Thus precision can be
difficult to extend to more sophisticated type systems, e.g. dependent types.
Still, it is interesting that those two definitions illustrate the correspondence
of different foundations (on simple types): one is defined directly on gradual
types, and the other stems from AGT, which is based on static subtyping.
Attempt to Extend the Restriction Operator. Suppose that we try to extend the
restriction operator to account for polymorphic types. The original restriction
operator is structural, meaning that it works for types of similar structures.
But for polymorphic types, two input types could have different structures due
to universal quantifiers, e.g., ∀a.a → Int and (Int → ) → Int. If we try to
mask the first type using the second, it seems hard to maintain the information
that a should be instantiated to a function while ensuring that the return type is
masked. There seems to be no satisfactory way to extend the restriction operator
in order to support this kind of non-structural masking.
CAEN
25th March, 1644. We arrived at Caen, a noble and beautiful
town, situate on the river Orne, which passes quite through it, the
two sides of the town joined only by a bridge of one entire arch. We
lay at the Angel, where we were very well used, the place being
abundantly furnished with provisions, at a cheap rate. The most
considerable object is the great Abbey and Church, large and rich,
built after the Gothic manner, having two spires and middle lantern
at the west end, all of stone. The choir round and large, in the
center whereof elevated on a square, handsome, but plain sepulcher,
is this inscription:
"Hoc sepulchrum invictissimi juxta et clementissimi conquestoris,
Gulielmi, dum viverat Anglorum Regis, Normannorum Cenomannorumque
Principis, hujus insignis Abbatiae piissimi Fundatoris: Cum anno 1562
vesano hæreticorum furore direptum fuisset, pio tandem nobilium
ejusdem Abbatiae religiosorum gratitudinis sensu in tam beneficum
largitorem, instauratum fuit, aº D'ni 1642. D'no Johanne de Bailhache
Assætorii proto priore. D.D."
Under this is a very wide pair of gates, nailed full of wolves and
wild-boars' heads. Behind the castle the present Duke Gaston had
begun a fair building, through which we walked into a large garden,
esteemed for its furniture one of the fairest, especially for simples
and exotic plants, in which he takes extraordinary delight. On the
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com