# Semantic subtyping with an SMT solver

@inproceedings{Bierman2010SemanticSW, title={Semantic subtyping with an SMT solver}, author={G. Bierman and A. D. Gordon and Catalin Hritcu and D. Langworthy}, booktitle={ICFP '10}, year={2010} }

We study a first-order functional language with the novel combination of the ideas of refinement type (the subset of a type to satisfy a Boolean expression) and type-test (a Boolean expression testing whether a value belongs to a type). Our core calculus can express a rich variety of typing idioms; for example, intersection, union, negation, singleton, nullable, variant, and algebraic types are all derivable. We formulate a semantics in which expressions denote terms, and types are interpreted… Expand

#### Topics from this paper

#### 63 Citations

A Logical Approach To Deciding Semantic Subtyping - Supporting function, intersection, negation, and polymorphic types

- Mathematics
- 2013

We consider a type algebra equipped with recursive, product, function, intersection, union, and complement types together with type variables and implicit universal quantification over them. We… Expand

A Logical Approach to Deciding Semantic Subtyping

- Computer Science
- TOPL
- 2015

A type algebra equipped with recursive, product, function, intersection, union, and complement types, together with type variables, provides a powerful polymorphic type system aiming at maintaining full static type-safety of functional programs that manipulate trees, even with higher-order functions, which is particularly useful in the context of XML. Expand

Parametric polymorphism and semantic subtyping: the logical connection

- Computer Science
- ICFP '11
- 2011

A type algebra equipped with recursive, product, function, intersection, union, and complement types together with type variables and implicit universal quantification over them, providing a powerful polymorphic type system aiming at maintaining full static type-safety of functional programs that manipulate trees, even with higher-order functions, which is particularly useful in the context of XML. Expand

Functional Extensionality for Refinement Types

- Computer Science
- ArXiv
- 2021

A new approach to equality in Liquid Haskell is developed: a propositional equality in a library the authors call PEq, which avoids the unsoundness while still proving useful equalities at higher types; its use in several case studies is demonstrated. Expand

Formulog: Datalog for SMT-based static analysis

- Computer Science
- Proc. ACM Program. Lang.
- 2020

This work proposes Formulog, a domain-specific language that makes it possible to write a range of SMT-based static analyses in a way that is both close to their formal specifications and amenable to high-level optimizations and efficient evaluation. Expand

Nested refinements: a logic for duck typing

- Computer Science
- POPL '12
- 2012

A core calculus is presented that merges SMT-based logical implication and syntactic subtyping to automatically typecheck sophisticated dynamic language programs and can precisely reason about the interaction of higher-order functions, polymorphism, and dictionaries. Expand

Logical types for untyped languages

- Computer Science
- ICFP '10
- 2010

The reformulate occurrence typing for Scheme derives propositional logic formulas that hold when an expression evaluates to true or false, respectively, and the implementation of this revised occurrence type system thus copes with many more untyped programming idioms than the original system. Expand

Programming Up to Congruence (Extended version)

- Mathematics
- 2014

This paper presents the design of ZOMBIE, a dependently-typed programming language that uses an adaptation of a congruence closure algorithm for proof and type inference. This algorithm allows the… Expand

Monadic Refinement Types for Verifying JavaScript Programs

- Computer Science
- 2012

Researchers have developed several special-purpose type systems and program logics to analyze JavaScript and other dynamically typed programming languages. Still, no prior system can precisely reason… Expand

Programming up to Congruence Vilhelm Sjöberg

- 2014

This paper presents the design of ZOMBIE, a dependently-typed programming language that uses an adaptation of a congruence closure algorithm for proof and type inference. This algorithm allows the… Expand

#### References

SHOWING 1-10 OF 139 REFERENCES

Subtyping with Singleton Types

- Computer Science
- CSL
- 1994

We give syntax and a PER-model semantics for a typed λ-calculus with subtypes and singleton types. The calculus may be seen as a minimal calculus of subtyping with a simple form of dependent types.… Expand

A unified system of type refinements

- Computer Science
- 2007

This work presents a system of type refinements that unifies and extends past work on datasort and index refinements, and provides unified mechanisms of definite types, such as intersections, and indefinite types,such as unions. Expand

Dependent Types with Subtyping and Late-Bound Overloading

- Computer Science, Mathematics
- Inf. Comput.
- 2001

A calculus with dependent types, subtyping, and late-bound overloading is presented, which is motivated by several practical needs that range form the definition of logic encodings to proof specialization and reuse and to object-oriented extension of the SML module system. Expand

Logical types for untyped languages

- Computer Science
- ICFP '10
- 2010

The reformulate occurrence typing for Scheme derives propositional logic formulas that hold when an expression evaluates to true or false, respectively, and the implementation of this revised occurrence type system thus copes with many more untyped programming idioms than the original system. Expand

Dependent types from counterexamples

- Computer Science
- POPL '10
- 2010

The paper presents the type inference system, reports on the experience with a prototype implementation that infers dependent types for a subset of the Ocaml language, and makes non-trivial use of "linear" intersection types in the refinement phase. Expand

Type-based data structure verification

- Computer Science
- PLDI '09
- 2009

A refinement type-based approach for the static verification of complex data structure invariants that reduces the manual annotation required to verify complex properties like sortedness, balancedness, binary-search-ordering, and acyclicity by more than an order of magnitude. Expand

Efficient static analysis of XML paths and types

- Computer Science
- PLDI '07
- 2007

An algorithm to solve XPath decision problems under regular tree type constraints and its use to statically type-check XPath queries is presented and the decidability of a logic with converse for finite ordered trees is proved. Expand

A Bidirectional Refinement Type System for LF

- Computer Science, Mathematics
- Electron. Notes Theor. Comput. Sci.
- 2008

A system of refinement types for LF in the style of recent formulations where only canonical forms are well-typed, leading to a straightforward proof of decidability of type-checking even in the presence of intersection types. Expand

Tridirectional typechecking

- Computer Science
- POPL '04
- 2004

A decidable formulation for this type assignment system based on bidirectional checking is provided, combining type synthesis and analysis following logical principles. Expand

Subset Coercions in Coq

- Computer Science
- TYPES
- 2006

A new language for writing programs with dependent types on top of the COQ proof assistant allowing to write algorithms as easily as in a practical functional programming language whilst giving them as rich a specification as desired and proving that the code meets the specification using the whole COQProof apparatus. Expand