dprokoptsev/pire — pull request #6 by sergey-v-galtsev (2012-07-27 14:50:14+00:00)
Title: States beeing unreachable from init state are considered dead in Fsm::DeadStates() now.

Compare NFAs for /^.$/ (dumped after a call to Fsm::RemoveDeadEnds()):

(Without this patch; states 1 and 7 are unreachable.)
```dot
digraph {
"initial"[shape="plaintext",label="NFA for: /^.$/"]

0[shape="circle",label="0"]
0 -> 2[label=""]

1[shape="circle",label="1"]
1 -> 2[label=""]

2[shape="circle",label="2"]
2 -> 3[label="[\\360-\\367]"]
2 -> 4[label="[\\340-\\357]"]
2 -> 5[label="[\\300-\\337]"]
2 -> 6[label=" [\\000-\\177]"]

3[shape="circle",label="3"]
3 -> 4[label="[\\200-\\277]"]

4[shape="circle",label="4"]
4 -> 5[label="[\\200-\\277]"]

5[shape="circle",label="5"]
5 -> 6[label="[\\200-\\277]"]

6[shape="circle",label="6"]
6 -> 8[label=""]

7[shape="circle",label="7"]
7 -> 8[label=""]

8[shape="circle",label="8"]
8 -> 10[label=""]

9[shape="circle",label="9"]
"initial" -> 9
9 -> 0[label=""]
9 -> 9[label=" ."]

10[shape="doublecircle",label="10"]
10 -> 10[label=" ."]

}
```

(With the patch; states 1 and 7 are removed.)
```dot
digraph {
"initial"[shape="plaintext",label="NFA for: /^.$/"]

0[shape="circle",label="0"]
0 -> 2[label=""]

2[shape="circle",label="2"]
2 -> 3[label="[\\360-\\367]"]
2 -> 4[label="[\\340-\\357]"]
2 -> 5[label="[\\300-\\337]"]
2 -> 6[label=" [\\000-\\177]"]

3[shape="circle",label="3"]
3 -> 4[label="[\\200-\\277]"]

4[shape="circle",label="4"]
4 -> 5[label="[\\200-\\277]"]

5[shape="circle",label="5"]
5 -> 6[label="[\\200-\\277]"]

6[shape="circle",label="6"]
6 -> 8[label=""]

8[shape="circle",label="8"]
8 -> 10[label=""]

9[shape="circle",label="9"]
"initial" -> 9
9 -> 0[label=""]
9 -> 9[label=" ."]

10[shape="doublecircle",label="10"]
10 -> 10[label=" ."]

}
```