Results 1 -
6 of
6
Retrieving Library Identifiers via Equational Matching of Types
- Proceedings of the 10th International Conference on Automated Deduction, volume 449 of LNAI
, 1992
"... In functional programming environments, one can use types as search keys in program libraries, if one disregards trivial differences in argument order or currying. A way to do this is to identify types that are isomorphic in every Cartesian closed category; simpler put, types should be identified if ..."
Abstract
-
Cited by 24 (1 self)
- Add to MetaCart
In functional programming environments, one can use types as search keys in program libraries, if one disregards trivial differences in argument order or currying. A way to do this is to identify types that are isomorphic in every Cartesian closed category; simpler put, types should be identified if they are equal under an arithmetic interpretation, with Cartesian product as multiplication and function space as exponentiation. When the type system is polymorphic, one may also want to retrieve identifiers of types more general than the query. This paper describes a method to do both, that is, an algorithm for pattern matching modulo canonical CCC-isomorphism. The algorithm returns a finite complete set of matchers. An implementation shows that satisfactory speed can be achieved for library search. Contents 1 Introduction 2 2 Unification/Matching in Equational Theories 6 3 Comparison with Previous Work 9 4 An Algorithm for \Gamma-matching 14 5 Practical Experience of Library Search 25 6...
Memoization in type-directed partial evaluation
- Proceedings of the 2002 ACM SIGPLAN/SIGSOFT Conference on Generative Programming and Component Engineering, number 2487 in Lecture Notes in Computer Science
, 2002
"... Abstract. We use a code generator—type-directed partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express th ..."
Abstract
-
Cited by 14 (6 self)
- Add to MetaCart
Abstract. We use a code generator—type-directed partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the functions and type-directed partial evaluation provides a convenient setting to obtain the normal form of their composition. However, off-the-shelf type-directed partial evaluation turns out to yield gigantic normal forms. We identify that this gigantism is due to redundancies, and that these redundancies originate in the handling of sums, which uses delimited continuations. We successfully eliminate these redundancies by extending type-directed partial evaluation with memoization capabilities. The result only works for pure functional programs, but it provides an unexpected use of code generation and it yields orders-of-magnitude improvements both in time and in space for type isomorphisms. 1
Remarks on isomorphisms in typed lambda calculi with empty and sum types
- In Proc. of the 17 th Annual IEEE Symposium on Logic in Computer Science (LICS’02
, 2002
"... Tarski asked whether the arithmetic identities taught in high school are complete for showing all arithmetic equations valid for the natural numbers. The answer to this question for the language of arithmetic expressions using a constant for the number one and the operations of product and exponenti ..."
Abstract
-
Cited by 8 (2 self)
- Add to MetaCart
Tarski asked whether the arithmetic identities taught in high school are complete for showing all arithmetic equations valid for the natural numbers. The answer to this question for the language of arithmetic expressions using a constant for the number one and the operations of product and exponentiation is affirmative, and the complete equational theory also characterises isomorphism in the typed lambda calculus, where the constant for one and the operations of product and exponentiation respectively correspond to the unit type and the product and arrow type constructors. This paper studies isomorphisms in typed lambda calculi with empty and sum types from this viewpoint. We close an open problem by establishing that the theory of type isomorphisms in the presence of product, arrow, and sum types (with or without the unit type) is not finitely axiomatisable. Further, we observe that for type theories with arrow, empty and sum types the correspondence between isomorphism and arithmetic equality generally breaks down, but that it still holds in some particular cases including that of type isomorphism with the empty type and equality with zero. 1
Efficient Algorithms for Isomorphisms of Simple Types
"... The first order isomorphism problem is to decide whether two nonrecursive types using product- and function-type constructors, are isomorphic under the axioms of commutative and associative products, and currying and distributivity of functions over products. We show that this problem can be solved ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
The first order isomorphism problem is to decide whether two nonrecursive types using product- and function-type constructors, are isomorphic under the axioms of commutative and associative products, and currying and distributivity of functions over products. We show that this problem can be solved in 2 is the input size. This result improves upon the space bounds of the best previous algorithm. We also describe an time algorithm for the linear isomorphism problem, which does not include the distributive axiom, whereby improving upon the time of the best previous algorithm for this problem.
Computers and universal algebra: some directions, Algebra Universalis 34
- Algebra Universalis
, 1995
"... The microcomputer revolution has captured the interest of many mathematicians — and Alan Day was certainly a leader in the new wave of computer enthusiasts. Early on he worked out an arrangement with Apple computers; and he was always a strong supporter of their machines. One of his early projects w ..."
Abstract
-
Cited by 3 (0 self)
- Add to MetaCart
The microcomputer revolution has captured the interest of many mathematicians — and Alan Day was certainly a leader in the new wave of computer enthusiasts. Early on he worked out an arrangement with Apple computers; and he was always a strong supporter of their machines. One of his early projects was to create a large database of papers in universal algebra and lattice theory. In the mid 1980’s he distributed to his colleagues a program to draw lattices which had menus to check properties such as distributivity and modularity. And the last lecture I heard him give was a lovely talk on relational databases, at McMaster in the Fall of 1989. Unfortunately I am not qualified to give a detailed commentary on Alan’s work in computer science ([20], [21]). But I will discuss some aspects of computers and universal algebra which I think Alan would have found interesting. 1 Some Basic Questions The interest in general algebra and computing goes back at least to Kozen’s 1977 paper [38] in which he looks at the complexity of various questions for finitely presented algebras. In his work there is no background equational theory, such as groups, to take into consideration. With this convention he shows that the word problem, the finiteness problem, the triviality problem, and the subalgebra membership problem have polynomial time algorithms,
Keeping sums under control
, 2004
"... In a recent paper [31], I presented with Marcelo Fiore and Roberto Di Cosmo a new normalisation tool for the λ-calculus with sum types, based on the technique of normalisation by evaluation, and more precisely on techniques developped by Olivier Danvy for partial evaluation, using control operators. ..."
Abstract
- Add to MetaCart
In a recent paper [31], I presented with Marcelo Fiore and Roberto Di Cosmo a new normalisation tool for the λ-calculus with sum types, based on the technique of normalisation by evaluation, and more precisely on techniques developped by Olivier Danvy for partial evaluation, using control operators. The main characteristic of this tool is that it produces a result in a canonical form we introduced. That is to say: two βη-equivalent terms will be normalised into (almost) identical terms. It was not the case with the traditional algorithm, which could even lead to an explosion of the size of code. This canonical form is an η-long β-normal form with constraints, which capture the definition of η-long normal form for the λ-calculus without sums, and reduces drastically the η-conversion possibilities for sums. The present paper recall the definition of these normal forms and the normalisation algorithm, and shows how it is possible to use these tools to solve a problem of characterization of type isomorphisms. Indeed, the canonical form allowed to find the complicated counterexamples we exhibited in another work [6], that proves that type isomorphisms in the λ-calculus with sums are not finitely axiomatisable. What’s more, when proving that these terms are isomorphisms, the new partial evaluation algorithm avoids an explosion of the size of the term that arises with the old one.

