Question: Let = { ( , ) }, that is, the set of left-parenthesis and right-parenthesis symbols. Let L2 be the set of all balanced strings
Let = { ( , ) }, that is, the set of left-parenthesis and right-parenthesis symbols. Let L2 be the set of all balanced strings in * such that the number of left parentheses is equal to the number of right parentheses, and the number of left parentheses in any prefix of a balanced string is no smaller than the number of right parentheses in that prefix. Note that this is equivalent to the string comprised only of parenthesis characters derived from a legal arithmetic expression after removing all variables, numbers, and operators. Show that language L2 is context free by constructing a PDA that recognizes L2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
