A New Syntax and Semantics for Probabilistic Trace Expressions

Davide Ancona, Angelo Ferrando, Viviana MascardiarXiv 2026

TL;DR

This paper introduces a refined syntax and semantics for Probabilistic Trace Expressions (PTEs), a formal framework designed for runtime verification in partially observable environments where events can be lost, delayed, or missed entirely. By decoupling probabilities from syntactic transitions and instead attaching them to the set of enabled event types in each semantic state, the authors achieve a highly modular framework that can handle non-regular (infinite-state) specifications and subsume classical Hidden Markov Models (HMMs).

What Problem Does This Paper Address?

Runtime Verification (RV) is a computing technique used to check whether a running system complies with desired correctness properties. Traditionally, RV algorithms operate under an idealistic assumption: perfect observability. They assume the monitor sees every single event exactly when it happens.

In real-world applications—such as distributed networks, IoT systems, or deep-space robotic missions—this assumption falls apart. Communication channels drop packets, sensors fail, and monitors experience observation "gaps."

When an event goes missing, how should a monitor update its verdict? Existing solutions often rely on Probabilistic Finite State Automata (PFSAs) or HMMs to estimate the system's true state. However, these models are strictly limited to regular languages and finite-state behavior. They cannot easily handle complex, non-regular patterns (like matching push/pop operations in a stack-based buffer). The authors previously proposed an early version of PTEs in 2022 to bridge this gap, but it attached probabilities directly to syntactic transitions, which harmed modularity and caused consistency issues in infinite-state systems.

Methods

The authors redesign PTEs from the ground up with a clean separation of concerns: a PTE is now a standard, non-probabilistic Trace Expression (TE) paired with a separate probability distribution function ($\Pi$). This distribution is dynamically evaluated based on the event types enabled in the current semantic state.

The paper introduces two distinct operational semantics to interpret traces with gaps:

  1. Observation Semantics (ObSem): Used for belief-based monitoring. Observed events are treated as certain (probability = 1), and probability mass is distributed among possible alternative paths only when a gap is encountered.
  2. Guess Semantics (GuesSem): Aligns with likelihood-based trace analysis. It treats both observed events and gaps as probabilistic outcomes, calculating the overall likelihood of a specific sequence of actual events occurring.
Figure 2: The PFSA modelling COGC.

The authors also outline a systematic translation pipeline called HMM2PTE to convert existing HMMs into PTEs, and demonstrate how Linear Temporal Logic (LTL) formulas can be translated into the same framework to evaluate property satisfaction under uncertainty. The entire framework was implemented as a proof-of-concept monitor using SWI-Prolog, taking advantage of Prolog's native support for unification and backtracking to explore the state-space generated by observation gaps.

Datasets

Not discussed in the paper. The authors evaluate and illustrate their approach using a synthetic, illustrative scenario based on a Mars Rover communication protocol (the COGC protocol shown in the figure above).

Key Insights and Ideas

  • Incremental Modularity: By separating the probability definitions from the trace expression syntax, engineers can reuse the same underlying protocol specification and simply swap out the probability distributions based on changing environmental deployment conditions.
  • Beyond Regular Languages: Because probabilities are bound to semantic states rather than static syntactic transitions, PTEs can easily scale to infinite-state protocols (e.g., using shuffle and recursion operators) while maintaining mathematical consistency.
  • Gaps as Conflicting Viewpoints: The authors note that "gaps" don't just represent lost data; they can also model scenarios where multiple independent observers disagree on what event occurred, allowing the monitor to treat conflicting multi-trace data as localized uncertainty gaps.

Key Results

  • HMM Equivalence: The authors mathematically prove (Theorem 5.1) that under GuesSem, the probability mass propagated by a PTE matches the exact state estimation calculated by the classical HMM Forward Algorithm.
  • Expressive Dominance: The framework successfully subsumes both HMM-style reasoning and LTL specifications, meaning any property expressible in those formalisms can be verified using PTEs, whereas the reverse is not true.
  • Prolog Execution: The SWI-Prolog implementation successfully handles the "set-to-set" transitions required when a gap forces the monitor to split its focus across a tree of multiple potential current states.

Limitations and Future Work

  • State-Space Explosion: Every time an observation gap occurs, the monitor must branch out and track all possible valid events that could have filled that gap. In highly nondeterministic systems, this logical tree grows rapidly, presenting a significant computational bottleneck for real-time, online monitoring.
  • Centralization: The practical discussion focuses primarily on a single, centralized external monitor. While the authors suggest that splitting the workload across decentralized monitors is a viable path forward, the exact algorithms for decentralized coordination during mutual gaps remain open.
  • Next Steps: Future work includes introducing parameters into the PTE syntax, conducting a rigorous computational complexity analysis of the gap-filling algorithms, and extending the domain-specific Runtime Monitoring Language (RML) to natively support these probabilistic variants.

Summary updated

BibTeX
@misc{ancona2026new,
  author = {Davide Ancona and Angelo Ferrando and Viviana Mascardi},
  title = {{A New Syntax and Semantics for Probabilistic Trace Expressions}},
  year = {2026},
  eprint = {2608.17594},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.17594},
}
Figure