mirror of
https://github.com/achlipala/frap.git
synced 2024-11-10 00:07:51 +00:00
SessionTypes: switched to modular structure, to define several variants
This commit is contained in:
parent
9f247b8375
commit
7fc57d795c
1 changed files with 9 additions and 3 deletions
|
@ -9,7 +9,11 @@ Set Implicit Arguments.
|
|||
Set Asymmetric Patterns.
|
||||
|
||||
|
||||
(** * Defining the Type System *)
|
||||
(** * Two-Party Session Types *)
|
||||
|
||||
Module TwoParty.
|
||||
|
||||
(** ** Defining the type system *)
|
||||
|
||||
Inductive type :=
|
||||
| TSend (ch : channel) (A : Set) (t : A -> type)
|
||||
|
@ -32,7 +36,7 @@ Inductive hasty : proc -> type -> Prop :=
|
|||
hasty Done TDone.
|
||||
|
||||
|
||||
(** * Examples of Typed Processes *)
|
||||
(** * Examples of typed processes *)
|
||||
|
||||
(* Recall our first example from last chapter. *)
|
||||
Definition addN (k : nat) (input output : channel) : proc :=
|
||||
|
@ -53,7 +57,7 @@ Proof.
|
|||
Qed.
|
||||
|
||||
|
||||
(** * Complementing Types *)
|
||||
(** * Complementing types *)
|
||||
|
||||
Fixpoint complement (t : type) : type :=
|
||||
match t with
|
||||
|
@ -233,3 +237,5 @@ Proof.
|
|||
send_payment_info payment_success add_review);
|
||||
hasty.
|
||||
Qed.
|
||||
|
||||
End TwoParty.
|
||||
|
|
Loading…
Reference in a new issue