Lecture 17 TLDR: Regular Expressions

Date
Regular expressions are a way of describing a language via a string representation.

Atomic RE's

These are the fundamental units to which we can build every language from:

Left is RegEx and right is what it means in language via set theory

Closure properties (compounding)

Three closure properties (everything else is a derivative):

Other compounding actions are through the following properties.

Operator precedence

Remember, RegEx is a string representation of languages. It evaluates like a mathematical expression so we need some order of precedence which we define as the following:

Note that the first means parantheses

Example:

Also important to realize that RegEx closure operators operate via individual characters and not the entire string. For example, in booboo^*, only the last o can be kleene starred and not the whole string.

Designing RegEx's

Can also design them from alphabets and languages (see 30:00). Here is an example:

See middle of lecture for more examples.

Some more notation

Some results (proofs)

Should make some sense. I mean the name is "regular" after all.

We also have another result which is the reverse (which isn't as obvious):

Why so:

Essentially, the proof would use this intuition:

More so:

Do this by eliminating states via building up RegEx's

One tip: self-loops are "stay here as long as you like" and in RegEx form, we use the Kleene operator: aa^*

A complete example of this theorem: