Documentation

Cslib.Languages.Mech.Choreography.Basic

Choreography #

A choreography defines the collective behaviour of a system of communicating participants (processes) [Mon23].

Limitations #

Some notable features not yet included:

References #

Syntax of choreographies #

inductive Cslib.Languages.Mech.Expr (Var : Type u_1) (Val : Type u_2) (FunId : Type u_3) :
Type (max (max u_1 u_2) u_3)

Expressions for local computation.

  • var {Var : Type u_1} {Val : Type u_2} {FunId : Type u_3} (x : Var) : Expr Var Val FunId

    Read variable x.

  • val {Var : Type u_1} {Val : Type u_2} {FunId : Type u_3} (v : Val) : Expr Var Val FunId

    Value v.

  • call {Var : Type u_1} {Val : Type u_2} {FunId : Type u_3} (f : FunId) (args : List (Expr Var Val FunId)) : Expr Var Val FunId

    Call function f with arguments args.

Instances For
    @[instance_reducible]
    instance Cslib.Languages.Mech.instCoeExpr {Var : Type u_1} {Val : Type u_2} {FunId : Type u_3} :
    Coe Var (Expr Var Val FunId)

    Utility instance to write variables directly as expressions.

    Equations
    @[instance_reducible]
    instance Cslib.Languages.Mech.instCoeExpr_1 {Val : Type u_1} {Var : Type u_2} {FunId : Type u_3} :
    Coe Val (Expr Var Val FunId)

    Utility instance to write values directly as expressions.

    Equations
    inductive Cslib.Languages.Mech.Prefix (Pid : Type u_1) (Var : Type u_2) (Val : Type u_3) (FunId : Type u_4) (SelLabel : Type u_5) :
    Type (max (max (max (max u_1 u_2) u_3) u_4) u_5)

    Choreographic prefix.

    • assign {Pid : Type u_1} {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} (p : Pid) (x : Var) (e : Expr Var Val FunId) : Prefix Pid Var Val FunId SelLabel

      p assigns x the value computed from e.

    • com {Pid : Type u_1} {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} (p : Pid) (e : Expr Var Val FunId) (q : Pid) (x : Var) : Prefix Pid Var Val FunId SelLabel

      p communicates the evaluation of e to q, which stores it in its variable x.

    • sel {Pid : Type u_1} {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} (p q : Pid) (l : SelLabel) : Prefix Pid Var Val FunId SelLabel

      p communicates the selection label (a static tag used to denote a choice) to q.

    Instances For
      inductive Cslib.Languages.Mech.Choreography (Pid : Type u_1) (Var : Type u_2) (Val : Type u_3) (FunId : Type u_4) (SelLabel : Type u_5) (ProcName : Type u_6) :
      Type (max (max (max (max (max u_1 u_2) u_3) u_4) u_5) u_6)

      Choreographies.

      • nil {Pid : Type u_1} {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} {ProcName : Type u_6} : Choreography Pid Var Val FunId SelLabel ProcName

        The terminated choreography.

      • pre {Pid : Type u_1} {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} {ProcName : Type u_6} (prf : Prefix Pid Var Val FunId SelLabel) (c : Choreography Pid Var Val FunId SelLabel ProcName) : Choreography Pid Var Val FunId SelLabel ProcName

        Do prf and continue as c.

      • cond {Pid : Type u_1} {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} {ProcName : Type u_6} (p : Pid) (e : Expr Var Val FunId) (c₁ c₂ : Choreography Pid Var Val FunId SelLabel ProcName) : Choreography Pid Var Val FunId SelLabel ProcName

        Conditional: p evaluates e to choose between c₁ and c₂.

      • call {Pid : Type u_1} {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} {ProcName : Type u_6} (proc : ProcName) (ps : List Pid) : Choreography Pid Var Val FunId SelLabel ProcName

        Call the procedure proc.

      Instances For
        @[instance_reducible]
        instance Cslib.Languages.Mech.instZeroChoreography {Pid : Type u_1} {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} {ProcName : Type u_6} :
        Zero (Choreography Pid Var Val FunId SelLabel ProcName)
        Equations

        Syntactic category for prefixes.

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

            p assigns x the value computed from e.

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

              p communicates the evaluation of e to q, which stores it in its variable x.

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

                p communicates the selection label (a static tag used to denote a choice) to q.

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

                  Choreographic prefix.

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

                      Syntactic category for choreographies.

                      Equations
                      Instances For

                        The terminated choreography.

                        Equations
                        Instances For

                          Do prf and continue as c.

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

                            Conditional: p evaluates e to choose between c₁ and c₂.

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

                              Choreographies.

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Cslib.Languages.Mech.Prefix.pn {Pid : Type u_1} [DecidableEq Pid] {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} :
                                Prefix Pid Var Val FunId SelLabelFinset Pid

                                Process names in a prefix.

                                Equations
                                Instances For
                                  def Cslib.Languages.Mech.Choreography.pn {Pid : Type u_1} [DecidableEq Pid] {Var : Type u_2} {Val : Type u_3} {FunId : Type u_4} {SelLabel : Type u_5} {ProcName : Type u_6} :
                                  Choreography Pid Var Val FunId SelLabel ProcNameFinset Pid

                                  Process names in a choreography.

                                  Equations
                                  Instances For