Abstract Rewriting Systems and the Lambda Calculus

C.3 Abstract Rewriting Systems and the Lambda Calculus

As we mentioned in Sect. 6.5 , Abstract Rewriting Systems (ARS) are one of the best formal exemplifications of a concept of a physical symbol system, introduced by A. Newell and H.A. Simon. Such systems can be divided into Term Rewriting Systems (TRS) presented in this section, String Rewriting Systems (SRS), and Graph

Rewriting Systems (GRS). 10 The lambda calculus, being a special kind of TRS, plays

an important role in Artificial Intelligence (cf. Sect. 6.5 ).

Definition C.28 An Abstract Rewriting System, ARS is a pair

ARS = (A, {→ α : α ∈ I}) ,

where A is a set, → α is a set of binary relations, called rewrite relations, on A that are indexed by a set I.

Definition C.29 Let ARS = (A, {→ α : α ∈ I}) be an abstract rewriting system and α ∈ I.

(a) If (a, b) ∈→ α , for a, b ∈ A, then we talk about a direct step of rewriting a into

b , denoted a → α b (b is also called a (direct) reduct of a). (b) A rewriting sequence (or a rewriting) with → α is a finite or infinite sequence

a 0 → α a 1 → α a 2 → α .... The transitive and reflexive closure of a relation → α is denoted with ։ α .

Thus, a ։ α b , if there exists a finite (also: empty) rewriting sequence a ≡ a 0 → α

a 1 → α ···→ α a n ≡ b , where ≡ denotes an identity of elements belonging to the set A. An inverse relation to a relation → α (։ α ) is denoted with α ←( α և ).

Definition C.30

A relation → α in a set A is weakly confluent, in other words, has the weak Church-Rosser property (cf. Fig. C.1 a) iff the following condition is fulfilled

∀a, b, c ∈ A∃d ∈ A(b α ←a→ α c ⇒b։ α d α և c). Definition C.31

A relation → α in a set A is confluent, in other words, has the Church-Rosser property (cf. Fig. C.1 b) iff the following condition is fulfilled

∀a, b, c ∈ A ∃ d ∈ A (b α ևa։ α c ⇒b։ α d α և c).

10 Notions concerning SRS and GRS are presented in Appendix E .

Appendix C: Formal Models for Artificial Intelligence Methods … 263 Fig. C.1 Church-Rosser

property

(a)

(b)

Definition C.32 Let ARS = (A, → α )

be an abstract rewriting system. (a) a ∈ A is a normal form iff there does not exist b ∈ A such that a → α b .

(b) If a ։ α b and b ∈ A is a normal form, then we say that a ∈ A has a normal form and b is a normal form (for) a.

Now, we introduce basic notions for term rewriting systems. Definition C.33 • a countable infinite set of variables V = {a 0 , b 0 , c 0 ,..., z 0 , a 1 , b 1 , c 1 ,..., z 1 , a 2 ,

b 2 ,... } • a nonempty set of function symbols: f , g, . . .

