|
|
(One intermediate revision by one other user not shown) |
Line 1: |
Line 1: |
| A '''matrix grammar''' is a [[formal grammar]] in which instead of single productions, productions are grouped together into finite sequences. A production cannot be applied separately, it must be applied in sequence. In the application of such a sequence of productions, the rewriting is done in accordance to the each production in sequence, the first one, second one etc. till the last production has been used for rewriting. The sequences are referred to as '''matrices'''.
| | I'm Yoshiko Oquendo. Bottle tops gathering is the only hobby his wife doesn't approve of. Bookkeeping has been his working day job for a whilst. Years in the past we moved to Kansas.<br><br>Feel free to surf to my page :: [http://www.carelion.com/UserProfile/tabid/61/userId/107768/Default.aspx www.carelion.com] |
| | |
| Matrix grammar is an extension of [[context-free grammar]], and one instance of a [[Controlled grammar]].
| |
| | |
| == Formal definition ==
| |
| A ''matrix grammar'' is an ordered quadruple
| |
| | |
| :<math>G = (V_N, V_T, X_0, M).</math>
| |
| | |
| where
| |
| | |
| * <math>V_N</math> is a finite set of non-terminals
| |
| * <math>V_T</math> is a finite set of terminals
| |
| * <math>X_0</math> is a special element of <math>V_N</math>, viz. the starting symbol
| |
| * <math>M</math> is a finite set of non-empty sequences whose elements are ordered pairs
| |
| | |
| :<math>(P, Q), \quad P \in W(V) V_N W(V), \quad Q \in W(V), \quad V = V_N \cup V_T.</math>
| |
| | |
| The pairs are called productions, written as <math>P \to Q</math>. The sequences are called matrices and can be written as
| |
| | |
| :<math>m = [P_1 \to Q_1, \ldots, P_r \to Q_r].</math>
| |
| | |
| Let <math>F</math> be the set of all productions appearing in the matrices <math>m</math> of a matrix grammar <math>G</math>. Then the matrix grammar <math>G</math> is of type-<math>i, i = 0, 1, 2, 3</math>, ''length-increasing'', ''linear'', ''<math>\lambda</math>-free'', ''context-free'' or ''context-sensitive'' if and only if the grammar <math>G_1 = (V_N, V_T, X_0, F)</math> has the following property.
| |
| | |
| For a matrix grammar <math>G</math>, a binary relation <math>\Rightarrow_G</math> is defined; also represented as <math>\Rightarrow</math>. For any <math>P, Q \in W(V)</math>, <math>P \Rightarrow Q</math> holds if and only if there exists an integer <math>r \ge 1</math> such that the words
| |
| | |
| :<math>\alpha_1,, \ldots, \alpha_{r + 1}, \quad P_1, \ldots, P_r, \quad R_1, \ldots, R_r, \quad, R^1, \ldots, R^r</math>
| |
| | |
| over V exist and
| |
| | |
| * <math>\alpha_i = P</math> and <math>\alpha_{r + 1} = Q</math>
| |
| * <math>m</math> is one of the matrices of <math>G</math>
| |
| * <math>\alpha_i = R_i P_i R^i</math> and <math>\alpha_{i + 1} = R_i Q_i R^i.</math>
| |
| | |
| If the above conditions are satisfied, it is also said that <math>P \Rightarrow Q</math> holds with <math>(m, R_1)</math> as the ''specifications''.
| |
| | |
| Let <math>\Rightarrow^{*}</math> be the reflexive transitive closure of the relation <math>\Rightarrow</math>. Then, the language generated by the matrix grammar <math>G</math> is given by
| |
| | |
| :<math>L(G) = \{P \in W(V_T) | X_0 \Rightarrow^{*} P\}.</math> | |
| | |
| == Example ==
| |
| | |
| Consider the matrix grammar
| |
| | |
| <math>G = (\{S, X, Y\}, \{a, b, c\}, S, M)</math>
| |
| | |
| where <math>M</math> is a collection containing the following matrices:
| |
| | |
| <math>[S \rightarrow XY], \quad [X \rightarrow aXb, Y \rightarrow cY], \quad [X \rightarrow ab, Y \rightarrow c]</math>
| |
| | |
| These matrices, which contain only ''context-free'' rules generate the ''context-sensitive'' language
| |
| | |
| <math>L = \{a^nb^nc^n|n \ge 1\}.</math>
| |
| | |
| This example can be found on pages 8 and 9 of {{ref|Abraham1965}}.
| |
| | |
| == Properties ==
| |
| | |
| Let <math>MAT^\lambda</math> be the class of languages produced by matrix grammars, and <math>MAT</math> the class of languages produced by <math>\lambda</math>-free matrix grammars.
| |
| | |
| * Trivially, <math>MAT</math> is included in <math>MAT^\lambda</math>.
| |
| * All [[context-free languages]] are in <math>MAT</math>, and all languages in <math>MAT^\lambda</math> are [[recursively enumerable]].
| |
| * <math>MAT</math> is closed under [[Union (set theory)|union]], [[concatenation]], [[Intersection (set theory)|intersection]] with regular languages and permutation.
| |
| * All languages in <math>MAT</math> can be produced by a [[context-sensitive grammar]].
| |
| * There exists some languages in <math>MAT^\lambda</math> which can not be produced by a context-sensitive grammar.
| |
| * Each language produced by a matrix grammar with only one terminal symbol is regular.
| |
| | |
| == Open problems ==
| |
| | |
| It is not known whether there exist languages in <math>MAT^\lambda</math> which are not in <math>MAT</math>, and it is neither known whether <math>MAT^\lambda</math> contains languages which are not context-sensitive {{ref|Paun}}.
| |
| | |
| == References ==
| |
| * {{note|Abraham1965}} Ábrahám, S. Some questions of language theory. International Conference on Computational Linguistic, 1965. pp 1-11. [http://acl.ldc.upenn.edu/C/C65/C65-1001.pdf]
| |
| * {{note|Paun}} Gheorghe Păun, Membrane Computing: An Introduction, Springer-Verlag New York, Inc., Secaucus, NJ, USA, 2002. pp 30-32
| |
| | |
| [[Category:Formal languages]]
| |
I'm Yoshiko Oquendo. Bottle tops gathering is the only hobby his wife doesn't approve of. Bookkeeping has been his working day job for a whilst. Years in the past we moved to Kansas.
Feel free to surf to my page :: www.carelion.com