FDR  4.2.7(6ecbe5a21b71ab020e8fcaeccfe5ebaad0599f4f)
machine.h
1 #pragma once
2 
3 #include <vector>
4 
5 #include <fdr/lts/events.h>
6 #include <fdr/tasks/canceller.h>
7 
8 namespace FDR
9 {
10 namespace LTS
11 {
12 class Node;
13 
16 {
17 public:
20 
22  Transition(CompiledEvent event, const std::shared_ptr<Node>& destination);
23 
25  CompiledEvent event() const;
26 
28  const std::shared_ptr<Node>& destination() const;
29 
30 private:
31  CompiledEvent event_;
32  std::shared_ptr<Node> destination_;
33 };
34 
42 class Machine
43 {
44 public:
45  Machine()
46  {
47  }
48  virtual ~Machine(){};
49 
50  Machine(const Machine&) = delete;
51  Machine& operator=(const Machine& machine) = delete;
52 
54  virtual std::shared_ptr<Node> root_node() const = 0;
55 
60  virtual std::vector<CompiledEvent> initials(const Node& node) const = 0;
61 
68  virtual std::vector<std::shared_ptr<Node>> afters(const Node& node, const CompiledEvent event) const = 0;
69 
78  virtual std::vector<std::vector<CompiledEvent>> minimal_acceptances(const Node& node) const = 0;
79 
81  virtual std::vector<Transition> transitions(const Node& node) const = 0;
82 
95  virtual bool is_divergent(const Node& node, Canceller* canceller) const = 0;
96 
108  virtual std::vector<CompiledEvent> alphabet(bool include_tau) const = 0;
109 
111  virtual bool is_explicitly_divergent(const Node& node) const = 0;
112 
116  virtual bool has_divergence_labellings() const = 0;
117 
122  virtual bool has_minimal_acceptance_labellings() const = 0;
123 };
124 
125 } // end LTS
126 } // end FDR
FDR::LTS::Machine::has_minimal_acceptance_labellings
virtual bool has_minimal_acceptance_labellings() const =0
Does this GLTS have explicit minimal acceptance labels.
FDR::LTS::Transition::event
CompiledEvent event() const
The label of the arc this transition represents.
FDR::LTS::Machine::minimal_acceptances
virtual std::vector< std::vector< CompiledEvent > > minimal_acceptances(const Node &node) const =0
The set of minimal acceptances of the given node.
FDR::LTS::Transition::destination
const std::shared_ptr< Node > & destination() const
The destination of the arc.
FDR::LTS::Transition::Transition
Transition()
Creates a new, empty transition.
FDR::LTS::Machine
A compiled state machine (a GLTS).
Definition: machine.h:43
FDR::LTS::Machine::transitions
virtual std::vector< Transition > transitions(const Node &node) const =0
The transitions available from the given node.
FDR::LTS::Machine::has_divergence_labellings
virtual bool has_divergence_labellings() const =0
Does this GLTS have explicit divergence labels.
FDR::LTS::Machine::afters
virtual std::vector< std::shared_ptr< Node > > afters(const Node &node, const CompiledEvent event) const =0
The set of states reachable from the given node via the given event.
FDR::LTS::Machine::alphabet
virtual std::vector< CompiledEvent > alphabet(bool include_tau) const =0
Returns the set of events used by this Machine.
FDR::LTS::Node
A node (also known as state) in a GLTS.
Definition: node.h:15
FDR::LTS::Machine::is_divergent
virtual bool is_divergent(const Node &node, Canceller *canceller) const =0
True if the state is considered to diverge.
FDR::LTS::Machine::initials
virtual std::vector< CompiledEvent > initials(const Node &node) const =0
The set of events that the node can perform immediately.
FDR::Canceller
Allows cancellation of a running task to be requested.
Definition: canceller.h:53
FDR::LTS::Transition::Transition
Transition(CompiledEvent event, const std::shared_ptr< Node > &destination)
Creates a transition with the given label and destination.
FDR::LTS::Machine::is_explicitly_divergent
virtual bool is_explicitly_divergent(const Node &node) const =0
Is the state labelled as explicitly divergent.
FDR::LTS::Transition
A single transition of a Machine.
Definition: machine.h:16
FDR::LTS::Machine::root_node
virtual std::shared_ptr< Node > root_node() const =0
Returns the root, i.e. initial, node of this state machine.