|
| 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< FsmNode > | getInitialState () 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< FsmPresentationLayer > | getPresentationLayer () const |
|
int | getInitStateIdx () const |
|
void | resetColor () |
|
void | toDot (const std::string &fname) |
|
Fsm | intersect (const Fsm &f) |
|
std::shared_ptr< Tree > | getStateCover () |
|
std::shared_ptr< Tree > | getTransitionCover () |
|
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) |
|
|
| Fsm (const std::shared_ptr< FsmPresentationLayer > presentationLayer) |
|
std::shared_ptr< FsmNode > | newNode (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< FsmNode > | findp (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 |
|
|
std::string | name |
|
std::vector< std::shared_ptr< FsmNode > > | nodes |
|
std::shared_ptr< FsmNode > | currentParsedNode |
|
int | maxInput |
|
int | maxOutput |
|
int | maxState |
|
int | initStateIdx |
|
std::vector< std::shared_ptr< OFSMTable > > | ofsmTableLst |
|
std::shared_ptr< Tree > | characterisationSet |
|
std::vector< std::shared_ptr< Tree > > | stateIdentificationSets |
|
std::shared_ptr< FsmPresentationLayer > | presentationLayer |
|
Minimal | minimal |
|
|
std::ostream & | operator<< (std::ostream &out, const Fsm &fsm) |
|
default constructor without effect - needed by sub-classes
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 |
|
) |
| |
Constructor creating an FSM from file - used only internally
Fsm::Fsm |
( |
const std::string & |
fname, |
|
|
const std::shared_ptr< FsmPresentationLayer > |
presentationLayer, |
|
|
const std::string & |
fsmName |
|
) |
| |
Constructor creating an FSM specified in a file.
- Parameters
-
fname | Filename of a text file (typically with extension *.fsm), where each row is formatted as pre-state input output post-state pre-state is a number in range 0..(number of states -1) specifying the FSM pre-state input is a number in range 0..maxInput specifying the input applied to the pre-state output is a number in range 0..maxOutput specifying the output produced by the FSM when transiting to post-state on 'input' post-state is a number in range 0..(number of states -1) The initial state is expected to be the pre-state of the first row. The parameters 'number of states', maxInput, and maxOutput are determined when parsing the input file fname. |
presentationLayer | Pointer to instance of a presentation layer which associates each input number in range 0..maxInput with an input name, each output number in range 0..maxOutput with an output name, and each state number in range 0..(number of states -1) with a state name. |
fsmName | name of the FSM |
Fsm::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 |
|
) |
| |
Constructor for creating an FSM from a list of FsmNodes that have been created beforehand, together with the outgoing transitions of each FsmNode/.
- Parameters
-
fname | Filename where FSM specification resides in |
fsmName | name of the FSM (appears in every node) |
maxInput | maximal value of the (integer) input alphabet - admissible values are 0..maxInput |
maxOutput | maximal value of (integer) output alphabet - admissible values are 0..maxOutput |
void Fsm::calcStateIdentificationSets |
( |
| ) |
|
Calculate the state identification sets. The sets are stored in list stateIdentificationSets, ordered by the FSM state numbers.
- Precondition
- The FSM must be observable and minimal, and the characterisation set must have been previously calculated using operation getCharacterisationSet().
void Fsm::dumpFsm |
( |
std::ofstream & |
outputFile | ) |
const |
Write FSM to text file using the standard format in each line which is also used for instantiating an FSM from file: pre-state input output post-state pre-state is a number in range 0..(number of states -1) specifying the FSM pre-state input is a number in range 0..maxInput specifying the input applied to the pre-state output is a number in range 0..maxOutput specifying the output produced by the FSM when transiting to post-state on 'input' post-state is a number in range 0..(number of states -1)
Calculate the characterisation set W of a (possibly nondeterministic) FSM. In addition, calculate the state identification sets W_i containing prefixes of input traces of W, such that W_i distinguishes FSM state number i from every other FSM state.
- Precondition
- The FSM must be observable and minimised
- Returns
- The characterisation set W, represented by an instance of IOListContainer
- Note
- As a side effect, the state identification sets W_i are stored in the list stateIdentificationSets.
std::string Fsm::getName |
( |
| ) |
const |
This is the getter for the name of the FSM
- Returns
- Name of the FSM
Fsm Fsm::intersect |
( |
const Fsm & |
f | ) |
|
Create a new FSM that represents the intersection of this and the other FSM
- Parameters
-
- Returns
- a new FSM which equals the intersection of this and f
bool Fsm::isDeterministic |
( |
| ) |
const |
Check if FSM is deterministic
- Returns
- true if FSM is deterministic
bool Fsm::isObservable |
( |
| ) |
const |
Check this FSM with respect to observability
- Returns
- true if and only if the FSM is observable
Create the minimal observable FSM which is equivalent to this FSM. If this FSM is not observable, an observable equivalent is created first. The observable FSM is then minimised.
- Returns
- minimal observable FSM which is equivalent to this FSM
Fsm Fsm::minimiseObservableFSM |
( |
| ) |
|
Create the minimal observable FSM which is equivalent to this FSM.
- Precondition
- This method can only be applied to an observable OFSM
- Returns
- minimal observable FSM which is equivalent to this FSM
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
-
m | Maximum number of states |
- Returns
- A test suite
The documentation for this class was generated from the following files:
- /Users/janpeleska/SharedFoldersWin/fsmlib-cpp/src/fsm/Fsm.h
- /Users/janpeleska/SharedFoldersWin/fsmlib-cpp/src/fsm/Fsm.cpp