FSM Library - C++ version
Public Member Functions | List of all members
Dfsm Class Reference
Inheritance diagram for Dfsm:
Inheritance graph
[legend]
Collaboration diagram for Dfsm:
Collaboration graph
[legend]

Public Member Functions

 Dfsm (const std::string &fname, const std::string &fsmName, const int maxNodes, const int maxInput, const int maxOutput, const std::shared_ptr< FsmPresentationLayer > presentationLayer)
 
 Dfsm (const std::string &fsmName, const int maxNodes, const int maxInput, const int maxOutput, const std::shared_ptr< FsmPresentationLayer > presentationLayer)
 
 Dfsm (const std::string &fsmName, const int maxInput, const int maxOutput, const std::vector< std::shared_ptr< FsmNode >> lst, const std::shared_ptr< FsmPresentationLayer > presentationLayer)
 
 Dfsm (const Fsm &fsm)
 
Dfsm minimise ()
 
void printTables () const
 
IOListContainer getCharacterisationSet ()
 
IOTrace applyDet (const InputTrace &i)
 
bool pass (const IOTrace &io)
 
IOListContainer wMethod (const unsigned int m)
 
IOListContainer wpMethod (const int m)
 
- Public Member Functions inherited from Fsm
 Fsm (const std::string &fname, const std::string &fsmName, const int maxNodes, const int maxInput, const int maxOutput, const std::shared_ptr< FsmPresentationLayer > presentationLayer)
 
 Fsm (const std::string &fname, const std::shared_ptr< FsmPresentationLayer > presentationLayer, const std::string &fsmName)
 
 Fsm (const std::string &fsmName, const int maxInput, const int maxOutput, const std::vector< std::shared_ptr< FsmNode >> lst, const std::shared_ptr< FsmPresentationLayer > presentationLayer)
 
void dumpFsm (std::ofstream &outputFile) const
 
std::shared_ptr< FsmNodegetInitialState () const
 
std::string getName () const
 
virtual int getMaxNodes () const
 
int getMaxInput () const
 
int getMaxOutput () const
 
std::vector< std::shared_ptr< FsmNode > > getNodes () const
 
std::shared_ptr< FsmPresentationLayergetPresentationLayer () const
 
int getInitStateIdx () const
 
void resetColor ()
 
void toDot (const std::string &fname)
 
Fsm intersect (const Fsm &f)
 
std::shared_ptr< TreegetStateCover ()
 
std::shared_ptr< TreegetTransitionCover ()
 
OutputTree apply (const InputTrace &itrc)
 
Fsm transformToObservableFSM () const
 
bool isObservable () const
 
Minimal isMinimal () const
 
Fsm minimiseObservableFSM ()
 
Fsm minimise ()
 
bool isCharSet (const std::shared_ptr< Tree > w) const
 
void minimiseCharSet (const std::shared_ptr< Tree > w)
 
IOListContainer getCaracterisationSet ()
 
void calcStateIdentificationSets ()
 
void appendStateIdentificationSets (const std::shared_ptr< Tree > Wp2) const
 
IOListContainer wpMethod (const int m)
 
TestSuite createTestSuite (const IOListContainer &testCases)
 
bool isCompletelyDefined () const
 
bool isDeterministic () const
 
void setPresentationLayer (const std::shared_ptr< FsmPresentationLayer > ppresentationLayer)
 

Additional Inherited Members

- Protected Member Functions inherited from Fsm
 Fsm (const std::shared_ptr< FsmPresentationLayer > presentationLayer)
 
std::shared_ptr< FsmNodenewNode (const int id, const std::shared_ptr< std::pair< std::shared_ptr< FsmNode >, std::shared_ptr< FsmNode >>> p)
 
bool contains (const std::vector< std::shared_ptr< std::pair< std::shared_ptr< FsmNode >, std::shared_ptr< FsmNode >>>> &lst, const std::shared_ptr< std::pair< std::shared_ptr< FsmNode >, std::shared_ptr< FsmNode >>> p)
 
bool contains (const std::vector< std::shared_ptr< FsmNode >> &lst, const std::shared_ptr< FsmNode > n)
 
std::shared_ptr< FsmNodefindp (const std::vector< std::shared_ptr< FsmNode >> &lst, const std::shared_ptr< std::pair< std::shared_ptr< FsmNode >, std::shared_ptr< FsmNode >>> p)
 
void parseLine (const std::string &line)
 
void readFsm (const std::string &fname)
 
void parseLineInitial (const std::string &line)
 
void readFsmInitial (const std::string &fname)
 
std::string labelString (std::unordered_set< std::shared_ptr< FsmNode >> &lbl) const
 
- Protected Attributes inherited from Fsm
std::string name
 
