Which of the following constraints ensure(s) that the language is context-free?
["C","D"]
Step-by-Step Solution
Key idea: This is a structural constraint question for Context-Free Languages, recognizable because it asks which arithmetic constraints on the exponents of a 4-part string allow it to be generated by a single stack (PDA).
Step 1: The base string format is . A PDA processes this left-to-right. It can push symbols for the first parts and pop for the later parts. The fundamental limit is that it can only maintain ONE active nested comparison at a time.
Step 2: Evaluate Option A: . This requires matching the sum of the first and third parts with the sum of the second and fourth parts. Because and are in the middle, a single stack cannot simultaneously track against and against in a crossed manner. This requires two independent comparisons. NOT CFL.
Step 3: Evaluate Option B: and . This requires matching with and with . These are two independent comparisons separated by other symbols. A single stack cannot do this. NOT CFL.
Step 4: Evaluate Option C: and . The string is . The PDA can push 's, then push 's. When reading 's, it pops 's (matching ). When reading 's, it pops 's (matching ). This is a single, perfectly nested comparison. IS CFL.
Step 5: Evaluate Option D: . The PDA can push both 's and 's onto the stack. The total number of symbols pushed is . Then, it pops for every and every . The total number of symbols popped is . Since , the stack will empty exactly at the end. This is a single comparison of sums. IS CFL.
Answer: C, D