arXiv:2611.12761cs.LONov 2026

Manuscript Offprint

arXiv:2611.12761

A Hoare Logic for Continuous-Time Stochastic Processes

Kei Imada, Justin Hsu

KEI IMADA, Cornell University, United States

JUSTIN HSU, Cornell University, United States

Programming language researchers have developed a wide array of tools to reason about probabilistic programs, but it remains unclear how to apply these proof techniques to continuous-time stochastic processes. To bridge this gap, we propose a verification method for properties of continuous-time stochastic processes by reasoning about them as standard programs.

To demonstrate our approach, we define a continuous semantics for a probabilistic imperative language pWHILEdt^{dt} by taking the Kuratowski limit of the standard semantics, which collects limit points of the standard program semantics as the time-step approaches zero. Then, we present a Hoare-style logic that uses loop invariants and decreasing functions to verify properties of continuous programs. To establish soundness, we identify a broad class of assertions that are preserved from the standard semantics to the continuous semantics. To demonstrate our approach, we verify properties of ten continuous-time stochastic processes modeled in pWHILEdt^{dt}, including variants of Brownian motion and a stochastic hybrid system.

1 Introduction

Continuous-time stochastic processes play important roles in modeling random behavior. A canonical example is Brownian motion, which models diffusion: the random motion of particles suspended in fluids. Other processes build upon Brownian motion to capture other phenomena: geometric Brownian motion models stock-price behavior [1] and oscillating Brownian motion model particles that flow between different materials and appear in molecule movement for cell transport [2].

We aim to develop an imperative probabilistic language that can model continuous-time stochastic processes, and a program logic to reason about their properties. However, modeling continuous processes as programs requires bridging a fundamental semantic gap: typical probabilistic programs produce discrete distributions, but the state of continuous-time stochastic processes are usually distributed continuously over R\mathbb{R}. This mismatch makes it challenging to model and verify properties of continuous-time stochastic processes using standard program semantics.

To address this problem, our key insight is that continuous distributions can be modeled as limits of discrete distributions. In particular, we parametrize our probabilistic programs with a real-valued parameter dt, and we construct our continuous semantics as the set of limit distributions from the standard semantics of probabilistic programs as dt tends to zero. To reason about our continuous semantics, we identify a broad class of distributional properties preserved under our limit construction, allowing us to prove properties of continuous-time stochastic processes by establishing properties of standard probabilistic programs.

To realize this strategy, we present pWHILEdt^{dt}, a probabilistic language for modeling continuous-time stochastic processes. Our syntax extends WHILEdt^{dt} [3], an imperative language capable of modeling continuous-time deterministic processes, with two variants of binary sampling: probabilistic choice (flip) and probabilistic diffusion (db). Starting from the standard measure transformer semantics of Kozen [4], we define the continuous probabilistic semantics of pWHILEdt^{dt} as a set of limit distributions of the standard semantics as dt approaches 0. We prove our semantics is always nonempty, but ensuring uniqueness of limit distributions appears difficult without greatly limiting expressivity. Thus, we overapproximate by taking all limit distributions as our continuous semantics. This design choice allows us to model a large class of continuous-time stochastic processes while retaining semantics that is tractable for verification.

Authors' Contact Information: Kei Imada, Cornell University, Ithaca, New York, United States; Justin Hsu, Cornell University, Ithaca, New York, United States.

cont t,x; t,x := 0;
while (t < T) {
    t += dt; x += db;
}

Program 1. 1-Dimensional Brownian Motion p1bmp_{1bm}

cont t,x; t,x := 0;
while (|x| < D && t <= T) {
    t += dt; x += db;
}

Program 2. Escaping Brownian Motion p1bm−ep_{1bm-e}

To reason about continuous-time stochastic processes modeled with pWHILEdtpWHILE^{dt}, we construct a Hoare logic. Our assertions can involve expectations over polynomial test functions and probabilities of events. We define two notions of validity of Hoare triples: a discrete version, where dtdt is a positive real number, and a continuous version, where dtdt approaches 0. To prove discrete validity, we directly adapt proof rules from an existing program logic ELLORA [5]. In contrast, our proof rules for continuous validity are more novel. Crucially, we propose a new rule TRANSFER which allows us to prove properties about our continuous semantics using properties about our discrete semantics. This lets us reason about continuous-time stochastic processes by leveraging standard ideas from probabilistic program verification. Our logic can prove properties about all the limit distributions in our semantics; in special cases such as Brownian motion, we can also show uniqueness of the limit distribution using our proof rules.

The soundness of the discrete proof rules are standard, but the soundness of continuous proof rules—especially TRANSFER—require properties to be preserved under our limit operation. By carefully designing our assertion language, we show that a large class of assertions about measures are preserved, allowing us to lift validity from the discrete setting to the continuous setting.

Outline. After presenting our technical overview in Section 2, we present our contributions:

(1) the syntax of pWHILEdtpWHILE^{dt}, its standard semantics, our continuous semantics as a set of limit distributions of the standard semantics in Section 3. Limit distributions may not exist in general, so we prove a theorem establishing sufficient conditions for the existence of limits;

(2) discrete and continuous notions of validity for Hoare triples, corresponding Hoare logics for each notion, and soundness theorems for both logics in Section 4. Our continuous proof rules rely on discrete validity, but not all properties transfer from the discrete to the continuous. Hence, to prove soundness, we identify a large class of assertions that are preserved under our continuous semantics construction; and

(3) a demonstration of our proof system on ten example programs that model classical continuous-time stochastic processes and a stochastic hybrid system in Section 5. We prove 21 properties involving variance, expected escape time, tail probability, symmetry, and more.

We survey related work in Section 6 and conclude in Section 7.

References (69)