Enum sesstype::global::Type [] [src]

pub enum Type {
    Interact {
        p: Rc<Role>,
        q: Rc<Role>,
        g: HashMap<Message, Box<Type>>,
    },
    Recur {
        t: String,
        g: Box<Type>,
    },
    TypeVar {
        t: String,
    },
    End,
}

Global session types.

Definition 2.17

G ::= p → q : { lᵢ(Uᵢ).Gᵢ } where i ∈ I | μt.G | t | end

Variants

Interaction Type between two Roles.

G ::= p → q : { lᵢ(Uᵢ).Gᵢ } where i ∈ I

p and q are sender and receiver Roles respectively, and g is a mapping from Message to continuation Type.

Each map entry represents a Message sent by p to q, then the interaction proceeds as the continuation Type.

The Message should be distinct across in this Interaction Type.

Fields of Interact

Recursive Type for representing infinite behaviour.

G ::= μt.G

t is the type variable for identifying the recursion, and g is the Type for the continuation.

Fields of Recur

Type Variable for use with Recur to represent infinite behaviour.

G ::= t

t is the previously defined type variable in Recur.

Fields of TypeVar

Terminated Type with no continuation.

G ::= end

Methods

impl Type
[src]

[src]

Returns a heap-allocated Type::Interact with no interactions.

p and q are the sender and receiver Roles respectively.

[src]

Adds a message m_i (and its continuation g_i) to a Type::Interact and returns the updated Interact Type.

interact_type is the input Type, if it is not a Type::Interact it is returned unmodified.

[src]

Returns a heap-allocated Type::Recur.

name is the name given to the recursion scope. body is the recursion body.

[src]

Returns a heap-allocated Type::TypeVar.

name is the (previously defined) name of the recursion scope.

[src]

Returns a heap-allocated Type::End.

All types should end in an instance of this.

Trait Implementations

impl Debug for Type
[src]

[src]

Formats the value using the given formatter.

impl ToString for Type
[src]

[src]

Converts the given value to a String. Read more