Type-Theory of Acyclic Algorithms with Generalised Immediate Terms
Roussanka Loukanova
Stockholm University, Stockholm, Sweden
Keywords:
Mathematics of Algorithms, Acyclic Recursion, Types, Algorithmic Semantics, Denotation, Immediate
Terms, Immediate Denotation, Canonical Form.
Abstract:
The paper extends the higher-order, type-theory L
λ
ar
of acyclic algorithms by classifying some explicit terms
as generalised immediate terms. We introduce a restricted, specialised iβ-rule and reduction of generalised
immediate terms to their iβ-canonical forms. Then, we incorporate the iβ-rule in the reduction calculus of L
λ
ar
.
The new reduction calculus provides more efficient algoritms for computation of values of terms, by using
iterative calculations.
1 INTRODUCTION
This paper is on development of a new approach to
the mathematical notion of algorithm, by providing
recursive computations as iteration using basic com-
ponents in structured memory units. Originally, the
approach was initiated by (Moschovakis, 1994). In
recent years, related work has been reinitiated in new
directions of higher-order type-theoriesof algorithms
and information. A potential prospect for applications
of the new approach is to data science and compu-
tational semantics of artificial and natural languages,
from the perspective of AI. In particular, the theory of
acyclic recursion L
λ
ar
, see (Moschovakis, 2006), mod-
els the concepts of meaning and synonymy in typed
models. The formal system L
λ
ar
is a higher-order type
theory, which is a proper extension of Gallin’s TY
2
,
see (Gallin, 1975), and thus, of Montague’s Inten-
sional Logic (IL), see (Montague, 1973). The type
theory L
λ
ar
and its calculi extend Gallin’s TY
2
, at the
level of the formal language and its semantics, by us-
ing several means: (1) two kinds of variables (recur-
sion variables, called alternatively locations, and pure
variables); (2) by formation of an additional kind of
recursion terms; (3) systems of rules that form vari-
ous calculi, i.e., reduction calculi and the calculus of
algorithmic synonymy.
In the first part of the paper, we give the formal
definitions of the syntax and denotational semantics
of the language of L
λ
ar
, by providing intuitive descrip-
tions. Then, we give an informal description of the
algorithmic semantics of L
λ
ar
, and based on that, we
present a formal introduction to the major notions of
algorithmic equivalence between terms of L
λ
ar
. In this
introduction of L
λ
ar
, we have reformulated some of its
major theoretical characteristics, from the perspective
of potential theoretical and practical developments,
for applications to AI.
The second part of the paper is devoted to extend-
ing the reduction calculus of L
λ
ar
. The purpose is to
reduce the complexity of the algorithmic computa-
tions of the interpretations of L
λ
ar
terms, by simpli-
fying them. The new reduction system preserves the
major characteristics of the algorithms, while reduc-
ing computational steps that are inessential from com-
putational perspective.
Major characteristics and results of the theory of
L
λ
ar
and its original reduction system, are essential for
the mathematical notion of algorithm, and related ap-
plications to algorithmic semantics, especially in AI
areas. The first part of this paper introduces some of
the major concepts of L
λ
ar
, which are necessary for the
new contribution in the second part.
2 SYNTAX AND SEMANTICS
Syntax of L
λ
ar
. The formal language and calculus
L
λ
ar
(K) properly extends a corresponding version of
the classic typed λ-calculus, e.g., Ty
2
(Gallin, 1975;
Gallin, 2011), and thus, of Montague Intensional
Logic (IL) (Montague, 1973).
Types. The set Types is defined by the following
rules of a Context-free Grammar (CFG), in Backus-
Naur Form (BNF):
746
Loukanova, R.
Type-Theory of Acyclic Algorithms with Generalised Immediate Terms.
DOI: 10.5220/0007410207460754
In Proceedings of the 11th International Conference on Agents and Artificial Intelligence (ICAART 2019), pages 746-754
ISBN: 978-989-758-350-6
Copyright
c
2019 by SCITEPRESS Science and Technology Publications, Lda. All rights reserved
T
::
= e | t | s | (T T ) (1)
The type e is the type of the semantic entities and the
expressions denoting entities; t of the truth values and
corresponding expressions, s of the states. The types
(τ σ) are the types of functions from objects of type
τ to objects of type σ, and of expressions denoting
such functions.
The language L
λ
ar
(K) has typed constants: K =
S
τTypes
K
τ
, where K
τ
= {c
0
τ
,... ,c
τ
k
,. .. }. Distinc-
tively, L
λ
ar
(K) is that it has two kinds of typed vari-
ables: Vars = PureVarsRecVars, called pure vari-
ables, PureVars, and recursion variables, RecVars, so
that for each τ Types, PureVars
τ
= {v
0
,v
1
,. ..} and
RecVars
τ
= {r
0
,r
1
,. ..}.
Terms. The set Terms of L
λ
ar
is defined in a re-
cursive style, with the type assignments either as su-
perscripts or with colon sign:
A
:
c
τ
| x
τ
| (2a)
B
(στ)
(C
σ
)
τ
| (2b)
λv
σ
(B
τ
)
(στ)
| (2c)
A
σ
0
0
where { p
σ
1
1
:
= A
σ
1
1
,. .. , p
σ
n
n
:
= A
σ
n
n
}
σ
0
(2d)
c
τ
K
τ
; x
τ
PureVars
τ
RecVars
τ
; v
σ
PureVars
σ
;
A,B, A
σ
i
i
Terms (i = 0,. .. ,n); p
i
RecVars
σ
i
(i =
1,. .. ,n); {p
σ
1
1
:
= A
σ
1
1
,. .. , p
σ
n
n
:
= A
σ
n
n
} is an acyclic
sequence of assignments satisfying AC:
Acyclicity Constraint AC 1. For any given terms
A
1
: σ
1
, . . . , A
n
: σ
n
, and recursion variables p
1
:
σ
1
, . . . , p
n
: σ
n
, the set {p
1
:
= A
1
,. .. , p
n
:
= A
n
}
is an acyclic system of assignments iff there is a
ranking function rank : {p
1
,. .. , p
n
} N such that,
if p
j
occurs freely in A
i
then rank(p
j
) < rank(p
i
).
Denotational Semantics of L
λ
ar
. The language L
λ
ar
has denotational semantics that is given by a defini-
tion of a denotational function for semantic structures
with typed domain frames. The denotation function
of L
λ
ar
is defined by the structure of the L
λ
ar
terms.
A semantic structure (model) of L
λ
ar
is a tuple A =
hT,I i, where:
(S1) T, called the frame of A, is a set of typed sets of
objects:
T = {T
σ
| σ Types} where T
e
6= is a set of
entities, T
t
= {0, 1, er} T
e
of truth values, T
s
6=
of states
(S2) T is a standard frame:
T
(τ
1
τ
2
)
= { p | p : T
τ
1
T
τ
2
}
(S3) I : K T, is the interpretation function of A,
and for every c K
τ
, I (c) = c, for some c T
τ
(S4) the set of the variable assignments or valua-
tions, in A is:
G = { g | g : Vars T
and g(x) T
σ
, for every x : σ}
(3)
Definition 1 (Denotation Function). There is a func-
tion den
A
: Terms (G
S
T) defined by structural
induction on A Terms
σ
.
(D1) Variables and constants:
den
A
(x)(g) = g(x), for all x Vars (4a)
den
A
(c)(g) = I (c), for all c K (4b)
(D2) Application terms:
den
A
(A(B))(g) =
den
A
(A)(g)(den
A
(B)(g))
(5)
(D3) λ-abstraction terms: For all x : τ and B : σ,
den
A
(λ(x)(B))(g) : T
τ
T
σ
is the function such
that, for every t T
τ
,
[den
A
(λ(x)(B))(g)]
t
=
den
A
(B)(g{x
:
= t})
(6)
(D4) Recursion terms:
den
A
(A
0
where { p
1
:
= A
1
,. .. ,
p
n
:
= A
n
})(g)
(7a)
= den
A
(A
0
)(g{ p
1
:
= p
1
,. .. ,
p
n
:
= p
n
})
(7b)
where p
i
T
τ
i
are computed by recursion on
rank(p
i
), so that:
p
i
= den
A
(A
i
)(g{ p
i,1
:
= p
i,1
,. .. ,
p
i,k
i
:
= p
i,k
i
})
(8)
where p
i,1
, . . . , p
i,k
i
are the recursion variables
p
j
{p
1
,. .. , p
n
} with rank(p
j
) < rank(p
i
).
For a semantic structure A with standard frame T,
the denotation function den
A
, defined by the above
induction, exists and is unique.
We say that two terms A, B Terms are denota-
tionally equivalent, and write A = B, when A and B
have the same denotations, for all A and variable val-
uations in A, i.e.:
for a given A:
A |= A = B A
A
= B (9a)
den
A
(A)(g) = den
A
(B)(g)
for all g G in A
(9b)
A = B for all A, A |= A = B (10)
In this paper, we assume that A is a given, fixed
structure. Often, when it is understood, we skip writ-
ing A, e.g., in the subscripts, and in den
A
, by den.
Type-Theory of Acyclic Algorithms with Generalised Immediate Terms
747
Proper vs. Immediate Terms. Obtaining the de-
notational value den(A) of a canonically immediate
term A CImT does not involve any algorithmic steps
for its calculations. It is computed immediately from
the values of its free variables by a relevant valua-
tion function g G, and by functional application, or
λ-abstractions, according to Definition 1 of the deno-
tation function. This is done without resorting to al-
gorithmic steps and without extraction of denotation
values from memory locations, where they have been
saved after other computation steps.
On the other hand, the denotation den(A) of a
proper term A PrT requires calculations by an algo-
rithm depending on its syntactic structure, and using
also Definition 1.
The denotation values of generalised immediate
terms are obtained immediately, by employing their
β-canonical forms, which are canonically immediate
terms. That is, these denotations are obtained by us-
ing the valuation function for free variables and func-
tion applications to values, and also by forming new
functions by λ-abstractions, according to Definition 1,
3 REDUCTION CALCULUS
Definition 2 (Congruence). The congruence relation
is the smallest equivalence relation
c
between L
λ
ar
-
terms:
1. reflexivity, symmetricity, transitivity
2. the term formation rules of L
λ
ar
, for constants, vari-
ables, application, λ-abstraction, and acyclic re-
cursion
3. renaming bound, pure and recursion variables,
without causing variable collisions
4. re-ordering of assignments
Reduction Rules.
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
, then
A(B) A
0
(B
0
)
(c-ap)
If A B, then
λ(u)(A) λ(u)(B)
(c-λ)
If A
i
B
i
, for i = 0, . . . , n, then
A
0
where { p
1
:
= A
1
,. .. , p
n
:
= A
n
}
B
0
where { p
1
:
= B
1
,. .. , p
n
:
= B
n
}
(c-rec)
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
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
i
occurs free in any A
j
, for i = 1,
. . . , n, j = 1, . . . , m
Recursion-application rule: (recap)
(A
0
where {
p
:
=
A }
(B)
A
0
(B) where {
p
:
=
A }
given that no p
i
occurs free in B for i = 1, . . . , n
Application rule: (ap)
A(B) A(p) where {p
:
= B}
given that B is a proper term and p is a fresh loca-
tion
λ-rule: (λ)
λ(u)(A
0
where { p
1
:
= A
1
,. .. , p
n
:
= A
n
})
λ(u)A
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)}
for all i { 1, . . . , n }
(11)
Definition 3 (Reduction Relation, ).
The reduction relation between terms is the small-
est relation, denoted by , between terms that is
closed under the reduction rules
For any two terms A and B, A reduces to B, de-
noted by A B, iff B can be obtained from A by
a finite number of applications of reduction rules
Definition 4 (Term Irreducibility). We say that a term
A Terms is irreducible if and only if
for all B Terms, if A B, then A
c
B (12)
The following theorems are major results that are
essential for algorithmic semantics.
For every term A L
λ
ar
, there is an irreducible term
C, denoted by cf(A) and called the canonical form of
A, which satisfies Theorem 1.
ICAART 2019 - 11th International Conference on Agents and Artificial Intelligence
748
Theorem 1 (Extended Canonical Form Theorem: ex-
istence and uniqueness of the canonical forms). See
(Moschovakis, 2006), § 3.1 and § 3.14. For every term
A L
λ
ar
, the following properties hold:
1. (Existence of a canonical form of A) There exist
explicit, irreducible terms A
0
, . . . , A
n
(n 0) such
that
cf(A) A
0
where { p
1
:
= A
1
,. .. ,
p
n
:
= A
n
},
(13)
Thus, cf(A) is irreducible
2. A constant c K or a variable x Vars occurs
freely in cf(A) if and only if it occurs freely in A
3. A cf(A)
4. If A is irreducible, then cf(A)
c
A
5. If A B, then cf(A)
c
cf(B)
6. (Uniqueness of the canonical forms up to congru-
ence) If A B and B is irreducible, then B
c
cf(A), i.e., cf(A) is an unique, up to congruence,
irreducible term
Proof. By induction on term structure and using the
reduction rules
We write
A
cf
B B
c
cf(A) (14)
A
cf
cf(A) (15)
Definition 5 (Syntactic Equivalence
s
). For any
A,B Terms,
A
s
B cf(A)
c
cf(B) (16)
For more about syntactic synonymy (i.e., syn-
tactic equivalence), see (Moschovakis, 2006). The
difference between the syntactic synonymy
s
and
algorithmic synonymy in the selected A(K), is
that syntactic synonymy does not apply to denota-
tionally equivalent constants and syntactic constructs
such as λ-abstracts. For instance, assuming that dog
and canine are constants, such that den
A
(dog) =
den
A
(canine), then dog canine (by the Referen-
tial Synonymy Theorem 1), because both terms are
in canonical forms. On the other hand, dog 6≈
s
canine, since dog 6≡
c
canine. Also, den
A
(dog) =
den
A
(λ(x)dog(x)) (by the clauses (D1), (D3) of the
Definition 1 of the denotation function). There-
fore, dog λ(x)dog(x) (by the Referential Synonymy
Theorem 3), because both terms are in canonical
forms. On the other hand, dog 6≈
s
λ(x)dog(x), be-
cause dog 6≡
c
λ(x)dog(x).
Theorem 2. For any A, B Terms,
A B = A
s
B = A B = A = B (17)
4 ALGORITHMIC SEMANTIC
DATA
We shall consider a given, fixed A(K), which takes a
collection of data as its typed domains of objects and
functions. The constants from K of L
λ
ar
(K) are inter-
preted in the typed domains determined by the data.
For each term A, the variable valuations g G provide
values g(χ) of the free variables χ FreeV(A).
4.1 On the Algorithmic Semantics
The notion of intension in the class of formal lan-
guages of recursion covers the most essential, com-
putational aspect of the concept of meaning. The no-
tion of algorithm in L
λ
ar
is provided by formal syntax-
semantics interface of the theory and calculi of L
λ
ar
.
Informally, for a given meaningful, i.e., proper,
term A Terms and a semantic structure A, the ref-
erential intension of A is the algorithm for comput-
ing den(A) with interpretational reference to A. That
is, A Terms is a mathematical tuple of functions (a
recursor) that is defined by the denotations den(A
i
)
(i {0, . . . n}) of the parts, i.e., the head subterm 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
}
Two meaningful expressions are synonymous iff
their referential intensions are naturally isomorphic,
i.e., they are the same algorithms. Thus, the algo-
rithmic meaning of a proper term (i.e., its algorithmic
sense) is the information about how to “compute” its
denotation step-by-step: a proper term A determines
the algorithm for computing den)A) by carrying in-
structions within its term structure, which are revealed
by its canonical form cf(A), for computing what the
parts denote in A of a data system. Thus, the canoni-
cal form cf(A) of a proper A Terms determines the
algorithmic steps for computing semantic denotations
by using all necessary basic components of cf(A):
1. the basic instructions (facts), which consist of
{p
1
:
= A
1
, . . . , p
n
:
= A
n
}, i.e., each den(A
i
)(g)
is computed and “saved” in p
i
accordingly, by re-
cursion with respect to rank(p
i
)
2. den(A
i
)(g) of the head term A
0
is computed by
using the values in p
i
3. finally den(A)(g) = den(A
i
)(g)
4. the acyclicity constraint over each term A guaran-
tees a terminating algorithm by the rank order of
the recursive steps that compute each den(A
i
), for
i {0, .. ., n}, for incremental computation of the
denotation den(A) = den(A
0
)
Type-Theory of Acyclic Algorithms with Generalised Immediate Terms
749
Table 1: Algorithmic Semantics in L
λ
ar
.
L
λ
ar
Computations: Algorithms Denotations
| {z }
Algorithmic Semantics
A
cf
cf(A) (18a)
cf(A) determines the algorithm for
computing den(A)
den(A) = den
cf(A)
(18b)
The class of formal languages of Moschovakis re-
cursion offers formalisation of central computational
aspects, by (at least) two semantic “levels”:
1. algorithms, as mathematical objects, recursors,
which are determined by the terms in canonical
form
2. denotations, computed by recursive algorithms
The canonically immediate terms have canonical
forms and denotations, but they do not determine
any algorithms. For every canonically immediate
term A λ(~x)
X(~y)
, where X Vars, its denotation
den(A)(g) is obtained immediately, from the variable
values g(y), for all y FreeV(A), without performing
any designated algorithmic calculations.
In (Moschovakis, 2006), the recursor of a given
A Terms is called its referential intension. We prefer
to call these mathematical objects algorithms, e.g., re-
cursive procedures, for computing denotations. This
is more appropriate since it covers the mathematical
concept of algorithm, from foundational view. We
would try to avoid reloading the classic terminology
of the concept of intension, which has been estab-
lished since Montague’s Intensional Logic (IL), see
(Montague, 1973). In addition, the denotation func-
tion den in L
λ
ar
covers the classic
`
a la Montague notion
of intension. For every state dependent type (s τ):
den(A)(g): T
s
T
τ
,every term A : (s τ) (19)
The general scheme in Table 1 depicts the algo-
rithmic semantics of L
λ
ar
and its role for its denota-
tional semantics.
4.2 Algorithmic Equivalence
Here, we give criteria for algorithmic equivalence be-
tween terms that are interpreted in a given A(K). The
selected semantic structure A is based on a collection
of data structured in typed domains of objects, with
interpretations of constants and variable valuations in
the data domains.
Theorem 3 (Algorithmic Equivalence in A). (This is
a slightly extended version of the corresponding Ref-
erential Synonymy Theorem in (Moschovakis, 2006))
Two terms A, B are algorithmically (i.e., referentially)
synonymous, A B, if and only if one of the following
cases holds:
1. both terms A and B are immediate and for all val-
uations g G, den(A)(g) = den(B)(g)
2. or, both A and B are proper terms, and there are
explicit, irreducible terms of corresponding types,
A
i
: σ
i
and B
i
: σ
i
, i = 1, . . . , n (n 0) such that:
A
σ
0
cf
A
σ
0
0
where { p
1
:
= A
σ
1
1
,. .. ,
p
n
:
= A
σ
n
n
}
(19a)
B
σ
0
cf
B
σ
0
0
where { p
1
:
= B
σ
1
1
,. .. ,
p
n
:
= B
σ
n
n
}
(19b)
and for all i = 0, . . . , n,
den(A
i
)(g) = den(B
i
)(g), for all g G (20a)
Informally, A and B are algorithmically equiva-
lent, A B, in a given semantic structure A, if and
only if one of the following cases holds
1. Both A and B are immediate, i.e., do not have any
algorithmic meanings, and A and B have the same
denotations in A
2. A and B are proper terms with algorithmic mean-
ings, and the denotations of A and B, in A, are
equal and computed by the same algorithm. It
is determined by their canonical forms, cf(A)
and cf(B), with corresponding basic algorithmic
steps, represented by the denotationally equal, ir-
reducible parts A
i
and B
i
. The denotations of A
i
and B
i
are computed inductively, i.e., by mutual
recursion from the lowest up to the highest induc-
tion rank
In Table 2, the restrictions CRestr1(b) and CRe-
str2(c) are necessary.
Theorem 4 (Compositionality Theorem for algorith-
mic synonymy in a selected, fixed semantic struc-
ture A). For all A Terms
σ
, B,C Terms
τ
, x
PureVars
τ
, such that the substitutions A{x
:
B } and
A{x
:
C } are free, i.e., do not cause variable colli-
sions:
B C A{x
:
B } A{x
:
C } (21)
Proof. The proof is by induction on the term structure
of A, by using the rules of referential synonymy in
Table 2.
ICAART 2019 - 11th International Conference on Agents and Artificial Intelligence
750
Table 2: The calculus of algorithmic synonymy , with re-
spect to referential intensions in a fixed A.
A
s
B
A B (SynA)
A A
B A
A B
A B B C
A C
(EqRel)
A
1
B
1
A
2
B
2
A
1
(A
2
) B
1
(B
2
)
(ApC)
A B
λ(u)A λ(u)B
(λC)
A
0
B
0
A
1
B
1
.. . A
n
B
n
A
0
where {~a
:
=
~
A} B
0
where {
~
b
:
=
~
B}
(whC)
|= C = D
C D
(C, D e.i., CRestr1)
(eiEq)
λ(u)C
(v) C{u
:
v}
(C e.i., CRestr2)
(βEq)
where “e.i. stands for “explicit, irreducible term(s)”,
and the restrictions CRestr1–CRestr2 hold:
CRestr1 in (eiEq):
(a) |= C = D iff
for all g G, den
A
(C)(g) = den
A
(B)(g)
(b) C, D are e.i., both immediate or both proper
CRestr2 in (βEq):
(a) C is e.i. term
(b) u, v PureVars, the substitution C{u
:
v} is
free
(c)
λ(u)C
(v), C{u
:
v} are both immediate, or
both proper terms
5 GENERALISED IMMEDIATE
TERMS
5.1 Canonically Immediate Terms
In this section, we generalise the concept of immedi-
ately obtained denotations.
A set of special terms, called immediate terms, has
a significant role in the reduction calculus of L
λ
ar
and
in the notion of algorithmic semantics. Informally, the
immediate terms are formed only from variables of
both kinds, by a succession of applications of a recur-
sion variable to pure variables, which can be followed,
on the top level by a succession of λ-abstractions.
At first, we shall define the set of the canonically
immediate terms by Definition 22a using the Backus-
Naur notational style, TBNF. In (Moschovakis, 2006),
these terms, without allowing pure variables as appli-
cant, are just all the immediate terms. The canon-
ically immediate terms can have pure and recursion
variables as the applicant of an applicative immediate
term, while the arguments can only be pure variables.
Definition 6 (Canonically Immediate Terms, CImT,
explicating types: TBNF Notational Style). The set
CImT of the canonically immediate terms consists of
the terms defined as follows:
T
τ
:
X
τ
| V
(τ
1
...(τ
m
τ))
(v
τ
1
1
). .. (v
τ
m
m
) (22a)
T
(σ
1
...(σ
n
τ))
:
(22b)
λ(u
σ
1
1
). .. λ(u
σ
n
n
)V
(τ
1
...(τ
m
τ))
(v
τ
1
1
). .. (v
τ
m
m
)
where n 0, m 0; u
i
PureVars
σ
i
, for i = 1, .. ., n;
v
j
PureVars
τ
j
, for j = 1, .. ., m; V Vars
τ
, V
Vars
(τ
1
...(τ
m
τ))
.
The above TBNF in Definition 6 can be given
without mentioning the actual type assignments:
Definition 7 (Abbreviated CImT, without explicating
types).
T
:
V | V (v
1
). .. (v
m
) | (23a)
λ(u
1
). .. λ(u
n
)V (v
1
). .. (v
m
) (23b)
m,n 0, u
j
,v
i
, PureVars, (23c)
V Vars (23d)
Note that, in Definitions 6–7, T , X , V , u
i
, v
i
are
metavariables. We can present the TBNF Definition 7
of the set CImT of the canonically immediate terms,
by using a simple Context-free Grammar (CFG) in
BNF, without the relevant type assignment:
Definition 8 (Canonically Immediate Terms, CImT:
BNF).
I
ci
::
= A
ap
| A
λ
(24a)
A
ap
::
= V | A
ap
(X) (24b)
A
λ
::
= λ(X)(A
λ
) | λ(X)(A
ap
) (24c)
V
::
= X | R (24d)
R
::
= r, for each r RecVars (24e)
X
::
= x, for each x PureVars (24f)
In Definitions 8–9, the symbols I
ci
, A
ap
, etc., are
nonterminals naming the corresponding to syntactic
categories.
Definition 9 (Generalised Immediate Terms, GImT).
The set of the generalised immediate terms, GImT,
Type-Theory of Acyclic Algorithms with Generalised Immediate Terms
751
is generated by a grammar, which is presented in
BNF style notation (without the necessary type as-
signments), consisting of the rules in (25) by adding
the ones from Definition 8.
I
gi
::
= I
ci
| I
gi
(X) | λ(X)(I
gi
) (25)
The generalised immediate terms are formed from
variables of both kinds, in each type, and the oper-
ations application and λ abstraction, so that, recur-
sively, the applicants are generalised terms, the argu-
ments are pure variables, and the λ-abstraction over
proper variables.
Example 5.1.
h
λ(x
1
)λ(x
2
). ..
V (y
1
). .. (y
1
)
i
(z
k
1
). .. (z
k
m
) (26a)
λ(~u)
λ(~x)
X(~y)
(~z)
(26b)
λ(u)C
(v) (26c)
λ(~u)C
(~v) (26d)

λ(~u)C
(~v)

~z
(26e)
where C GImT is a generalised immediate term
Often, we shall say that a term A is immediate
term when it is a generalised immediate term, i.e.,
A GImT.
Definition 10 (Proper Terms). A term A is proper if
it is not immediate:
PrT = (Terms GImT) (27)
5.2 i-Beta Reduction
In this section, we extend the reduction calculus of L
λ
ar
by
Replacing the (ap)-rule with a new version for the
new notion of immediate terms, i.e., generalised
immediate terms
Adding the following restricted iβ-rule to the re-
duction rules in Sect. 3.
Restricted iβ-rule: For any u, v PureVars and
any generalised immediate term C GImT
such that the replacement C{u
:
v} is free
λ(u)(C)
(v)
iβ
C{u
:
v} (iβ)
Definition 11 (iβ Reduction Relation,
iβ
).
The iβ-reduction relation between terms is the
smallest relation, denoted by
iβ
, between terms
that is closed under the extended reduction rules,
including the updated (ap)-rule and
iβ
For any two terms A and B, A iβ-reduces to B,
denoted by A
iβ
B, iff B can be obtained from
A by a finite number of applications of reduction
rules, from the extended reduction calculus
Definition 12 (Term Irreducibility in
iβ
). We say
that a term A Terms is iβ irreducible if and only if
for all B Terms, if A
iβ
B, then A
c
B (28)
For every term A L
λ
ar
, there is an iβ-irreducible
term C, which we denote by ibcf(A) and call a iβ-
canonical form of A, which satisfies Theorem 5.
Theorem 5 (iβ-Canonical Form). For every A
Terms, the following properties hold:
(1) (Existence of an iβ-canonical form of A) There ex-
ist explicit, iβ-irreducible terms A
0
, . . . , A
n
(n 0)
such that
ibcf(A) A
0
where { p
1
:
= A
1
,. .. ,
p
n
:
= A
n
}
(29)
and thus, ibcf(A) is iβ-irreducible
(2) A constant c or a recursion variable r RecVars
occurs freely in ibcf(A) if and only if it occurs
freely in A; some pure variables may occur in A,
but not in ibcf(A): FreeV(ibcf(A)) PureVars
FreeV(A) PureVars
(3) A ibcf(A)
(4) If A is iβ-irreducible, then ibcf(A)
c
A
(5) If A
iβ
B, then ibcf(A)
c
ibcf(B)
(6) (Uniqueness of the iβ-canonical forms up to con-
gruence) If A B and B is iβ-irreducible, then
B
c
ibcf(A), i.e., ibcf(A) is the unique, up to con-
gruence, iβ-irreducible term
Proof. By induction on term structure and using the
extended system of reduction rules
(1) is proved by structural induction on formation
of terms and using the definition of the ibcf(A)
(2) and (3) are proved by induction on terms and
using the reduction rules
(4) by induction on the definition of the iβ reduc-
tion relation
(5) follows from (3) and (4)
Note that for some terms A, there may be pure
variables which have free occurrences in A, but not
in ibcf(A), i.e., there maty be x FreeV, such that
x FreeV(A), while x 6∈ FreeV(ibcf(A)).
We write
A
ibcf
B B
c
ibcf(A) (30a)
A
ibcf
ibcf(A) (30b)
ICAART 2019 - 11th International Conference on Agents and Artificial Intelligence
752
Theorem 6 (Canonically Immediate Terms: exis-
tence and uniqueness). For each generalised imme-
diate term A GImT, there is a unique, up to congru-
ence, iβ-irreducible term C, such that:
1. C CImT is canonically immediate term
2. A
iβ
C
3. if A
iβ
B and B is iβ-irreducible, then B
c
C, i.e., C is the unique, up to congruence, iβ-
irreducible term to which A can be reduced
4. C
c
ibcf(A), i.e., A
ibcf
ibcf(A)
Proof. By induction on the structure of A GImT,
using Definition 9, which extends Definition 8, and
Theorem 5.
The terms in Example (5.1) are not canonically
immediate, while they are explicit, irreducible terms
in canonical forms, in the original reduction calculus
of L
λ
ar
. Thus, they have algorithmic meanings. Their
denotations are computed by the denotation function
den over a sequence of λ-abstractions and applica-
tions. Some of these terms are algorithmically equiv-
alent to simpler terms by the rule (βEq) in Table 2. In
this paper we have extended the reduction calculus of
L
λ
ar
, to
iβ
-reduction. The purpose of this is effective
reduction of such terms A, which are not per se imme-
diate in the original system of L
λ
ar
, to canonically im-
mediate terms ibcf(A). By this, we reduce their struc-
ture to simpler, canonically immediate terms. The de-
notations of such terms, den(A) = den(ibcf(A)), are
obtained directly, immediately by den(ibcf(A)). This
reduces the complexity of terms in which they occur
as sub-terms.
6 CONCLUSIONS AND FUTURE
WORK
In this paper, we have introduced iβ-rule and
iβ
-
reduction for the purpose of reducing complexity of
algorithmic computations. The iβ rule and its re-
duction system,
iβ
, reduces generalised immediate
terms A GImT, e.g., such as the ones in Exam-
ple (5.1), and other terms in which they occur, to sim-
pler terms.
An important purpose of the introduced canoni-
cally immediate and generalised immediate terms, by
Definitions 6–9, concerns technical details. The cal-
culus of algorithmic synonymy in Table 2, which is
introduced by (Moschovakis, 2006), covers more than
the original reduction calculus to canonical forms.
The rules (eiEq) and the restricted β-reduction (βEq)
provide algorithmic equivalence of limited, explicit
irreducible terms, by appealing to finding their se-
mantic denotations. The canonically immediate terms
provide the denotations of respective generalised im-
mediate terms, without loosing any essential algo-
rithmic steps and declaratively, which remain in iβ-
reductions. The iβ-reduction introduced here, com-
plements the algorithmic semantics in this aspect.
Technical details are beyond the scope of this paper
and will be provided in extended work.
The
iβ
-reduction system is introduced in this
work for the first time, up to our knowledge. The next
direct line of work is to investigate more characteris-
tics of the iβ-rule and
iβ
-reduction system.
In future, extended work, we shall investigate how
the iβ reduction rule can be incorporated with other
extended reduction systems of L
λ
ar
. Of particular inter-
ests is upcoming work on integrating the results from
this paper on iβ-rule and
iβ
-reduction with work in
(Loukanova, 2016a; Loukanova, 2016b; Loukanova,
2018).
The results in this paper are on theoretical devel-
opments for more efficient and adequate formalisation
of computations based on formal and computer lan-
guages, for applications to advanced, intelligent tech-
nologies in AI.
REFERENCES
Gallin, D. (1975). Intensional and Higher-Order Modal
Logic. North-Holland.
Gallin, D. (2011). Intensional and higher-order modal
logic: with applications to Montague semantics, vol-
ume 19. Elsevier.
Loukanova, R. (2016a). Acyclic Recursion with Polymor-
phic Types and Underspecification. In van den Herik,
J. and Filipe, J., editors, Proceedings of the 8th In-
ternational Conference on Agents and Artificial Intel-
ligence, volume 2, pages 392–399. SCITEPRESS
Science and Technology Publications, Lda.
Loukanova, R. (2016b). 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. (2018). Gamma-star Reduction in the Type-
theory of Acyclic Algorithms. In Rocha, A. P. and
van den Herik, J., editors, Proceedings of the 10th
International Conference on Agents and Artificial In-
telligence (ICAART 2018), volume 2, pages 231–
242. INSTICC, SciTePress Science and Technol-
ogy Publications, Lda.
Montague, R. (1973). The Proper Treatment of Quantifi-
cation in Ordinary English. In Hintikka, J., Moravc-
sik, J., and Suppes, P., editors, Approaches to Natural
Language, pages 221–242. D. Reidel Publishing Co.,
Dordrecht, Holland.
Type-Theory of Acyclic Algorithms with Generalised Immediate Terms
753
Moschovakis, Y. N. (1994). Sense and denotation as algo-
rithm and value. In Oikkonen, J. and Vaananen, J.,
editors, Lecture Notes in Logic, number 2 in Lecture
Notes in Logic, pages 210–249. Springer.
Moschovakis, Y. N. (2006). A logical calculus of meaning
and synonymy. Linguistics and Philosophy, 29(1):27–
89.
ICAART 2019 - 11th International Conference on Agents and Artificial Intelligence
754