<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://lambda-the-ultimate.org">
<channel>
 <title>Lambda the Ultimate - Type Theory</title>
 <link>http://lambda-the-ultimate.org/taxonomy/term/21/0</link>
 <description></description>
 <language>en</language>
<item>
 <title>The Simple Essence of Algebraic Subtyping: Principal Type Inference with Subtyping Made Easy</title>
 <link>http://lambda-the-ultimate.org/node/5597</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://infoscience.epfl.ch/record/278576&quot;&gt;The Simple Essence of Algebraic Subtyping: Principal Type Inference with Subtyping Made Easy&lt;/a&gt;, Lionel Parreaux, ICFP 2020.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;MLsub extends traditional Hindley-Milner type inference with subtyping while preserving compact principal types, an exciting new development. However, its specification in terms of biunification is difficult to understand, relying on the new concepts of bisubstitution and polar types, and making use of advanced notions from abstract algebra. In this paper, we show that these are in fact not essential to understanding the mechanisms at play in MLsub. We propose an alternative algorithm called Simple-sub, which can be implemented efficiently in under &lt;a href=&quot;https://github.com/LPTK/simple-sub/tree/master/shared/src/main/scala/simplesub&quot;&gt;500 lines of code&lt;/a&gt; (including parsing, simplification, and pretty-printing), looks more familiar, and is easier to understand.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;There&#039;s also an &lt;a href=&quot;https://lptk.github.io/programming/2020/03/26/demystifying-mlsub.html&quot;&gt;introductory blog post&lt;/a&gt; and an &lt;a href=&quot;https://lptk.github.io/simple-sub/&quot;&gt;online demo&lt;/a&gt;.&lt;/p&gt;
&lt;p &gt;Stephen Dolan&#039;s Algebraic Subtyping (&lt;a href=&quot;http://lambda-the-ultimate.org/node/5393&quot;&gt;discussion)&lt;/a&gt; unexpectedly provided a solution to the problem of combining type inference and subtyping, but used somewhat heavy and unusual machinery. Now Lionel Parreaux shows that the system can be implemented in a very straightforward and pleasing way. Here&#039;s to hoping that it makes it into real languages!&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Fri, 24 Jul 2020 07:46:20 +0000</pubDate>
</item>
<item>
 <title>The Little Typer</title>
 <link>http://lambda-the-ultimate.org/node/5552</link>
 <description>&lt;p &gt;A new introductory book about dependent types, involving some familiar names:&lt;/p&gt;
&lt;p &gt;&lt;strong &gt;&lt;a href=&quot;https://mitpress.mit.edu/books/little-typer&quot;&gt;The Little Typer&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p &gt;by Daniel P. Friedman and David Thrane Christiansen.&lt;/p&gt;
&lt;p &gt;Foreword by Robert Harper.&lt;/p&gt;
&lt;p &gt;Afterword by Conor McBride.&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
&lt;strong &gt;An introduction to dependent types, demonstrating the most beautiful aspects, one step at a time.&lt;/strong&gt;&lt;/p&gt;
&lt;p &gt;A program&#039;s type describes its behavior. Dependent types are a first-class part of a language, and are much more powerful than other kinds of types; using just one language for types and programs allows program descriptions to be as powerful as the programs they describe. The Little Typer explains dependent types, beginning with a very small language that looks very much like Scheme and extending it to cover both programming with dependent types and using dependent types for mathematical reasoning. Readers should be familiar with the basics of a Lisp-like programming language, as presented in the first four chapters of The Little Schemer.&lt;/p&gt;
&lt;p &gt;The first five chapters of The Little Typer provide the needed tools to understand dependent types; the remaining chapters use these tools to build a bridge between mathematics and programming. Readers will learn that tools they know from programming—pairs, lists, functions, and recursion—can also capture patterns of reasoning. The Little Typer does not attempt to teach either practical programming skills or a fully rigorous approach to types. Instead, it demonstrates the most beautiful aspects as simply as possible, one step at a time.
&lt;/p&gt;&lt;/blockquote&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Mon, 24 Sep 2018 04:29:49 +0000</pubDate>
</item>
<item>
 <title>Safe Dynamic Memory Management in Ada and SPARK</title>
 <link>http://lambda-the-ultimate.org/node/5541</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://www.adacore.com/papers/safe-dynamic-memory-management-in-ada-and-spark&quot;&gt;Safe Dynamic Memory Management in Ada and SPARK&lt;/a&gt; by Maroua Maalej, Tucker Taft, Yannick Moy:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;Handling memory in a correct and efficient way is a step toward safer, less complex, and higher performing software-intensive systems. However, languages used for critical software development such as Ada, which supports formal verification with its SPARK subset, face challenges regarding any use of pointers due to potential pointer aliasing. In this work, we introduce an extension to the Ada language, and to its SPARK subset, to provide pointer types (“access types” in Ada) that provide provably safe, automatic storage management without any asynchronous garbage collection, and without explicit deallocation by the user. Because the mechanism for these safe pointers relies on strict control of aliasing, it can be used in the SPARK subset for formal verification, including both information flow analysis and proof of safety and correctness properties. In this paper, we present this proposal (which has been submitted for inclusion in the next version of Ada), and explain how we are able to incorporate these pointers into formal analyses&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;For the systems programmers among you, you might be interested in some new developments in Ada where they propose to add ownership types to Ada&#039;s pointer/access types, to improve the flexibility of the programs that can be written and whose safety can be automatically verified. The automated satisfiability of these safety properties is a key goal of the SPARK Ada subset.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/8">Implementation</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Thu, 26 Jul 2018 19:42:01 +0000</pubDate>
