160 likes | 281 Vues
Decidable Problems of Regular Languages. Answer:. Take the DFA that accepts and check if is accepted. Membership Question. Question:. Given regular language and string how can we check if ?. DFA. DFA. Question:. Given regular language how can we check
E N D
Decidable ProblemsofRegular Languages Prof. Busch - RPI
Answer: Take the DFA that accepts and check if is accepted Membership Question Question: Given regular language and string how can we check if ? Prof. Busch - RPI
DFA DFA Prof. Busch - RPI
Question: Given regular language how can we check if is empty: ? Answer: Take the DFA that accepts Check if there is any path from the initial state to an accepting state Prof. Busch - RPI
DFA DFA Prof. Busch - RPI
Question: Given regular language how can we check if is finite? Answer: Take the DFA that accepts Check if there is a walk with cycle from the initial state to a final state Prof. Busch - RPI
DFA is infinite DFA is finite Prof. Busch - RPI
Answer: Find if Question: Given regular languages and how can we check if ? Prof. Busch - RPI
and Prof. Busch - RPI
or Prof. Busch - RPI
Decidable Problemsof Context-Free Languages Prof. Busch - RPI
Parsers Membership Algorithms: • Exhaustive search parser • CYK parsing algorithm Membership Question: for context-free grammar find if string Prof. Busch - RPI
Algorithm: • Remove useless variables • Check if start variable is useless Empty Language Question: for context-free grammar find if Prof. Busch - RPI
Infinite Language Question: 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 for context-free grammar find if is infinite Prof. Busch - RPI
Example: Infinite language Dependency graph Prof. Busch - RPI