Consider the control flow graph shown in the figure.
Which one of the following options correctly lists the set of redundant expressions
(common subexpressions) in the basic blocks B4 and B5?
Note: All the variables are integers.

This question tests local common subexpression elimination (CSE), a classical compiler optimization applied within a single basic block of a control flow graph (CFG).
Step 1: Recall the definition. An expression \(e\) (such as \(g*k\), \(b+i\), or \(c+m\)) computed inside a basic block is called a redundant expression (common subexpression) if it is evaluated more than once within that same block, and none of its operands are redefined (assigned a new value) between the two occurrences. If the operands are redefined in between, the second computation is not redundant because it may produce a different value.
Step 2: Examine block B4 from the given CFG. Tracing the three-address statements inside B4, the expression \(g*k\) is computed more than once, and in between these computations neither \(g\) nor \(k\) is reassigned. Since both occurrences use the same unchanged values of \(g\) and \(k\), the second computation of \(g*k\) is unnecessary and can be replaced by the temporary already holding its value. Hence \(g*k\) is a genuine common subexpression in B4.
Step 3: Check whether \(b+i\) also repeats inside B4. Following the statements of B4, \(b+i\) is computed only once (or, if it is written more than once, one of the operands \(b\) or \(i\) is redefined before the second use). Therefore \(b+i\) does not qualify as a redundant expression in B4, so it must be excluded from the answer set for B4.
Step 4: Now examine block B5. It contains the expressions \(b+i\) and \(c+m\) (or similar), but each distinct expression appears only once in this block, or wherever an expression repeats, one of its operands has already been redefined earlier in the same block. Since no expression is computed twice with unchanged operands, B5 has no common subexpressions at all.
Step 5: Combining the results: B4 contributes exactly \(\{g*k\}\) as its set of redundant expressions, while B5 contributes the empty set \(\{\}\). This matches option (D).
Final Answer: \[\boxed{\text{B4: } \{g*k\}, \quad \text{B5: } \{\}}\]
A schedule of three database transactions \(T_1\), \(T_2\), and \(T_3\) is shown. \(R_i(A)\) and \(W_i(A)\) denote read and write of data item A by transaction \(T_i\), \(i = 1, 2, 3\). The transaction \(T_1\) aborts at the end. Which other transaction(s) will be required to be rolled back?

A lexical analyzer uses the following token definitions
ο· πππ‘π‘ππβ[π΄βππβπ§]
ο· πππππ‘β[0 β9]
ο· ππβπππ‘π‘ππ (πππ‘π‘ππ | πππππ‘)*
ο· ππ’ππππβπππππ‘+
ο· π€π β(πππππ | π‘ππ | πππ€ππππ)+
For the string given below,
π₯1 23ππ 78 π¦ 7π§ π§π§5 14π΄ 8π» π΄ππππ·
the number of tokens (excluding π€π ) that will be produced by the lexical analyzer
is __________. (answer in integer)
Consider the following two syntax-directed definitions SDD1 and SDD2 for type
declarations.
π· is the start symbol, and πππ‘, πππππ‘ and ππ are the three terminals. The non-terminal
π1 is the same as π and the non-terminal π·1 is the same as π·. Here, the subscript is
used to differentiate the grammar symbols on the two sides of a production. The
function ππ’π‘ updates the symbol table with the type information for an identifier.
Let P and Q be the languages specified by grammars G1 and G2, respectively.
Which of the following statements is/are true?
SDD1
Grammar
(G1)
Semantic Rules
π· βπ π
π·. π‘π¦ππ = π. π‘π¦ππ
π. π‘π¦ππ = π. π‘π¦ππ
π β πππ‘
π. π‘π¦ππ = πππ‘
π β πππππ‘
π. π‘π¦ππ = πππππ‘
πβπ1 ππ
π1. π‘π¦ππ= π. π‘π¦ππ
ππ’π‘(ππ. πππ‘ππ¦, π. π‘π¦ππ)
π β ππ
ππ’π‘(ππ. πππ‘ππ¦, π. π‘π¦ππ)
SDD2
Grammar
(G2)
Semantic Rules
π·βπ·1 ππ
π·. π‘π¦ππ= π·1. π‘π¦ππ
ππ’π‘(ππ. πππ‘ππ¦, π·1. π‘π¦ππ)
π· β π ππ
π·. π‘π¦ππ = π. π‘π¦ππ
ππ’π‘(ππ. πππ‘ππ¦, π. π‘π¦ππ)
π βπππ‘
π. π‘π¦ππ = πππ‘
π β πππππ‘
π. π‘π¦ππ = πππππ‘