ProtocolLearner
Class PassiveLearner

java.lang.Object
  extended by ProtocolLearner.PassiveLearner

public class PassiveLearner
extends java.lang.Object

A passive synthesis protocol learner that builds Finite State Machine from a set of protocol messages traces

Author:
Serge Gorbunov

Nested Class Summary
 class PassiveLearner.Loop
           
 
Constructor Summary
PassiveLearner()
           
 
Method Summary
 boolean checkRootsChildrenColors(FSAutomaton inputAutomaton)
          Checks whether the the children of the root of the tree have associated colors.
 FSAutomaton constructAutomaton(java.util.ArrayList<MessageTrace> traces, AbstractionFunct input, AbstractionFunct output)
          Constructs a FSM from a sample of message traces and input/output abstraction function
 int findStateHeights(FSAutomaton inputAutomaton, int statePointer)
          A recursive function that sets a height for each state in the FSA.
 java.util.HashMap<java.lang.Integer,java.lang.Integer> findStatesParent(FSAutomaton inputAutomaton, int statePointer)
          Function traverses the FSA and stores the parent ID for each child.
 FSAutomaton minimizeAutomaton(FSAutomaton inputAutomaton, java.util.ArrayList<MessageTrace> traces, AbstractionFunct input, AbstractionFunct output)
          Minimizes a finite state automaton by reducing similar states And restores the loops that were initially removed from the automaton
 void setTraceLoops(MessageTrace trace, AbstractionFunct inab)
          Identifies loops in the trace
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PassiveLearner

public PassiveLearner()
Method Detail

constructAutomaton

public FSAutomaton constructAutomaton(java.util.ArrayList<MessageTrace> traces,
                                      AbstractionFunct input,
                                      AbstractionFunct output)
Constructs a FSM from a sample of message traces and input/output abstraction function

Parameters:
traces - ArrayList of message traces
input - Input abstraction function
output - Output abstraction function
Returns:
Generated FSM

minimizeAutomaton

public FSAutomaton minimizeAutomaton(FSAutomaton inputAutomaton,
                                     java.util.ArrayList<MessageTrace> traces,
                                     AbstractionFunct input,
                                     AbstractionFunct output)
Minimizes a finite state automaton by reducing similar states And restores the loops that were initially removed from the automaton

Parameters:
inputAutomaton - Finite state automaton
traces - A collection of protocol traces that were used to construct the automaton
input - An abstraction function for the input messages
output - An abstraction function for the output messages
Returns:
Minimized finite state automaton

checkRootsChildrenColors

public boolean checkRootsChildrenColors(FSAutomaton inputAutomaton)
Checks whether the the children of the root of the tree have associated colors. This method is used for FSM minimization

Parameters:
inputAutomaton - FS automaton
Returns:
True if all children of the root have colors, false otherwise

findStateHeights

public int findStateHeights(FSAutomaton inputAutomaton,
                            int statePointer)
A recursive function that sets a height for each state in the FSA.

Parameters:
inputAutomaton - A finite state automaton
statePointer - Index of a state for which height is calculated.
Returns:
The height of the state

findStatesParent

public java.util.HashMap<java.lang.Integer,java.lang.Integer> findStatesParent(FSAutomaton inputAutomaton,
                                                                               int statePointer)
Function traverses the FSA and stores the parent ID for each child.

Parameters:
inputAtomaton - input FAS
Returns:
A hash map where state is the key, and its parent is the value

setTraceLoops

public void setTraceLoops(MessageTrace trace,
                          AbstractionFunct inab)
Identifies loops in the trace