From 78e2806bc85e69902fd38ae287cd9e8b02ab552e Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 13 Feb 2015 13:13:08 +0100 Subject: [PATCH] pseudocode added --- thesis2/5.appendices.tex | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/thesis2/5.appendices.tex b/thesis2/5.appendices.tex index 952575e..a3461f0 100644 --- a/thesis2/5.appendices.tex +++ b/thesis2/5.appendices.tex @@ -7,8 +7,28 @@ register:=$\emptyset$ while there is another word word = next word commonprefix = CommonPrefix(word) - laststate = $\delta^*(q_0, $commonprefix) - currentsuffix + laststate = delta_star(q0, commonprefix) + currentsuffix = word[length(commonprefix)..length(word)] + if has_children(laststate) + then + replace_or_register(last_state) + endif + add_suffix(laststate, currentsuffix) +endwhile +replace_or_register(q0) + +function replace_or_register(state) + child = last_child(state) + if has_children(child) + replace_or_register(child) + fi + if there is an equivalent state q + last_child(state = q + delete(child) + else + register.add(child) + endif +endfunction \end{minted} \end{listing} -- 2.20.1