NormalizeGuppy

class tket.passes.NormalizeGuppy(simplify_cfgs=True, remove_tuple_untuple=True, constant_folding=True, remove_dead_funcs=True, inline_dfgs=True, remove_redundant_order_edges=True, squash_borrows=True, _scope=GlobalScope.PRESERVE_PUBLIC)[source]

Bases: ComposablePass

__call__(hugr, *, inplace=True)

Call the pass to transform a HUGR, returning a Hugr.

Return type:

Hugr

__init__(simplify_cfgs=True, remove_tuple_untuple=True, constant_folding=True, remove_dead_funcs=True, inline_dfgs=True, remove_redundant_order_edges=True, squash_borrows=True, _scope=GlobalScope.PRESERVE_PUBLIC)
constant_folding: bool = True
inline_dfgs: bool = True
property name: str

Returns the name of the pass.

remove_dead_funcs: bool = True
remove_redundant_order_edges: bool = True
remove_tuple_untuple: bool = True
run(hugr, *, inplace=True)[source]

Run the pass to transform a HUGR, returning a PassResult.

See implement_pass_run() for a helper function to implement this method.

Return type:

PassResult

simplify_cfgs: bool = True
squash_borrows: bool = True
then(other)

Perform another composable pass after this pass.

Return type:

ComposablePass

with_scope(_scope)[source]

Set the scope of this pass and return self.

Return type:

NormalizeGuppy