Escolar Documentos
Profissional Documentos
Cultura Documentos
COMPUTATION
Kleenes theorem
TG of Even Even
a,b
a,b
aaa
+4
+2
a,b
bbb
+4
a,b
2. If TG has more than one final states , then introduce a new final state, connecting the old final
a,b
states to the new final states by the transitions labeled
a,b
aaa
bbb
3
a,b
4
a,b
3. If a state has two or more incoming transition edges labeled by the corresponding Res, from the
same state including the possibility of loops at a state , then replace all these transition edges with
a single transition edge labeled by the summation of corresponding R.Es.
We can see that step three is not applicable with our given example so it can be illustrated with
another example.
Befor step 3
Applied
step 4
Kleenes Theorem Part III : If a language can be expressed by a RE then it can be accepted by
an FA as well.
Example: method I union of two FAs
Let r1 =((a+b)(a+b))* define L1
then FA1 be
Union
r1+r2= ((a+b)(a+b))* + (a+b)((a+b)(a+b))*
Concatenation:
r1.r2= (a+b)*b . (a+b)*aa(a+b)*
FA to r* can be determined as
are applied whenever exact descriptions of languages are needed; for instance in official language
specification, in manuals and in text books on programming language theory.
A Van-Wijngaarden grammar, also vW-grammar or W-grammar., is a 2 level grammar which provides a
technique to define potentially infinite context free grammar in a finite number of rules. The formalism
was invented by Adriaan van Wijangaarden to define rigorously some syntactic restrictions which
previously had to be formulated in natural language, despite their essentially syntactical content. Typical
applications are the treatment of gender and number in natural language syntax and well definedness of
identifiers in programming languages.
A W-grammar consists of a finite set of meta rules, which are used to derive production rules from a finite
set of hyper rules. Meta rules are restricted to those defined by a context free grammar. Hyper rules
restrict the admissible contexts at the upper level. Essentially, the consistent substitution used in the
derivation process is equivalent to unification as in Prolog, as was noted by Alain Colmeraure.
For example, the assignment x := 1 is only valid if the variable x can contain an integer. Therefore the
context free syntax variable := value is incomplete. In a 2 level grammar, this might be specified in a
context sensitive manner as REF TYPE variable := TYPE value. Then ref interger variable := integer
value could be a production rule but ref Boolean variable := integer value is not a possible production
rule. This also means that assigning with incompatible types becomes a syntax error which can be caught
at compile time. Similarly
Style begin token, new layer1 preludes,
Parallel token, new layer1 tasks pack,
Style end token