</item>
<item>
 <title>The Gentle Art of Levitation</title>
 <link>http://lambda-the-ultimate.org/node/5526</link>
 <description>&lt;a href=&quot;http://jmchapman.github.io/papers/levitation.pdf&quot;&gt;The Gentle Art of Levitation&lt;/a&gt;
&lt;p &gt;2010 by James Chapman, Pierre-Evariste Dagand, Conor McBride, Peter Morrisy&lt;/p&gt;
&lt;blockquote &gt;
We present a closed dependent type theory whose inductive types
are given not by a scheme for generative declarations, but by encoding
in a universe. Each inductive datatype arises by interpreting its
description—a first-class value in a datatype of descriptions. Moreover,
the latter itself has a description. Datatype-generic programming
thus becomes ordinary programming. We show some of the
resulting generic operations and deploy them in particular, useful
ways on the datatype of datatype descriptions itself. Surprisingly
this apparently self-supporting setup is achievable without paradox
or infinite regress.
&lt;/blockquote&gt;
It&#039;s datatype descriptions all the way down.</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Fri, 11 May 2018 19:26:31 +0000</pubDate>
</item>
<item>
 <title>Comprehending Ringads</title>
 <link>http://lambda-the-ultimate.org/node/5525</link>
 <description>&lt;a href=&quot;http://www.cs.ox.ac.uk/jeremy.gibbons/publications/ringads.pdf&quot;&gt;Comprehending Ringads&lt;/a&gt;
&lt;p &gt;2016 by Jeremy Gibbons&lt;/p&gt;
&lt;blockquote &gt;
Ringad comprehensions represent a convenient notation for expressing
database queries. The ringad structure alone does not provide
a good explanation or an efficient implementation of relational joins;
but by allowing heterogeneous comprehensions, involving both bag and
indexed table ringads, we show how to accommodate these too.
&lt;/blockquote&gt;
Indexed/parametric/graded monads are the key (read the paper to understand the pun).</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/22">Category Theory</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Sat, 05 May 2018 02:59:11 +0000</pubDate>
</item>
<item>
 <title>Sequent Calculus as a Compiler Intermediate Language</title>
 <link>http://lambda-the-ultimate.org/node/5519</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://www.microsoft.com/en-us/research/wp-content/uploads/2016/04/sequent-calculus-icfp16.pdf&quot;&gt;Sequent Calculus as a Compiler Intermediate Language&lt;/a&gt;&lt;br &gt;
