I'm currently reading "Engineering a Compiler" book. In the chapter that explanes computing epsilon-closure there is listed the following algorithm:enter image description here

But I couldn't understand what does $E(n)$ and $E(p)$ mean. I know that it has something to do with sets.


For each state $n \in N$, we maintain a set of states $E(n)$. Eventually, $E(n)$ would contain all states reachable from $n$ via $\epsilon$-transitions.

You can think of $E$ as an array of sets. The notation $E(n)$ just means the value of $E$ at position $n$. So $E(p)$ is just the value of $E$ at position $p$.

  • $\begingroup$ It may be useful to note that this notation probably maps into concrete syntax that looks more like E[n] := {n} in many programming languages $\endgroup$ – Curtis F Aug 23 '19 at 21:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.