Skip to content

Setup Annotations

HansvdLaan edited this page Apr 25, 2018 · 17 revisions

These are the annotations which can be used to set details about the learning setup, such as which methods should be called to start, initialize and shut down the SUL and which methods should be called to ensure equivalence between queries. All annotations except Start have an order value to set in which order they should be executed compared to other methods of the same type. If this value is left empty, it will be executed last. Below all annotations are showcased together with a small example. More information about their exact workings can be found in the JavaDoc.

@Start

The Start annotation is used to indicate which method should be called to start the SUL and which kind of automaton should be learned.

@Start(automaton = "MealyMachine")
@Override
public static void main(String[] args) throws Exception { 
    // code
}

@Shutdown

The Shutdown annotation is used to indicate which method should be called to shut down the SUL.

@Shutdown
public void quit() {
    System.exit(0);
}

@Initialize

The Initialize annotation is used to indicate which method should be called to initialize the SUL. This method will be called after the method annotated with Start.

@Initialize(order = 1)
public void a() { 
    // code
}

@Initialize()
public void b() { 
    // code
}

@Initialize(order = 2)
public void c() { 
    // code
}

@PreQuery

The PreQuery annotation type is used to indicate which method should be called before each Query on the SUL as to ensure query equivalence.

@PostQuery

The PostQuery is used to indicate which method should be called after each Query on the SUL as to ensure query equivalence.

@PreInputInvocation

The PreInputInvocation annotation type is used to indicate which method should be called before any input method of any input symbol is invocated on the SUL as to ensure query equivalence.

@PostInputInvocation

The PostInputInvocation annotation type is used to indicate which method should be called after any input method of any input symbol is invocated on the SUL as to ensure query equivalence.

@PreOutputInvocation

The PreOutputInvocationannotation type is used to indicate which method should be called before any output method of any input symbol is invocated on the SUL as to ensure query equivalence.

@PostOutputInvocation

The PostOutputInvocationannotation type is used to indicate which method should be called after any output method of any input symbol is invocated on the SUL as to ensure query equivalence.