简体   繁体   中英

How would you prove an ordered language is regular?

I want to know how to prove a language that has order constraints is regular. For example if you had that Σ = {1,2,3,4,5} where L (a subset of Σ*) = (a1,a2,...an) such that an+1 was larger than an how would you prove that this is a regular language?

eg α = (1,3,5) would be accepted, however α = (1,4,5,2) would not.

Any language that can be recognized by a DFA (deterministic finite automaton) is regular. To prove that the language you described is regular, you simply have to prove that there exists a DFA that recognizes this particular language.

Remember that Σ is finite. If I understood the constraint of the language properly, one construction that works would have one starting state (accepting or non-accepting depending on whether you want to include ε in your language), one accepting state for each symbol in Σ and one rejecting state. The transition function should result in the state corresponding to the current input symbol if the current state is the starting state or corresponds to a "lesser" symbol, and to the rejecting state otherwise.

A shortcut is also available - each finite language is regular, and if I understood the constraint of the language you described properly, it is clearly finite (since Σ is finite). This trivially means that the language is also regular.

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