Module patch

Source
Expand description

Rewrite operations on the HUGR - replacement, outlining, etc.

Re-exports§

pub use simple_replace::SimpleReplacement;
pub use simple_replace::SimpleReplacementError;

Modules§

consts
Rewrite operations involving Const and LoadConst operations
inline_call
Rewrite to inline a Call to a FuncDefn by copying the body of the function into a DFG which replaces the Call node.
inline_dfg
A rewrite that inlines a DFG node, moving all children of the DFG except Input+Output into the DFG’s parent, and deleting the DFG along with its Input + Output
insert_cut
Patch for inserting a sub-HUGR as a “cut” across existing edges.
insert_identity
Implementation of the InsertIdentity operation.
outline_cfg
Rewrite for inserting a CFG-node into the hierarchy containing a subsection of an existing CFG
peel_loop
Rewrite to peel one iteration of a TailLoop, creating a DFG containing a copy of the loop body, and a Conditional containing the original TailLoop node.
replace
Implementation of the Replace operation.
simple_replace
Implementation of the SimpleReplace operation.

Structs§

HostPort
A port in the host graph.
ReplacementPort
A port in the replacement graph.
Transactional
Wraps any rewrite into a transaction (i.e. that has no effect upon failure)

Enums§

BoundaryPort
A port in either the host or replacement graph.

Traits§

Patch
A patch that can be applied to a mutable Hugr of type H.
PatchHugrMut
A patch that can be applied to any HugrMut.
PatchVerification
Verify that a patch application would succeed.