6

I am going through the book , introduction to compiler design , by Torben Ægidius Mogensen.

It provides the following definition of an epsilon closure :

Given a set M of NFA states, we define $\ \epsilon $-closure($\ M $) to be the least (in terms of the subset relation) solution to the set equation $\ \epsilon $-closure($\ M $) =$\ M $ $\ \cup $ {$\ t $|$\ s $ ∈ $\ \epsilon $-closure($\ M $) and $\ s^\epsilon t$∈T}, where T is the set of transitions in the NFA.

Initially , it defined the notion $\ a^b c $ to mean that a transition from state $\ a $ to $\ b$ takes place when a symbol $\ c $ is encountered .

But in the above definition $\ s^\epsilon t $ , $\ t$ is an element of the set of transitions , not the set of states .

This has resulted in a bit of confusion as to what exactly does an epsilon closure mean .

One more terminology word-play that wanted to be clear about is , the exact meaning of a sentence of the following sort :

"We extend the set of NFA states with those you can reach from these by using only epsilon transitions ."

But in a set of NFA states , the epsilon transition would direct one state to another which would be already included in the set of NFA states. So , how is it possible to extend the same set with the elements already contained in it ?

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
Eddie Dorphy
  • 93
  • 1
  • 5

1 Answers1

9

Your textbook is being very formal, probably since it aims at using set equations later on. However, $\epsilon$-closure is a very simple concept. The $\epsilon$-closure of a set $M$ of states is the collection of states that can be reached from a state in $M$ by taking any number of $\epsilon$-transitions (possibly zero).

The textbook uses a different (but equivalent) definition: it defines the $\epsilon$-closure of $M$ to be the smallest set of states that contains $M$ and that for every state $s$ that it contains, contains all states reachable from $s$ by a single $\epsilon$-transition.

Regarding the second quote, there is some context missing. Here is one possible context which would make sense. For an NFA without $\epsilon$-transitions, we define $\delta(q,a)$ to be the set of states that can be reached from $q$ by taking a transition labeled $a$. When we have $\epsilon$-transitions, there are several different possible definitions of the transition function. One possibility is to define $\delta(q,a)$ to be the set of states that can be reached from $q$ by taking a transition labeled $a$ and then an arbitrary number of transitions labeled $\epsilon$ (possibly none).

Yuval Filmus
  • 276,994
  • 27
  • 311
  • 503
  • epsilon closure is a set of states which are always in M or may lie outside M ? – Eddie Dorphy Oct 01 '17 at 16:16
  • The $\epsilon$-close of $M$ consists of all states you can reach from $M$ by taking zero or more $\epsilon$-transitions. – Yuval Filmus Oct 01 '17 at 16:20
  • : So they may not be included in M , right ? – Eddie Dorphy Oct 01 '17 at 16:39
  • Any suggestions as to why in the defintion of e-closure has he termed "t" to be set of all transitions . As per the way the notation is understood shouldn't it be a set of states ? – Eddie Dorphy Oct 01 '17 at 16:41
  • I added a paragraph with the meaning of the notation. In fact, $t$ is a single state. – Yuval Filmus Oct 01 '17 at 16:47
  • Thanks a lot . The least solution for this state equation will be M , isn't it obvious ? Or as we have not specified whether the states we reach by epsilon transitions from M are always included in M or not , hence the answer might not always be M ? – Eddie Dorphy Oct 01 '17 at 16:52
  • The least fixpoint solution is exactly what I described in the first paragraph. You might enjoy proving this. – Yuval Filmus Oct 01 '17 at 17:00
  • I can prove that when "F" is the epsilon closure then a fixed point definitely exists but what about any random function "F" ? – Eddie Dorphy Oct 01 '17 at 18:22
  • I'm not sure what $F$ is, but in any case I suggest reviewing the definition of least fixpoint. If you are still stuck, ask a new question specifically about this point. – Yuval Filmus Oct 01 '17 at 18:33