2016 by Paul Downen, Luke Maurer, Zena M. Ariola, Simon Peyton Jones&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
The typed λ-calculus arises canonically as the term language for a logic called natural deduction, using the Curry-Howard isomorphism: the pervasive connection between logic and programming languages asserting that propositions are types and proofs are programs. Indeed, for many people, the λ-calculus is the living embodiment of Curry-Howard.&lt;/p&gt;
&lt;p &gt;But natural deduction is not the only logic! Conspicuously, natural deduction has a twin, born in the very same paper, called the sequent calculus. Thanks to the Curry-Howard isomorphism, terms of the sequent calculus can also be seen as a programming language with an emphasis on control flow.
&lt;/p&gt;&lt;/blockquote&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/11">Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/6">General</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/20">Lambda Calculus</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Mon, 02 Apr 2018 17:06:41 +0000</pubDate>
</item>
<item>
 <title>The Syntax and Semantics of Quantitative Type Theory</title>
 <link>http://lambda-the-ultimate.org/node/5453</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://bentnib.org/quantitative-type-theory.html&quot;&gt;The Syntax and Semantics of Quantitative Type Theory&lt;/a&gt; by Robert Atkey:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;Type Theory offers a tantalising promise: that we can program and reason within a single unified system. However, this promise slips away when we try to produce efficient programs. Type Theory offers little control over the intensional aspect of programs: how are computational resources used, and when can they be reused. Tracking resource usage via types has a long history, starting with Girard&#039;s Linear Logic and culminating with recent work in contextual effects, coeffects, and quantitative type theories. However, there is conflict with full dependent Type Theory when accounting for the difference between usages in types and terms. Recently, McBride has proposed a system that resolves this conflict by treating usage in types as a zero usage, so that it doesn&#039;t affect the usage in terms. This leads to a simple expressive system, which we have named Quantitative Type Theory (QTT).&lt;/p&gt;
&lt;p &gt;McBride presented a syntax and typing rules for the system, as well as an erasure property that exploits the difference between “not used” and “used”, but does not do anything with the finer usage information. In this paper, we present present a semantic interpretation of a variant of McBride&#039;s system, where we fully exploit the usage information. We interpret terms simultaneously as having extensional (compile-time) content and intensional (runtime) content. In our example models, extensional content is set-theoretic functions, representing the compile-time or type-level content of a type-theoretic construction. Intensional content is given by realisers for the extensional content. We use Abramsky et al.&#039;s Linear Combinatory Algebras as realisers, yield a large range of potential models from Geometry of Interaction, graph models, and syntactic models. Read constructively, our models provide a resource sensitive compilation method for QTT.&lt;/p&gt;
&lt;p &gt;To rigorously define the structure required for models of QTT, we introduce the concept of a Quantitative Category with Families, a generalisation of the standard Category with Families class of models of Type Theory, and show that this class of models soundly interprets Quantitative Type Theory.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Resource-aware programming is a hot topic these days, with Rust exploiting affine and ownership types to scope and track resource usage, and with &lt;a href=&quot;http://lambda-the-ultimate.org/node/5003&quot;&gt;Ethereum&lt;/a&gt; requiring programs to spend &quot;gas&quot; to execute. Combining linear and dependent types has proven difficult though, so making it easier to track and reason about resource usage in dependent type theories would then be a huge benefit to making verification more practical in domains where resources are limited.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/19">Theory</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Tue, 25 Jul 2017 17:28:17 +0000</pubDate>
</item>
<item>
 <title>RustBelt: Securing the Foundations of the Rust Programming Language</title>
 <link>http://lambda-the-ultimate.org/node/5448</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://www.ralfj.de/blog/2017/07/08/rustbelt.html&quot;&gt;RustBelt: Securing the Foundations of the Rust Programming Language&lt;/a&gt; by Ralf Jung, Jacques-Henri Jourdan, Robbert Krebbers, Derek Dreyer:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;
