6 #ifndef FSM_FSM_FSMNODE_H_
7 #define FSM_FSM_FSMNODE_H_
12 #include <unordered_set>
13 #include <unordered_map>
27 class FsmNode :
public std::enable_shared_from_this<FsmNode>
30 std::vector<FsmTransition> transitions;
35 std::shared_ptr<FsmPresentationLayer> presentationLayer;
36 std::shared_ptr<std::pair<std::shared_ptr<FsmNode>, std::shared_ptr<FsmNode>>> derivedFromPair;
38 const static int white = 0;
39 const static int grey = 1;
40 const static int black = 2;
41 FsmNode(
const int id,
const std::shared_ptr<FsmPresentationLayer> presentationLayer);
42 FsmNode(
const int id,
const std::string & name,
const std::shared_ptr<FsmPresentationLayer> presentationLayer);
44 std::vector<FsmTransition> getTransitions()
const;
46 std::string getName()
const;
47 bool hasBeenVisited()
const;
49 void setPair(
const std::shared_ptr<FsmNode> l,
const std::shared_ptr<FsmNode> r);
50 void setPair(
const std::shared_ptr<std::pair<std::shared_ptr<FsmNode>, std::shared_ptr<FsmNode>>> p);
51 bool isDerivedFrom(
const std::shared_ptr<std::pair<std::shared_ptr<FsmNode>, std::shared_ptr<FsmNode>>> p)
const;
52 std::shared_ptr<std::pair<std::shared_ptr<FsmNode>, std::shared_ptr<FsmNode>>> getPair()
const;
53 std::shared_ptr<FsmNode> apply(
const int e,
OutputTrace & o);
63 std::unordered_set<std::shared_ptr<FsmNode>>
after(
const InputTrace & itrc);
75 std::vector<std::shared_ptr<FsmNode>>
after(
const int x);
76 std::unordered_set<std::shared_ptr<FsmNode>> afterAsSet(
const int x);
77 void setColor(
const int color);
79 std::shared_ptr<DFSMTableRow> getDFSMTableRow(
const int maxInput);
80 bool distinguished(
const std::shared_ptr<FsmNode> otherNode,
const std::vector<int>& iLst);
81 std::shared_ptr<InputTrace> distinguished(
const std::shared_ptr<FsmNode> otherNode, std::shared_ptr<Tree> w);
102 InputTrace calcDistinguishingTrace(
const std::shared_ptr<FsmNode> otherNode,
const std::vector<std::shared_ptr<OFSMTable>>& ofsmTblLst,
const int maxInput,
const int maxOutput);
103 bool isObservable()
const;
109 friend std::ostream & operator<<(std::ostream & out,
const FsmNode & node);
110 friend bool operator==(
FsmNode const & node1,
FsmNode const & node2);
112 #endif //FSM_FSM_FSMNODE_H_
InputTrace calcDistinguishingTrace(const std::shared_ptr< FsmNode > otherNode, const std::vector< std::shared_ptr< PkTable >> &pktblLst, const int maxInput)
Definition: FsmNode.cpp:245
std::unordered_set< std::shared_ptr< FsmNode > > after(const InputTrace &itrc)
Definition: FsmNode.cpp:139
Definition: DFSMTableRow.h:17
bool isDeterministic() const
Definition: FsmNode.cpp:395
Definition: OutputTree.h:15
Definition: OFSMTable.h:37
Definition: FsmPresentationLayer.h:16
Definition: OutputTrace.h:15
Definition: FsmTransition.h:15