Algorithm that checks if a context free grammar generates infinite language that a DFA rejects -


i have dfa , cfg g, have check if g generates infinite words don't accept (rejected a), , nice complexity time.

i thought construct graph cfg , if contains directed cycle, produces infinite language. vertices variables , each production draw edges. input words rejected dfa , when found cycle can cfg generates infinite language rejected dfa a.

i don't know how transform in algorithm or if proposal not correct , have create new one.

edit: can transform cfg cnf , dfa ( chomsky ).after, try find cycle. transformed dfa can have less states dfa a... need how words rejected dfa in cfg think.

given cfg g, construct pda b. given dfa , pda b, construct pda c such c accepts l(c) = l(b) \ l(a), \ set difference. now, l(c) precisely language of words accepted pda b (hence generated cfg g) not accepted, i.e. rejected, dfa a.

now, question whether language of b infinite. can this. 1 way convert pda cfg, , put cfg in cnf - removing unnecessary , unproductive symbols. then, create dependency tree among nonterminal symbols. if remaining (productive) nonterminal symbol depends upon itself, i.e., there loop, language infinite. otherwise, language finite (empty, if there no productive symbols remaining).


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -