## Partiality, State and Dependent Types

### Cached

### Download Links

Citations: | 1 - 1 self |

### BibTeX

@MISC{Svendsen_partiality,state,

author = {Kasper Svendsen and Lars Birkedal and Aleksandar Nanevski},

title = {Partiality, State and Dependent Types},

year = {}

}

### OpenURL

### Abstract

Partial type theories allow reasoning about recursively-defined computations using fixed-point induction. However, fixed-point induction is only sound for admissible types and not all types are admissible in sufficiently expressive dependent type theories. Previous solutions have either introduced explicit admissibility conditions on the use of fixed points, or limited the underlying type theory. In this paper we propose a third approach, which supports Hoare-style partial correctness reasoning, without admissibility conditions, but at a tradeoff that one cannot reason equationally about effectful computations. The resulting system is still quite expressive and useful in practice, which we confirm by an implementation as an extension of Coq.

### Citations

1439 | Object-Oriented Software Construction
- Meyer
- 2000
(Show Context)
Citation Context ...ams. This signature too is a dependent record, providing types for all the array methods. Just as in the case of setfin and In, the signature may also include properties, similar to object invariants =-=[13, 15]-=-. For example, we have found it useful in practice to hide from the clients the definitions of the array type and the array shape predicate, but expose that two arrays in stable states; that is, betwe... |

413 |
Proof of correctness of data representations
- Hoare
- 1972
(Show Context)
Citation Context ...ams. This signature too is a dependent record, providing types for all the array methods. Just as in the case of setfin and In, the signature may also include properties, similar to object invariants =-=[13, 15]-=-. For example, we have found it useful in practice to hide from the clients the definitions of the array type and the array shape predicate, but expose that two arrays in stable states; that is, betwe... |

268 | Local reasoning about programs that alter data structures
- O’Hearn, Reynolds, et al.
- 2001
(Show Context)
Citation Context ...some specification-level value, such as f above, the dependency can be expressed by an ordinary propositional quantification. Hoare types employ small footprint specifications, as in separation logic =-=[20]-=-, whereby the specifications only describe the parts of the heap that the computation traverses. The untraversed parts are by default invariant. To illustrate, consider the type for the method new tha... |

112 |
Categorical Logic and Type Theory
- Jacobs
- 1999
(Show Context)
Citation Context .... The model is based on a standard realizability model of partial equivalence relations (PERs) and assemblies over a combinatory algebra A. These give rise to a model of the Calculus of Constructions =-=[14]-=-, with set modelled using PERs. Restricting PERs to complete PERs (i.e., PERs closed under limits of ω-chains)over a suitable universal domain, allows one to model recursion in a simply-typed setting... |

74 |
The Vienna Development Method: The MetaLanguage
- Bjørner, Jones
- 1978
(Show Context)
Citation Context ...input heap h and output heap m. In particular, the result r is indeed the array value at index k (r = f k), and the input heap is unchanged (m = h). Unlike in ordinary Hoare logic, but similar to VDM =-=[6]-=-, our postcondition is parametrized wrt. both input and the output heaps in order to directly express the relationship between the two. In particular, when this relationship depends on some specificat... |

48 |
Recursion over realizability structures
- Amadio
- 1991
(Show Context)
Citation Context ... with set modelled using PERs. Restricting PERs to complete PERs (i.e., PERs closed under limits of ω-chains)over a suitable universal domain, allows one to model recursion in a simply-typed setting =-=[4]-=-, or in a dependently-typed setting, but without strong Σ types [21]. Our contribution is in identifying a set of complete monotone PERs that are closed under Σ types and Hoare types. Complete PERs do... |

37 | Wellfounded trees in categories
- Moerdijk, Palmgren
- 2000
(Show Context)
Citation Context ...W-types at the set universe supports elimination over large types. Semantically, in the setting of locally cartesian closed categories, W-types are modelled as initial algebras of polynomial functors =-=[16]-=-. In the setting of split closed comprehension categories we define: Definition 9. A split closed comprehension category P : E → B→ has split W-types, if for every I ∈ B, X ∈ EI and Y ∈ E {X} the endo... |

36 | Ynot: Dependent types for imperative programs
- Nanevski, Morrisett, et al.
- 2008
(Show Context)
Citation Context ... which either lacks higher-order store [19], lacks strong Σ types [21], or whose soundness has been justified using specific syntactic methods that do not scale to fully general inductive definitions =-=[17, 18]-=-. The model is based on a standard realizability model of partial equivalence relations (PERs) and assemblies over a combinatory algebra A. These give rise to a model of the Calculus of Constructions ... |

34 |
Partial objects in constructive type theory
- Constable, Smith
- 1987
(Show Context)
Citation Context ...fication. However, to maintain soundness, they typically require all computations to be pure and terminating, severely limiting their use as general purpose programming languages. Constable and Smith =-=[9]-=- proposed adding partiality by introducing a type ○τ of potentially non-terminating computations of type τ, along with the following fixed point principle for typing recursively defined computations: ... |

