pseudocode added
[bsc-thesis1415.git] / thesis2 / 5.appendices.tex
1 \section{Algorithm}
2 \begin{listing}
3 \label{pseudodawg}
4 \caption{Graph minimization algorithm}
5 \begin{minted}[mathescape=true,linenos=true]{text}
6 register:=$\emptyset$
7 while there is another word
8 word = next word
9 commonprefix = CommonPrefix(word)
10 laststate = delta_star(q0, commonprefix)
11 currentsuffix = word[length(commonprefix)..length(word)]
12 if has_children(laststate)
13 then
14 replace_or_register(last_state)
15 endif
16 add_suffix(laststate, currentsuffix)
17 endwhile
18 replace_or_register(q0)
19
20 function replace_or_register(state)
21 child = last_child(state)
22 if has_children(child)
23 replace_or_register(child)
24 fi
25 if there is an equivalent state q
26 last_child(state = q
27 delete(child)
28 else
29 register.add(child)
30 endif
31 endfunction
32 \end{minted}
33 \end{listing}
34
35 \section{Schemes}
36 \subsection{scheme.xsd}
37 \label{scheme.xsd}
38 \xmlcode{scheme1.xsd}
39 \xmlcode[firstnumber=51]{scheme2.xsd}