Download presentation
Presentation is loading. Please wait.
Published byGladys Harrell Modified over 9 years ago
1
1/44 #-Rewriting Systems Based upon Brno University of Technology, Czech Republic meduna@fit.vutbr.cz Křivka, Z., Meduna, A., Schönecker, R.: Generation of Languages by Rewriting Systems that Resemble Automata, In: IJFCS Vol. 17, No. 5, 2006 and An Infinite Hierarchy Resulting from Them
2
2/44 Contents 1. Concepts 2. Definition 3. Main Result: An Infinite Hierarchy 4. Open Problem Areas
3
3/44 #-Rewriting Systems in Formal Language Theory Language-defining models Pure rewriting systems Between automata and grammars: have states but generate languages
4
4/44 Concept #-Rewriting System is based on the rules of the form p m # q x 0 # x 1 … # x n by which the system makes a computational step as (p, …#y m-1 #y m #y m+1 …) (q, …# y m-1 x 0 #x 1 …#x n y m # y m+1 …) mth #
5
5/44 Definition 1/2 #-Rewriting System (#RS) is a quadruple H = (Q, , s, R), where Q finite set of states, alphabet, # is called a bounder, s Q start state, R finite set of rules of the form p m # qx where p, q Q, m is a positive integer, x *.
6
6/44 Definition 2/2 Computational step: (p, u#v) (q, uxv) [p m # qx R], where the number of #s in u is m – 1, p, q Q, u, x, v *. Configuration: (q, x), q Q, x * Generated language: L(H) = {w ( – #) * : (s, #) * (q, w) in H, q Q}.
7
7/44 Example: #RS #RS H: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c H accepts aabbcc:
8
8/44 Example: #RS (s, #) #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
9
9/44 Example: #RS (s, #) [1] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
10
10/44 Example: #RS (s, #) (p, ##) [1] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
11
11/44 Example: #RS (s, #) (p, ##) [1] [2] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
12
12/44 Example: #RS (s, #) (p, ##) [1] (q, a#b#) [2] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
13
13/44 Example: #RS (s, #) (p, ##) [1] (q, a#b#) [2] [3] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
14
14/44 Example: #RS (s, #) (p, ##) [1] (q, a#b#) [2] (p, a#bc#) [3] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
15
15/44 Example: #RS (s, #) (p, ##) [1] (q, a#b#) [2] (p, a#bc#) [3] [4] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
16
16/44 Example: #RS (s, #) (p, ##) [1] (q, a#b#) [2] (p, a#bc#) [3] (f, aabbc#) [4] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
17
17/44 Example: #RS (s, #) (p, ##) [1] (q, a#b#) [2] (p, a#bc#) [3] (f, aabbc#) [4] [5] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
18
18/44 Example: #RS (s, #) (p, ##) [1] (q, a#b#) [2] (p, a#bc#) [3] (f, aabbc#) [4] (f, aabbcc) [5] #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
19
19/44 Example: #RS (s, #) (p, ##) [1] (q, a#b#) [2] (p, a#bc#) [3] (f, aabbc#) [4] (f, aabbcc) [5] L(H) = {a n b n c n : n 1} #RS H: H accepts aabbcc: [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
20
20/44 Finite index of #RS #-Rewriting systems of index k: over configurations with k or fewer #s #RS k – the language family generated by #RSs of index k Example: Index k = 2: 1. (p, a#a#b) (q, aa#aa#b) [p 1 # qa#a R]OK 2. (p, a#a#b) (q, a#aa##bb) [p 2 # qa##b R]INCORRECT
21
21/44 Example: #RS of finite index (s, #) (p, ##) [1] (q, a#b#) [2] (p, a#bc#) [3] (f, aabbc#) [4] (f, aabbcc) [5] L(H) = {a n b n c n : n 1} #RS 2 #RS H: H accepts aabbcc: H is of index 2. [1]. s 1 # p ## [2]. p 1 # q a#b [3]. q 2 # p #c [4]. p 1 # f ab [5]. f 1 # f c
22
22/44 Main Result: An Infinite Hierarchy Theorem: #RS k #RS k+1, for all k 1. Proof: makes use of programmed grammars (PG) of index k
23
23/44 Proof: Programmed Grammars Programmed Grammar (PG) is a modification of context-free grammar based on the rules of the form: r: A x, W r r: A x is a context-free rule labeled by r, W r finite set of rule labels Derivation step ( ): after the application of rule r, a rule from W r has to be applied
24
24/44 Proof: Finite index of PG Programmed grammars of index k: over sentential forms with k or fewer occurrences of nonterminals. P k – the language family defined by programmed grammars of index k
25
25/44 Example: PG PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
26
26/44 Example: PG S PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
27
27/44 Example: PG S [1] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
28
28/44 Example: PG S ABC [1] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
29
29/44 Example: PG S ABC [1] [2] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
30
30/44 Example: PG S ABC [1] aABC [2] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
31
31/44 Example: PG S ABC [1] aABC [2] [3] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
32
32/44 Example: PG S ABC [1] aABC [2] aAbBC [3] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
33
33/44 Example: PG S ABC [1] aABC [2] aAbBC [3] [4] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
34
34/44 Example: PG S ABC [1] aABC [2] aAbBC [3] aAbBcC [4] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
35
35/44 Example: PG S ABC [1] aABC [2] aAbBC [3] aAbBcC [4] [5] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
36
36/44 Example: PG S ABC [1] aABC [2] aAbBC [3] aAbBcC [4] aabBcC [5] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
37
37/44 Example: PG S ABC [1] aABC [2] aAbBC [3] aAbBcC [4] aabBcC [5] [6] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
38
38/44 Example: PG S ABC [1] aABC [2] aAbBC [3] aAbBcC [4] aabBcC [5] aabbcC [6] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
39
39/44 Example: PG S ABC [1] aABC [2] aAbBC [3] aAbBcC [4] aabBcC [5] aabbcC [6] aabbcc [7] PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
40
40/44 Example: PG S ABC [1] aABC [2] aAbBC [3] aAbBcC [4] aabBcC [5] aabbcC [6] aabbcc [7] L(G) = {a n b n c n : n 1} P 3 PG G: 1: S ABC, {2, 5} 2: A aA, {3} 3: B bB, {4} 4: C cC, {2, 5} 5: A a, {6} 6: B b, {7} 7: C c, G generates aabbcc:
41
41/44 Proof: P k = #RS k, k 1 aAbBc G adXYbBc [p: A dXY, {q, o}] G … [q] as ( AB, p , a#b#c) H ( XYB, q , ad##b#c) [ AB, p 1 # XYB, q d##] P k #RS k : Let G be a PG of index k. Construct a #RS H of index k, so H simulates derivation step P k #RS k :
42
42/44 Proof: #RS k = P k, k 1 (p, a#b#c) H (q, aa#bb#c) [p 1 # q a#b] as a p, 1, 2 b p, 2, 2 c G a q , 1, 2 b p, 2, 2 c G a q , 1, 2 b q, 2, 2 c G aa q, 1, 2 bb q, 2, 2 c G aa q, 1, 2 bb q, 2, 2 c G aa q, 1, 2 bb q, 2, 2 c 1) Renumbering: 2) Rewriting: 3) Finalization: #RS k P k : Let H be a #RS of index k. Construct a PG G of index k, so G simulates a computational step
43
43/44 Proof: #RS k #RS k+1, k 1 Theorem: #RS k #RS k+1, for all k 1. Recall that: P k P k+1, for all k 1 As P k = #RS k, for all k 1, we have
44
44/44 Future Investigation Determinism Unlimited index Other variants: Right-linear Context-sensitive Parallel Discussion
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.