diff --git a/content/esm.table b/content/esm.table new file mode 100644 index 0000000..bc6b9a8 --- /dev/null +++ b/content/esm.table @@ -0,0 +1,137 @@ +states Hopcroft Moore +546 0.05548176 0.05162218 +547 0.065968448 0.374567635 +571 0.151784094 2.562025297 +610 0.161709531 2.923059564 +612 0.162847423 2.949833339 +616 0.16393522 2.979295117 +634 0.169730862 3.136451995 +644 0.171697908 3.205603966 +646 0.173519053 3.247711454 +664 0.174829094 3.303879469 +674 0.176219619 3.404398614 +704 0.18026932 3.772591464 +723 0.176796323 4.025279554 +724 0.176144222 4.041852225 +727 0.177380196 4.078740205 +750 0.184511916 4.376803632 +752 0.184925295 4.39675801 +755 0.18608039 4.427337413 +779 0.191979151 4.696313345 +796 0.19801254 4.906009044 +808 0.199559131 4.969958634 +816 0.202306127 5.06486171 +820 0.203567904 5.11139433 +826 0.206071634 5.194849765 +849 0.217511686 5.553222482 +851 0.220003201 5.5797187 +881 0.226420016 5.94774453 +951 0.235091864 6.33370116 +952 0.234470623 6.357592105 +976 0.243413677 6.785026456 +998 0.247111407 7.115376566 +1022 0.254264636 7.475588529 +1028 0.253825238 7.676966117 +1031 0.253552779 7.655207879 +1032 0.253959583 7.687817395 +1036 0.256927602 7.753280811 +1038 0.256454243 7.785150879 +1044 0.2676729 7.914658705 +1048 0.268592945 7.993362548 +1090 0.280256629 8.571307839 +1096 0.283057389 8.72110485 +1104 0.285299766 8.860082549 +1172 0.30334844 9.682438227 +1182 0.308970132 9.785819737 +1222 0.323826492 10.508031711 +1230 0.325670362 10.670810609 +1242 0.331428484 10.796530463 +1248 0.32975737 10.897072507 +1262 0.33353854 11.303006909 +1268 0.338205563 11.351776371 +1460 0.371807782 13.490904423 +1466 0.372692439 13.528562317 +1486 0.380183351 14.004736754 +1492 0.382841945 14.188868672 +1495 0.382159405 14.265695125 +1513 0.388669725 14.900034072 +1516 0.390405231 14.81499996 +1518 0.390463274 14.944426519 +1522 0.392151819 14.915203734 +1524 0.393186661 14.961747551 +1526 0.394158427 15.037075056 +1573 0.408168072 16.133197125 +1598 0.416766067 16.678992988 +1660 0.44328243 18.142114009 +1665 0.444965405 18.25355816 +1666 0.444720035 18.28403416 +1667 0.446062015 18.284690403 +1668 0.446125714 18.329058714 +1670 0.446133206 18.572377324 +1672 0.446952057 18.695455536 +1708 0.456918651 18.790907562 +1712 0.458244796 18.905278887 +1720 0.461813708 19.17002062 +1728 0.465456384 19.392921399 +1736 0.46909665 19.581211756 +1738 0.469009293 19.63986836 +1739 0.470088086 19.654523832 +1745 0.472925164 19.834706477 +1747 0.476427047 19.882721961 +1756 0.477945503 20.126510562 +1776 0.48555338 21.050697212 +1779 0.487291725 20.769860328 +1785 0.487422511 20.95968171 +1792 0.490868025 21.171034734 +1799 0.495984897 21.381192056 +1829 0.500577054 22.305283908 +1835 0.501130431 22.349754728 +1841 0.499636037 22.458577516 +1853 0.502867922 22.789015879 +1857 0.503177778 22.824136936 +1863 0.506992088 22.968349427 +1869 0.511573083 23.149349308 +1870 0.510409209 23.185619132 +1891 0.51604806 23.597859463 +1915 0.52134704 23.854239145 +1927 0.526302999 24.077963239 +1935 0.529154809 24.256248614 +1951 0.533841463 24.888246072 +1972 0.537198755 25.293137881 +1978 0.538614268 25.390662904 +2032 0.565800375 26.03466246 +2053 0.559773001 26.420268108 +2101 0.569853806 27.579091597 +2125 0.575521253 28.225772617 +2137 0.57871672 28.277690829 +2155 0.581133036 28.500376699 +2158 0.582197362 28.494612045 +2167 0.584903052 28.531839432 +2170 0.588296814 28.575386555 +2172 0.588168789 28.727190877 +2202 0.601001684 29.645737322 +2214 0.607209659 30.433077486 +2218 0.610239584 30.515088605 +2224 0.612489408 30.80970033 +2228 0.609919931 30.970134524 +2246 0.616805458 30.836588838 +2364 0.688856681 36.422097475 +2382 0.699198195 37.22853454 +2386 0.699697687 37.399438633 +2390 0.696379643 37.491589119 +2448 0.722756074 40.559368969 +2822 0.892213459 56.246352395 +2894 0.925655807 58.298946257 +2902 0.930451456 58.91838622 +2908 0.934032602 59.191770267 +2915 0.939078333 59.149010129 +3042 0.979294733 63.624004421 +3109 1.008006854 66.701448478 +3164 1.030117558 69.210002572 +3172 1.028983357 68.766214254 +3326 1.06337783 72.518414203 +3364 1.080085845 75.032993864 +3368 1.081815962 74.785882543 +3380 1.086156479 75.969527635 +3406 1.095992942 76.987838799 +3410 1.11796171 79.799157453 diff --git a/content/hopcroft_a.table b/content/hopcroft_a.table new file mode 100644 index 0000000..db29d04 --- /dev/null +++ b/content/hopcroft_a.table @@ -0,0 +1,15 @@ +states Hopcroft Moore +4 0.000004394 0.000008367 +8 0.000007727 0.000020106 +16 0.000014457 0.000052275 +32 0.000030602 0.000155723 +64 0.000072037 0.000509607 +128 0.000193457 0.001816708 +256 0.000563881 0.00676876 +512 0.00145047 0.026100461 +1024 0.003533843 0.101946121 +2048 0.008529486 0.407693 +4096 0.021424756 1.64542877 +8192 0.051799602 6.570335332 +16384 0.12096594 26.285563125 +32768 0.295170838 106.794193669 diff --git a/content/hopcroft_b.table b/content/hopcroft_b.table new file mode 100644 index 0000000..f5c19cc --- /dev/null +++ b/content/hopcroft_b.table @@ -0,0 +1,15 @@ +states Hopcroft Moore +4 0.000004181 0.00000485 +8 0.000007397 0.000012002 +16 0.000013752 0.000030596 +32 0.000027895 0.000084655 +64 0.000061301 0.000258466 +128 0.000149001 0.00085492 +256 0.000390771 0.003013328 +512 0.000959998 0.011248316 +1024 0.002402636 0.043437952 +2048 0.005954948 0.1706022 +4096 0.015253576 0.684592527 +8192 0.035884835 2.758716619 +16384 0.082455912 11.050600273 +32768 0.194492715 43.719043747 diff --git a/content/minimal-separating-sequences.tex b/content/minimal-separating-sequences.tex index 0a968b8..a6d92df 100644 --- a/content/minimal-separating-sequences.tex +++ b/content/minimal-separating-sequences.tex @@ -647,9 +647,60 @@ This can be done in $\bigO(n^2)$ time using a trie data structure. \stopsection +\startsection + [title={Experimental Results}] -\todo{ga verder bij \tt 732} +We have implemented \in{Algorithms}[alg:increase-k, alg:increase-k-v3] in Go, and we have compared their running time on two sets of FSMs. +\footnote{Available at \todo{https://gitlab.science.ru.nl/rick/partition/}.} +The first set is from \cite{Smeenk}, where FSMs for embedded control software were automatically constructed. +These FSMs are of increasing size, varying from 546 to 3~410 states, with 78 inputs and up to 151 outputs. +The second set is inferred from \citet[Hopcroft1971], where two classes of finite automata, $A$ and $B$, are described that serve as a worst case for \in{Algorithms}[alg:increase-k, alg:increase-k-v3] respectively. +The FSMs that we have constructed for these automata have 1 input, 2 outputs, and $2^2$~--~$2^{15}$ states. +The running times in seconds on an Intel Core i5-2500 are plotted in \in{Figure}[fig:results]. +We note that different slopes imply different complexity classes, since both axes have a logarithmic scale. +\startplacefigure + [title={Running time in seconds of \in{Algorithm}[alg:increase-k] (grey) and \in{Algorithm}[alg:increase-k-v3] (black).}, + reference=fig:results] +\startcombination[2*1] +{\starttikzpicture +\startloglogaxis[width=0.5\textwidth, xtick={500, 1000, 2000, 3000}, xticklabels={500, 1000, 2000, 3000}] +\addplot[color=darkgray] table[x=states, y=Moore] {esm.table}; +\addplot[color=black] table[x=states, y=Hopcroft] {esm.table}; +\stoploglogaxis +\stoptikzpicture} {(a) Embedded control software.} +{\starttikzpicture +\startloglogaxis[width=0.5\textwidth, xtick={4, 64, 2048, 32768}, xticklabels={$2^2$, $2^6$, $2^{11}$, $2^{15}$}] +\addplot[color=darkgray, dashed] table[x=states, y=Moore] {hopcroft_b.table}; +\addplot[color=black, dashed] table[x=states, y=Hopcroft] {hopcroft_b.table}; +\addplot[color=darkgray] table[x=states, y=Moore] {hopcroft_a.table}; +\addplot[color=black] table[x=states, y=Hopcroft] {hopcroft_a.table}; +\stoploglogaxis +\stoptikzpicture} {(b) Class $A$ (dashed) and class $B$ (solid).} +\stopcombination +\stopplacefigure + + +\stopsection +\startsection + [title={Conclusion}] + +In this paper we have described an efficient algorithm for constructing a set of minimal-length sequences that pairwise distinguish all states of a finite state machine. +By extending Hopcroft's minimisation algorithm, we are able to construct such sequences in $\bigO(m \log n)$ for a machine with $m$ transitions and $n$ states. +This improves on the traditional $\bigO(mn)$ method that is based on the classic algorithm by Moore. +As an upshot, the sequences obtained form a characterisation set and a separating family, which play a crucial in conformance testing. + +Two key observations were required for a correct adaptation of Hopcroft's algorithm. +First, it is required to perform splits in order of the length of their associated sequences. +This guarantees minimality of the obtained separating sequences. +Second, it is required to consider nodes as a candidate before any one of its children are considered as a candidate. +This order follows naturally from the construction of a splitting tree. + +Experimental results show that our algorithm outperforms the classic approach for both worst-case finite state machines and models of embedded control software. +Applications of minimal separating sequences such as the ones described by \citet[dorofeeva2010fsm, Smeenk] therefore show that our algorithm is useful in practice. + + +\stopsection \referencesifcomponent \stopchapter \stopcomponent diff --git a/environment/tikz.tex b/environment/tikz.tex index 834a8fa..f07c14b 100644 --- a/environment/tikz.tex +++ b/environment/tikz.tex @@ -3,6 +3,8 @@ \usemodule[tikz] \usetikzlibrary[automata, arrows, positioning, matrix, fit, decorations.pathreplacing] +\usemodule[pgfplots] + % defaults \tikzset{node distance=2cm} % 'shorten >=2pt' only for automata