workflow::preprocess

Function simplify

Source
pub fn simplify(
    wir: Workflow,
) -> Result<(Workflow, HashMap<ProgramCounter, usize>), Error>
Expand description

Simplifies the given WIR-workflow as much as possible to increase the compatability with checker workflows.

Most importantly, it:

  • Attempts to inline functions as long as they’re non-recursive (since functions are not supported)

§Arguments

  • wir: The input WIR to simply.

§Returns

A tuple of the same wir as given, but then optimized, and a mapping of (remaining) Edge::Calls to whatever function they actually map.

§Errors

This function may error if the input workflow is incoherent.