docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
interstate_edge.h
Go to the documentation of this file.
1#pragma once
2
3#include <boost/lexical_cast.hpp>
4#include <memory>
5#include <nlohmann/json.hpp>
6#include <string>
7#include <unordered_map>
8
10#include "sdfg/element.h"
11#include "sdfg/graph/graph.h"
13
14using json = nlohmann::json;
15
16namespace sdfg {
17
18namespace builder {
19class SDFGBuilder;
20}
21
22namespace control_flow {
23
31
71class InterstateEdge : public Element {
73
74private:
75 // Remark: Exclusive resource
76 const graph::Edge edge_;
77
78 const control_flow::State& src_;
79 const control_flow::State& dst_;
80
81 symbolic::Condition condition_;
82 control_flow::Assignments assignments_;
83
84 InterstateEdge(
85 size_t element_id,
86 const DebugInfo& debug_info,
87 const graph::Edge& edge,
92 );
93
94public:
95 // Remark: Exclusive resource
96 InterstateEdge(const InterstateEdge& state) = delete;
97 InterstateEdge& operator=(const InterstateEdge&) = delete;
98
99 ElementType type_id() const override {
101 }
102
103 static bool classof(const Element& element) {
104 return element.type_id() == ElementType::InterstateEdge;
105 }
106
119 void validate(const Function& function) const override;
120
125 const graph::Edge edge() const;
126
131 const control_flow::State& src() const;
132
137 const control_flow::State& dst() const;
138
149
154 bool is_unconditional() const;
155
166
172 void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override;
173};
174
175} // namespace control_flow
176} // namespace sdfg
Definition element.h:30
Element(size_t element_id, const DebugInfo &debug_info)
size_t element_id() const
const DebugInfo & debug_info() const
virtual ElementType type_id() const =0
Returns the type of the element.
Definition function.h:43
Definition sdfg_builder.h:13
ElementType type_id() const override
Returns the type of the element.
Definition interstate_edge.h:99
static bool classof(const Element &element)
Definition interstate_edge.h:103
InterstateEdge(const InterstateEdge &state)=delete
const control_flow::State & src() const
Returns the source state of this edge.
const control_flow::Assignments & assignments() const
Returns the symbol assignments for this edge.
const control_flow::State & dst() const
Returns the destination state of this edge.
const graph::Edge edge() const
Returns the graph edge representing this interstate edge.
void replace(const symbolic::Expression old_expression, const symbolic::Expression new_expression) override
Replaces symbolic expressions in the edge's condition and assignments.
const symbolic::Condition condition() const
Returns the condition guarding this transition.
void validate(const Function &function) const override
Validates the interstate edge within the context of a function.
InterstateEdge & operator=(const InterstateEdge &)=delete
bool is_unconditional() const
Checks if this edge represents an unconditional transition.
A state in a Stateful DataFlow Graph (SDFG).
Definition state.h:38
SymEngine::RCP< const SymEngine::Basic > Expression
Reference-counted pointer to a symbolic expression (SymEngine Basic).
Definition symbolic.h:83
std::unordered_map< Symbol, Expression, SymEngine::RCPBasicHash, SymEngine::RCPBasicKeyEq > SymbolMap
Map from symbols to expressions.
Definition symbolic.h:98
SymEngine::RCP< const SymEngine::Boolean > Condition
Reference-counted pointer to a boolean condition expression.
Definition symbolic.h:86
nlohmann::json json
Definition interstate_edge.h:14
Definition interstate_edge.h:22
symbolic::SymbolMap Assignments
Type alias for symbol assignments on interstate edges.
Definition interstate_edge.h:30
boost::graph_traits< Graph >::edge_descriptor Edge
Definition graph.h:26
Definition analysis.h:7
ElementType
Definition element.h:72
@ InterstateEdge
Definition element.h:74
Symbolic system for integer-based symbol analysis.