Documentation

PolyFun.ITree.Machine

Interaction trees as machines #

An interaction tree is itself a machine, in two ways.

ITree.withSilentSteps lifts a handler of visible events to F + y: it acknowledges each silent step with pure () and never invokes the visible handler on one. Silent steps still consume the budget of the toDynComputation runners, and a finite budget makes no claim of termination or productivity.

An interaction tree as a dynamical system over its raw polynomial: expose the head node of the M-type representation and update to the selected child.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    The behavior of toDynSystem is the raw M-type representation.

    An interaction tree as a returning computation over F + y: silent steps become visible unit queries.

    Equations
    Instances For
      @[simp]

      The denotation of toDynComputation is the resumption-with-tau encoding.

      Interpret visible operations by handler and acknowledge silent steps internally, so a handler for F runs toDynComputation.

      Equations
      Instances For
        @[simp]
        theorem ITree.withSilentSteps_visible {F : PFunctor.{uA, uB}} {m : Type uB → Type uM} [Monad m] (handler : PFunctor.Handler m F) (operation : F.A) :
        withSilentSteps handler (Sum.inl operation) = handler operation

        Visible operations go to handler. The position is stated at the reduced type F.A ⊕ PUnit, the form simp leaves the implicit arguments of Sum.inl in, so the lemma fires under simp, simp only and rw alike.

        @[simp]

        Silent steps are acknowledged without consulting handler; stated at F.A ⊕ PUnit for the same reason as withSilentSteps_visible.