34 |
A.: A Small Scale Reflection Extension for the Coq system
- Gonthier, Mahboubi
(Show Context)
Citation Context ...ix. As iHTT is an extension of CIC, we have implemented iHTT as an axiomatic extension of Coq [1], available at: http://www.itu.dk/people/kasv/ihtt.tgz. The implementation is carried out in Ssreflect =-=[12]-=- (a recent extension of Coq), based on the previous implementation of predicative Hoare Type Theory [19]. Details and proofs can be found in the accompanying technical report [23]. 2 Hoare types by ex... |

29 | General Recursion via Coinductive Types
- Capretta
(Show Context)
Citation Context ...e partial function. This allows the definition of partial computations by general recursion, but does not model non-termination, as f can only be applied to arguments on which it terminates. Capretta =-=[8]-=- proposed an alternative co-inductive representation, which does model non-termination, representing a partial function f : A ⇀ B as a total function f : A → B v , where B v is co-inductive type of pa... |

22 |
Hoare type theory, polymorphism and separation
- Nanevski, Morrisett, et al.
(Show Context)
Citation Context ...(P, Q), standing for computations with pre-condition P , post-condition Q, that diverge or terminate with a value of type τ. The resulting type theory is an impredicative variant of Hoare Type Theory =-=[17]-=-, which differs from previous work on Hoare Type Theory in the scope of features considered and the semantic approach. In particular, this paper is the first to clarify semantically the issue of admis... |

22 | Structuring the verification of heap-manipulating programs
- Nanevski, Vafeiadis, et al.
- 2010
(Show Context)
Citation Context ...to the heap, and (2) supporting arbitrary Σ types, and more generally, inductive types. In this respect iHTT differs from the previous work on Hoare Type Theory, which either lacks higher-order store =-=[19]-=-, lacks strong Σ types [21], or whose soundness has been justified using specific syntactic methods that do not scale to fully general inductive definitions [17, 18]. The model is based on a standard ... |

15 | Representing inductively defined sets by wellorderings in Martin-Löf’s type theory
- Dybjer
- 1997
(Show Context)
Citation Context ...rnative presentation, based on W-types (a type-theoretic formalization of well-founded trees), which is strong enough to represent a wide range of inductive types in extensional models (such as ours) =-=[11, 3]-=-. Since W-types in addition have a simple categorical semantics, we have chosen to show that iHTT models inductive types by showing that it models W-types. Specifically, we show that it models W-types... |

15 | A realizability model of impredicative Hoare type theory
- Peterson, Birkedal, et al.
- 2008
(Show Context)
Citation Context ...derlying dependent type theory is restricted in such a way that one can only form types that are trivially admissible. This approach has, e.g., been explored in recent work on Hoare Type Theory (HTT) =-=[21]-=-. The restrictions exclude usage of subset types and Σ types, which are often used for expressing properties of computations and for modularity. Another problem with this approach is that since it lim... |

10 | Simple general recursion in type theory
- Bove
(Show Context)
Citation Context ...elation to the work on admissibility by Crary [10] in the introduction. Below we first discuss related work on partiality, followed by related work on partial correctness reasoning.Bove and Capretta =-=[7]-=- proposed representing a partial function f : A ⇀ B as a total function f : Πa : A. P (a) → B, defined by recursion over an inductively defined predicative P : A → prop, expressing the domain of the p... |

6 | Representing nested inductive types using Wtypes
- Abbott, Altenkirch, et al.
- 2004
(Show Context)
Citation Context ...rnative presentation, based on W-types (a type-theoretic formalization of well-founded trees), which is strong enough to represent a wide range of inductive types in extensional models (such as ours) =-=[11, 3]-=-. Since W-types in addition have a simple categorical semantics, we have chosen to show that iHTT models inductive types by showing that it models W-types. Specifically, we show that it models W-types... |

6 | Admissibility of Fixpoint Induction over Partial Types
- Crary
- 1998
(Show Context)
Citation Context ...vely defined computations: if M : ○τ → ○τ then fix(M) : ○τ Unfortunately, in sufficiently expressive dependent type theories, there exists types τ for which the above fixed point principle is unsound =-=[10]-=-. For instance, in type theories with subset-types, the fixed point principle allows reasoning by a form of fixed point induction, which is only sound for admissible predicates (a predicate is admissi... |

5 | Realisability semantics of parametric polymorphism, general references, and recursive types
- Birkedal, Støvring, et al.
- 2010
(Show Context)
Citation Context ...orld is modified to contain the new type (semantically, the per R) upon update. Thus our notion and use of worlds is different from the use of worlds in models of “weak” ML-like reference types, e.g. =-=[5]-=-; in particular, note that we do not index every type by a world, but only use worlds to interpret the type of heaps and the operations thereon (see also the next subsection for further discussion). C... |

3 | Synthetic domain theory in type theory: Another logic of computable functions
- Reus
- 1996
(Show Context)
Citation Context ...and reason about partial computations inside the type theory, but does not extend the type theory itself with partial computations. This approach has for instance been studied and implemented by Reus =-=[22]-=-, who formalized Synthetic Domain Theory in the Lego proof checker. The resulting type theory can be seen as a very expressive version of LCF. The synthetic approach alleviates the need for continuity... |