简体   繁体   中英

How to construct a pushdown automata for L= { w ∈ {a, b}* | w does not equal xx^R for some x ∈ {a, b}* }?

How to construct a pushdown automata for L= { w ∈ {a, b}* |w does not equal xx^R for some x ∈ {a, b}* }

I'm assuming you want a non-deterministic push-down automaton. I don't think this is doable with a deterministic PDA.

This sounds like a homework problem, so I'm only going to give a general outline:

You essentially guess where the center of the string is. You push elements onto the stack, until at some point you guess that you've reached the center of the string. You then start comparing your input to elements that you're popping off the stack. You fail if they don't match. You succeed if you reach the end of the input exactly as the stack is empty.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM