Consider the following languages: I. \(?^? ?^??^??^?| ? + ? = ? + ?, where \text{ ?}, ?, ?, ? ≥ 0\) II. \({?^??^??^??^?| ? = ? \text{ and } ? = ?, where \text{ ?}, ?, ?, ? ≥ 0}\) III. \(?^??^??^??^?| ? = ? = ? \text{ and } ? ≠ ?, where \text{ ?}, ?, ?, ? ≥ 0\) IV. \(?^??^??^??^?| ?? = ? + ?, where \text{ ?}, ?, ?, ? ≥ 0\) Which of the languages above are context-free?
Consider the following languages: I. \(?^? ?^??^??^?| ? + ? = ? + ?, where \text{ ?}, ?, ?, ? ≥ 0\) II. \({?^??^??^??^?| ? = ? \text{ and } ? = ?, where \text{ ?}, ?, ?, ? ≥ 0}\) III. \(?^??^??^??^?| ? = ? = ? \text{ and } ? ≠ ?, where \text{ ?}, ?, ?, ? ≥ 0\) IV. \(?^??^??^??^?| ?? = ? + ?, where \text{ ?}, ?, ?, ? ≥ 0\) Which of the languages above are context-free? Correct Answer I and II only
(i) and (ii) can be recognized using a single stack while (iii) has two comparisons hence it will require 2 stacks which means it is not cfl.
(iv) is not cfl because a pda can not do non linear arithmetics.
মোঃ আরিফুল ইসলাম
Feb 20, 2025