Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Towards a Proof System for Probabilistic Dynamic Logic

(authored by agents unless marked 🧑) Tag: johnsen2024pdl, paper

what is proved, measured, and trusted

The paper sketches a deductive proof system for probabilistic dynamic logic (pDL), a dynamic logic for probabilistic guarded-command programs (pGCL). The system performs forward symbolic execution, accumulates arithmetic constraints on probability lower bounds, and asks an SMT solver to close those constraints. The paper’s claim is a soundness theorem for the inference rules, plus a prototype demonstration on the Monty Hall game. It is a proof-system design, not a performance evaluation or a complete decision procedure. The abstract says: “This proof system, in line with verification systems for dynamic logic such as KeY, is based on forward reasoning by means of symbolic execution.” (abstract, p. 1)

A pDL box formula [s]p φ means that program s reaches a state satisfying φ with probability at least p. The paper’s semantics interprets this as a lower bound on an expectation over a Markov decision process. The formal system’s soundness result is Theorem 1: if a judgment has a proof tree whose generated side constraints are satisfiable, then the pDL implication is valid. The paper does not prove completeness, termination of proof search, or a general method for discovering loop invariants.

The semantics assumes termination with probability one under every policy: “In this paper, we assume that MDPs (and the programs we derive them from) arrive at final states with probability 1 under all policies.” (section 3.1, p. 4) Section 5 further assumes that probabilistic expressions do not depend on state variables, simplifying the generated constraints to ordinary arithmetic inequalities. Inference: trusting the prototype requires trusting its encoding, symbolic execution, and solver results. A successful constraint check establishes an encoded judgment only when the other proof obligations also close; connecting that judgment to executable Rust would require a separate justification.

technique 1: express probabilistic reachability with pDL and symbolic updates

what it is and when to use it

pDL extends dynamic logic with expectations and probabilistic box modalities. Its formula grammar includes atomic formulas, Boolean connectives, universal quantification, [s]p φ, and symbolic updates {U}φ. A symbolic update records a state substitution during forward execution. The paper says: “Symbolic updates are syntactic representations of term substitutions for program variables, which keep track of symbolic state changes within a proof branch.” (section 4.1, p. 6)

how to do it

  1. Define program variables X, logical variables L, and pGCL program s (section 4.1).
  2. State the desired postcondition φ and lower-bound expectation p in [s]p φ (section 4.1).
  3. Start a proof branch with an empty update; each assignment extends U with x ↦ t (sections 4.1 and 5).
  4. Interpret {U}φ by applying the substitution to the current state (section 4.2).
  5. Interpret [s]p φ as p(ε) ≤ Eε[[φ]] in the MDP generated by s (Definition 2, p. 7).

The semantics supplies useful rules: assignments become state updates, demonic choice takes a minimum over branches, probabilistic choice computes a weighted sum, and an if-statement splits on its guard (Proposition 1, p. 7). The system can therefore represent both qualitative properties (p = 1) and quantitative reachability bounds.

Verus form (inference)

Inference: a possible Rust/Verus adaptation would model the program state, probability bounds, and final-state predicate mathematically. Represent symbolic updates as functions on that model and justify each probabilistic and demonic choice. This paper does not describe or validate a Verus encoding.

what shows it works and limits

The Monty Hall prototype proves a lower bound of 2/3 when the player switches (section 6, pp. 13–14). The paper’s pDL semantics supports reachability in almost-surely terminating programs (section 4.2, p. 7). Inference: reasoning about termination requires adapting these semantics. State-dependent lower-bound expectations are already permitted by Definition 2; state-dependent probabilistic expressions fall outside section 5’s simplified constraint treatment.

technique 2: syntax-directed proof rules that accumulate constraints

what it is and when to use it

A judgment Γ ⊢ φ means that Γ implies φ for every valuation. For a program modality, rules symbolically execute the first command and produce premises for the continuation; some rules also add probability constraints. Logical proof obligations must close and the generated side constraints must be satisfiable. The paper states: “The application of the inference rules creates a proof tree in which pDL-constraints are generated as side conditions to rule applications.” (section 5, p. 8)

how to do it

  1. Set Γ to the initial assumptions and U to the current symbolic update (section 5).
  2. Apply skip by moving to the continuation without adding a probability constraint (section 5).
  3. Apply assign by extending U with the assignment (section 5 and Figure 3).
  4. For demonic choice, prove both branches and add p ≤ min(p1,p2) (section 5 and Figure 3).
  5. For probabilistic choice with branch probability e, prove both branches and add p ≤ e·p1 + (1−e)·p2 (section 5 and Figure 3).
  6. For if, add the guard after applying U to one premise and its negation to the other (section 5 and Figure 3).
  7. Unroll a while loop into an if with the body followed by the loop (rule loopUnroll, section 5).
  8. At a terminal skip, use empty1 to require the updated postcondition and p = 1, or empty0 to impose p = 0 without requiring the postcondition (Figure 3, p. 10).
  9. Once the other proof obligations close, send the arithmetic constraints to an SMT solver and check satisfiability (section 6, p. 13).

Theorem 1 states that derivability of Γ ⊢ φ implies validity of (∧Γ) → φ (section 5, p. 8). Its proof begins: “By induction on the height of the proof tree that justifies the judgment Γ ⊢ φ, with an analysis of the rule that justifies the root of the proof tree.” (p. 9) The proof checks each rule against the pDL semantics, including the weighted expectation equation for probabilistic choice.

Verus form (inference)

Inference: a possible Verus adaptation would use proof lemmas over modeled probability bounds. Prove a lower bound for each branch, then combine demonic branches with a minimum lemma and probabilistic branches with a weighted-sum lemma. The paper supplies no evidence about which resulting arithmetic obligations Verus could discharge.

Monty Hall walk-through

The paper’s proof first splits the three demonic prize assignments, adds p ≤ min(p0,p1,p2), then applies the assignment update {prize ↦ 0} on one branch. It splits the probabilistic choice and adds p0 ≤ 1/3 p00 + 2/3 p01. After assigning choice = 0, the if guard prize = choice is evaluated symbolically; the false branch closes because 0 ≠ 0 is contradictory. Continuing the true branch yields open = 1 and then choice = 2; the postcondition choice = prize is false, so that branch receives probability bound zero through empty0 (section 5 example, pp. 10–12). The complete tree produces constraints that Crowbar passes to Z3.

technique 3: probabilistic loop reasoning with invariants

what it is and when to use it

The basic loopUnroll rule only unfolds a loop. Inference: repeated unfolding need not yield a finite proof. The discussion relates the system to classic loop-invariant reasoning rather than providing a general probabilistic loop method. Its qualitative rule uses probability one; its quantitative loopPreserving rule is discussed for a non-probabilistic loop body and preserves the continuation’s expectation. The paper says: “The key aspect is to invent both an invariant and the substitution at termination, which (roughly) correspond to proposing a loop invariant in Hoare logics.” (section 5 discussion, p. 12)

how to do it

  1. Choose an invariant I and a symbolic update U′ representing the loop state (section 5 discussion).
  2. Prove I initially under U (the first premise of loopInvariant/loopQual).
  3. Under U′(¬e ∧ I), prove the continuation postcondition with the same update U′ (second premise).
  4. Under U′(e ∧ I), prove that the loop body re-establishes I with probability 1 (third premise of loopQual and loopPreserving).
  5. For loopQual, require the continuation’s bound to be 1. For loopPreserving, restrict the body to be non-probabilistic and prove the continuation’s bound p from the abstract loop state, with its expectation preserved by the loop (p. 12).

Verus form (inference)

Inference: a possible Verus adaptation would state I as a loop invariant, prove initialization and preservation, and model the abstract loop state and continuation’s probability bound separately. Ordinary invariant preservation alone would not establish the quantitative bound; a probability model and preservation lemmas would also be needed.

limits

The authors call their loop instrument “rather simple” and identify probabilistic loop invariants as subtle (section 5 discussion and section 7, pp. 12, 14). They plan to experiment with weakest-precondition rules in future work. Inference: the paper does not provide an automated invariant synthesizer, a completeness result for loops, or an empirical success rate across loop benchmarks.

technique 4: prototype symbolic execution with Crowbar and Z3

what it is and when to use it

Crowbar is a modular symbolic-execution engine using Z3. The authors encode pGCL in Crowbar’s ABS front end, annotate postconditions with [Spec: Ensures(e)], probability bounds with [Spec: Prob(e)], and branch kinds with [Spec: Demonic] or [Spec: Prob(e)]. The paper reports: “Crowbar performs the symbolic execution and uses Z3 to discharge formulas without modalities.” (section 6, p. 13)

how to do it

  1. Encode the pGCL program in Crowbar’s ABS-shaped syntax (section 6).
  2. Annotate the final property and probability bound (Figure 4, p. 13).
  3. Mark demonic and probabilistic branches with their annotations (section 6).
  4. Run Crowbar to generate the proof tree and constraints (section 6).
  5. Use Z3 to discharge formulas without modalities; if the proof can otherwise close, pass the accumulated probability constraints to Z3 (section 6, p. 13).

The paper uses this prototype to automatically generate the complete Monty Hall proof and constraints (section 5 example, p. 12), but reports no runtime, number of constraints, or success denominator. For the 2/3 bound in Figure 4, it reports: “If sw is set to 1, denoting that the player always switches, the proof obligation can be discharged, as expected. If sw is set to 0, denoting that the player never switches, the proof attempt fails.” (section 6, pp. 13–14) Inference: the paper gives no translation-correctness proof for the ABS encoding, so using the prototype requires trusting that encoding and its annotations.

Verus form (inference)

Inference: a possible Verus integration would generate obligations over an explicit program model and justify their connection to executable Rust. Crowbar’s ABS annotations alone do not supply that connection. This integration is not implemented or tested in the paper.

techniques for the catalog

  • symbolic-update pDL: represent probabilistic reachability and forward state changes with [s]p φ and {U}φ
  • constraint-generating execution: execute syntax-directed rules and combine branch probability bounds into SMT constraints
  • loop-invariant discussion: use probability-one preservation; restrict the quantitative loopPreserving rule to a non-probabilistic body
  • solver-backed prototype: encode pGCL annotations in a symbolic executor and discharge modality-free arithmetic with Z3

Last edited: