I sure wish I knew what you're talking about. This is not computer language as I always knew it. (I knew Pascal and BASIC, and I would like to learn C, but not if I have to learn the language you have shown below.) --doug At 21:29 06/04/2002 -0400, George Auch wrote:
On Tuesday 04 June 2002 04:59 pm, Christopher Mahmood wrote:
* Jon Clausen (dsl23212@vip.cybercity.dk) [020604 13:49]:
how is one supposed to understand the 'regular' in regular expressions?
It's a term from computer theory...a regular expression is a string accepted by a particular class of automata. Someone who actually knows something about computer science will hopefully give a better answer.
From 'Introduction to Computer Theory' Cohen, 1986, 823 pgs.
Part -1 - Automata Theory Background, Languages, Recursive Definitions, Regular Expressions, Finite Automata, Transition Graphs, Kleene's Thereom, Nondeterminism, Finite Automata with Output, Regular Languages, Nonregular Languages, Decidability.
See Chapter 4 (pgs. 38-62) - Regular Expressions
'..The language defining symbols we are about to create are called regular expressions. We will define the term regular expression itself recursively. The languages that are associated with these regular expressions are called regular languages and are also said to be defined by finite representation.'
Example: ab*a Is the Set of all strings of a's and b's that have at least two letters, that begin and end with a's, and that have nothing but b's inside, if anything at all.
language (ab*a) = {aa aba abba abbba abbbba .....}
Theorem 5 If L is a finite language (a language with only finitely many words), the L can be defined by a regular expression.
Proof To make a regular expression that defines the language L, turn all the words in L to boldface type and stick pluses between them.
L= {baa abbba bababa} is baa + abba + bababa (note: this line should be in bold type) if L = {aa ab ba bb}
The algorithm described above gives the regular expression aa + ab + ba + bb (note: this line should be in bold type)
Another regular expression that defines this language is (a + b)(a + b) (Note: this line should be in bold type) so the regular expression need not be unique.
The reason this trick only works for finite languages is that infinite language would become a regular expression which is infinitely long, which is forbidden.
... all I can say is that I I took this 400 level course, Theory of Computing, a long time back after returning to college. It was ugly then, and still is... add to this a class in discrete mathematics and you have one great semester. Most of this was conveniently removed from memory a long time back.
George
-- SuSE 8.0 | Linux 2.4.19-pre9 i686
-- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com
Also check the archives at http://lists.suse.com