mCRL2
Loading...
Searching...
No Matches
simple_structure_graph.h
Go to the documentation of this file.
1// Author(s): Wieger Wesselink
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9/// \file mcrl2/pbes/simple_structure_graph.h
10/// \brief add your file description here.
11
12#ifndef MCRL2_PBES_SIMPLE_STRUCTURE_GRAPH_H
13#define MCRL2_PBES_SIMPLE_STRUCTURE_GRAPH_H
14
15#include "mcrl2/atermpp/standard_containers/vector.h"
16#include "mcrl2/pbes/structure_graph.h"
17
18
19
20namespace mcrl2::pbes_system {
21
22// A structure graph
24{
25 public:
26 using decoration_type = structure_graph::decoration_type;
27 using index_type = structure_graph::index_type;
28 using vertex = structure_graph::vertex;
29
30 protected:
32
33 public:
34 explicit simple_structure_graph(const structure_graph::vertex_vector& vertices)
36 {}
37
38 decoration_type decoration(index_type u) const
39 {
41 }
42
43 std::size_t extent() const
44 {
45 return m_vertices.size();
46 }
47
49 {
50 return find_vertex(u).rank;
51 }
52
54 {
55 return m_vertices;
56 }
57
59 {
60 return m_vertices;
61 }
62
64 {
65 return find_vertex(u).predecessors;
66 }
67
69 {
70 return find_vertex(u).successors;
71 }
72
73 index_type strategy(index_type u) const
74 {
76 }
77
78 const vertex& find_vertex(index_type u)
79 {
80 return m_vertices[u];
81 }
82
83 const vertex& find_vertex(index_type u) const
84 {
85 return m_vertices[u];
86 }
87
88 bool contains(index_type /* u */) const
89 {
90 return true;
91 }
92
93 bool is_empty() const
94 {
95 return m_vertices.empty();
96 }
97
98 std::size_t size() const
99 {
100 return m_vertices.size();
101 }
102};
103
104inline
106{
107 return print_structure_graph(out, G);
108}
109
110} // namespace mcrl2::pbes_system
111
112
113
114#endif // MCRL2_PBES_SIMPLE_STRUCTURE_GRAPH_H
const std::vector< index_type > & successors(index_type u) const
decoration_type decoration(index_type u) const
const structure_graph::vertex_vector & all_vertices() const
const structure_graph::vertex_vector & m_vertices
const structure_graph::vertex_vector & vertices() const
simple_structure_graph(const structure_graph::vertex_vector &vertices)
const std::vector< index_type > & predecessors(index_type u) const
const vertex & find_vertex(index_type u) const
std::ostream & operator<<(std::ostream &out, const simple_structure_graph &G)