de.ls5.jlearn.algorithms.angluin
Class Angluin

java.lang.Object
  extended by de.ls5.jlearn.algorithms.angluin.Angluin
All Implemented Interfaces:
Learner, DotPlottable, GraphPlottable, Plottable, TextPlottable

public class Angluin
extends Object
implements Learner, DotPlottable, TextPlottable, GraphPlottable

Author:
fh

Constructor Summary
Angluin()
           
 
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 addSingleSuffix(Word concat)
           
 void addSuffix(Word concat)
          Add given Word to the internal set of suffixes of this Learner.
 void addWordToS(Word s)
           
 Class<? extends Plottable>[] getFormats()
          returns an array of currently available plotable formats.
 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
 String plotAsDot()
          returns a dot view on the plotable objejt
 de.ls5.layouter.api.model.Graph plotAsGraph()
          Will plot this polatbale as Graph
 String plotAsString()
          Will plot this polatbale as String
 void setAlphabet(Alphabet alphabet)
          Specifies the Alphabet used for construction of the hypothesis
 void setDInit(Collection<Word> dInit)
           
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Angluin

public Angluin()
Method Detail

addWordToS

public void addWordToS(Word s)
                throws LearningException
Throws:
LearningException

addSingleSuffix

public void addSingleSuffix(Word concat)

addSuffix

public void addSuffix(Word concat)
Description copied from interface: Learner
Add given Word to the internal set of suffixes of this Learner.

Specified by:
addSuffix in interface Learner
Parameters:
concat - Word to be additionally considered when constructing a hypothesis

getResult

public Automaton getResult()
Description copied from interface: Learner
Provides the current hypothesis as Automaton object

Specified by:
getResult in interface Learner
Returns:
current hypothesis

learn

public void learn()
           throws LearningException
Description copied from interface: Learner
Starts the learning algorithm, returns once a hypothesis has been constructed

Specified by:
learn in interface Learner
Throws:
LearningException - if any learning-related exception occurs an instance of this exception will be thrown

addCounterExample

public boolean addCounterExample(Word example,
                                 Word output)
                          throws ObservationConflictException
Description copied from interface: Learner
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).

Specified by:
addCounterExample in interface Learner
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

public int addLetter(Symbol letter)
Description copied from interface: Learner
Add given Symbol to the internal Alphabet of this Learner.

Specified by:
addLetter in interface Learner
Parameters:
letter - Symbol to be additionally considered when construction a hypothesis
Returns:
index into the internal Alphabet this letter was added to

getSigma

public int getSigma()
Description copied from interface: Learner
Return the size of the internal Alphabet this Learner uses to construct a hypothesis.

Specified by:
getSigma in interface Learner
Returns:
size of the internal alphabet

setOracle

public void setOracle(Oracle oracle)
Description copied from interface: Learner
Set the Oracle to be queried during the learning process

Specified by:
setOracle in interface Learner
Parameters:
oracle - Oracle to be queried

setAlphabet

public void setAlphabet(Alphabet alphabet)
Description copied from interface: Learner
Specifies the Alphabet used for construction of the hypothesis

Specified by:
setAlphabet in interface Learner
Parameters:
alphabet - Alphabet to be used for construction

setSplitterCreator

public void setSplitterCreator(SplitterCreator splitterCreator)
Description copied from interface: Learner
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).

Specified by:
setSplitterCreator in interface Learner
Parameters:
splitterCreator - instance of SplitterCreator to be used for processing counterexamples

setDInit

public void setDInit(Collection<Word> dInit)
Parameters:
dInit - the dInit to set

getFormats

public Class<? extends Plottable>[] getFormats()
Description copied from interface: Plottable
returns an array of currently available plotable formats.

Specified by:
getFormats in interface Plottable
Returns:
array of available plotable formats

plotAsDot

public String plotAsDot()
Description copied from interface: DotPlottable
returns a dot view on the plotable objejt

Specified by:
plotAsDot in interface DotPlottable
Returns:
dot view

plotAsString

public String plotAsString()
Description copied from interface: TextPlottable
Will plot this polatbale as String

Specified by:
plotAsString in interface TextPlottable
Returns:
String representation

plotAsGraph

public de.ls5.layouter.api.model.Graph plotAsGraph()
Description copied from interface: GraphPlottable
Will plot this polatbale as Graph

Specified by:
plotAsGraph in interface GraphPlottable
Returns:
String representation


Copyright © 2011. All Rights Reserved.