Rust is a new systems programming language that promises to overcome the seemingly fundamental tradeoff between high-level safety guarantees and low-level control over resource management. Unfortunately, none of Rust’s safety claims have been formally proven, and there is good reason to question whether they actually hold. Specifically, Rust employs a strong, ownership-based type system, but then extends the expressive power of this core type system through libraries that internally use unsafe features. In this paper, we give the first formal (and machine-checked) safety proof for a language representing a realistic subset of Rust. Our proof is extensible in the sense that, for each new Rust library that uses unsafe features, we can say what verification condition it must satisfy in order for it to be deemed a safe extension to the language. We have carried out this verification for some of the most important libraries that are used throughout the Rust ecosystem.
&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Rust is definitely pushing the envelope in a new direction, but there&#039;s always a little wariness around using libraries that make use of unsafe features, since &quot;safety with performance&quot; is a main reason people want to use Rust. So this is a great step in the right direction!&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/11">Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/12">Object-Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Mon, 10 Jul 2017 15:14:45 +0000</pubDate>
</item>
<item>
 <title>Type Systems as Macros</title>
 <link>http://lambda-the-ultimate.org/node/5426</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf&quot;&gt;Type Systems as Macros&lt;/a&gt;, by Stephen Chang, Alex Knauth, Ben Greenman:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;We present TURNSTILE, a metalanguage for creating typed embedded languages. To implement the type system, programmers write type checking rules resembling traditional judgment syntax. To implement the semantics, they incorporate elaborations into these rules. TURNSTILE critically depends on the idea of linguistic reuse. It exploits a &lt;em &gt;macro system&lt;/em&gt; in a novel way to simultaneously type check and rewrite a surface program into a target language. Reusing a macro system also yields modular implementations whose rules may be mixed and matched to create other languages. Combined with typical compiler and runtime reuse, TURNSTILE produces performant typed embedded languages with little effort.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;This looks pretty awesome considering it&#039;s not limited to simple typed languages, but extends all the way to System F and F-omega! Even better, they can reuse previous type systems to define new ones, thereby reducing the effort to implement more expressive type systems. All code and further details &lt;a href=&quot;http://www.ccs.neu.edu/home/stchang/popl2017/&quot;&gt;available here&lt;/a&gt;, and &lt;a href=&quot;http://blog.racket-lang.org/2017/04/type-tailoring.html&quot;&gt;here&#039;s a blog post&lt;/a&gt; where Ben Greenman further discusses the related &quot;type tailoring&quot;, and of course, these are both directly related to &lt;a href=&quot;http://lambda-the-ultimate.org/node/1339&quot;&gt;Active Libraries&lt;/a&gt;.&lt;/p&gt;
&lt;p &gt;Taken to its extreme, why not have an assembler with a powerful macro system of this sort as your host language, and every high-level language would be built on this. I&#039;m not sure if this approach would extend that far, but it&#039;s an interesting idea. You&#039;d need a cpp-like highly portable macro tool, and porting to a new platform consists of writing architecture-specific macros for some core language, like System F.&lt;/p&gt;
&lt;p &gt;This work may also conceptually dovetail with &lt;a href=&quot;http://lambda-the-ultimate.org/node/5424&quot;&gt;another thread discussing fexprs and compilation&lt;/a&gt;.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/24">DSL</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/11">Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/20">Lambda Calculus</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/15">Meta-Programming</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Wed, 19 Apr 2017 23:38:56 +0000</pubDate>
</item>
<item>
 <title>Contextual isomorphisms</title>
 <link>http://lambda-the-ultimate.org/node/5398</link>
 <description>&lt;p &gt;
&lt;a href=&quot;http://www.cs.bham.ac.uk/~pbl/papers/contextiso.pdf&quot;&gt;Contextual Isomorphisms&lt;/a&gt;&lt;br &gt;
Paul Blain Levy&lt;br &gt;
2017&lt;br &gt;
&lt;/p&gt;

&lt;blockquote &gt;
&lt;p &gt;
What is the right notion of &quot;isomorphism&quot; between types, in a simple
type theory? The traditional answer is: a pair of terms that are
inverse, up to a specified congruence. We firstly argue that, in the
presence of effects, this answer is too liberal and needs to be
restricted, using Führmann’s notion of thunkability in the case of
value types (as in call-by-value), or using Munch-Maccagnoni’s notion
of linearity in the case of computation types (as in
call-by-name). Yet that leaves us with different notions of
isomorphism for different kinds of type.
&lt;/p&gt;
&lt;p &gt;
This situation is resolved by means of a new notion of “contextual”
isomorphism (or morphism), analogous at the level of types to
contextual equivalence of terms. A contextual morphism is a way of
replacing one type with the other wherever it may occur in
a judgement, in a way that is preserved by the action of any term with
holes. For types of pure λ-calculus, we show that a contextual
morphism corresponds to a traditional isomorphism. For value types,
a contextual morphism corresponds to a thunkable isomorphism, and for
computation types, to a linear isomorphism.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p &gt;This paper is based on a very simple idea that everyone familiar
with type-systems can enjoy. It then applies it in a technical setting
in which it brings a useful contribution. I suspect that many readers
will find that second part too technical, but they may still enjoy the
idea itself. To facilitate this, I will rephrase the abstract above in
a way that I hope makes it accessible to a larger audience.&lt;/p&gt;

&lt;p &gt;The problem that the paper solves is: how do we know what it means
for two types to be equivalent? For many languages they are reasonable
definitions of equivalence (such that: there exists a bijection
between these two types in the language), but for more advanced
languages these definitions break down. For example, in presence of
hidden mutable state, one can build a pair of functions from the
one-element type &lt;code &gt;unit&lt;/code&gt; to the two-element
type &lt;code &gt;bool&lt;/code&gt; and back that are the identity when composed
together -- the usual definition of bijection -- while these two types
should probably not be considered &quot;the same&quot;. Those two functions
share some hidden state, so they &quot;cheat&quot;. Other, more complex notions
of type equivalence have been given in the literature, but how do we
know whether they are the &quot;right&quot; notions, or whether they may
disappoint us in the same way?&lt;/p&gt;

&lt;p &gt;To define what it means for two program fragments to be equivalent,
we have a &quot;gold standard&quot;, which is contextual equivalence: two
program fragments are contextually equivalent if we can replace one
for the other in any complete program without changing its
behavior. This is simple to state, it is usually clear how to
instantiate this definition for a new system, and it gives you
a satisfying notion of equivalent. It may not be the most convenient
one to work with, so people define others, more specific notions of
equivalence (typically beta-eta-equivalence or logical relations); it
is fine if they are more sophisticated, and their definiton harder to
justify or understand, because they can always be compared to this
simple definition to gain confidence.&lt;/p&gt;

&lt;p &gt;The simple idea in the paper above is to use this exact same trick
to define what it means for two &lt;em &gt;types&lt;/em&gt; to be
equivalent. Naively, one could say that two types are equivalent if,
in any well-typed program, one can replace some occurrences of the
first type by occurrences of the second type, all other things being
unchanged. This does not quite work, as changing the types that appear
in a program without changing its terms would create ill-typed
terms. So instead, the paper proposes that two types are equivalent
when we are told how to transform any program using the first type
into a program using the second type, in a way that is bijective
(invertible) and compositional -- see the paper for details.&lt;/p&gt;

&lt;p &gt;Then, the author can validate this definition by showing that, when
instantiated to languages (simple or complex) where existing notions
of equivalence have been proposed, this new notion of equivalence
corresponds to the previous notions.&lt;/p&gt;

&lt;p &gt;(Readers may find that even the warmup part of the paper, namely
the sections 1 to 4, pages 1 to 6, are rather dense, with a compactly
exposed general idea and arguably a lack of concrete examples that would help
understanding. Surely this terseness is in large part a consequence of
strict page limits -- conference articles are the tweets of computer
science research. A nice side-effect (no pun intended) is that you can
observe a carefully chosen formal language at work, designed to expose
the setting and perform relevant proofs in minimal space: category
theory, and in particular the concept of naturality, is the killer
space-saving measure here.)&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Fri, 09 Dec 2016 21:37:50 +0000</pubDate>
</item>
<item>
 <title>Polymorphism, subtyping and type inference in MLsub</title>
 <link>http://lambda-the-ultimate.org/node/5393</link>
 <description>&lt;p &gt;I am very enthusiastic about the following paper: it brings new ideas and solves a problem that I did not expect to be solvable, namely usable type inference when both polymorphism and subtyping are implicit. (By &quot;usable&quot; here I mean that the inferred types are both compact and principal, while previous work generally had only one of those properties.)&lt;/p&gt;

&lt;p &gt;
&lt;a href=&quot;http://www.cl.cam.ac.uk/%7Esd601/papers/mlsub-preprint.pdf&quot;&gt;Polymorphism, Subtyping, and Type Inference in MLsub&lt;/a&gt;&lt;br &gt;
Stephen Dolan and Alan Mycroft&lt;br &gt;
2017&lt;/p&gt;
&lt;blockquote &gt;
&lt;p &gt;We present a type system combining subtyping and ML-style parametric polymorphism. Unlike previous work, our system supports
type inference and has compact principal types. We demonstrate
this system in the minimal language MLsub, which types a strict
superset of core ML programs.&lt;/p&gt;

