Algorithmic Eta-reduction in Type-theory of Acyclic Recursion
Roussanka Loukanova
1,2
1
Stockholm University, Stockholm, Sweden
2
Institute of Mathematics and Informatics, Bulgarian Academy of Sciences,
Acad. G. Bonchev Str., Block 8, 1113 Sofia, Bulgaria
Keywords:
Algorithms, Acyclic Recursion, Type Theory, Reduction Calculi, Canonical Forms, Eta-reduction.
Abstract:
The paper extends the standard reduction calculus of the higher-order Type-theory of Acyclic Recursion to η-
reduction. This is achieved by adding a restricted η-rule, which is applicable only to terms in canonical forms
satisfying certain conditions. Canonical forms of terms determine the iterative algorithms for computing the
semantic denotations of the terms. Unnecessary λ-abstractions and corresponding functional applications in
canonical forms contribute to algorithmic complexity. The η-rule provides a simple way to reduce complexity
by maintenance of essential algorithmic structure of computations.
1 INTRODUCTION
This paper is part of theoretical development and ap-
plications of a new approach to the mathematical no-
tion of algorithm, originally introduced by the for-
mal languages of recursion (Moschovakis, 1989). The
simply-typed theory of recursion L
λ
ar
introduced in
(Moschovakis, 2006) is a higher-order type theory,
which is a proper extension of Gallin type theory TY
2
(Gallin, 1975). The book (Moschovakis, 2019) inves-
tigates complexity in its untyped version.
The formal languages FLR introduced in a se-
quence of papers (Moschovakis, 1989; Moschovakis,
1993; Moschovakis, 1997), while untyped systems
formalising untyped domains of recursive functions,
allow full recursion with cyclicity, and are equivalent
to any of the classic theories of the mathematical no-
tion of algorithm. The formal syntax of L
λ
ar
, presented
originally in (Moschovakis, 2006), is typed and al-
lows only recursion terms with acyclic systems of as-
signments, thus, formalising algorithms that end after
finite iterations of computations. Typed languages of
full recursion L
λ
r
have the typed syntax of L
λ
ar
, with-
out the acyclicity requirement. The classes of lan-
guages of recursion (FLR, L
λ
r
, and L
λ
ar
) have two se-
mantic layers: denotational semantics and algorith-
mic semantics. The recursion terms of L
λ
ar
are essen-
tial for representing algorithmic computations of se-
mantic information.
This paper concerns the typed theory of algoritms
L
λ
ar
, which is already well developed, and provides
new approaches to intelligent foundations, with ver-
satile applications, and especially to the areas of Ar-
tificial Intelligence (AI). In this paper, we introduce
a technique, which, by adding a simple additional re-
duction rule to the reduction calculi of L
λ
ar
, is impor-
tant for applications of L
λ
ar
to the areas of AI.
The purpose of the reduction calculi of the for-
mal language of L
λ
ar
is to reduce every L
λ
ar
term A to
a term in a canonical form that represents the com-
putational steps for the computation of the denotation
of A. The reduction calculi of L
λ
ar
reflect fundamen-
tal algorithmic patterns in computations. Among the
potential applications of L
λ
ar
are intelligent software
systems, e.g., in robotics and in AI, that perform al-
gorithmic procedures, which determine reliable per-
formance. The prominent applications of L
λ
ar
are to
computational semantics of formal and natural lan-
guages, and, in particular, semantics of programming
and other specification languages in Computer Sci-
ence and AI, as well as Natural Language Process-
ings (NLP), and computational grammars that cover
semantics.
The reduction calculus of L
λ
ar
reduces every L
λ
ar
-
term to its canonical form. The canonical forms not
only preserve the denotations of the L
λ
ar
-terms, they
reveal the algorithmic steps encoded by the terms
for computing their denotations. The canonical form
cf(A) of every L
λ
ar
-term A determines the algorithm
that computes the denotation of A in the semantics
domain of every given semantic structure. The λ-rule
of L
λ
ar
is one of the most important reduction rules
Loukanova, R.
Algorithmic Eta-reduction in Type-theory of Acyclic Recursion.
DOI: 10.5220/0009182410031010
In Proceedings of the 12th International Conference on Agents and Artificial Intelligence (ICAART 2020) - Volume 2, pages 1003-1010
ISBN: 978-989-758-395-7; ISSN: 2184-433X
Copyright
c
2022 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
1003
for the recursion and abstraction operators. Never-
theless, in many cases, the λ-rule, creates redundant
λ-abstractions over variables that do not occur freely
in the recursion terms (e.g., see Example 3.1). For ex-
ample, it is important to simplify terms having such
extra abstractions, when translating, i.e., rendering,
natura language (NL) expressions to semantic repre-
sentations by L
λ
ar
-terms.
This paper presents a restricted η-reduction that
simplifies terms in canonical forms. The η-rule does
not preserve the strictest referential synonymy of its
input and output terms, which are in canonical forms.
Importantly, the η-rule takes care to maintain closely
the algorithmic meaning of the terms in the entire
reduction sequence, while reducing computational
complexity caused by excessive, superfluous lambda-
abstractions and corresponding functional applica-
tions. It preserves the denotations of the input and re-
duced terms. (Loukanova, 2019c; Loukanova, 2019b)
introduce and investigate the properties of more intri-
cate rules and reduction calculi for removing redun-
dant lambda-abstractions. The η-reduction is also in-
teresting. It is easier to use, by extending the ordinal
reduction calculus of L
λ
ar
, since it is applied directly,
only to terms in canonical forms.
(Loukanova, 2011d) introduces very briefly the η-
rule, for the purpose of applying it to semantic rep-
resentations of human language, without looking into
its properties. We reformulate the rule here, for pre-
senting its properties with respect to its existing and
potential applications to the areas of Artificial Intelli-
gence (AI). In particular, we point to applications that
need context dependent information and algorithmic
computations that depend on states of information, in-
cluding agents.
We should stress that the η-rule introduced here is
about recursion terms and the algorithms designated
by them. It is different from, while related to, the
denotational η-rule in standard λ-calculi.
In Section 2, we give the formal definitions of the
syntax of L
λ
ar
. We introduce the denotational and algo-
rithmic semantics of L
λ
ar
with some intuitions and ex-
amples. Then, we introduce the rules of the reduction
calculus of the type theory L
λ
ar
, which is central to the
referential intensions, i.e., to the algorithmic meaning
in a selected specific semantic domain of applications,
and some key theoretical results. The central part of
the paper is on introducing the new, additional η-rule
for reduction of the L
λ
ar
terms, which are in canoni-
cal forms, to simpler η-canonical forms that formalise
more efficient algorithmic computations.
2 TYPE-THEORY OF ACYCLIC
RECURSION
2.1 Types
The set Types is the smallest set defined recursively
as follows, by :
τ
:
e | t | s | (τ
1
τ
2
) (Types)
The type e is for entities, also called individuals; s
is for states consisting of various information, e.g.,
such as possible worlds, context, time and/or space
locations, some agents, e.g., a speaker; t is for truth
values. For an elaboration of possible choices of con-
text information, which include speaker agents, see
(Loukanova, 2011b). The type (s τ) is for context
dependent objects.
2.2 Syntax of L
λ
ar
Vocabulary of L
λ
ar
Constants: K =
S
τTypes
K
τ
,
where, for each τ Types, K
τ
is a finite set:
K
τ
= { c
τ
0
, c
τ
1
, . . . , c
τ
k
τ
}
Pure Variables: PureV =
S
τTypes
PureV
τ
,
where, for each τ Types,
PureV
τ
= { v
τ
0
, v
τ
1
, . . . } (a denumerable set)
Recursion Variables (Memory Locations):
RecV =
S
τTypes
RecV
τ
,
where, for each τ Types,
RecV
τ
= { p
τ
0
, p
τ
1
, . . . } (a denumerable set)
Definition 1 (The set Terms of L
λ
ar
).
A
:
c
τ
: τ | x
τ
: τ | B
(στ)
(C
σ
) : τ (1)
| λ(v
σ
)(B
τ
) : (σ τ) (2)
| A
σ
0
where { p
σ
1
1
:
= A
σ
1
1
, . . . ,
p
σ
n
n
:
= A
σ
n
n
} : σ
(3)
for A
1
: σ
1
, . . . , A
n
: σ
n
are terms (n 0), and p
1
: σ
1
,
. . . , p
n
: σ
n
are pairwise different recursion variables
(memory locations), and the sequence of assignments
{ p
1
:
= A
1
, . . . , p
n
:
= A
n
} satisfies the Acyclicity Con-
straint:
Acyclicity Constraint. A sequence of assignments
of the form:
{ p
1
:
= A
1
, . . . , p
n
:
= A
n
}
is acyclic iff there is a ranking function
rank : { p
1
, . . . , p
n
} N
such that, for all p
i
, p
j
{ p
1
, . . . , p
n
}, if p
j
oc-
curs freely in A
i
, then rank(p
j
) < rank(p
i
).
ICAART 2020 - 12th International Conference on Agents and Artificial Intelligence
1004
Intuitively, an acyclic sequence of assignments
{ p
1
:
= A
1
, . . . , p
n
:
= A
n
} defines recursive computa-
tions of the values den(A
1
), . . . , den(A
n
) to be as-
signed to the locations p
1
, . . . , p
n
, which close-off
after a finite number of steps; ranking rank(p
j
) <
rank(p
i
) means that the value A
i
assigned to p
i
, may
depend on the values of the free occurrences of the
location p
j
in A
i
, and of all other free occurrences of
locations with lower rank than p
j
.
Some Notations and Abbreviations
The symbol “=” is a predicate constant of the lan-
guage L
λ
ar
for identity, and also used for the iden-
tity relation, which it denotes
The symbol ” is a meta-symbol for literal iden-
tity between expressions
The symbol “
:
” is a meta-symbol that we use in
definitions, e.g., of types and terms, and for the
replacement operation
Often, we skip some “understood” parentheses
The type σ of a term A may be depicted either as
a superscript, A
σ
, or by a colon, A : σ
We use the following abbreviations for “folding” and
“unfolding” sequences of assignments. For any terms
A
1
: σ
1
, . . . , A
n
: σ
n
, A
n+1
: σ
n+1
, C, D : τ, and recur-
sion variables p
1
: σ
1
, . . . , p
n
: σ
n
, (where n 0):
p
:
=
A p
1
:= A
1
, . . . , p
n
:= A
n
(4a)
p
:
=
A {C
:
D} (4b)
p
1
:
= A
1
{C
:
D}, . . . , p
n
:
= A
n
{C
:
D} (4c)
where, for all i = 1, . . . , n, A
i
{C
:
D} are the result of
the replacement of all occurrences of C, respectively
in A
i
without causing variable clashes.
Denotational Semantics of L
λ
ar
The language L
λ
ar
has denotational semantics provided by a denotational
function den
A
, for any given typed semantic structure
A with typed domain frames and variable assignments
g in A. The definition of den
A
is by structural in-
duction on the terms, for details, see (Moschovakis,
2006) and (Loukanova, 2019c; Loukanova, 2019b).
Often, we shall designate the denotation function by
den without the superscript.
2.3 Reduction Calculus of L
λ
ar
The reduction rules define a reduction relation be-
tween terms.
The congruence relation,
c
, is the smallest rela-
tion between L
λ
ar
terms (A
c
B) that is reflexive, sym-
metric, transitive, and closed under: term formation
rules (application, λ-abstraction, and acyclic recur-
sion); renaming bound variables (pure and recursion),
without causing variable collisions; and re-ordering
of the assignments within the acyclic sequences of as-
signments of the recursion terms , i.e., for any permu-
tation π: {1, . . . , n} {1, . . . , n}:
Reduction Rules of L
λ
ar
Congruence If A
c
B, then A B (cong)
Transitivity If A B and B C, then A C (trans)
Compositionality
If A A
0
and B B
0
, (rep1)
then A(B) A
0
(B
0
)
If A B, then λu (A) λu (B) (rep2)
If A
i
B
i
, for i = 0, . . . , n, then (rep3)
A
0
where { p
1
:
= A
1
, . . . , p
n
:
= A
n
}
B
0
where { p
1
:
= B
1
, . . . , p
n
:
= B
n
}
The Head Rule (head)
A
0
where {
p
:
=
A }
where {
q
:
=
B }
A
0
where {
p
:
=
A ,
q
:
=
B }
given that no p
i
occurs freely in any B
j
, for i = 1,
. . . , n, j = 1, . . . , m
The Beki
ˇ
c-Scott Rule (B-S)
A
0
where {p
:
=
B
0
where {
q
:
=
B }
,
p
:
=
A }
A
0
where {p
:
= B
0
,
q
:
=
B ,
p
:
=
A }
given that no q
j
occurs freely in any A
i
, for i = 1,
. . . , n, j = 1, . . . , m
The Recursion-application Rule (recap)
(A
0
where {
p
:
=
A }
(B)
A
0
(B) where {
p
:
=
A }
given that no p
i
occurs freely in B, for i = 1, . . . ,
n
The Application Rule (ap)
A(B) A(p) where {p
:
= B}
given that B is a proper term and p is a fresh loca-
tion
The λ-Rule (λ)
λu(A
0
where { p
1
:
= A
1
, . . . , p
n
:
= A
n
})
λuA
0
0
where { p
0
1
:
= λu A
0
1
, . . . , p
0
n
:
= λu A
0
n
},
where for all i = 1, . . . , n, p
0
i
is a fresh lo-
cation and A
0
i
is the result of the replacement
of the free occurrences of p
1
, . . . , p
n
in A
i
with
p
0
1
(u), . . . , p
0
n
(u), respectively, i.e.:
A
0
i
:
A
i
{p
1
:
p
0
1
(u), . . . , p
n
:
p
0
n
(u)}
Algorithmic Eta-reduction in Type-theory of Acyclic Recursion
1005
2.4 Some Major Properties of L
λ
ar
The following theorems are important for the algo-
rithmic meanings of the terms.
Theorem 1 (Canonical Form Theorem). (For details,
see (Moschovakis, 2006), § 3.1.) For each term A,
there is a unique, up to congruence, irreducible term
C, denoted by cf(A) and called the canonical form of
A, such that:
1. cf(A) A
0
where { p
1
:= A
1
, . . . , p
n
:= A
n
} for
some explicit, irreducible terms A
1
, . . . , A
n
(n 0)
2. A cf(A)
3. if A B and B is irreducible, then B
c
cf(A), i.e.,
cf(A) is the unique, up to congruence, irreducible
term to which A can be reduced
Theorem 2. (See (Moschovakis, 2006), § 3.11.) For
any L
λ
ar
terms A and B, if A B, then
den(A) = den(B) (5a)
den(A) = den(cf(A)) (5b)
The canonical forms have a distinguished feature that
is part of their computational (algorithmic) role: they
provide algorithmic patterns of semantic computa-
tions. The more general terms provide algorithmic
patterns that consist of sub-terms with components
that are recursion variables; the most basic assign-
ments of recursion variables (of lowest ranks) pro-
vide the specific basic data that feeds-up the general
computational patterns. The more general terms and
sub-terms classify language expressions with respect
to their semantics and determine the algorithms for
computing the denotations of the expressions.
Algorithmic Semantics of L
λ
ar
. The notion of algo-
rithmic semantics, i.e., algorithmic intension, in the
languages of recursion, (Moschovakis, 2006), covers
the most essential, computational aspect of the con-
cept of meaning. The referential intension, int(A),
of a meaningful term A is the tuple of functions (a
recursor) that is defined by the denotations den(A
i
)
(i {0, . . . n}) of the parts (i.e., the head sub-term A
0
and of the terms A
1
, . . . , A
n
in the system of assign-
ments) of its canonical form:
cf(A) A
0
where { p
1
:= A
1
, . . . , p
n
:= A
n
}
Intuitively, for each meaningful term A, the inten-
sion of A, int(A), is the algorithm for computing its
denotation den(A). Two meaningful expressions are
synonymous iff their referential intensions are natu-
rally isomorphic, i.e., they are the same algorithm.
Thus, the algorithmic meaning of a meaningful term
(i.e., its sense) is the information about how to com-
pute its denotation step-by-step: a meaningful term
has sense by carrying instructions within its struc-
ture, which are revealed by its canonical form, for
acquiring what they denote in a model. The canon-
ical form cf(A) of a meaningful term A encodes its
intension, i.e., the algorithm for computing its deno-
tation, via: (1) the basic instructions (facts), which
consist of { p
1
:= A
1
, . . . , p
n
:= A
n
} and the head
term A
0
, which are needed for computing the deno-
tation den(A), and (2) a terminating rank order of
the recursive steps that compute each den(A
i
), for
i {0, . . . , n}, for incremental computation of the de-
notation den(A) = den(A
0
).
The reduction calculus of the type theory L
λ
ar
is
effective. The calculus of the intensional synonymy,
i.e., algorithmic equivalence, in the type-theory L
λ
ar
has a restricted β-reduction rule, which contributes
to the high expressiveness of the language of L
λ
ar
,
see (Moschovakis, 2006) and (Loukanova, 2011a;
Loukanova, 2011c).
Theorem 3 (Referential Synonymy Theorem). (See
(Moschovakis, 2006), § 3.4.) Two terms A, B are ref-
erentially synonymous, A B, i.e., algorithmically
equivalent, with respect to a given semantic structure
A iff there are explicit, irreducible terms (of appropri-
ate types), A
0
, A
1
, . . . , A
n
, B
0
, B
1
, . . . , B
n
, n 0, such
that:
1. A
cf
A
0
where { p
1
:= A
1
, . . . , p
n
:= A
n
},
2. B
cf
B
0
where { p
1
:= B
1
, . . . , p
n
:= B
n
},
3.(a) for every x PureV RecV,
x FreeVars(A
i
) iff x FreeVars(B
i
),
for i {0, . . . , n}
(6)
(b) for all g G:
den(A
i
)(g) = den(B
i
)(g), i {0, . . . , n} (7)
3 ETA-REDUCTION
In this section, at first, we present an example from
natural language to motivate the usefulness of the ad-
ditional η-rule, and then we introduce the η-rule and
the extended reduction calculus.
Example 3.1. The detailed steps of rendering the sen-
tence (8a) into a term, and its reduction to the canoni-
cal form (8b)–(8e), are given in (Loukanova, 2019b),
as motivation for γ-reduction, which is more general
and complex.
ICAART 2020 - 12th International Conference on Agents and Artificial Intelligence
1006
Kim hugs some dog
render
A. . . (8a)
cf(A)
c
[λy
k
(some
d(y
k
)
(h(y
k
)))](k) where (8b)
{k
:
= kim, (8c)
h
:
= λy
k
λx
d
hugs(x
d
)(y
k
), (8d)
d
:
= λy
k
dog} (8e)
Then, by Theorem 3:
cf(A) 6≈ B
c
λy
k
some(d
0
)
h(y
k
)

(k) where (9a)
{k
:
= kim, (9b)
h
:
= λy
k
λx
d
hugs(x
d
)(y
k
), (9c)
d
0
:
= dog } (9d)
The term B in (9a)-(9b) is in a canonical form, but it is
not algorithmically equivalent (referentially synony-
mous) to the term (8b)-(8e), by the reduction calculus
of L
λ
ar
. That is, these two terms are not algorithmi-
cally equivalent with respect to the strictest notion of
algorithm introduced in (Moschovakis, 2006).
Definition 2 (η-rule). Let A be a term in a canonical
form:
A A
0
where {
p
:
=
A ,
p
n+1
:
= λvA
n+1
,
q
:
=
B }
(10a)
A
0
where { p
1
:= A
1
, . . . , p
n
:= A
n
,
p
n+1
:
= λvA
n+1
,
q
1
:
= B
1
, . . . , q
k
:
= B
k
}
(10b)
with n 0, k 0, such that
1. v : σ is a pure variable and p
n+1
: (σ τ) is a
recursion variable (location).
2. The explicit, irreducible term A
n+1
: τ does not
have any (free) occurrences of v (and p
n+1
).
3. All the occurrences of p
n+1
in A
0
,
A , and
B are
occurrences of the term p
n+1
(v), which are in the
scope of λv (modulo appropriate renaming of v).
Then, for any fresh recursion variable p
0
n+1
: τ
A
0
where {
p
:
=
A ,
p
n+1
:
= λvA
n+1
,
q
:
=
B }
(11a)
η
A
0
{p
n+1
(v)
:
p
0
n+1
} where {
p
:
=
A {p
n+1
(v)
:
p
0
n+1
},
p
0
n+1
:
= A
n+1
,
q
:
=
B {p
n+1
(v)
:
p
0
n+1
}}
(11b)
where,
A {p
n+1
(v)
:
p
0
n+1
} is the result of the re-
placement A
i
{p
n+1
(v)
:
p
0
n+1
} of all occurrences
of p
n+1
(v) with p
0
n+1
, in all terms A
i
of
A , and
B {p
n+1
(v)
:
p
0
n+1
} is the is the result of the re-
placement B
j
{p
n+1
(v)
:
p
0
n+1
} of all occurrences of
p
n+1
(v) with p
0
n+1
, in all terms B
j
of
B .
Note: In the η-rule and corresponding applica-
tions, for all i {0, . . . , n} and j {0, . . . , k}, the re-
placements A
i
{p
n+1
(v)
:
p
0
n+1
} and B
j
{p
n+1
(v)
:
p
0
n+1
} are such that the occurrences of the term
p
n+1
(v) in A
i
and B
j
are in the scope of λv.
Theorem 4 (Denotational Equivalence by η-rule).
Let A be a term in a canonical form:
A A
0
where {
p
:
=
A ,
p
n+1
:
= λvA
n+1
,
q
:
=
B }
(12a)
(n 0) such that:
1. v : σ is a pure variable and p
n+1
: (σ τ) is a
recursion variable.
2. The explicit, irreducible term A
n+1
: τ does not
have any (free) occurrences of v (and p
n+1
).
3. All the occurrences of p
n+1
, in A
0
,
A , and
B , are
occurrences of the term p
n+1
(v), which are in the
scope of λv (modulo appropriate renaming of v).
Let p
0
n+1
: τ be a fresh recursion variable, and A
0
be a
term as in (13b) (by the η-rule):
A [A
0
where {
p
:
=
A ,
p
n+1
:
= λvA
n+1
,
q
:
=
B }]
(13a)
η
A
0
[A
0
{p
n+1
(v)
:
p
0
n+1
} where
{
p
:
=
A {p
n+1
(v)
:
p
0
n+1
},
p
0
n+1
:
= A
n+1
,
q
:
=
B {p
n+1
(v)
:
p
0
n+1
}}]
(13b)
Then,
A 6≈ A
0
(14a)
cf(A
0
)
c
A
0
(14b)
and, for all g G, i {0, . . . , n}, and j {1, . . . , k},
the following denotational equalities hold:
den(A)(g) = den(A
0
)(g) (15)
and:
den(A
i
)(g{
p
:
=
p , p
n+1
:
= p
n+1
,
q
:
=
q })
(16a)
=den
A
i
{p
n+1
(v)
:
p
0
n+1
}
(g{
p
:
=
p
0
,
p
0
n+1
:
= p
0
n+1
,
q
:
=
q
0
})
(16b)
Algorithmic Eta-reduction in Type-theory of Acyclic Recursion
1007
and:
den(B
j
)(g{
p
:
=
p , p
n+1
:
= p
n+1
,
q
:
=
q
0
})
(17a)
=den
B
j
{p
n+1
(v)
:
p
0
n+1
}
(g{
p
:
=
p
0
,
p
0
n+1
:
= p
0
n+1
,
q
:
=
q
0
})
(17b)
where, for all i {1, . . . , n+1} and j {1, . . . , k}, the
values p
i
T
σ
i
, p
0
i
T
σ
i
, q
j
T
τ
j
, and q
0
j
T
τ
j
are
calculated by recursion on the rank of
p , p
n+1
,
p
0
,
p
0
n+1
,
q ,
q
0
.
Proof. The proof is long, by induction on the rank
values, and is not in the subject of this paper.
Definition 3 (η-reduction). The η-reduction relation
in L
λ
ar
is the smallest relation
η
between L
λ
ar
-terms,
such that:
(1) For any L
λ
ar
-terms A and B,
if cf(A)
η
B, then A
η
B (η-red)
(2)
η
is closed under transitivity, congruence, and
is compositional with respect to term formation
rules, i.e.:
Transitivity If A
η
B and B
η
C, then A
η
C
(η-tr)
Congruence If A
c
B, then A
η
B (η-cong)
Compositionality
If A
η
A
0
and B
η
B
0
, then A(B)
η
A
0
(B
0
)
(η-rep1)
If A
η
B, then λu(A)
η
λu(B) (η-rep2)
If A
i
η
B
i
, for i = 0, . . . , n, then (η-rep3)
A
0
where { p
1
:
= A
1
, . . . , p
n
:
= A
n
}
η
B
0
where { p
1
:
= B
1
, . . . , p
n
:
= B
n
}
Definition 4 (η-equivalence relation
η
). For any
L
λ
ar
-terms A and B
A
η
B for some C,
cf(A)
η
C and C B
(18)
Corollary 1. For any L
λ
ar
-terms A and B,
(1) if A
η
B, then den(A) = den(B)
(2) if A
η
B, then den(A) = den(B)
Proof. ((1)) is proved by induction on the definition
of the
η
. Then, ((2)) follows by the Definition 4 of
η
.
Corollary 2. There exist (many) L
λ
ar
-terms A, B, and
C such that
A B
η
C = A B = A
η
B
η
C (19a)
while C 6≈ B and C 6≈ A (19b)
4 USEFULNESS OF THE
ETA-RULE
In this section, we present some arguments for the use
of η-rule and η-reduction, for existing and potential
applications.
Maintenance of Essential Algorithmic Computa-
tions. While the equalities (15), (16a), (17a) are
about denotations, they do not use the denotational
traditional β-conversion or any other syntactical ma-
nipulations over the terms A and A
0
, except the η-rule
for A
η
A
0
.
Preservance of Algorithmic Structure. The η-rule
preserves very closely the computational structure of
the term A in a canonical form. The term A
0
, which is
such that A
η
A
0
, is also in a canonical form, with
parts that are almostly the same as the correspond-
ing parts of A, with the exception of the replacements
{p
n+1
(v)
:
p
0
n+1
} and skipped λv from the term part
of p
n+1
:
= λvA
n+1
to the term part of p
0
n+1
:
= A
n+1
.
The where assignments formalise some essentials
of object declarations in object oriented programming
languages, and in general, of function declarations in
programming languages.
The equalities of the denotations of the corre-
sponding parts, given in (16a)–(16b) and (17a)–(17b),
are proved by recursion on rank. The denotations of
the parts may, in general, strictly depend on the values
of the recursion variables that have lesser rank. The
denotational equality of the corresponding parts, e.g.,
of A
i
and A
i
{p
n+1
(v)
:
p
0
n+1
}, in (20a)–(20b), holds
for the variable assignment g due to its update for the
local variables within the scope of where, which are
constrained by the recursion assignments.
den(A
i
)(g{
p
:
=
p , p
n+1
:
= p
n+1
,
q
:
=
q })
(20a)
=den
A
i
{p
n+1
(v)
:
p
0
n+1
}
(g{
p
:
=
p
0
,
p
0
n+1
:
= p
0
n+1
,
q
:
=
q
0
})
(20b)
The recursion variables
p , p
n+1
,
p
0
, p
0
n+1
,
q ,
q
0
,
are bound, i.e., constrained to the values determined
by the assignments in the scope of where. In case that
rank(p
i
) > rank(p
n+1
), the value den(A
i
)(g) of the
part A
i
can depend on the value of p
n+1
, and respec-
tively, den
A
i
{p
n+1
(v)
:
p
0
n+1
}
(g) on the value of
p
0
n+1
. Without the constraints p
n+1
:
= λvA
n+1
and
p
0
n+1
:
= A
n+1
, a variable assignment g can be such
that for some a T
σ
, g(p
n+1
)(a) 6= g(p
0
n+1
). Then,
without the specified update of g, outside the scope of
ICAART 2020 - 12th International Conference on Agents and Artificial Intelligence
1008
where, i.e. outside the local system of assignments,
it is possible that den(A
i
)(g) 6= den
A
i
{p
n+1
(v)
:
p
0
n+1
}
(g).
Local Scope of Recursion Operator. We explain
the role of the local scope of the recursion operator
designated by the constant where.
Let us consider again the terms in Example 3.1.
The corresponding parts, which are subject of the η-
rule, λy
k
(some
d(y
k
)
(h(y
k
))), of the term (8b)–(8e),
and λy
k
(some
d
0
(h(y
k
))), of (9a)–(9b), depend on
the values of d and d
0
, respectively. The denota-
tions of these terms are equal only within the local
scopes of where, with the variable assignment up-
dated, i.e., constrained by the corresponding assign-
ments d
:
= λy
k
dog and d
0
:
= dog. Without these con-
straints, it is possible that, for some g G, we have
the denotational inequality in (21a)–(21b):
den
λy
k
(some
d(y
k
)
(h(y
k
)))
(g) (21a)
6= den
λy
k
(some
d
0
(h(y
k
)))
(g) (21b)
because g(d) T
(ee(ee
e
t))
and g(d
0
) T
(ee
e
t)
can be
any objects in these domains. For example,
g(d)
(k)
can depend on a, and it is possible that there is some
k T
ee
, such that
g(d)
(k) 6= g(d
0
) so that, the fol-
lowing holds:
den
λy
k
(some
d(y
k
)
(h(y
k
)))
(k) (22a)
6= den
λy
k
(some
d
0
(h(y
k
)))
(k) (22b)
Then, from (22a) by the denotation function, den, we
have (23a).
I (some)
g(d)
(k)

g(h)
(k)
(23a)
6= I (some)
g(d
0
)

g(h)
(k)
(23b)
For all variable assignments g in a given semantic
structure A, we get den(A)(g) = den(A
0
)(g), because
the recursion variables
p , p
n+1
,
p
0
, p
0
n+1
,
q ,
q
0
, are
bound, i.e., constrained to the values determined by
the assignments in the scope of where. The term A
carries the binding constraints together with the scope
of where.
Theorem 4 is not just about denotational seman-
tics of terms related by the η-rule. Many different
terms (as in many formal languages) have the same
denotations. Some manipulations and operators over
terms, do not preserve denotations, i.e., they may pro-
duce new terms that have different denotations from
the original terms over which they operate. While the
η-rule does not preserve the original, strict algorith-
mic steps, i.e., the referential intension, Theorem 4
proves that the η-rule, applied on a canonical form
cf(A), preserves its denotational semantics, by mini-
mal divergence from the algorithmic steps determined
by the original canonical form cf(A) on which it is
applied. This additional reduction is useful for var-
ious tasks, e.g., in translations between NL expres-
sions and generation of NL from semantic representa-
tions. Theorem 4 extended to the
η
equivalence by
Corollary1 shows that the
η
equivalence is one of
the many equivalence relations between terms, which
is stronger than denotational equality and weaker than
referential synonymy.
5 EXISTING AND POTENTIAL
APPLICATIONS
In this section, we point to existing and potential ap-
plications of the Type-Theory of Acyclic Recursion
L
λ
ar
, in areas that are within the subareas of Artifi-
cial Intelligence (AI). The reduction calculs of L
λ
ar
ex-
tended to η-reduction is useful in such applications,
for reducing algorithmic complexity.
programming languages: for algorithmic (proce-
dural) semantics of programming languages
compiler programming languages: for automatic
conversion of recursive programs into iterative
programs, where the reduction calculus is build
into parts of compilation processing
algorithm specifications with higher-order type
theory of algorithms
data science / database
Computational Semantics (Loukanova, 2016)
Syntax-Semantics Interface in NLP, computa-
tional grammar, and lexicon of human language
(Loukanova, 2019d; Loukanova, 2019a)
Language Processing / Technology
Computational Neuroscience (Loukanova, 2017)
6 OUTLOOK AND FUTURE
WORK
We have formulated the η-rule to simplify the canon-
ical forms in some cases with occurrences of vacuous
λ-abstractions and corresponding functional applica-
tions, by preserving all other structural components
Algorithmic Eta-reduction in Type-theory of Acyclic Recursion
1009
of the canonical terms. The proof of Theorem 4 in-
volves details of general canonical forms and induc-
tion steps. It demonstrates what part of a canonical
form is reduced, by inessential divergence from the
strictest referential synonymy of the entire term. It
demonstrates that the replacements preserve the de-
notation of the entire term.
The presented η-rule has applications to computa-
tional semantics of human languages and to semantics
of programs and compilers. Replacements based on
the η-rule are not always possible because there are
intervening (algorithmic) structures. The effect of a
general β-replacement would have been like reversing
iteration to recursive program interpreter. Something
like a compiler that translates a program with recur-
sion (i.e. a L
λ
ar
term) to a program with induction,
and then finds functional components that compute
constant functions (not depending on inputs), and in
attempts to provide the constant value, without using
the “vacuous” function applications, is reversing the
tail recursion into recursion. The presented η-rule
avoids this.
In the analyses of certain classes of human lan-
guage expressions, at least those that we have covered
in recent work, the η-rule provides simplification of
canonical terms that are otherwise irreducible.
REFERENCES
Gallin, D. (1975). Intensional and Higher-Order Modal
Logic: With Applications to Montague Semantics.
North-Holland Publishing Company, Amsterdam and
Oxford, and American Elsevier Publishing Company.
Loukanova, R. (2011a). From Montague’s Rules of Quan-
tification to Minimal Recursion Semantics and the
Language of Acyclic Recursion. In Bel-Enguix, G.,
Dahl, V., and Jim
´
enez-L
´
opez, M. D., editors, Biology,
Computation and Linguistics, volume 228 of Fron-
tiers in Artificial Intelligence and Applications, pages
200–214. IOS Press, Amsterdam; Berlin; Tokyo;
Washington, DC.
Loukanova, R. (2011b). Modeling Context Information
for Computational Semantics with the Language of
Acyclic Recursion. In P
´
erez, J. B., Corchado, J. M.,
Moreno, M., Juli
´
an, V., Mathieu, P., Canada-Bago,
J., Ortega, A., and Fern
´
andez-Caballero, A., editors,
Highlights in Practical Applications of Agents and
Multiagent Systems, volume 89 of Advances in Intel-
ligent and Soft Computing, pages 265–274. Springer
Berlin Heidelberg.
Loukanova, R. (2011c). Reference, Co-reference and
Antecedent-anaphora in the Type Theory of Acyclic
Recursion. In Bel-Enguix, G. and Jim
´
enez-L
´
opez,
M. D., editors, Bio-Inspired Models for Natural and
Formal Languages, pages 81–102. Cambridge Schol-
ars Publishing.
Loukanova, R. (2011d). Semantics with the Language of
Acyclic Recursion in Constraint-Based Grammar. In
Bel-Enguix, G. and Jim
´
enez-L
´
opez, M. D., editors,
Bio-Inspired Models for Natural and Formal Lan-
guages, pages 103–134. Cambridge Scholars Publish-
ing.
Loukanova, R. (2016). Relationships between Speci-
fied and Underspecified Quantification by the Theory
of Acyclic Recursion. ADCAIJ: Advances in Dis-
tributed Computing and Artificial Intelligence Jour-
nal, 5(4):19–42.
Loukanova, R. (2017). Binding Operators in Type-Theory
of Algorithms for Algorithmic Binding of Functional
Neuro-Receptors. In Ganzha, M., Maciaszek, L., and
Paprzycki, M., editors, Proceedings of the 2017 Fed-
erated Conference on Computer Science and Informa-
tion Systems, volume 11 of Annals of Computer Sci-
ence and Information Systems, pages 57–66. Polish
Information Processing Society.
Loukanova, R. (2019a). Computational Syntax-Semantics
Interface with Type-Theory of Acyclic Recursion for
Underspecified Semantics. In Osswald, R., Retor
´
e,
C., and Sutton, P., editors, IWCS 2019 Workshop on
Computing Semantics with Types, Frames and Re-
lated Structures. Proceedings of the Workshop, pages
37–48. The Association for Computational Linguis-
tics (ACL).
Loukanova, R. (2019b). Gamma-Reduction in Type The-
ory of Acyclic Recursion. Fundamenta Informaticae,
170(4):367–411.
Loukanova, R. (2019c). Gamma-star canonical forms in the
type-theory of acyclic algorithms. In van den Herik, J.
and Rocha, A. P., editors, Agents and Artificial Intel-
ligence, pages 383–407, Cham. Springer International
Publishing.
Loukanova, R. (2019d). Syntax-semantics interfaces of
modifiers. In Rodr
´
ıguez, S., Prieto, J., Faria, P.,
Kłos, S., Fern
´
andez, A., Mazuelas, S., Jim
´
enez-
L
´
opez, M. D., Moreno, M. N., and Navarro, E. M.,
editors, Distributed Computing and Artificial Intelli-
gence, Special Sessions, 15th International Confer-
ence, pages 231–239, Cham. Springer International
Publishing.
Moschovakis, Y. N. (1989). The formal language of recur-
sion. Journal of Symbolic Logic, 54(04):1216–1252.
Moschovakis, Y. N. (1993). Sense and denotation as algo-
rithm and value. In Oikkonen, J. and V
¨
a
¨
an
¨
anen, J.,
editors, Logic Colloquium ’90: ASL Summer Meet-
ing in Helsinki, volume Volume 2 of Lecture Notes in
Logic, pages 210–249. Springer-Verlag, Berlin.
Moschovakis, Y. N. (1997). The logic of functional recur-
sion. In Dalla Chiara, M. L., Doets, K., Mundici,
D., and van Benthem, J., editors, Logic and Scientific
Methods, volume 259, pages 179–207. Springer, Dor-
drecht.
Moschovakis, Y. N. (2006). A Logical Calculus of Mean-
ing and Synonymy. Linguistics and Philosophy,
29(1):27–89.
Moschovakis, Y. N. (2019). Abstract Recursion and Intrin-
sic Complexity, volume 45 of Lecture Notes in Logic.
Cambridge University Press.
ICAART 2020 - 12th International Conference on Agents and Artificial Intelligence
1010