A characterization of lambda definable tree operations (original) (raw)

A Characterisation of Lambda Definable Tree Operations

Information and Computation/information and Control, 1990

I-language over simple type structure is considered. Type Y== (0 --t (0 -+ 0)) + (0 -+ 0) is called a binary tree type because of the isomorphism between binary trees and closed terms of this type. Therefore any closed term of type Y+(Y-P ... -P (Y + Y) ) represents an n-ary tree function. The problem is to characterize tree operations represented by the closed terms of the examined type. It is proved that the set of 1 definable tree operations is the minimal set containing constant functions and projections and closed for composition and the limited version of recursion. This result should be contrasted with the results of Schwichtenberg and Statman, which characterize the I-definable functions over natural number types (0 + 0) -+ (0 --+ 0) by composition only, as well as with the result of Zaionc for I-definable functions over type (0 -t 0) + ((0 + 0) + (0 + 0)) which are also characterized by means of composition. 0 1990 Academic Press. Inc.

Word operation definable in the typed λ-calculus

Theoretical Computer Science, 1987

=(O+O)+ (( 0 + 0) + (0 + 0)) is called a binary word type because of the isc-morphism between words over a binary alphabet and closed terms of this type. Therefore, any term of type B-, (B-, . ..+(B_.B)~.* ) represents an n-ary word function. The problem is: what class of word func&ire a:e represented by the closed terms of the examined type. It is proved that there exists a finite base of word functions such that any A-definable word function is some composition of functions from the base. The algorithm which, for every closed term, returns the function in the form of a composition of basic operations is given. The main result is proved for a binary alphabet only, but can be easily extended to any finite alphabet. This result is a natural extension of the Schwichtenberg theorem (see and Statman (1979)) which solves the same problem for the natural number type N = (0 +.O) + (0 + 0).

Binary Tree Arithmetic with Generalized Constructors

arXiv (Cornell University), 2013

We describe arithmetic computations in terms of operations on some well known free algebras (S1S, S2S and ordered rooted binary trees) while emphasizing the common structure present in all them when seen as isomorphic with the set of natural numbers. Constructors and deconstructors seen through an initial algebra semantics are generalized to recursively defined functions obeying similar laws. Implementations using Scala's apply and unapply are discussed together with an application to a realistic arbitrary size arithmetic package written in Scala, based on the free algebra of rooted ordered binary trees, which also supports rational number operations through an extension to signed rationals of the Calkin-Wilf bijection. Categories and Subject Descriptors D.3.3 [PROGRAMMING LANGUAGES]: Language Constructs and Features-Data types and structures General Terms Algorithms, Languages, Theory Keywords arithmetic computations with free algebras, generalized constructors, declarative modeling of computational phenomena, bijective Gödel numberings and algebraic datatypes, Calkin-Wilf bijection between natural and rational numbers

Exploring the Regular Tree Types

Lecture Notes in Computer Science, 2006

In this paper we use the Epigram language to define the universe of regular tree types-closed under empty, unit, sum, product and least fixpoint. We then present a generic decision procedure for Epigram's in-built equality at each type, taking a complementary approach to that of Benke, Dybjer and Jansson . We also give a generic definition of map, taking our inspiration from Jansson and Jeuring . Finally, we equip the regular universe with the partial derivative which can be interpreted functionally as Huet's notion of 'zipper', as suggested by McBride in and implemented (without the fixpoint case) in Generic Haskell by Hinze, Jeuring and Löh . We aim to show through these examples that generic programming can be ordinary programming in a dependently typed language.

Idempotent tree languages

Demonstratio Mathematica

A tree language of a fixed type τ is any set of terms of type τ. We consider here a binary operation + n on the set W τ (X n) of all n-ary terms of type τ , which results in semigroup (W τ (X n), + n). We characterize languages which are idempotent with respect to this binary operation, and look at varieties of tree languages containing idempotent languages. We also compare properties of semigroup homomorphisms from (P(W τ (X n)); + n) to (P(W τ (X m)); + m) with properties of homomorphisms between the corresponding absolutely free algebras F τ (X n) and F τ (X m).

On the expressive power of finitely typed and universally polymorphic recursive procedures

Theoretical Computer Science, 1992

Kfoury, A.J., J. Tiuryn and P. Urzyczyn, On the expressive power of finitely typed and universally polymorphic recursive procedures, Theoretical Computer Science 93 (1992) l-41. Finitely typed functional programs are naturally classified by their levels. This syntactic classification of functional programs corresponds to a semantical classification: the higher the level of functional programs, the more functions they can compute. We call FL the language of finitely typed functional programs. The halting problem on finite interpretations is elementary recursive for every FL program, i.e. for every FL program P there is an elementary recursive procedure to decide for every finite interpretation 9 whether P halts on 9. The well-known programming language ML is essentially FL, augmented with the polymorphic let-in constructor. We show that ML computes the same class of functions as FL. As a consequence,

On the complexity of the syntax of tree languages

Lecture Notes in Computer Science, 2009

The syntactic complexity of a tree language is defined according to the number of the distinct syntactic classes of all trees with a fixed yield length. This leads to a syntactic classification of tree languages and it turns out that the class of recognizable tree languages is properly contained in that of languages with bounded complexity. A refined syntactic complexity notion is also presented, appropriate exclusively for the class of recognizable tree languages. A tree language is recognizable if and only if it has finitely many refined syntactic classes. The constructive complexity of a tree automaton is also investigated and we prove that for any reachable tree automaton it is equal with the refined syntactic complexity of its behavior. © 2009 Springer.

Tree algebras and varieties of tree languages

Theoretical Computer Science, 2007

We consider several aspects of Wilke's [T. Wilke, An algebraic characterization of frontier testable tree languages, Theoret. Comput. Sci. 154 (1996) 85-106] tree algebra formalism for representing binary labelled trees and compare it with approaches that represent trees as terms in the traditional way. A convergent term rewriting system yields normal form representations of binary trees and contexts, as well as a new completeness proof and a computational decision method for the axiomatization of tree algebras. Varieties of binary tree languages are compared with varieties of tree languages studied earlier in the literature. We also prove a variety theorem thus solving a problem noted by several authors. Syntactic tree algebras are studied and compared with ordinary syntactic algebras. The expressive power of the language of tree algebras is demonstrated by giving equational definitions for some well-known varieties of binary tree languages.

Fixed points and extensionality in typed functional programming languages

1992

We consider the interaction of recursion with extensional data types in several typed functional programming languages based on the simply-typed lambda calculus. Our main results concern the relation between the equational proof systems for reasoning about terms and the operational semantics for evaluating programs. We also present several results about the expressivity of the languages, compared according to both the functions and the data types definable in them. The methods used are those of classical lambda calculus and category theory.