object pilib

[source: scala/concurrent/pilib.scala]

object pilib
extends AnyRef

Library for using Pi-calculus concurrent primitives in Scala. As an example, the definition of a two-place buffer using the pilib library looks like:

  def Buffer[a](put: Chan[a], get: Chan[a]) {
    def B0 { choice ( put * { x => B1(x) } ) }
    def B1(x: a) { choice ( get(x) * B0, put * { y => B2(x, y) } ) }
    def B2(x: a, y: a) { choice ( get(x) * B1(y) ) }
See Also
PiLib: A Hosted Language for Pi-Calculus Style Concurrency
Vincent Cremet, Martin Odersky
Value Summary
val spawn : Spawn
Method Summary
def choice [A](s : GP[A]*) : A
Pi-calculus non-deterministic choice.
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
class Chan [A] extends UChan with (A) => Product[A]
Name on which one can emit, receive or that can be emitted or received during a communication.
class GP [a](n : UChan, polarity : Boolean, v : Any, c : (Any) => a) extends AnyRef
Typed guarded process.
class Product [A](c : Chan[A], v : A) extends AnyRef
abstract class Spawn extends AnyRef
Run several processes in parallel using the following syntax: spawn < p1 | ... | pn >
case class Sum (val gs : List[UGP]) extends Product
class UChan extends AnyRef
Untyped channel.
case class UGP (val n : UChan, val polarity : Boolean, val v : Any, val c : (Any) => Any) extends Product
An untyped guarded process.
Value Details
val spawn : Spawn

Method Details
def choice[A](s : GP[A]*) : A
Pi-calculus non-deterministic choice.
s - ...