&lt;p &gt;This is made possible by keeping a strict separation between
the types used to describe inputs and those used to describe outputs, and extending the classical unification algorithm to handle
subtyping constraints between these input and output types. Principal types are kept compact by type simplification, which exploits
deep connections between subtyping and the algebra of regular languages. An implementation is available online.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p &gt;The paper is full of interesting ideas. For example, one idea is that adding type variables to the base grammar of types -- instead of defining them by their substitution -- forces us to look at our type systems in ways that are more open to extension with new features. I would recommend looking at this paper even if you are interested in ML and type inference, but not subtyping, or in polymorphism and subtyping, but not type inference, or in subtyping and type inference, but not functional languages.&lt;/p&gt;

&lt;p &gt;This paper is also a teaser for the first&#039;s author PhD thesis, &lt;a href=&quot;https://www.cl.cam.ac.uk/~sd601/thesis.pdf&quot;&gt;&lt;em &gt;Algebraic Subtyping&lt;/em&gt;&lt;/a&gt;. There is also an &lt;a href=&quot;https://www.cl.cam.ac.uk/~sd601/mlsub/&quot;&gt;implementation&lt;/a&gt; available.&lt;/p&gt;

&lt;p &gt;(If you are looking for interesting work on inference of polymorphism and subtyping in object-oriented languages, I would recommend &lt;a href=&quot;http://www.cs.cornell.edu/~ross/publications/shapes/&quot;&gt;Getting F-Bounded Polymorphism into Shape&lt;/a&gt; by Ben Greenman, Fabian Muehlboeck and Ross Tate, 2014.)&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Wed, 23 Nov 2016 16:54:15 +0000</pubDate>
</item>
<item>
 <title>Proving Programs Correct Using Plain Old Java Types</title>
 <link>http://lambda-the-ultimate.org/node/5387</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://fpl.cs.depaul.edu/jriely/papers/2009-pojt.pdf&quot;&gt;Proving Programs Correct Using Plain Old Java Types&lt;/a&gt;, by Radha Jagadeesan, Alan Jeffrey, Corin Pitcher, James Riely:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;Tools for constructing proofs of correctness of programs have a long history of development in the research community, but have often faced difficulty in being widely deployed in software development tools. In this paper, we demonstrate that the off-the-shelf Java type system is already powerful enough to encode non-trivial proofs of correctness using propositional Hoare preconditions and postconditions.&lt;/p&gt;
&lt;p &gt;We illustrate the power of this method by adapting Fähndrich and Leino’s work on monotone typestates and Myers and Qi’s closely related work on object initialization. Our approach is expressive enough to address phased initialization protocols and the creation of cyclic data structures, thus allowing for the elimination of null and the special status of constructors. To our knowledge, our system is the first that is able to statically validate standard one-pass traversal algorithms for cyclic graphs, such as those that underlie object deserialization. Our proof of correctness is mechanized using the Java type system, without any extensions to the Java language.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Not a new paper, but it provides a lightweight verification technique for some program properties that you can use right now, without waiting for integrated theorem provers or SMT solvers. Properties that require only monotone typestates can be verified, ie. those that operations can only move the typestate &quot;forwards&quot;.&lt;/p&gt;
&lt;p &gt;In order to achieve this, they require programmers to follow a few simple rules to avoid Java&#039;s pervasive nulls. These are roughly: don&#039;t assign null explicitly, be sure to initialize all fields when constructing objects.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/14">OOP</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Fri, 04 Nov 2016 14:27:32 +0000</pubDate>
</item>
<item>
 <title>Fully Abstract Compilation via Universal Embedding</title>
 <link>http://lambda-the-ultimate.org/node/5364</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://www.williamjbowman.com/resources/fabcc-paper.pdf&quot;&gt;Fully Abstract Compilation via Universal Embedding&lt;/a&gt; by Max S. New, William J. Bowman, and Amal Ahmed:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;A &lt;em &gt;fully abstract&lt;/em&gt; 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: target-language attackers can make no more observations of a compiled component than a source-language 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 back-translated to a behaviorally equivalent source context.&lt;/p&gt;
&lt;p &gt;We prove the first full abstraction result for a translation whose target language contains exceptions, but the source does not. Our translation—specifically, closure conversion of simply typed λ-calculus with recursive types—uses types at the target level to ensure that a compiled component is never linked with attackers that have more distinguishing power than source-level attackers. We present a new back-translation technique based on a deep embedding of the target language into the source language at a dynamic type. Then boundaries are inserted that mediate terms between the untyped embedding and the strongly-typed source. This technique allows back-translating non-terminating programs, target features that are untypeable in the source, and well-bracketed effects.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Potentially a promising step forward to secure multilanguage runtimes. We&#039;ve previously discussed security vulnerabilities caused by full abstraction failures &lt;a href=&quot;http://lambda-the-ultimate.org/node/3830&quot;&gt;here&lt;/a&gt; and &lt;a href=&quot;http://lambda-the-ultimate.org/node/1588&quot;&gt;here&lt;/a&gt;. The paper also provides a comprehensive review of associated literature, like various means of protection, back translations, embeddings, etc.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/20">Lambda Calculus</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/29">Semantics</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/19">Theory</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Wed, 27 Jul 2016 15:57:02 +0000</pubDate>
</item>
<item>
 <title>Set-Theoretic Types for Polymorphic Variants</title>
 <link>http://lambda-the-ultimate.org/node/5351</link>
 <description>&lt;p &gt;&lt;a href=&quot;http://arxiv.org/pdf/1606.01106v1.pdf&quot;&gt;Set-Theoretic Types for Polymorphic Variants&lt;/a&gt; by Giuseppe Castagna, Tommaso Petrucciani, and Kim Nguyễn:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;Polymorphic variants are a useful feature of the OCaml language whose current definition and implementation rely on kinding constraints to simulate a subtyping relation via unification. This yields an awkward formalization and results in a type system whose behaviour is in some cases unintuitive and/or unduly restrictive.&lt;/p&gt;
&lt;p &gt;In this work, we present an alternative formalization of polymorphic variants, based on set-theoretic types and subtyping, that yields a cleaner and more streamlined system. Our formalization is more expressive than the current one (it types more programs while preserving type safety), it can internalize some meta-theoretic properties, and it removes some pathological cases of the current implementation resulting in a more intuitive and, thus, predictable type system. More generally, this work shows how to add full-fledged union types to functional languages of the ML family that usually rely on the Hindley-Milner type system. As an aside, our system also improves the theory of semantic subtyping, notably by proving completeness for the type reconstruction algorithm.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Looks like a nice result. They integrate union types and restricted intersection types for complete type inference, which prior work on CDuce could not do. The disadvantage is that it does not admit principal types, and so inference is non-deterministic (see section 5.3.2).&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/11">Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Thu, 09 Jun 2016 13:38:24 +0000</pubDate>
</item>
<item>
 <title>No value restriction is needed for algebraic effects and handlers</title>
 <link>http://lambda-the-ultimate.org/node/5343</link>
 <description>&lt;p &gt;&lt;a href=&quot;https://arxiv.org/pdf/1605.06938v1.pdf&quot;&gt;No value restriction is needed for algebraic effects and handlers&lt;/a&gt;, by Ohad Kammar and Matija Pretnar:&lt;/p&gt;
&lt;blockquote &gt;&lt;p &gt;We present a straightforward, sound Hindley-Milner polymorphic type system for algebraic effects and handlers in a call-by-value calculus, which allows type variable generalisation of arbitrary computations, not just values. This result is surprising. On the one hand, the soundness of unrestricted call-by-value Hindley-Milner polymorphism is known to fail in the presence of computational effects such as reference cells and continuations. On the other hand, many programming examples can be recast to use effect handlers instead of these effects. Analysing the expressive power of effect handlers with respect to state effects, we claim handlers cannot express reference cells, and show they can simulate dynamically scoped state.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p &gt;Looks like a nice integration of algebraic effects with simple Hindly-Milner, but which yields some unintuitive conclusions. At least I certainly found the possibility of supporting dynamically scoped state but not reference cells surprising!&lt;/p&gt;
&lt;p &gt;It highlights the need for some future work to support true reference cells, namely a polymorphic type and effect system to generate fresh instances.&lt;/p&gt;</description>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/35">Effects</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/11">Functional</category>
 <category domain="http://lambda-the-ultimate.org/taxonomy/term/21">Type Theory</category>
 <pubDate>Wed, 25 May 2016 13:54:59 +0000</pubDate>
</item>
</channel>
</rss>
