DiffRefiner: Difference Analysis in APAs
- DiffRefiner is a formal tool that analyzes and decomposes differences between abstract probabilistic automata (APAs) used in compositional verification.
- It employs over- and under-approximations with symbolic constraint manipulation to capture counterexamples when refinement fails.
- Its quantitative framework uses discounted metrics to ensure convergence, rigorously balancing soundness and completeness in system analysis.
A DiffRefiner is a formal tool designed for analyzing and decomposing differences between specifications given as Abstract Probabilistic Automata (APAs), particularly in the context of compositional verification and quantitative model reasoning. When two APAs, representing system behaviors or requirements, stand in a non-refinement relation, DiffRefiner systematically synthesizes a new APA that captures all counterexample stochastic systems (implementations) attesting to the failure of refinement. The tool produces both sound over-approximations as well as convergent under-approximations of the difference, with rigorous quantitative control. At its core are distance metrics on automata, discounted convergence, and algorithms for symbolic manipulation of constraint-transition systems (Delahaye et al., 2012).
1. Formal Structure of APAs and Refinement
An Abstract Probabilistic Automaton (APA) in single-valuation normal form is a tuple: where is the finite set of states, an action alphabet, atomic propositions, assigns at most one set of atomic proposition valuations per state, are initial states, and
$L:S \times A \times C(S) \to \{\bot,\, \may,\, \top\}$
maps each state-action-constraint triple to a modality. Here, is a set of transition constraints on distributions over : means “must”, $\may$ means “may”, and means “must not”.
Refinement is defined by a relation (for two APAs ) such that, for every :
- The valuation .
- Must-part: for every "must" outgoing from , there is a corresponding "must" in satisfying distribution coupling via .
- May-part: for every "may" outgoing from , there is a "may" in with correspondingly coupled distributions.
Refinement () holds if there exists such a relation covering all initial states. This definition generalizes simulation-like relations to the probabilistic and modal setting and is critical for sound refinement and difference reasoning (Delahaye et al., 2012).
2. Difference Operators and Approximation Schemes
When , it is often useful to characterize the set difference of their implementations, i.e., those PAs allowed by that do not conform to . In general, the exact difference
need not correspond to an APA, so the DiffRefiner computes:
- An over-approximation , admitting a superset of the actual difference,
- A family of under-approximations (for depth ), which grow increasingly tight as .
These operators are defined by symbolic construction on APA states and transitions, carefully tracking modalities and constraints, and ensuring that under-approximations are contained in the true difference while the over-approximation contains it (Delahaye et al., 2012).
3. Quantitative Theory and Convergence
DiffRefiner introduces a discounted quantitative metric: where is a discount factor and compares sets of distributions via a Hausdorff-like distance. This metric supports rigorous statements about the convergence of under-approximate difference automata: ensuring precision can be controlled arbitrarily by depth (Delahaye et al., 2012).
Both soundness (over-approximation admits all true witnesses to non-refinement) and completeness (every true difference appears in some under-approximation) are guaranteed, with convergence governed by the choice of .
4. Core Algorithmic Workflow
The difference computation proceeds as follows:
- Maximal Refinement Computation: Compute the largest refinement relation and the associated index function (witnessing depth to breakdown) between .
- Depth Selection: Choose minimal such that , for the desired precision .
- Construction of Under-Approximation: Build the under-approximate difference automaton by symbolically constructing state tuples , with transitions handled according to six "breaking" cases (detailed in the source (Delahaye et al., 2012), Table V).
- Distance Evaluation and Termination: Optionally, measure the (discounted) distance to verify convergence and sufficiency with respect to .
Pseudocode for this high-level process:
1 2 3 4 5 6 7 |
function ApproxDifference(N1, N2, λ, ε):
if N1 ⪯ N2:
return ∅
R, ind_R ← ComputeMaxRefinement(N1, N2)
K ← ceil( log(ε) / log(λ) )
Ndiff ← BuildUnderApprox(N1, N2, R, ind_R, K)
return Ndiff |
Complexity is modest: for fixed and , asymptotically dominated by the cost of the underlying refinement computation and symbolic constraint solving.
5. Implementation and Practical Considerations
Efficient implementation of DiffRefiner entails:
- Representation of APA states, transitions, and constraints (often as SMT objects for ).
- Bit-matrix storage and queue management for .
- Implicit handling of under-approximation states using hash-maps keyed on tuples .
- Iterative value-iteration for distance calculations if convergence needs to be explicitly monitored.
- Tuning of for the sensitivity/convergence tradeoff, and setting accordingly.
Discounting guarantees that cycles and infinite behaviors contribute at most at depth .
6. Example and Characterization of Results
Consider two APAs and (each with two states, simple Boolean-atomic-propositions). Suppose enables an action leading deterministically to a state , and requires action to hit state with probability at least 0.5. All implementations of actually refine , so the DiffRefiner returns the empty difference.
If instead allows any mixture between and on , there are behaviors excluded by ; the under-approximate difference at increasing will include more concrete counterexamples (e.g., those assigning less than 0.5 mass to ), and as , approaches the set of all such witness PAs. Over-approximation represents all possible ways to fail refinement, possibly admitting infinitesimal cases (Delahaye et al., 2012).
7. Theoretical and Practical Significance
The DiffRefiner approach is theoretically grounded, delivering both soundness and completeness guarantees via over-/under-approximation, all under explicit metric control. This enables precision-tunable difference analyses not only for exhaustively distinguishing implementable behaviors but also for understanding specification robustness and root causes in system design.
The construction is as efficient as ordinary refinement-checking. Its rigor and algorithmic transparency make it suitable for runtime integration in probabilistic/verifiable system design and analysis workflows.
For formal details, soundness proofs, construction of difference automata, and worked examples, see "Refinement and Difference for Probabilistic Automata" (Delahaye et al., 2012).