A Rule-Based and Imperative Language for Biochemical Modeling and Simulation

We present COSBI LAB Language ($\mathcal{L}$ for short), a simple modeling language for biochemical systems. $\mathcal{L}$ features stochastic multiset rewriting, defined in part through rewriting rules, and in part through imperative code. We provide a continuous-time Markov chain semantics for $\mathcal{L}$ at three different abstraction levels, linked by Galois connections. We then describe a simulation algorithm for the most concrete semantics, which is then adapted to work at higher abstract levels while improving space and time performance. Doing so results in the well-known Gillespie's Direct Method, as well as in a further optimized algorithm.