-
- There are 7 operators in the above expression.
- 3 concatenation operators
- 3 + operators
- 1 * operator
-
The last operator of r is the second + operator.
(ab+b)* + (a + ba)a
-
-
- There are 3 operators in s = (ab+b)*, one
of each type.
- The last operator of s is the * operator.
- In this case, there is only one subexpression s' = ab+b.
-
All unlabeled arcs in the transition diagram below are
transitions.
-
All unlabeled arcs in the transition diagram below are
transitions.
-
All unlabeled arcs in the transition diagram below are
transitions.
-
All unlabeled arcs in the transition diagram below are
transitions.
-
- We are showing that every regular expression can be converted
into an equivalent NFA using a single proof that applies to
any regular expression r.
- The basic property of regular expressions that we used was the
fact that every regular expression has finite length and
thus a finite number of operators.
- Once this property was established, we could apply an induction
proof to complete the argument.
-
- Transform(r)
- Base Case
- If r has no operators, then return the corresponding
NFA for r
- There are only a finite number of cases to consider, and I
do not list these here as they have been listed above
in the proof.
- Recursive Case
- Identify the "last operator" of r
- Decompose r into s and t using
this last operator (note t will not exist
if the last operator is a *)
- Ns = Transform(s)
- Nt = Transform(t) (if t exists)
- Put Ns and Nt together
according to the rules described in the proof to form
Nr
- Return Nr