A FINITE SEMANTICS OF SIMPLY-TYPED LAMBDA TERMS FOR INFINITE RUNS OF AUTOMATA

. Model checking properties are often described by means of ﬁnite automata. Any particular such automaton divides the set of inﬁnite trees into ﬁnitely many classes, according to which state has an inﬁnite run. Building the full type hierarchy upon this interpretation of the base type gives a ﬁnite semantics for simply-typed lambda-trees. A calculus based on this semantics is proven sound and complete. In particular, for regular inﬁnite lambda-trees it is decidable whether a given automaton has a run or not. As regular lambda-trees are precisely recursion schemes, this decidability result holds for arbitrary recursion schemes of arbitrary level, without any syntactical restriction.


Introduction and Related Work
The lambda calculus has long been used as a model of computation. Restricting it to simple types allows for a particularly simple set-theoretic semantics. The drawback, however, is that only few functions can be defined in the simply-typed lambda calculus. To overcome this problem one can, for example, add fixed-point combinators Y σ at every type, or allow infinitary lambda terms. The latter is more flexible, as we can always syntactically unfold fixed points, paying the price to obtain an infinite, but regular, lambda-tree.
Finite automata are a standard tool in the realm of model checking [10]. They provide a concrete machine model for the properties to be verified. In this article we combine automata, and hence properties relevant for model checking, with the infinitary simply-typed lambda calculus, using the fact that the standard set theoretic semantics for the simple types has a free parameter -the interpretation of the base type.
More precisely, we consider the following problem.
Given a, possibly infinite, simply-typed lambda-tree t of base type, and given a non-deterministic tree automaton A. Does A have a run on the normal form of t? The idea is to provide a "proof" of a run of A on the normal form of t by annotating each subterm of t with a semantical value describing how this subterm "looks, as seen by A". Since, in the end, all the annotations turn out to be out of a fixed finite set, the existence of such a proof is decidable.
So, what does a lambda-tree look like, if seen by an automaton A? At the base type, a lambda-tree denotes an infinite term. Hence, from A's point of view, we have to distinguish for which states there is an infinite run starting in this particular state.
Since we are interested in model checking terms of base type only, we can use any semantics for higher types, as long as it is adequate, that is, sound and complete. So we use the most simple one available, that is, the full set-theoretic semantics with the base type interpreted as just discussed. This yields a finite set as semantical realm for every type.
As an application of the techniques developed in this article, we show that for arbitrary recursion schemes it is decidable whether the defined tree has a property expressible by an automaton with trivial acceptance condition. This gives a partial answer to an open problem by Knapik,Niwinski and Urzyczyn [5].
Infinitary lambda-trees were also considered by Knapik,Niwinski and Urzyczyn [4], who also proved the decidability of the Monadic Second Order (MSO) theory of trees given by recursion schemes enjoying a certain "safety" condition [5]. The fact, that the safety restriction can be dropped at level two has been shown by Aehlig,de Miranda and Ong [2], and, independently, by Knapik, Niwinski, Urzyczyn and Walukiewicz [6]. The work of the former group also uses implicitly the idea of a "proof" that a particular automaton has a run on the normal form of a given infinite lambda-tree.
Recently [9] Luke Ong showed simultaneously and independently that the safety restriction can be dropped for all levels and still decidability for the full MSO theory is obtained. His approach is based on game semantics and is technically quite involved. Therefore, the author believes that his approach, due to its simplicity and straight forwardness, is still of interest, despite showing a weaker result. Moreover, the novel construction of a finite semantics and its adequacy even in a coinductive setting seem to be of independent interest.

Preliminaries
Let Σ be a set of letters or terminals. We use f to denote elements of Σ . Each terminal f is associated an arity (f) ∈ N. Definition 1. Define Σ = Σ ∪ {R, β} with R, β two new terminals of arity one.

Definition 2.
For Δ a set of terminals, a Δ-term is a, not necessarily wellfounded, tree labelled with elements of Δ where every node labelled with f has (f) many children.