val pingpong:Duplex.prot
val pingpong:Duplex.prot
let pingpong : Duplex.prot =
  x <-- Protocol.send int;
  y <-- Protocol.recv (y:int{y > x});
  Protocol.done
(*
   Copyright 2020 Microsoft Research

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*)

module PingPong
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.Channel.Protocol
module Duplex = Steel.Channel.Duplex
module Protocol = Steel.Channel.Protocol

(** Specification and implementation of a pingpong protocol *)

/// Specification of a pingpong protocol.
/// The protocol consists of two messages.
/// A client first sends an integer on a channel.
/// It then receives an integer that is ensured to be strictly greater than the one she sent
/
Steel.Primitive.ForkJoin.fsti.checked Steel.Memory.fsti.checked Steel.Effect.Atomic.fsti.checked Steel.Effect.fsti.checked Steel.Channel.Protocol.fst.checked Steel.Channel.Duplex.fsti.checked prims.fst.checked FStar.Pervasives.fsti.checked FStar.List.Tot.Base.fst.checked
PingPong.fst
Steel.Channel.Duplex.prot
Steel.Channel.Protocol.bind Prims.int Prims.unit Steel.Channel.Protocol.send Prims.b2t Prims.op_GreaterThan Steel.Channel.Protocol.recv Steel.Channel.Protocol.done Steel.Channel.Protocol.protocol
let pingpong:Duplex.prot =
  
x <-- Protocol.send int ;
y <-- Protocol.recv (y: int{y > x}) ;
Protocol.done