diff --git a/ChangeLog b/ChangeLog index 18d103340..bf5b7092f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-02-03 Alexandre Duret-Lutz + + * src/tgbaalgos/gtec/gtec.hh (couvreur99_check): Add pseudo code. + 2005-02-02 Alexandre Duret-Lutz * src/tgbaalgos/randomgraph.cc (random_graph): Make sure n > 0. diff --git a/src/tgbaalgos/gtec/gtec.hh b/src/tgbaalgos/gtec/gtec.hh index 610c0e8f2..c49a37203 100644 --- a/src/tgbaalgos/gtec/gtec.hh +++ b/src/tgbaalgos/gtec/gtec.hh @@ -53,9 +53,48 @@ namespace spot /// } /// \endverbatim /// - /// check() returns true if the automaton's language is empty. When - /// it return false, a stack of SCC has been built is available - /// using result() (spot::counter_example needs it). + /// A recursive definition of the algorithm would look as follows, + /// but the implementation is of course not recursive. + /// (<Sigma, Q, delta, q, F> is the automaton to + /// check, H is an associative array mapping each state to its + /// positive DFS order or 0 if it is dead, SCC is and ACC are two + /// stacks.) + /// + /// \verbatim + /// check(, H, SCC, ACC) + /// if q is not in H // new state + /// H[q] = H.size + 1 + /// SCC.push() + /// forall : in delta + /// ACC.push(a) + /// res = check(, H, SCC, ACC) + /// if res + /// return res + /// = SCC.top() + /// if n = H[q] + /// SCC.pop() + /// mark_reachable_states_as_dead(, H$) + /// return 0 + /// else + /// if H[q] = 0 // dead state + /// ACC.pop() + /// return true + /// else // state in stack: merge SCC + /// all = {} + /// do + /// = SCC.pop() + /// all = all union a union { ACC.pop() } + /// until n <= H[q] + /// SCC.push() + /// if all != F + /// return 0 + /// return new emptiness_check_result(necessary data) + /// \endverbatim + /// + /// check() returns 0 iff the automaton's language is empty. It + /// returns an instance of emptiness_check_result. If the automaton + /// accept a word. (Use emptiness_check_result::accepting_run() to + /// extract an accepting run.) /// /// There are two variants of this algorithm: spot::couvreur99_check and /// spot::couvreur99_check_shy. They differ in their memory usage, the