6 posts tagged “π-calculus”
I seem to have one. Here's the OCaml signature. The module file is all of 250 lines at this point, but I expect to define a lot of built-in processes for the preamble. That will bloat out the module file.
type 'a t
module Op: sig
val ( >>= ): 'a t -> ('a -> 'b t) -> 'b t
endval return: 'a -> 'a t
val eval: unit t -> unittype n
type repeat = Once | Alwaysval nil: unit t
val start: unit t -> unit t
val lambda: n t
val nu: n t
val fusion: n -> repeat -> n list -> unit t -> unit tval v_void: n
val v_true: n
val v_false: nval if_then_else: n -> unit t -> unit t -> unit t
type dio = D_in | D_out
val def: dio list -> (n array -> unit t) -> n tval preamble: n Name.Map.t t
I continue to noodle around with an abstract syntax for types in my internal language. (Sigh. This is taking forever.) Here's what I'm looking at now:
τ ::= α | ν⟨σ⟩ | λ(σ)
σ ::= ∀δ,σ | ∃α,σ | τ,σ | ϵ
δ ::= α | α = τ | α > τ
While I was in the shower this morning, it occurred to me that I should make a note for myself about how monads work in the polyadic D-fusion calculus.
- The type construction is simply a channel (να) for sending a value of the underlying type.
- The unit function is a channel (να λ(λ(να))) for sending a value of the underlying type and receiving a responsive channel that carries the resulting monadic value.
- The binding operation is a channel (να ν(να λ(λ(νβ)))) λ(λ(νβ))) for sending two values, 1) a monadic value of type α and 2) a channel for sending a value of the underlying type α and receiving a responsive channel that carries the resulting value of monadic type β; the binding operation channel also permits receiving a responsive channel that carries the resulting value of monadic type β.
When you're building a concurrent functional programming language around an internal language derived from the π-calculus, it's a known strategy [c.f. Pict, by Pierce and Turner] to allow applicative expressions to be used in the place of π-names in action prefixes. These are a kind of syntactic sugar that expand to a concurrent process that produces the result of function application on an ephemerally bound name that takes the place of the expression.
∀α β. α → β → α
A :: ⟦ ∀α β. να νβ λ⟦ λα ⟧⟧
B :: ⟦ ∀α. να λ⟦ ∀β. νβ λ⟦ λα ⟧⟧⟧
Last night, I think I figured out some important things about the π-calculus.
Just a brief note to go on the record. I note that the widespread deployment of pseudo-symmetric multiprocessing hardware in personal computers is giving software developers new reasons to put more energy into crawling up the concurrent programming learning curve. Sadly, it seems that a lot of the sooper-hip cool kids are glomming onto the latest craze in the world of haute couture for coders, i.e. The Actor Model.
