Incorrect. Please note that!
3.3.3: test the number of strings with N length.
3.3.5: Write the formal definitions of the following languages
(1) lowercase strings containing all five vowels.
Nonvowel → [B-DF-HJ-NP-TV-Z]
L → (nonvowel | A) * a (nonvowel | E) * E (nonvowel | I) * I (nonvowel | O) * O (nonvowel | u) * unonvowel *
(2) lowercase string of all letters in ascending order
A * B * C *... y * z *
(3) comment, that is, the string between/* and */, and the string does not contain */that is not in double quotation marks */
Nonquote → Σ -{"}
Quote → "nonquote *"
Star → \*
Nonstarquote Σ -{",\*}
Nonstarslashquote → Σ -{",/,\*}
Comm → quote | nonstarquote | star + (nonstarslashquote | quote)
L →/starcomm * star +/
3. Grammar G: S → ASB | BSA | ABS | bas | SAB | SBA | ε
1) prove that grammar G is a binary Grammar
Evidence: The following two different syntax analysis trees can be provided for AB:
Therefore, this document serves as an example.
(2) What is the language for grammar g recognition?
It is a string of equal numbers of A and B defined on the letter {a, B.
(3) rewrite grammar g to non-Ambiguity grammar G', so that l (G) = L (G ') (too difficult, not required)
S → ABS | bas | ε
A → Baa |
B → ABB | B
[Longshu] theoretical exercise (2)