Which of the following statements are correct?
Choose the correct answer from the options given below:
In compiler design, leaders are used to form basic blocks.
Rules for finding leaders:
So, statement $1$ is true.
So, statement $2$ is false.
So, statement $3$ is true.
So, statement $4$ is true.
Correct statements are:
$1,3,4$
Which of the following are correct on regular expressions?
a. $\varphi + L = L + \varphi = L$
b. $\epsilon L = L\epsilon = L$
c. $\varphi L = L\varphi = \varphi$
d. $\varphi L = L\varphi = L$
Choose the correct answer from the options given below:
Statement a:
Union with empty language gives the same language.
$\varphi + L = L$
So, statement a is true.
Statement b:
Concatenation with empty string does not change the language.
$\epsilon L = L\epsilon = L$
So, statement b is true.
Statement c:
Concatenation with empty language gives empty language.
$\varphi L = L\varphi = \varphi$
So, statement c is true.
Statement d:
This says concatenation with empty language gives $L$, which is false.
So, statement d is false.
Correct statements are:
a, b and c only
| List-I | List-II |
| a. $S \to aSa \mid aa$ | I. $((2^n$ *3)-4); n > 1 |
| b. $S \to aaSaa \mid aa$ | II. $2^n$; n>=1 |
| c. $S \to aaaSaaa \mid aa$ | III. ((4*$2^n$)-6);n>=1 |
d. $S \to aaaaSaaaa \mid aa$ |
IV. $2^n$ - 2; n>= 2 |
Choose the correct answer from the options given below:
For $S \to aSa \mid aa$:
It generates strings:
$aa, aaaa, aaaaaa, \ldots$
So, length pattern is:
$2n$
Therefore,
a → II
For $S \to aaSaa \mid aa$:
It generates strings by adding two $a$'s on both sides.
So, it matches the given form IV.
Therefore,
b → IV
For $S \to aaaSaaa \mid aa$:
It generates lengths:
$2,8,14,20,\ldots$
This is:
$6n-4$
or
$((2n*3)-4)$
Therefore,
c → I
For $S \to aaaaSaaaa \mid aa$:
It generates lengths:
$2,10,18,26,\ldots$
This is:
$8n-6$
or
$((4*2n)-6)$
Therefore,
d → III
Correct matching:
a-II, b-IV, c-I, d-III
Which of the following is the function of the semantic analysis phase of compilation process?
Compiler phases:
Lexical analysis → Tokenization
Syntax analysis → Parsing
Semantic analysis → Type checking, type conversion, scope checking
Optimization → Loop optimization, data flow analysis
Thus type conversion belongs to semantic analysis.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.