I\'m curious about which (if any) real-world programming languages have a regular grammar (i.e. the set of all syntactically correct programs is regular).
Does such a thing exist?If so, 开发者_如何学编程could you please provide an example?Thanks.A -> a
I have a list: 1name1 2name2 3name3 I need to replace all 1,2,3... to \'1\', \'2\', \'3\'...and name1, name2, na开发者_StackOverflow中文版me3 to \'name1\', \'name\', \'name\'3.
Assume E = {a, b}. Let L0 = {(b^(n))(a^(2n)) : n >= 0}. Let L = ((NOT OPERATION)L0) Is L regular, context-free but not regular, or not c开发者_如何学Context-free? Prove your answer.
Here\'s a homework problem: Is L_4 Regular? Let L_4 = L*, where L={0^i1^i | i>=1}. I know L is non-regular and I know that Kleene Star is a closed operation, so my assumption is that L_4 is non-
I.e., I get a list of words and I want to construct a simple regular expression from that which matches at least all of the words (but maybe more).
What is an R-trivial langua开发者_如何学Cge? I.e. what is the definition? What is an R-trivial monoid?
I am studying membership algorithms and I am working on this particular problem which says the following:
I am stumped by this practice problem (not for marks): {w is an element of {a,b}* : the number of a\'s is even and the number of b\'s is even }
After having read up on RE/NF开发者_JAVA技巧A and DFA, it seems that finding a substring within a string might actually be asymptotically faster using an RE rather than a brute force O(mn) find. My re