A context, denoted C[ ], is a term 11 that includes a single occurrence of a symbol , which means an empty place. A substitution of a term t (t ∈ T (V)

in C[t] ∈ T (V) . We say that a term t is a subterm of C[t], denoted t ⊆ C[t]. Definition C.34 Mapping from T (V) to T (V) fulfilling the following condition:

σ(f (t 1 ,..., t n )) = f (σ(t 1 ), . . . , σ(t n )), where f is a function symbol, is called a substitution. A substitution σ(t) is often denoted with t σ .

11 A notion of term is introduced in the first section of this appendix.

264 Appendix C: Formal Models for Artificial Intelligence Methods … Definition C.35

A term rewriting rule is a pair (t, s), t, s ∈ T (V) such that t is not

a variable, and variables occurring in s are included in t.

A term rewriting rule (t, s) is often denoted with r : t → s, where r is an index identifying the rule, t is called the left-hand side of the rule, and s is called the

right-hand side of the rule.

A term rewriting rule r : t → s defines a set of rewrites t σ → r s σ for all the substitutions σ. Then, t σ is called an r-redex and s σ is called an r-contractum.

Definition C.36

A term rewriting step according to a rewriting rule r is a replace- ment of an r-redex t σ with an r-contractum s σ inside a context C[ ], denoted

[t σ ]→ r C [s ].

A term rewriting sequence is a finite or infinite sequence t 0 →t 1 →t 2 →···A

sequence t 0 →···→t n is denoted with t 0 ։t n .

Definition C.37

A Term Rewriting System, TRS is a pair

ARS

At the end of this section, we present basic definitions of the lambda calculus for

notions introduced informally in Chap. 6 .

Definition C.38

The following simplifying notation is used in the lambda calculus. • Outmost parentheses can be omitted.

• It is assumed that an application is left-associative, i.e. instead of (MN)P one can write MNP.

• Instead of λx 1 ( λx 2 (. . . ( λx n M) . . .)) one can write λx 1 x 2 ... x n M . An operator of a lambda abstraction λ binds variables in such a way that all the

occurrences of a variable x in an expression λx.M are bound. Let us introduce a definition of free variables in the lambda calculus.

Definition C.39 A set of free variables of a lambda expression M, denoted FV(M), is defined inductively in the following way.

F V(x) = {x},

F V(MN) = FV(M) ∪ FV(N),

F V(λx.M) = FV(M)\{x}.

Appendix C: Formal Models for Artificial Intelligence Methods … 265

A variable is a free variable of an expression M if it belongs to a set FV(M), otherwise it is a bound variable.

Let M ≡ N mean an identity of M and N up to renaming bound variables. A substitution for a free variable is defined in the following way.

Definition C.40

A substitution of an expression N for a free occurrence of a variable x in an expression M, denoted M[x := N], is defined in the following way.

x [x := N] ≡ N, y

( M 1 M 2 ) [x := N] ≡ (M 1 [x := N])(M 2 [x := N]),

( ∈ FV(N). At the end, let us introduce formal definitions of beta-reduction (β-reduction) and

alpha-conversion (α-conversion) which were discussed in Chap. 6 . Definition C.41

A beta-reduction, denoted → β fulfilling the following conditions.

• (λx.M)N → β M [x := N]. • If M → β M ′ , then: MZ → β M ′ Z , ZM → β ZM ′ , and λx.M → β λx.M ′ .

Definition C.42 α An alpha-conversion, denoted ≡, is the smallest equivalence rela-

λx.M α ≡ λy.(M[x := y]) for any y / ∈ FV(M).

Lambda expressions up to an alpha conversion are called lambda terms.

Dokumen yang terkait

Hubungan pH dan Viskositas Saliva terhadap Indeks DMF-T pada Siswa-siswi Sekolah Dasar Baletbaru I dan Baletbaru II Sukowono Jember (Relationship between Salivary pH and Viscosity to DMF-T Index of Pupils in Baletbaru I and Baletbaru II Elementary School)

0 46 5

Institutional Change and its Effect to Performance of Water Usage Assocition in Irrigation Water Managements

0 21 7

The Effectiveness of Computer-Assisted Language Learning in Teaching Past Tense to the Tenth Grade Students of SMAN 5 Tangerang Selatan

4 116 138

the Effectiveness of songs to increase students' vocabuloary at second grade students' of SMP Al Huda JAkarta

3 29 100

The effectiveness of classroom debate to improve students' speaking skilll (a quasi-experimental study at the elevent year student of SMAN 3 south Tangerang)

1 33 122

Kerjasama ASEAN-China melalui ASEAN-China cooperative response to dangerous drugs (ACCORD) dalam menanggulangi perdagangan di Segitiga Emas

2 36 164

The Effect of 95% Ethanol Extract of Javanese Long Pepper (Piper retrofractum Vahl.) to Total Cholesterol and Triglyceride Levels in Male Sprague Dawley Rats (Rattus novergicus) Administrated by High Fat Diet

2 21 50

Factors Related to Somatosensory Amplification of Patients with Epigas- tric Pain

0 0 15

The Concept and Value of the Teaching of Karma Yoga According to the Bhagavadgita Book

0 0 9

Pemanfaatan Permainan Tradisional sebagai Media Pembelajaran Anak Usia Dini untuk Mengembangkan Aspek Moral dan Bahasa Anak Utilization of Traditional Games as Media Learning Early Childhood to Develop Aspects of Moral and Language Children Irfan Haris

0 0 11