2,981 research outputs found
Meta-F*: Proof Automation with SMT, Tactics, and Metaprograms
We introduce Meta-F*, a tactics and metaprogramming framework for the F*
program verifier. The main novelty of Meta-F* is allowing the use of tactics
and metaprogramming to discharge assertions not solvable by SMT, or to just
simplify them into well-behaved SMT fragments. Plus, Meta-F* can be used to
generate verified code automatically.
Meta-F* is implemented as an F* effect, which, given the powerful effect
system of F*, heavily increases code reuse and even enables the lightweight
verification of metaprograms. Metaprograms can be either interpreted, or
compiled to efficient native code that can be dynamically loaded into the F*
type-checker and can interoperate with interpreted code. Evaluation on
realistic case studies shows that Meta-F* provides substantial gains in proof
development, efficiency, and robustness.Comment: Full version of ESOP'19 pape
Homotopy Type Theory in Lean
We discuss the homotopy type theory library in the Lean proof assistant. The
library is especially geared toward synthetic homotopy theory. Of particular
interest is the use of just a few primitive notions of higher inductive types,
namely quotients and truncations, and the use of cubical methods.Comment: 17 pages, accepted for ITP 201
lim+, delta+, and Non-Permutability of beta-Steps
Using a human-oriented formal example proof of the (lim+) theorem, i.e. that
the sum of limits is the limit of the sum, which is of value for reference on
its own, we exhibit a non-permutability of beta-steps and delta+-steps
(according to Smullyan's classification), which is not visible with
non-liberalized delta-rules and not serious with further liberalized
delta-rules, such as the delta++-rule. Besides a careful presentation of the
search for a proof of (lim+) with several pedagogical intentions, the main
subject is to explain why the order of beta-steps plays such a practically
important role in some calculi.Comment: ii + 36 page
Refinement Types for Logical Frameworks and Their Interpretation as Proof Irrelevance
Refinement types sharpen systems of simple and dependent types by offering
expressive means to more precisely classify well-typed terms. We present a
system of refinement types for LF in the style of recent formulations where
only canonical forms are well-typed. Both the usual LF rules and the rules for
type refinements are bidirectional, leading to a straightforward proof of
decidability of typechecking even in the presence of intersection types.
Because we insist on canonical forms, structural rules for subtyping can now be
derived rather than being assumed as primitive. We illustrate the expressive
power of our system with examples and validate its design by demonstrating a
precise correspondence with traditional presentations of subtyping. Proof
irrelevance provides a mechanism for selectively hiding the identities of terms
in type theories. We show that LF refinement types can be interpreted as
predicates using proof irrelevance, establishing a uniform relationship between
two previously studied concepts in type theory. The interpretation and its
correctness proof are surprisingly complex, lending support to the claim that
refinement types are a fundamental construct rather than just a convenient
surface syntax for certain uses of proof irrelevance
On Irrelevance and Algorithmic Equality in Predicative Type Theory
Dependently typed programs contain an excessive amount of static terms which
are necessary to please the type checker but irrelevant for computation. To
separate static and dynamic code, several static analyses and type systems have
been put forward. We consider Pfenning's type theory with irrelevant
quantification which is compatible with a type-based notion of equality that
respects eta-laws. We extend Pfenning's theory to universes and large
eliminations and develop its meta-theory. Subject reduction, normalization and
consistency are obtained by a Kripke model over the typed equality judgement.
Finally, a type-directed equality algorithm is described whose completeness is
proven by a second Kripke model.Comment: 36 pages, superseds the FoSSaCS 2011 paper of the first author,
titled "Irrelevance in Type Theory with a Heterogeneous Equality Judgement
Elaboration in Dependent Type Theory
To be usable in practice, interactive theorem provers need to provide
convenient and efficient means of writing expressions, definitions, and proofs.
This involves inferring information that is often left implicit in an ordinary
mathematical text, and resolving ambiguities in mathematical expressions. We
refer to the process of passing from a quasi-formal and partially-specified
expression to a completely precise formal one as elaboration. We describe an
elaboration algorithm for dependent type theory that has been implemented in
the Lean theorem prover. Lean's elaborator supports higher-order unification,
type class inference, ad hoc overloading, insertion of coercions, the use of
tactics, and the computational reduction of terms. The interactions between
these components are subtle and complex, and the elaboration algorithm has been
carefully designed to balance efficiency and usability. We describe the central
design goals, and the means by which they are achieved
A Dependently Typed Language with Nontermination
We propose a full-spectrum dependently typed programming language, Zombie, which supports general recursion natively. The Zombie implementation is an elaborating typechecker. We prove type saftey for a large subset of the Zombie core language, including features such as computational irrelevance, CBV-reduction, and propositional equality with a heterogeneous, completely erased elimination form. Zombie does not automatically beta-reduce expressions, but instead uses congruence closure for proof and type inference. We give a specification of a subset of the surface language via a bidirectional type system, which works up-to-congruence, and an algorithm for elaborating expressions in this language to an explicitly typed core language. We prove that our elaboration algorithm is complete with respect to the source type system. Zombie also features an optional termination-checker, allowing nonterminating programs returning proofs as well as external proofs about programs
Type Theory Unchained: Extending Agda with User-Defined Rewrite Rules
Dependently typed languages such as Coq and Agda can statically guarantee the correctness of our proofs and programs. To provide this guarantee, they restrict users to certain schemes - such as strictly positive datatypes, complete case analysis, and well-founded induction - that are known to be safe. However, these restrictions can be too strict, making programs and proofs harder to write than necessary. On a higher level, they also prevent us from imagining the different ways the language could be extended.
In this paper I show how to extend a dependently typed language with user-defined higher-order non-linear rewrite rules. Rewrite rules are a form of equality reflection that is applied automatically by the typechecker. I have implemented rewrite rules as an extension to Agda, and I give six examples how to use them both to make proofs easier and to experiment with extensions of type theory. I also show how to make rewrite rules interact well with other features of Agda such as ?-equality, implicit arguments, data and record types, irrelevance, and universe level polymorphism. Thus rewrite rules break the chains on computation and put its power back into the hands of its rightful owner: yours
Contextual Refinement Types
We develop an extension of the proof environment Beluga with datasort
refinement types and study its impact on mechanized proofs. In particular, we
introduce refinement schemas, which provide fine-grained classification for the
structures of contexts and binders. Refinement schemas are helpful in concisely
representing certain proofs that rely on relations between contexts. Our
formulation of refinements combines the type checking and sort checking phases
into one by viewing typing derivations as outputs of sorting derivations. This
allows us to cleanly state and prove the conservativity of our extension.Comment: In Proceedings LFMTP 2023, arXiv:2311.0991
Type Classes for Mathematics in Type Theory
The introduction of first-class type classes in the Coq system calls for
re-examination of the basic interfaces used for mathematical formalization in
type theory. We present a new set of type classes for mathematics and take full
advantage of their unique features to make practical a particularly flexible
approach formerly thought infeasible. Thus, we address both traditional proof
engineering challenges as well as new ones resulting from our ambition to build
upon this development a library of constructive analysis in which abstraction
penalties inhibiting efficient computation are reduced to a minimum.
The base of our development consists of type classes representing a standard
algebraic hierarchy, as well as portions of category theory and universal
algebra. On this foundation we build a set of mathematically sound abstract
interfaces for different kinds of numbers, succinctly expressed using
categorical language and universal algebra constructions. Strategic use of type
classes lets us support these high-level theory-friendly definitions while
still enabling efficient implementations unhindered by gratuitous indirection,
conversion or projection.
Algebra thrives on the interplay between syntax and semantics. The
Prolog-like abilities of type class instance resolution allow us to
conveniently define a quote function, thus facilitating the use of reflective
techniques
- …