Results 1  10
of
17
Observational Equality, Now!
 A SUBMISSION TO PLPV 2007
, 2007
"... This paper has something new and positive to say about propositional equality in programming and proof systems based on the CurryHoward correspondence between propositions and types. We have found a way to present a propositional equality type • which is substitutive, allowing us to reason by repla ..."
Abstract

Cited by 23 (8 self)
 Add to MetaCart
This paper has something new and positive to say about propositional equality in programming and proof systems based on the CurryHoward correspondence between propositions and types. We have found a way to present a propositional equality type • which is substitutive, allowing us to reason by replacing equal for equal in propositions; • which reflects the observable behaviour of values rather than their construction: in particular, we have extensionality— functions are equal if they take equal inputs to equal outputs; • which retains strong normalisation, decidable typechecking and canonicity—the property that closed normal forms inhabiting datatypes have canonical constructors; • which allows inductive data structures to be expressed in terms of a standard characterisation of wellfounded trees; • which is presented syntactically—you can implement it directly, and we are doing so—this approach stands at the core of Epigram 2; • which you can play with now: we have simulated our system by a shallow embedding in Agda 2, shipping as part of the standard examples package for that system [20]. Until now, it has always been necessary to sacrifice some of these aspects. The closest attempt in the literature is Altenkirch’s construction of a setoidmodel for a system with canonicity and extensionality on top of an intensional type theory with proofirrelevant propositions [4]. Our new proposal simplifies Altenkirch’s construction by adopting McBride’s heterogeneous approach to equality [18].
Miniagda: Integrating sized and dependent types
 In Partiality and Recursion (PAR
, 2010
"... Sized types are a modular and theoretically wellunderstood tool for checking termination of recursive and productivity of corecursive definitions. The essential idea is to track structural descent and guardedness in the type system to make termination checking robust and suitable for strong abstrac ..."
Abstract

Cited by 12 (2 self)
 Add to MetaCart
Sized types are a modular and theoretically wellunderstood tool for checking termination of recursive and productivity of corecursive definitions. The essential idea is to track structural descent and guardedness in the type system to make termination checking robust and suitable for strong abstractions like higherorder functions and polymorphism. To study the application of sized types to proof assistants and programming languages based on dependent type theory, we have implemented a core language, MiniAgda, with explicit handling of sizes. New considerations were necessary to soundly integrate sized types with dependencies and pattern matching, which was made possible by modern concepts such as inaccessible patterns and parametric function spaces. This paper provides an introduction to MiniAgda by example and informal explanations of the underlying principles. 1
Termination Analysis of HigherOrder Functional Programs
 In APLAS 2005: The Third Asian Symposium on Programming Languages and Systems ( Kwangkeun
, 2005
"... This thesis concerns fully automatic termination analysis for higherorder purely functional programs, both strict and lazy. We build on existing work on sizechange termination, in which a program is deemed to terminate if any potential infinite sequence of calls would result in infinite descent in ..."
Abstract

Cited by 11 (1 self)
 Add to MetaCart
This thesis concerns fully automatic termination analysis for higherorder purely functional programs, both strict and lazy. We build on existing work on sizechange termination, in which a program is deemed to terminate if any potential infinite sequence of calls would result in infinite descent in a wellfounded data value. This was proposed for strict firstorder programs, and a termination analysis of the pure untyped λcalculus was subsequently obtained in this framework. We present a generalisation of this work, to handle realistic purely functional programming languages. From our general semantic framework, instances of the termination criterion are derived for both strict (callbyvalue) and lazy (callbyneed) and proved sound. It is shown that nontrivial higherorder and lazy programs can be proved to terminate. It is further shown that the analysis of lazy programs requires techniques beyond previous work on sizechange termination. Our analysis proceeds by extracting the call graph of a higherorder program, together with dataflow annotations; termination is then proved by showing that infinite paths in the
Semicontinuous sized types and termination
 In Zoltán Ésik, editor, Computer Science Logic, 20th International Workshop, CSL 2006, 15th Annual Conference of the EACSL
"... Abstract. Some typebased approaches to termination use sized types: an ordinal bound for the size of a data structure is stored in its type. A recursive function over a sized type is accepted if it is visible in the type system that recursive calls occur just at a smaller size. This approach is onl ..."
Abstract

Cited by 10 (5 self)
 Add to MetaCart
Abstract. Some typebased approaches to termination use sized types: an ordinal bound for the size of a data structure is stored in its type. A recursive function over a sized type is accepted if it is visible in the type system that recursive calls occur just at a smaller size. This approach is only sound if the type of the recursive function is admissible, i.e., depends on the size index in a certain way. To explore the space of admissible functions in the presence of higherkinded data types and impredicative polymorphism, a semantics is developed where sized types are interpreted as functions from ordinals into sets of strongly normalizing terms. It is shown that upper semicontinuity of such functions is a sufficient semantic criterion for admissibility. To provide a syntactical criterion, a calculus for semicontinuous functions is developed. 1.
Static Determination of Quantitative Resource Usage for HigherOrder Programs
 IN: 37TH ACM SYMP. ON PRINCIPLES OF PROG. LANGS
, 2010
"... We describe a new automatic static analysis for determining upperbound functions on the use of quantitative resources for strict, higherorder, polymorphic, recursive programs dealing with possiblyaliased data. Our analysis is a variant of Tarjan’s manual amortised cost analysis technique. We use ..."
Abstract

Cited by 10 (4 self)
 Add to MetaCart
We describe a new automatic static analysis for determining upperbound functions on the use of quantitative resources for strict, higherorder, polymorphic, recursive programs dealing with possiblyaliased data. Our analysis is a variant of Tarjan’s manual amortised cost analysis technique. We use a typebased approach, exploiting linearity to allow inference, and place a new emphasis on the number of references to a data object. The bounds we infer depend on the sizes of the various inputs to a program. They thus expose the impact of specific inputs on the overall cost behaviour. The key novel aspect of our work is that it deals directly with polymorphic higherorder functions without requiring sourcelevel transformations that could alter resource usage. We thus obtain safe and accurate compiletime bounds. Our work is generic in that it deals with a variety of quantitative resources. We illustrate our approach with reference to dynamic memory allocations/deallocations, stack usage, and worstcase execution time, using metrics taken from a real implementation on a simple microcontroller platform that is used in safetycritical automotive applications.
Implementing a normalizer using sized heterogeneous types
 In Workshop on Mathematically Structured Functional Programming, MSFP
, 2006
"... In the simplytyped lambdacalculus, a hereditary substitution replaces a free variable in a normal form r by another normal form s of type a, removing freshly created redexes on the fly. It can be defined by lexicographic induction on a and r, thus, giving rise to a structurally recursive normalize ..."
Abstract

Cited by 7 (1 self)
 Add to MetaCart
In the simplytyped lambdacalculus, a hereditary substitution replaces a free variable in a normal form r by another normal form s of type a, removing freshly created redexes on the fly. It can be defined by lexicographic induction on a and r, thus, giving rise to a structurally recursive normalizer for the simplytyped lambdacalculus. We generalize this scheme to simultaneous substitutions, preserving its simple termination argument. We further implement hereditary simultaneous substitutions in a functional programming language with sized heterogeneous inductive types, Fωb, arriving at an interpreter whose termination can be tracked by the type system of its host programming language.
Typebased termination of generic programs
 Science of Computer Programming
, 2007
"... Instances of a polytypic or generic program for a concrete recursive type often exhibit a recursion scheme that is derived from the recursion scheme of the instantiation type. In practice, the programs obtained from a generic program are usually terminating, but the proof of termination cannot be ca ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
Instances of a polytypic or generic program for a concrete recursive type often exhibit a recursion scheme that is derived from the recursion scheme of the instantiation type. In practice, the programs obtained from a generic program are usually terminating, but the proof of termination cannot be carried out with traditional methods as term orderings alone, since termination often crucially relies on the program type. In this article, it is demonstrated that typebased termination using sized types handles such programs very well. A framework for sized polytypic programming is developed which ensures (typebased) termination of all instances. 1
Termination Casts: A Flexible Approach to Termination with General Recursion
"... This paper proposes a typeandeffect system called T eq ↓ , which distinguishes terminating terms and total functions from possibly diverging terms and partial functions, for a lambda calculus with general recursion and equality types. The central idea is to include a primitive typeform “Terminate ..."
Abstract

Cited by 2 (2 self)
 Add to MetaCart
This paper proposes a typeandeffect system called T eq ↓ , which distinguishes terminating terms and total functions from possibly diverging terms and partial functions, for a lambda calculus with general recursion and equality types. The central idea is to include a primitive typeform “Terminates t”, expressing that term t is terminating; and then allow terms t to be coerced from possibly diverging to total, using a proof of Terminates t. We call such coercions termination casts, and show how to implement terminating recursion using them. For the metatheory of the system, we describe a translation from T eq ↓ to a logical theory of termination for general recursive, simply typed functions. Every typing judgment of T eq ↓ is translated to a theorem expressing the appropriate termination property of the computational part of the T eq ↓ term. 1
A SizeAware Type System with Algebraic Data Types  With proofs of soundness and decidability
, 2008
"... We present a sizeaware type system for a firstorder functional language with algebraic data types, where types are annotated with polynomials over size variables. We define how to generate typing rules for each data type, provided its user defined size function meets certain requirements. As an e ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
We present a sizeaware type system for a firstorder functional language with algebraic data types, where types are annotated with polynomials over size variables. We define how to generate typing rules for each data type, provided its user defined size function meets certain requirements. As an example, a program for balancing binary trees is type checked. The type system is shown to be sound with respect to the operational semantics in the class of shapely functions. Type checking is shown to be undecidable, however, decidability for a large subset of programs is guaranteed.
Typebased productivity of stream definitions in the calculus of constructions
 In LICS’13
, 2013
"... Abstract—Productivity of corecursive definitions is an essential property in proof assistants since it ensures logical consistency and decidability of type checking. Typebased mechanisms for ensuring productivity use types annotated with size information to track the number of elements produced in ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
Abstract—Productivity of corecursive definitions is an essential property in proof assistants since it ensures logical consistency and decidability of type checking. Typebased mechanisms for ensuring productivity use types annotated with size information to track the number of elements produced in corecursive definitions. In this paper, we propose an extension of the Calculus of Constructions—the theory underlying the Coq proof assistant—with a typebased criterion for ensuring productivity of stream definitions. We prove strong normalization and logical consistency. Furthermore, we define an algorithm for inferring size annotations in types. These results can be easily extended to handle general coinductive types. I.