Stochastic Pi

1 program Added 2026-03-10T12:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: SPiM, Stochastic Pi calculus, Stochastic Pi Machine
Provenance: commit 14c9cf47a8 · authored 2026-03-10T11:42:10+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

SOM (0.18)SAM76 (0.14)Assembly (0.14)Caml (0.14)Turing Machine (0.14)

LLM-contributed programs

Michaelis-Menten Enzyme Kinetics

Provenance: commit 14c9cf47a8 · authored 2026-03-10T11:42:10+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.spi · added: 2026-03-10T12:00:00Z
(* Enzymatic reaction: E + S <-> ES -> E + P
   Classic Michaelis-Menten example in SPiM *)
directive sample 100.0 points 1000
directive plot "E" , "S" , "ES" , "P"

val kf   = 0.001 in  (* forward binding rate *)
val kb   = 0.001 in  (* reverse unbinding rate *)
val kcat = 0.1   in  (* catalytic rate *)

new bind   : chan<>
new unbind : chan<>
new release: chan<>

(* Enzyme: waits to bind substrate *)
let rec E() =
  do kf bind?();     ES()

(* Enzyme-Substrate complex: either unbinds or releases product *)
and ES() =
  choice
    { do kb unbind!(); E() }
    { do kcat release!(); E() }

(* Substrate: waits to bind enzyme *)
let rec S() =
  do kf bind!(); 0

(* Product: created upon catalysis *)
let rec P() =
  do kcat release?(); P()

run ( E() | E() | S() | S() | S() | S() | S() | P() )

Contribute — propose a file extension

Tell us where to find evidence about Stochastic Pi (mapped to pl/stochastic_pi). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/Stochastic Pi/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← STMSL stockholm-format →