examples
The examples module holds several classes that display the usage and application of the tool.
It contains several benchmarks for which we want to briefly sketch the quantitative and qualitative results in the following.
Note, for generating counterexamples in our black-box testing scenario, we (in order) generated 10000 random, well-matched, rooted words of maximum length 100, for CFG based approaches (Palindromes, Exponential) generated 10000 words of the (instrumented) context-free language and finally sampled from a manually constructed set of characteristic words to ensure termination against the correct model.
The results for the quantitative evaluations are averaged over 15 learning runs.
Palindromes
A qualitative comparison of the palindrome examples has already been presented earlier.
The following shows the quantitative comparison of the different learning scenarios.
|
#CEs |
#Queries |
#Symbols |
Hyp. size |
| SPA [L* (classic)] |
7.4 |
435.5 |
3794.7 |
12.0 |
| SPA [L* (Riv. & Schap.)] |
8.7 |
315.2 |
2356.1 |
12.0 |
| SPA [L* (Kearns & Vaz.)] |
9.2 |
214.1 |
1457.8 |
12.0 |
| SPA [DiscriminationTree] |
9.1 |
218.1 |
1452.5 |
12.0 |
| SPA [TTT] |
9.3 |
186.6 |
1265.6 |
12.0 |
| VPA [DiscriminationTree] |
7.9 |
1616.5 |
15176.7 |
11.0 |
| VPA [TTT] |
8.1 |
1651.9 |
15343.1 |
11.0 |
As can be seen, our SPA approach outperforms the VPA approach by a significant margin, even for this small of an example.
XML
XML documents are a highly practical example, where our orchestration naturally integrates into the given structure:
When interpreting XML tags as procedures, the start and end of a procedure is given by its opening and closing tag.
For our example, consider the following DTD (document type definition):
<!ELEMENT person ((mother | father)? |
(father, mother) |
(mother, father))>
<!ELEMENT mother (person)>
<!ELEMENT father (person)>
<!ATTLIST person name CDATA #REQUIRED>
<!ATTLIST person died CDATA #IMPLIED>
Documents adhering to this DTD allow to store information about the pedigree of a person.
Each person has to be identified via its name attribute and may optionally store information about his/her year of death (if the person died already). Furthermore, it is possible to store information about his/her ancestors via nested <mother> or <father> tags (optional and irrespective of order), which themselves hold persons again.
By translating abstract queries (e.g. PERSON name R) to concrete XML documents (i.e <person name="..."></person>), we can learn the structure of DTDs solely by asking a black-box DTD validator, if a provided XML document conforms to an (unknown, to be inferred) DTD or not.
In this example, we have modeled {PERSON, MOTHER, FATHER} as call symbols representing the tags and {name, died} as internal symbols representing attributes.
The following shows the inferred models:
(Click on the images for a full-sized view)
As one can see, from the SPA model it is directly possible to infer the nesting structure of the different procedures (tags).
Furthermore, given that attributes were modeled as internal symbols, one can deduce that the name attribute is mandatory, whereas the died attribute is completely optional.
One can reconstruct the structure of the (previously unknown) DTD, given the model of the SPA.
In contrast to that is the VPA model, which with its explicit stack management, makes it hard to understand the key structure of the document.
Regarding performance, the following table again shows that our SPA approach additionally allows to reduce the query complexity.
In this case an improvement around a factor of 3-4 was achieved.
|
#CEs |
#Queries |
#Symbols |
Hyp. size |
| SPA [L* (classic)] |
8.1 |
492.2 |
6521.3 |
14.0 |
| SPA [L* (Riv. & Schap.)] |
8.5 |
344.7 |
4102.1 |
14.0 |
| SPA [L* (Kearns & Vaz.)] |
9.5 |
220.9 |
2710.8 |
14.0 |
| SPA [DiscriminationTree] |
9.9 |
234.8 |
2829.1 |
14.0 |
| SPA [TTT] |
9.5 |
201.4 |
2636.5 |
14.0 |
| VPA [DiscriminationTree] |
6.6 |
901.9 |
9858.1 |
9.0 |
| VPA [TTT] |
6.8 |
819.8 |
8812.8 |
9.0 |
Regular Exponential Systems
Even in cases, where the structure of software systems is not necessarily context-free but exhibits a highly repetitive structure, the correct abstraction level can be beneficial for its understanding and learning performance.
Consider, for example, the following procedural system
A -> B B B B
B -> C C C C
C -> D D D D
D -> a b c
This system exhibits a regular structure and thus can also be learned in its non-instrumented form with arbitrary regular learning algorithms.
The following shows the inferred models and performance measurements for the SPA, VPA and regular (non-instrumented) configuration.
(Click on the images for a full-sized view. There are 3 images)
|
#CEs |
#Queries |
#Symbols |
Hyp. size |
| SPA [L* (classic)] |
5.0 |
1320.0 |
565376.0 |
23.0 |
| SPA [L* (Riv. & Schap.)] |
5.0 |
868.0 |
355863.0 |
23.0 |
| SPA [L* (Kearns & Vaz.)] |
5.0 |
856.0 |
347419.0 |
23.0 |
| SPA [DiscriminationTree] |
5.0 |
855.0 |
348077.0 |
23.0 |
| SPA [TTT] |
5.0 |
906.0 |
387557.0 |
23.0 |
| VPA [DiscriminationTree] |
2.0 |
22936.0 |
10124646.0 |
18.0 |
| VPA [TTT] |
2.0 |
22971.0 |
10137135.0 |
18.0 |
| REG [L* (classic)] |
2.0 |
223687.0 |
43264617.0 |
194.0 |
| REG [Rivest/Schapire] |
2.0 |
114007.0 |
21798161.0 |
194.0 |
| REG [Kearns/Vazirani] |
2.0 |
1292135.0 |
132508009.0 |
194.0 |
| REG [DiscriminationTree] |
2.0 |
95673.0 |
19383730.0 |
194.0 |
| REG [TTT] |
2.0 |
95661.0 |
19470481.0 |
194.0 |
Again, our SPA approach directly allows to infer the underlying structure of the system, while performing best among its competitors -- this time even an order of magnitude better.
As the regular non-instrumented setup shows, even for this simple example a regular abstraction is in no way feasible for learning inherently procedural systems.