Documentation

VCVio.Interaction.TwoParty.Role

Sender / receiver roles #

Interaction.Role marks which side of a two-party protocol acts at each node. Action and Dual package the active/passive node shapes for the focal side and its environment; interact runs one round.

Which side speaks at a protocol node: sender (proposes a move) or receiver (observes).

Instances For

    Exchange sender and receiver (duality on the role type).

    Instances For
      def Interaction.Role.Action (role : Role) (m : Type u → Type u) (X : Type u) (Cont : XType u) :

      Focal party's action type: when acting, the focal party may use effects to choose the next move itself; when observing, it responds to any received move.

      Instances For
        def Interaction.Role.Dual (role : Role) (m : Type u → Type u) (X : Type u) (Cont : XType u) :

        Environment / dual view: sender branch observes the chosen move and may continue effectfully; receiver branch samples the move and continuation.

        Instances For
          def Interaction.Role.interact {m : Type u → Type u} [Monad m] {X : Type u} {ACont DCont : XType u} {Result : Type u} (role : Role) :
          role.Action m X AControle.Dual m X DCont((x : X) → ACont xDCont xm Result)m Result

          Run one round: pair an Action with the matching Dual and continue in k.

          Instances For