An edge connecting two states in an SDFG control-flow graph.
More...
#include <sdfg/control_flow/interstate_edge.h>
An edge connecting two states in an SDFG control-flow graph.
InterstateEdge represents a transition between states in a Stateful DataFlow Graph. Each edge can have:
- A condition: A boolean expression that guards the transition
- Assignments: Updates to symbols that occur during the transition
Execution Semantics
IMPORTANT: When an interstate edge is traversed, the execution order is:
- First, the condition is evaluated using the current symbol values
- Then, if the condition is true, the assignments are executed to update symbols
- Finally, control transfers to the destination state
This means:
- The condition sees symbol values BEFORE any assignments on this edge
- Assignments cannot affect the condition evaluation on the same edge
- Assignments affect symbol values for subsequent edges and states
Examples
const control_flow::Assignments & assignments() const
Returns the symbol assignments for this edge.
const symbolic::Condition condition() const
Returns the condition guarding this transition.
Expression add(const Expression lhs, const Expression rhs)
Addition of two expressions.
Condition Lt(const Expression lhs, const Expression rhs)
Less-than comparison.
Integer integer(int64_t value)
Creates an integer constant.
Symbol symbol(const std::string &name)
Creates a symbolic variable with the given name.
Condition __true__()
Creates a boolean true condition.
SymEngine::RCP< const SymEngine::Symbol > Symbol
Reference-counted pointer to a SymEngine Symbol.
Definition symbolic.h:71
symbolic::SymbolMap Assignments
Type alias for symbol assignments on interstate edges.
Definition interstate_edge.h:30
- See also
- State for the source and destination of transitions
-
symbolic::Condition for the condition expressions
◆ InterstateEdge()
| sdfg::control_flow::InterstateEdge::InterstateEdge |
( |
const InterstateEdge & | state | ) |
|
|
delete |
◆ assignments()
Returns the symbol assignments for this edge.
Assignments are executed AFTER the condition is evaluated and found to be true. The assignments update symbol values that will be visible in the destination state and subsequent edges.
- Returns
- Map of symbols to their assigned expressions
◆ classof()
| bool sdfg::control_flow::InterstateEdge::classof |
( |
const Element & | element | ) |
|
|
inlinestatic |
◆ condition()
Returns the condition guarding this transition.
The condition is evaluated BEFORE any assignments are executed. The condition uses the symbol values as they exist when entering the edge.
- Returns
- The boolean condition expression
- See also
- is_unconditional() to check if this is an unconditional transition
◆ dst()
Returns the destination state of this edge.
- Returns
- Reference to the destination state
◆ edge()
| const graph::Edge sdfg::control_flow::InterstateEdge::edge |
( |
| ) |
const |
Returns the graph edge representing this interstate edge.
- Returns
- The graph edge
◆ is_unconditional()
| bool sdfg::control_flow::InterstateEdge::is_unconditional |
( |
| ) |
const |
Checks if this edge represents an unconditional transition.
- Returns
- true if the condition is always true, false otherwise
◆ operator=()
| InterstateEdge & sdfg::control_flow::InterstateEdge::operator= |
( |
const InterstateEdge & | | ) |
|
|
delete |
◆ replace()
Replaces symbolic expressions in the edge's condition and assignments.
- Parameters
-
| old_expression | The expression to replace |
| new_expression | The replacement expression |
Implements sdfg::Element.
◆ src()
Returns the source state of this edge.
- Returns
- Reference to the source state
◆ type_id()
| ElementType sdfg::control_flow::InterstateEdge::type_id |
( |
| ) |
const |
|
inlineoverridevirtual |
◆ validate()
| void sdfg::control_flow::InterstateEdge::validate |
( |
const Function & | function | ) |
const |
|
overridevirtual |
Validates the interstate edge within the context of a function.
Validates that:
- The condition is a valid boolean expression
- All symbols in the condition and assignments are properly typed
- Assignment targets are integer scalar types
- Assignment sources evaluate to integer or pointer types
- Parameters
-
| function | The function containing this edge |
- Exceptions
-
Implements sdfg::Element.
◆ builder::SDFGBuilder
The documentation for this class was generated from the following file: