Decidable Problems of Regular Languages Costas Busch - LSU 1 Membership Question Question: Answer: Given regular language L and string w how can we check if w L? Take the DFA that accepts L and check if w is accepted Costas Busch - LSU 2 DFA w w L DFA w w L Costas Busch - LSU 3 Question: Given regular language L how can we check if L is empty: ( L ) ? Answer: Take the DFA that accepts L Check if there is any path from the initial state to an accepting state Costas Busch - LSU 4 DFA L DFA L Costas Busch - LSU 5 Question: Given regular language how can we check if L is finite? Answer: Take the DFA that accepts L L Check if there is a walk with cycle from the initial state to a final state Costas Busch - LSU 6 DFA L is infinite DFA L is finite Costas Busch - LSU 7 Question: Given regular languages L1 and how can we check if L1 L2 ? Answer: Find if L2 ( L1 L2 ) ( L1 L2 ) Costas Busch - LSU 8 ( L1 L2 ) ( L1 L2 ) and L1 L2 L1 L1 L2 L2 L2 L 2 L1 L2 L1 L1 L2 L1 L1 L2 Costas Busch - LSU 9 ( L1 L2 ) ( L1 L2 ) L1 L2 L1 or L1 L2 L2 L2 L1 L2 L1 L2 L1 L1 L2 Costas Busch - LSU 10 Decidable Problems of Context-Free Languages Costas Busch - LSU 11 Membership Question: for context-free grammar find if string w L(G ) G Membership Algorithms: Parsers • Exhaustive search parser • CYK parsing algorithm Costas Busch - LSU 12 Empty Language Question: for context-free grammar find if L(G ) G Algorithm: 1. Remove useless variables 2. Check if start variable Costas Busch - LSU S is useless 13 Infinite Language Question: for context-free grammar find if L(G ) is infinite G Algorithm: 1. Remove useless variables 2. Remove unit and productions 3. Create dependency graph for variables 4. If there is a loop in the dependency graph then the language is infinite Costas Busch - LSU 14 Example: S AB A aCb | a B bB | bb C cBS Infinite language Dependency graph A C S B Costas Busch - LSU 15 S AB A aCb | a B bB | bb C cBS S AB aCbB acBSbB acbbSbbb S acbbSbbb (acbb) S (bbb) (acbb) S (bbb) i 2 2 i Costas Busch - LSU 16
© Copyright 2026 Paperzz