Does anyone know how to answer this problem? SAE Grammar Let\'s create a grammar
ID: 3714084 • Letter: D
Question
Does anyone know how to answer this problem?
SAE Grammar
Let's create a grammar for the SAE langauge. Before doing so, we'll assume the following simplifications:
“x” stands for any number or variable identifier
“p” stands for plus '+' or minus '-'
“m” stands for multiplication '*' or division '/'
@ is a terminal symbol
With these assumptions in mind, here's our SAE grammar:
Notice that this grammar is a Regular Grammar since each of the productions conforms to the constraints introduced in the beginning of this section.
S ? ( B ? x C B ? x C ? ( B C ? p D ? m D ? ) E ? @ D ? x C ? ( B E ? ) E ? p S ? m S ? @Explanation / Answer
Definations:
Given - SAE Langauage to secify the constriants in the simplifications for lingustics.
'x' stands for any numbers
'p' stands for plus '+' or minus '-'
'm' stands for multiplications '*'.
'm' stands for divisions '/'.
@ is a terminal symbol.
SAE - Regular Language it can be expressed in regular expressions :
Definite Closure Properties of Regular Languages will be:
1. Union : If X and If Y are two regular languages, their union X ? Y will also be regular. For example: X = {an | n ? 0} and Y = {bn | n ? 0} & Z = X ? Y = {an? bn | n ? 0} is also regular.
2. Intersection : If X and If Y are two regular languages, their intersection X ? Y will also be regular. For example: X = {am bn | n ? 0 and m ? 0} and Y = {am bn? bn am | n ? 0 and m ? 0}
Z = L1 ? L2 = {am bn | n ? 0 and m ? 0} is also regular.
3. Concatenation : If X and If Y are two regular languages, their concatenation X.Y will also be regular. For example: X = {an | n ? 0} and L2 = {bn | n ? 0} Z = X.Y = {am . bn | m ? 0 and n ? 0} is also regular.
4. Closure : If X is a regular language, its closure Y* will also be regular. For example: X = (a ? b) Y = (a ? b)*
5. Complement : If X(G) is regular language, its complement X’(G) will also be regular. Complement of a language can be found by subtracting strings which are in L(G) from all possible strings. For example:
X(G) = {an | n > 3}
X’(G) = {an | n <= 3}
Thus, Overall expression cab be identified with Logical expression LE = { x,p,m,@} i.e., Logical operators { +,-,*,/} are considered to be SME regular expression languages.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.