1 / 133

Clearing Restarting Automata

Clearing Restarting Automata. Peter Černo František MráZ. About. We propose a new restricted version of restarting automata called C learing R estarting A utomata . About. We propose a new restricted version of restarting automata called C learing R estarting A utomata .

clive
Download Presentation

Clearing Restarting Automata

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Clearing Restarting Automata Peter Černo František MráZ

  2. About We propose a new restricted versionof restarting automata called ClearingRestartingAutomata.

  3. About We propose a new restricted versionof restarting automata called ClearingRestartingAutomata. The newmodel can be learned very efficiently from positive examples and its stronger version enablesto learn effectively a large class of languages.

  4. About We propose a new restricted versionof restarting automata called ClearingRestartingAutomata. The newmodel can be learned very efficiently from positive examples and its stronger version enablesto learn effectively a large class of languages. We relate the class of languages recognized byclearing restarting automata to the Chomsky hierarchy.

  5. Definition Let kbe a positiveinteger.

  6. Definition Let kbe a positiveinteger. k-clearingrestartingautomaton(k-cl-RA-automaton for short) is a couple M = (Σ, I), where:

  7. Definition • Let kbe a positiveinteger. • k-clearingrestartingautomaton(k-cl-RA-automaton for short) is a couple M = (Σ, I), where: • Σ is a finite nonempty alphabet, ¢, $ ∉ Σ.

  8. Definition • Let kbe a positiveinteger. • k-clearingrestartingautomaton(k-cl-RA-automaton for short) is a couple M = (Σ, I), where: • Σ is a finite nonempty alphabet, ¢, $ ∉ Σ. • I is a finite set of instructions(x, z, y), x∊ LCk, y ∊ RCk, z ∊ Σ+, • left context LCk = Σk∪¢.Σ≤k-1 • right context RCk = Σk∪Σ≤k-1.$

  9. Definition • Let kbe a positiveinteger. • k-clearingrestartingautomaton(k-cl-RA-automaton for short) is a couple M = (Σ, I), where: • Σ is a finite nonempty alphabet, ¢, $ ∉ Σ. • I is a finite set of instructions(x, z, y), x∊ LCk, y ∊ RCk, z ∊ Σ+, • left context LCk = Σk∪¢.Σ≤k-1 • right context RCk = Σk∪Σ≤k-1.$ • The special symbols: ¢ and $ are called sentinels.

  10. Definition • Let kbe a positiveinteger. • k-clearingrestartingautomaton(k-cl-RA-automaton for short) is a couple M = (Σ, I), where: • Σ is a finite nonempty alphabet, ¢, $ ∉ Σ. • I is a finite set of instructions(x, z, y), x∊ LCk, y ∊ RCk, z ∊ Σ+, • left context LCk = Σk∪¢.Σ≤k-1 • right context RCk = Σk∪Σ≤k-1.$ • The special symbols: ¢ and $ are called sentinels. • The width of the instructioni = (x, z, y) is |i| = |xzy|.

  11. Definition • A word w = uzvcan be rewritten to uv (uzv⊢Muv) if and only if there exist an instruction i = (x, z, y) ∊ I such that: • x⊒ ¢.u(x is a suffix of ¢.u) • y⊑ v.$ (y is a prefix of v.$)

  12. Definition • A word w = uzvcan be rewritten to uv (uzv⊢Muv) if and only if there exist an instruction i = (x, z, y) ∊ I such that: • x⊒ ¢.u(x is a suffix of ¢.u) • y⊑ v.$ (y is a prefix of v.$) • A word w is accepted if and only if w ⊢*M λwhere ⊢*M is reflexive and transitive closure of ⊢M.

  13. Definition • A word w = uzvcan be rewritten to uv (uzv⊢Muv) if and only if there exist an instruction i = (x, z, y) ∊ I such that: • x⊒ ¢.u(x is a suffix of ¢.u) • y⊑ v.$ (y is a prefix of v.$) • A word w is accepted if and only if w ⊢*M λwhere ⊢*M is reflexive and transitive closure of ⊢M . • The k-cl-RA-automatonMrecognizes the language L(M) = {w ∊ Σ* | M accepts w}.

  14. Definition By cl-RA we will denote the class of all clearingrestarting automata.

  15. Definition By cl-RA we will denote the class of all clearingrestarting automata. ℒ(k-cl-RA) denotes the class of all languages accepted by k-cl-RA-automata.

  16. Definition By cl-RA we will denote the class of all clearingrestarting automata. ℒ(k-cl-RA) denotes the class of all languages accepted by k-cl-RA-automata. Similarly ℒ(cl-RA) denotes the class of all languages accepted by cl-RA-automata.

  17. Definition By cl-RA we will denote the class of all clearingrestarting automata. ℒ(k-cl-RA) denotes the class of all languages accepted by k-cl-RA-automata. Similarly ℒ(cl-RA) denotes the class of all languages accepted by cl-RA-automata. ℒ(cl-RA) = ⋃k≥1ℒ(k-cl-RA).

  18. Definition By cl-RA we will denote the class of all clearingrestarting automata. ℒ(k-cl-RA) denotes the class of all languages accepted by k-cl-RA-automata. Similarly ℒ(cl-RA) denotes the class of all languages accepted by cl-RA-automata. ℒ(cl-RA) = ⋃k≥1ℒ(k-cl-RA). Note: For every cl-RA M: λ ⊢*M λhence λ∊ L(M). If we say that cl-RA Mrecognizes a language L, we mean that L(M) = L ∪ {λ}.

  19. Motivation • This model was inspired by the Associative Language Descriptions (ALD) model: • By Alessandra Cherubini, Stefano Crespi-Reghizzi, Matteo Pradella, Pierluigi San Pietro. • See: http://home.dei.polimi.it/sanpietr/ALD/ALD.html

  20. Motivation • This model was inspired by the Associative Language Descriptions (ALD) model: • By Alessandra Cherubini, Stefano Crespi-Reghizzi, Matteo Pradella, Pierluigi San Pietro. • See: http://home.dei.polimi.it/sanpietr/ALD/ALD.html • The simplicity of cl-RA model implies that the investigation of its properties is not so difficult and also the learning of languages is easy.

  21. Motivation • This model was inspired by the Associative Language Descriptions (ALD) model: • By Alessandra Cherubini, Stefano Crespi-Reghizzi, Matteo Pradella, Pierluigi San Pietro. • See: http://home.dei.polimi.it/sanpietr/ALD/ALD.html • The simplicity of cl-RA model implies that the investigation of its properties is not so difficult and also the learning of languages is easy. • Another important advantage of this model is that the instructions are human readable.

  22. Example Language L = {anbn | n ≥ 0}.

  23. Example • Language L = {anbn | n ≥ 0}. • Can be recognized by the 1-cl-RA M = ({a, b}, I), where the instructions I are: • R1 = (a, ab, b) • R2 = (¢, ab, $)

  24. Example • Language L = {anbn | n ≥ 0}. • Can be recognized by the 1-cl-RA M = ({a, b}, I), where the instructions I are: • R1 = (a, ab, b) • R2 = (¢, ab, $) • For instance: • aaaabbbb ⊢R1aaabbb

  25. Example • Language L = {anbn | n ≥ 0}. • Can be recognized by the 1-cl-RA M = ({a, b}, I), where the instructions I are: • R1 = (a, ab, b) • R2 = (¢, ab, $) • For instance: • aaaabbbb ⊢R1aaabbb⊢R1aabb

  26. Example • Language L = {anbn | n ≥ 0}. • Can be recognized by the 1-cl-RA M = ({a, b}, I), where the instructions I are: • R1 = (a, ab, b) • R2 = (¢, ab, $) • For instance: • aaaabbbb ⊢R1aaabbb⊢R1aabb⊢R1ab

  27. Example • Language L = {anbn | n ≥ 0}. • Can be recognized by the 1-cl-RA M = ({a, b}, I), where the instructions I are: • R1 = (a, ab, b) • R2 = (¢, ab, $) • For instance: • aaaabbbb ⊢R1aaabbb⊢R1aabb⊢R1ab⊢R2λ. • Now we see that the word aaaabbbb is accepted because aaaabbbb ⊢*Mλ.

  28. Some Theorems • Error preserving property: Let M = (Σ, I)be a cl-RA-automaton and u, v be two words from Σ*. If u ⊢*M v and u ∉ L(M), then v ∉ L(M). • Proof. v ∊ L(M) ⇒ v ⊢*M λ ⇒ u ⊢*M v ⊢*M λ ⇒ u ∊ L(M). ∎

  29. Some Theorems • Error preserving property: Let M = (Σ, I)be a cl-RA-automaton and u, v be two words from Σ*. If u ⊢*M v and u ∉ L(M), then v ∉ L(M). • Proof. v ∊ L(M) ⇒ v ⊢*M λ ⇒ u ⊢*M v ⊢*M λ ⇒ u ∊ L(M). ∎ • Observation: For each finite L ⊆ Σ*there exist 1-cl-RA-automaton M such that L(M) = L ∪ {λ}. • Proof. Suppose L = {w1, …, wn}. Consider I = {(¢, w1, $), …, (¢, wn, $)}. ∎

  30. Some Theorems • Theorem: ℒ(k-cl-RA) ⊂ ℒ((k+1)-cl-RA), for all k ≥ 1. • Note: The following language: { (ckack)n(ckbck)n | n ≥ 0 } belongs to ℒ((k+1)-cl-RA) - ℒ(k-cl-RA).

  31. Some Theorems • Theorem: ℒ(k-cl-RA) ⊂ ℒ((k+1)-cl-RA), for all k ≥ 1. • Note: The following language: { (ckack)n(ckbck)n | n ≥ 0 } belongs to ℒ((k+1)-cl-RA) - ℒ(k-cl-RA). • Theorem: For each regular language L ⊆ Σ* there exist a k-cl-RA-automatonM : L(M) = L ∪ {λ}.

  32. Some Theorems • Theorem: ℒ(k-cl-RA) ⊂ ℒ((k+1)-cl-RA), for all k ≥ 1. • Note: The following language: { (ckack)n(ckbck)n | n ≥ 0 } belongs to ℒ((k+1)-cl-RA) - ℒ(k-cl-RA). • Theorem: For each regular language L ⊆ Σ* there exist a k-cl-RA-automatonM : L(M) = L ∪ {λ}. • Proof. Based on pumping lemma for regular languages.

  33. Some Theorems • Theorem: ℒ(k-cl-RA) ⊂ ℒ((k+1)-cl-RA), for all k ≥ 1. • Note: The following language: { (ckack)n(ckbck)n | n ≥ 0 } belongs to ℒ((k+1)-cl-RA) - ℒ(k-cl-RA). • Theorem: For each regular language L ⊆ Σ* there exist a k-cl-RA-automatonM : L(M) = L ∪ {λ}. • Proof. Based on pumping lemma for regular languages. • For each z ∊ Σ*, |z|=nthere exist u, v, wsuch that |v|≥1and δ(q0, uv) = δ(q0, u); the word v can be crossed out.

  34. Some Theorems • Theorem: ℒ(k-cl-RA) ⊂ ℒ((k+1)-cl-RA), for all k ≥ 1. • Note: The following language: { (ckack)n(ckbck)n | n ≥ 0 } belongs to ℒ((k+1)-cl-RA) - ℒ(k-cl-RA). • Theorem: For each regular language L ⊆ Σ* there exist a k-cl-RA-automatonM : L(M) = L ∪ {λ}. • Proof. Based on pumping lemma for regular languages. • For each z ∊ Σ*, |z|=nthere exist u, v, wsuch that |v|≥1and δ(q0, uv) = δ(q0, u); the word v can be crossed out. • We add corresponding instruction iz = (¢.u, v, w).

  35. Some Theorems • Theorem: ℒ(k-cl-RA) ⊂ ℒ((k+1)-cl-RA), for all k ≥ 1. • Note: The following language: { (ckack)n(ckbck)n | n ≥ 0 } belongs to ℒ((k+1)-cl-RA) - ℒ(k-cl-RA). • Theorem: For each regular language L ⊆ Σ* there exist a k-cl-RA-automatonM : L(M) = L ∪ {λ}. • Proof. Based on pumping lemma for regular languages. • For each z ∊ Σ*, |z|=nthere exist u, v, wsuch that |v|≥1and δ(q0, uv) = δ(q0, u); the word v can be crossed out. • We add corresponding instruction iz = (¢.u, v, w). • For each accepted z ∊ Σ<n - {λ} we add instruction iz = (¢, z, $).

  36. Some Theorems Theorem: The language L1 = {ancbn | n ≥ 0} ∪ {λ} is not recognized by any cl-RA-automaton.

  37. Some Theorems • Theorem: The language L1 = {ancbn | n ≥ 0} ∪ {λ} is not recognized by any cl-RA-automaton. • Note: L1 can be recognized by a simple RRWW-automaton. Moreover L1 is a context-free language, thus we get the following corollary: • Corollary: • ℒ(cl-RA) ⊂ ℒ(RRWW). • CFL - ℒ(cl-RA) ≠ ∅.

  38. Some Theorems Let L2 = {anbn | n≥0} and L3 = {anb2n | n≥0} be two sample languages. Apparently both L2 and L3 are recognized by 1-cl-RA-automata.

  39. Some Theorems Let L2 = {anbn | n≥0} and L3 = {anb2n | n≥0} be two sample languages. Apparently both L2 and L3 are recognized by 1-cl-RA-automata. Theorem: Languages L2∪ L3 and L2 . L3 are not recognized by any cl-RA-automaton.

  40. Some Theorems • Let L2 = {anbn | n≥0} and L3 = {anb2n | n≥0} be two sample languages. Apparently both L2 and L3 are recognized by 1-cl-RA-automata. • Theorem: Languages L2∪ L3 and L2 . L3 are not recognized by any cl-RA-automaton. • Corollary: ℒ(cl-RA) is not closed under union, concatenation, and homomorphism. • For homomorphism use{anbn | n≥0} ∪ {cnd2n | n≥0} and homomorphism defined as: a ↦ a, b ↦ b, c ↦ a, d ↦ b. ∎

  41. Some Theorems • It is easy to see that each of the following languages: • L4 = {ancbn | n ≥ 0} ∪ {ambm | m ≥ 0} • L5 = {ancbm | n, m ≥ 0} ∪ {λ} • L6 = {ambm | m ≥ 0} can be recognized by a 1-cl-RA-automaton.

  42. Some Theorems • It is easy to see that each of the following languages: • L4 = {ancbn | n ≥ 0} ∪ {ambm | m ≥ 0} • L5 = {ancbm | n, m ≥ 0} ∪ {λ} • L6 = {ambm | m ≥ 0} can be recognized by a 1-cl-RA-automaton. • Corollary:ℒ(cl-RA) is not closed under: • intersection: L1 = L4 ∩ L5.

  43. Some Theorems • It is easy to see that each of the following languages: • L4 = {ancbn | n ≥ 0} ∪ {ambm | m ≥ 0} • L5 = {ancbm | n, m ≥ 0} ∪ {λ} • L6 = {ambm | m ≥ 0} can be recognized by a 1-cl-RA-automaton. • Corollary:ℒ(cl-RA) is not closed under: • intersection: L1 = L4 ∩ L5. • intersection with regular language: L5 is regular.

  44. Some Theorems • It is easy to see that each of the following languages: • L4 = {ancbn | n ≥ 0} ∪ {ambm | m ≥ 0} • L5 = {ancbm | n, m ≥ 0} ∪ {λ} • L6 = {ambm | m ≥ 0} can be recognized by a 1-cl-RA-automaton. • Corollary:ℒ(cl-RA) is not closed under: • intersection: L1 = L4 ∩ L5. • intersection with regular language: L5 is regular. • set difference: L1 = (L4- L6) ∪ {λ} .

  45. Parentheses The following instruction of 1-cl-RAM is enough for recognizing the language of correct parentheses: (λ, ( ), λ)

  46. Parentheses • The following instruction of 1-cl-RAM is enough for recognizing the language of correct parentheses: • (λ, ( ), λ) • Note: This instruction represents a set of instructions: • ({¢}∪Σ, ( ), Σ∪{$}), where Σ = {(, )} and • (A, w, B) = {(a, w, b) | a∊A, b∊B}.

  47. Parentheses • The following instruction of 1-cl-RAM is enough for recognizing the language of correct parentheses: • (λ, ( ), λ) • Note: This instruction represents a set of instructions: • ({¢}∪Σ, ( ), Σ∪{$}), where Σ = {(, )} and • (A, w, B) = {(a, w, b) | a∊A, b∊B}. • Note: We use the following notation for the (A, w, B): A B w

  48. Arithmetic Expressions • Suppose that we want to check correctness of arithmetic expressions over the alphabet Σ = {α, +, *, (, )}.

  49. Arithmetic Expressions • Suppose that we want to check correctness of arithmetic expressions over the alphabet Σ = {α, +, *, (, )}. • For example α+(α*α+α)is correct, α*+αis not.

  50. Arithmetic Expressions • Suppose that we want to check correctness of arithmetic expressions over the alphabet Σ = {α, +, *, (, )}. • For example α+(α*α+α)is correct, α*+αis not. • The priority of the operations is considered.

More Related