Automatically Verifying Expressive Epistemic Properties of Programs

Francesco Belardinelli, Ioana Boureanu, Vadim Malvone, Fortunat Rajaona

Abstract

In the domains of AI explainability and cybersecurity, verifying what an agent knows about a system's state is paramount. This paper introduces $L_{PK}$, a novel program-epistemic logic that allows for formal reasoning about knowledge before, during, and after program execution. By providing a recursive translation of $L_{PK}$ into standard First-Order Logic (FOL), the authors enable the use of off-the-shelf SMT solvers for automated verification. While the framework demonstrates superior expressiveness and competitive performance on small-scale benchmarks, scalability remains a challenge due to the complexity of quantifiers generated during translation.

Introduction

Traditional verification methods often focus on what a program does, but in security-critical applications, it is equally important to understand what information is leaked to or known by various observers. For instance, one might need to verify if an observer can deduce a private variable's value after witnessing a specific function's output. Previous logics, such as $L_{\square K}$, were limited by their inability to reason about knowledge at intermediate execution steps and their reliance on bespoke, hard-to-generalize predicate transformers.

To address these gaps, this research proposes $L_{PK}$, a logic that integrates star-free Linear Dynamic Logic (LDL) with epistemic operators. This approach treats programs as first-class citizens within the logic, allowing for more flexible and expressive property checking.

The $L_{PK}$ Framework and FOL Translation

The core innovation of $L_{PK}$ lies in its commutative properties. Unlike earlier frameworks, $L_{PK}$ allows epistemic operators ($K_a$) and program operators ($[\rho]$) to commute. This enables reasoning about complex properties like "knowing that a program will result in X" ($K_a[\rho]\alpha$) with the same ease as "after a program, knowing X" ($[\rho]K_a\alpha$).

To automate the verification of these properties, the authors developed a recursive translation function, $\tau$, which maps $L_{PK}$ formulas into First-Order Logic. This translation is significant because FOL serves as a universal language for automated theorem provers. By converting epistemic queries into FOL, the authors can leverage the power of SMT solvers like Z3. The implementation, written in Haskell, takes a program and a desired property as input and utilizes the SMT solver to determine if the property holds.

Experimental Evaluation

The authors evaluated their SMT-based approach using two primary benchmarks: the classic Dining Cryptographers protocol (testing anonymity in multi-agent systems) and a Simple Revelation example (testing non-observable variables). The performance was compared against specialized model checkers like MCMAS and previous logic translations.

Performance comparison of the proposed translation against existing methods.

As shown in the experimental results, the proposed translation offers a distinct advantage in expressiveness. For example, the property $\neg\alpha'_2$ could be verified by the authors' tool but was not supported by the framework of Gorogiannis et al. (2017). In terms of speed, the tool outperformed MCMAS for the Dining Cryptographers problem at $n=5$. However, as the system size increased to $n=10$, the performance degraded significantly compared to bespoke methods. This slowdown is attributed to the complex alternating quantifiers produced by the general translation, which can hinder SMT solver optimizations.

Key Insights and Limitations

A major strength of this approach is its semantic independence. By avoiding bespoke predicate transformers, the verifier does not need to be redesigned for different programming language semantics. Furthermore, the logic carefully distinguishes between de re and de dicto knowledge—knowing a specific value versus knowing that some value exists—through explicit variable substitution.

However, scalability remains the primary hurdle. The current implementation relies on the Haskell SBV library, which lacks full support for alternating quantifiers, forcing the manual expansion of quantifiers into large conjunctions or disjunctions. This process bypasses many of the built-in optimizations of modern SMT solvers.

Conclusion and Future Work

This research provides a robust, generalized framework for verifying epistemic properties in programs. While the current SMT-based implementation excels in expressiveness and small-scale efficiency, future work will focus on improving scalability. Potential avenues include integrating the translation with theorem provers better suited for quantifiers (such as Vampire or iProver) and extending the logic to include the Kleene star for reasoning about program loops.

Summary updated

BibTeX
@inproceedings{belardinelli2023automatically,
  author = {Francesco Belardinelli and Ioana Boureanu and Vadim Malvone and Fortunat Rajaona},
  title = {{Automatically Verifying Expressive Epistemic Properties of Programs}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  doi = {10.1609/aaai.v37i5.25769},
}
Figure