Subset Coercions in Coq
نویسنده
چکیده
We propose a new language for writing programs with dependent types which can be elaborated into partial Coq terms. This language permits to establish a phase distinction between writing and proving algorithms in the Coq environment. Concretely, this means 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 Coq proof apparatus. This is achieved by extending conversion to an equivalence which relates types and subsets based on them, a technique originating from the “Predicate subtyping” feature of PVS and following mathematical convention. The typing judgements can be translated to the Calculus of (Co-)Inductive Constructions (Cic) by means of an interpretation which inserts coercions at the appropriate places. These coercions can contain existential variables representing the propositional parts of the final term, corresponding to proof obligations (or PVS type-checking conditions). A prototype implementation of this process is integrated with the Coq environment.
منابع مشابه
Heq: A Coq library for Heterogeneous Equality
We give an introduction to the library Heq, which provides a set of tactics to manipulate heterogeneous equality and explicit coercion, such as rewriting of heterogeneous equality and elimination and relocation of explicit coercions.
متن کاملA Constructive Algebraic Hierarchy in Coq
We describe a framework of algebraic structures in the proof assistant Coq. We have developed this framework as part of the FTA project in Nijmegen, in which a constructive proof of the Fundamental Theorem of Algebra has been formalized in Coq. The algebraic hierarchy that is described here is both abstract and structured. Structures like groups and rings are part of it in an abstract way, defi...
متن کاملCoq à la Tarski: a predicative calculus of constructions with explicit subtyping
The predicative Calculus of Inductive Constructions (pCIC), the theory behind the Coq proof system, contains an infinite hierarchy of predicative universes T ype 0 ∈ T ype 1 ∈ T ype 2 ∈. .. and an impredicative universe P rop for propositions, together with an implicit cumulativity relation P rop ⊆ T ype 0 ⊆ T ype 1 ⊆ T ype 2 ⊆. .. . Subtyping in Coq is implicit, and is handled by the kernel. A...
متن کاملPackaging Mathematical Structures
This paper proposes generic design patterns to define and combine algebraic structures, using dependent records, coercions and type inference, inside the Coq system. This alternative to telescopes in particular allows multiple inheritance, maximal sharing of notations and theories, and automated structure inference. Our methodology is robust enough to support a hierarchy comprising a broad vari...
متن کاملThe Rooster and the Syntactic Bracket
We propose an extension of pure type systems with an algebraic presentation of inductive and co-inductive type families with proper indices. This type theory supports coercions toward from smaller sorts to bigger sorts via explicit type construction, as well as impredicative sorts. Type families in impredicative sorts are constructed with a bracketing operation. The necessary restrictions of pa...
متن کامل