std::vector< std::shared_ptr< FsmNode > > nodes
 
std::shared_ptr< FsmNodecurrentParsedNode
 
int maxInput
 
int maxOutput
 
int maxState
 
int initStateIdx
 
std::vector< std::shared_ptr< OFSMTable > > ofsmTableLst
 
std::shared_ptr< TreecharacterisationSet
 
std::vector< std::shared_ptr< Tree > > stateIdentificationSets
 
std::shared_ptr< FsmPresentationLayerpresentationLayer
 
Minimal minimal
 

Constructor & Destructor Documentation

Dfsm::Dfsm ( const std::string &  fname,
const std::string &  fsmName,
const int  maxNodes,
const int  maxInput,
const int  maxOutput,
const std::shared_ptr< FsmPresentationLayer presentationLayer 
)

Create a DFSM from a file description

Parameters
fnameThe name of the file containing the FSM informations
fsmNameThe name of the DFSM
maxNodesNumber of DFSM states
maxInputMaximal value of the (integer) input alphabet - admissible values are 0..maxInput
maxOutputMaximal value of (integer) output alphabet - admissible values are 0..maxOutput
presentationLayerThe presentation layer used by the DFSM
Dfsm::Dfsm ( const std::string &  fsmName,
const int  maxNodes,
const int  maxInput,
const int  maxOutput,
const std::shared_ptr< FsmPresentationLayer presentationLayer 
)

Random creation of a completely defined deterministic FSM

Parameters
fsmNameThe name of the DFSM
maxNodesNumber of DFSM states
maxInputMaximal value of the (integer) input alphabet - admissible values are 0..maxInput
maxOutputMaximal value of (integer) output alphabet - admissible values are 0..maxOutput
presentationLayerThe presentation layer used by the DFSM

Here is the call graph for this function:

Dfsm::Dfsm ( const std::string &  fsmName,
const int  maxInput,
const int  maxOutput,
const std::vector< std::shared_ptr< FsmNode >>  lst,
const std::shared_ptr< FsmPresentationLayer presentationLayer 
)

Create a DFSM from a list of nodes

Parameters
fsmNameThe name of the DFSM
maxInputMaximal value of the (integer) input alphabet - admissible values are 0..maxInput
maxOutputMaximal value of (integer) output alphabet - admissible values are 0..maxOutput
lstThe list of nodes of the DFSM
presentationLayerThe presentation layer used by the DFSM
Dfsm::Dfsm ( const Fsm fsm)

Create a DFSM from the equivalent deterministic FSM

Parameters
fsmThe deterministic FSM

Member Function Documentation

IOTrace Dfsm::applyDet ( const InputTrace i)

Apply input trace to the initial state of the FSM.

Note
This operation is only applicable to deterministic FSMs
Parameters
iinput trace
Returns
IOTrace containing the maximal sub-trace of i that could be processed as inputs (if FSM is completely defined this is always the complete trace i) and the associated outputs of the same length (the outputs are uniquely determined by the inputs, since the FSM is deterministic.

Here is the call graph for this function:

Here is the caller graph for this function:

IOListContainer Dfsm::getCharacterisationSet ( )

Calculate characterisation set according to Gill's algorithm based on Pk-tables

Precondition
the DFSM has already been minimised, and it is completely defined
Returns
Characterisation set

Here is the call graph for this function:

Here is the caller graph for this function:

Dfsm Dfsm::minimise ( )

Minimise this DFSM As a side effect, create the DFSM table and all Pk tables needed.

Returns
the new minimised DFSM
bool Dfsm::pass ( const IOTrace io)

Check whether IOTrace is in the language of the DFSM

Parameters
ioIOTrace to be checked against the DFSM
Returns
True if io is in the language of the DFSM, False otherwise

Here is the call graph for this function:

void Dfsm::printTables ( ) const

Output the DFSM table and the Pk-tables in LaTeX format. The output file name is hard-coded as tables.tex.

Note
This requires that the operation minimise() has been called before.
IOListContainer Dfsm::wMethod ( const unsigned int  m)

Perform test generation by means of the W Method.

Parameters
mMaximum number of states
Returns
A test suite

Here is the call graph for this function:

IOListContainer Dfsm::wpMethod ( const int  m)

Perform test generation by means of the Wp Method. The algorithm we have implemented is applicable to both nondeterministic and deterministic FSMs. It relies, however, on the existence of OFSM tables which we only calculate for nondeterministic FSMs. Therefore we need a wrapper method for DFSMs which first calculates OFSM tables (by means of a call to minimiseObervableFSM()) and then calls the wpMethod() operation of the super class Fsm.

Parameters
mMaximum number of states
Returns
A test suite

Here is the call graph for this function:


The documentation for this class was generated from the following files: