de.ls5.jlearn.interfaces
Interface Learner

All Known Implementing Classes:
Angluin, DHC, DHCModular, ObservationPack

public interface Learner

Interface for learning algorithms

Author:
merten

Method Summary
 boolean addCounterExample(Word example, Word output)
          Process a counterexample.
 int addLetter(Symbol letter)
          Add given Symbol to the internal Alphabet of this Learner.
 void addSuffix(Word suffix)
          Add given Word to the internal set of suffixes of this Learner.
 Automaton getResult()
          Provides the current hypothesis as Automaton object
 int getSigma()
          Return the size of the internal Alphabet this Learner uses to construct a hypothesis.
 void learn()
          Starts the learning algorithm, returns once a hypothesis has been constructed
 void setAlphabet(Alphabet alphabet)
          Specifies the Alphabet used for construction of the hypothesis
 void setOracle(Oracle oracle)
          Set the Oracle to be queried during the learning process
 void setSplitterCreator(SplitterCreator splitterCreator)
          Setter for the SplitterCreator, which encapsulates logic for dealing with counterexamples (logic that, e.g., determines a suffix of the counterexample that witnesses unequality of states, thus "splitting" a state in the hypothesis).
 

Method Detail

setOracle

void setOracle(Oracle oracle)
Set the Oracle to be queried during the learning process

Parameters:
oracle - Oracle to be queried

setAlphabet

void setAlphabet(Alphabet alphabet)
Specifies the Alphabet used for construction of the hypothesis

Parameters:
alphabet - Alphabet to be used for construction

setSplitterCreator

void setSplitterCreator(SplitterCreator splitterCreator)
Setter for the SplitterCreator, which encapsulates logic for dealing with counterexamples (logic that, e.g., determines a suffix of the counterexample that witnesses unequality of states, thus "splitting" a state in the hypothesis).

Parameters:
splitterCreator - instance of SplitterCreator to be used for processing counterexamples

getResult

Automaton getResult()
Provides the current hypothesis as Automaton object

Returns:
current hypothesis

learn

void learn()
           throws LearningException
Starts the learning algorithm, returns once a hypothesis has been constructed

Throws:
LearningException - if any learning-related exception occurs an instance of this exception will be thrown

addCounterExample

boolean addCounterExample(Word example,
                          Word output)
                          throws ObservationConflictException
Process a counterexample. Usually invoked once a hypothesis was constructed and an EquivalenceOracle found proof (a counterexample) for diverging behavior between the hypothesis and the System Under Test (SUT).

Parameters:
example - counterexample provided by the equivalence oracle
output - output produced by the SUT when processing the counterexample
Returns:
boolean flag if the counterexample was processed
Throws:
ObservationConflictException - exception that is thrown if the counterexample and its output diverges from already observed behavior

addLetter

int addLetter(Symbol letter)
Add given Symbol to the internal Alphabet of this Learner.

Parameters:
letter - Symbol to be additionally considered when construction a hypothesis
Returns:
index into the internal Alphabet this letter was added to

addSuffix

void addSuffix(Word suffix)
Add given Word to the internal set of suffixes of this Learner.

Parameters:
suffix - Word to be additionally considered when constructing a hypothesis

getSigma

int getSigma()
Return the size of the internal Alphabet this Learner uses to construct a hypothesis.

Returns:
size of the internal alphabet


Copyright © 2011. All Rights Reserved.