de.ls5.jlearn.algorithms.dhcmodular
Class DHCModular

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

public class DHCModular
extends Object
implements Learner, ObservableDataStructure, DotPlottable, TextPlottable, GraphPlottable

Author:
merten

Constructor Summary
DHCModular()
           
DHCModular(Alphabet startalphabet, Oracle oracle)
           
 
Method Summary
 boolean addCounterExample(Word example, Word output)
          Take an counterexample, determine what prefix makes the difference, add that splitter to the alphabet, and reset the hypothesis automaton
 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.
 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 setEquivalenceConcept(EquivalenceConcept ec)
           
 void setMaximumStatesInBatch(int maxstates)
           
 void setOracle(Oracle oracle)
          Set the Oracle to be queried during the learning process
 void setOutputSymbolCreator(OutputSymbolCreator osc)
           
 void setQueryCreator(QueryCreator qc)
           
 void setQueueGuard(QueueGuard guard)
           
 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).
 void setTransitionSelector(TransitionSelector ts)
           
 String toDot()
          return current state of data structure as dot text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DHCModular

public DHCModular()

DHCModular

public DHCModular(Alphabet startalphabet,
                  Oracle oracle)
Method Detail

setOracle

public final 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 final 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

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
Take an counterexample, determine what prefix makes the difference, add that splitter to the alphabet, and reset the hypothesis automaton

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

setEquivalenceConcept

public void setEquivalenceConcept(EquivalenceConcept ec)

setOutputSymbolCreator

public void setOutputSymbolCreator(OutputSymbolCreator osc)

setQueryCreator

public void setQueryCreator(QueryCreator qc)

setTransitionSelector

public void setTransitionSelector(TransitionSelector ts)

setMaximumStatesInBatch

public void setMaximumStatesInBatch(int maxstates)

setQueueGuard

public void setQueueGuard(QueueGuard guard)

addSuffix

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

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

toDot

public String toDot()
Description copied from interface: ObservableDataStructure
return current state of data structure as dot text.

Specified by:
toDot in interface ObservableDataStructure
Returns:

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.