case class PiState(inputs: Map[Chan, Input], outputs: Map[Chan, Output], calls: List[PiFuture], threads: Map[Int, PiFuture], threadCtr: Int, freshCtr: Int, processes: Map[String, PiProcess], resources: ChanMap) extends Product with Serializable

This is the pi-calculus state of a running workflow.

We separate inputs from outputs to make searching for matching channels more efficient. We could have everything in one list like PiLib does.

inputs

a map of Input type continuations based on their primary channels

outputs

a map of Output type continuations based on their primary channels

calls

a list of processes that have been called but the inputs haven't arrived yet

threads

a map of processes that have been called and whose results we want. The calls to the actual processes should happen outside the PiState by a process executor, so that things are kept clean and independent here. Each call has a unique reference number so that results don't clash.

threadCtr

an integer to help create unique reference numbers for threads

freshCtr

an integer to help create unique (fresh) channel names

processes

a map of available processes, both atomic and composite, so that we know how to handle calls when they occur

resources

a ChanMap of unhandled resources. We try to keep this as clean as possible, so that it only contains resources that need to be received by a pending call (though this is not guaranteed, we might get some leftover garbage in here as well).

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PiState
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PiState(inputs: Map[Chan, Input], outputs: Map[Chan, Output], calls: List[PiFuture], threads: Map[Int, PiFuture], threadCtr: Int, freshCtr: Int, processes: Map[String, PiProcess], resources: ChanMap)

    inputs

    a map of Input type continuations based on their primary channels

    outputs

    a map of Output type continuations based on their primary channels

    calls

    a list of processes that have been called but the inputs haven't arrived yet

    threads

    a map of processes that have been called and whose results we want. The calls to the actual processes should happen outside the PiState by a process executor, so that things are kept clean and independent here. Each call has a unique reference number so that results don't clash.

    threadCtr

    an integer to help create unique reference numbers for threads

    freshCtr

    an integer to help create unique (fresh) channel names

    processes

    a map of available processes, both atomic and composite, so that we know how to handle calls when they occur

    resources

    a ChanMap of unhandled resources. We try to keep this as clean as possible, so that it only contains resources that need to be received by a pending call (though this is not guaranteed, we might get some leftover garbage in here as well).

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from PiState to any2stringadd[PiState] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (PiState, B)
    Implicit
    This member is added by an implicit conversion from PiState to ArrowAssoc[PiState] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. val calls: List[PiFuture]
  8. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  9. def ensuring(cond: (PiState) ⇒ Boolean, msg: ⇒ Any): PiState
    Implicit
    This member is added by an implicit conversion from PiState to Ensuring[PiState] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (PiState) ⇒ Boolean): PiState
    Implicit
    This member is added by an implicit conversion from PiState to Ensuring[PiState] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): PiState
    Implicit
    This member is added by an implicit conversion from PiState to Ensuring[PiState] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): PiState
    Implicit
    This member is added by an implicit conversion from PiState to Ensuring[PiState] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def execute(p: PiFuture): Option[PiState]

    This converts a PiFuture in the calls list to an instatiated thread to be executed externally.

    This converts a PiFuture in the calls list to an instatiated thread to be executed externally. A unique thread id is generated using threadCtr. We also remove the mappings of all free channels in the process inputs from the resources list. These get used up in the process execution and are no longer needed. This helps keep the resources list clean.

  15. def executeFirst(): Option[PiState]

    By 'execute' we mean converting a call to a thread.

    By 'execute' we mean converting a call to a thread. This means checking a process in the calls list about whether its inputs have arrived. This executes the first process (if any) in calls whose inputs have arrived.

  16. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from PiState to StringFormat[PiState] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  18. val freshCtr: Int
  19. final def fullReduce(): PiState

    Perform all possible reductions to the state.

    Perform all possible reductions to the state.

    Annotations
    @tailrec()
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def handleCall(c: PiCall): PiState

    Handles process calls.

    Handles process calls. For atomic process calls, we create an instantiated PiFuture and add it to the calls. We also generate and add the process input terms. For composite process calls we instantiate the body and add it as a term.

  22. def handleThreads(handler: ((Int, PiFuture)) ⇒ Boolean): PiState

    Executes a thread handling function over all threads.

    Executes a thread handling function over all threads. Handler is expected to have side-effects (typically some Future trigger). Handler should return true if a thread was handled successfully, false if it failed. Returns the updated state containing only threads that were handled successfully.

  23. def incFCtr(i: Int = 1): PiState
  24. def incTCtr(): PiState
  25. val inputs: Map[Chan, Input]
  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  29. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  30. val outputs: Map[Chan, Output]
  31. val processes: Map[String, PiProcess]
  32. def reduce(): Option[PiState]

    Performs either a single pi-calculus reduction or else handles the first available call with completed inputs.

    Performs either a single pi-calculus reduction or else handles the first available call with completed inputs. The intersection of key sets detects common channels between inputs and outputs, which can then communicate.

  33. def removeThread(ref: Int): PiState
  34. def removeThreads(refs: Iterable[Int]): PiState
  35. val resources: ChanMap
  36. def result(ref: Int, res: PiObject): Option[PiState]

    This method should be used by the external executor to report the result of an executed thread and obtain the appropriate new state.

    This method should be used by the external executor to report the result of an executed thread and obtain the appropriate new state. The PiFuture is removed from the threads list and its output Term is added, with the given object as the output resource.

  37. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  38. val threadCtr: Int
  39. val threads: Map[Int, PiFuture]
  40. def updateProcs(f: (PiProcess) ⇒ PiProcess): PiState
  41. def updateProcs(m: Map[String, PiProcess]): PiState
  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  45. def withCalls(l: PiFuture*): PiState
  46. def withFCtr(i: Int): PiState
  47. def withProc(p: PiProcess): PiState
  48. def withProcs(l: PiProcess*): PiState
  49. def withSub(c: Chan, a: PiObject): PiState
  50. def withSubs(m: ChanMap): PiState
  51. def withSubs(l: Seq[(Chan, PiObject)]): PiState
  52. def withSubs(m: Map[Chan, PiObject]): PiState
  53. def withTCtr(i: Int): PiState
  54. def withTerm(t: Term): PiState

    Introducing a term can have many different effects on the state.

    Introducing a term can have many different effects on the state. e.g. an Input term is simply added to the inputs, but a PiCut term adds new terms to both inputs and outputs and it affects freshCtr. We also want to leave enough room for any future types of terms we might want to add. We therefore defer the state effect to be determined by the Term itself.

  55. def withTerms(t: Seq[Term]): PiState
  56. def withThread(ref: Int, name: String, chan: Chan, args: Seq[PiResource]): PiState
  57. def withThreads(t: (Int, PiFuture)*): PiState
  58. def [B](y: B): (PiState, B)
    Implicit
    This member is added by an implicit conversion from PiState to ArrowAssoc[PiState] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from PiState to any2stringadd[PiState]

Inherited by implicit conversion StringFormat from PiState to StringFormat[PiState]

Inherited by implicit conversion Ensuring from PiState to Ensuring[PiState]

Inherited by implicit conversion ArrowAssoc from PiState to ArrowAssoc[PiState]

Ungrouped