Semantic Analysis & Type Checking

Answer & solution
Answer: B under a restricted one-pass evaluation model (no official key was published)
1. A synthesized attribute flows from children to parent and is naturally evaluated when a bottom-up parser reduces a production. An inherited attribute flows from parent or siblings toward a child and may be needed before that child is reduced. Therefore identify which dependency schedule the question permits before selecting an option.
2. Inherited attributes cannot in general be computed by the simple reduce-only mechanism used for synthesized attributes. In the usual left-to-right one-pass implementation, usable inherited information must be available from the parent context and already processed left siblings, the L-attributed dependency condition behind B. Even then suitable scheduling/marker productions or stack access may be needed; being L-attributed is not a blanket guarantee for every unmodified LR evaluation scheme. If bottom-up evaluation instead allows building a full parse/dependency graph and later scheduling arbitrary acyclic dependencies, L-attributedness is not necessary. The choice therefore depends on the conventional parsing-time model, which the prompt does not spell out.