Automatic Verification of Partial Correctness of Golog Programs

Naiqi Li, Yongmei LiuIJCAI 2015

Abstract

When Golog programs are used to control agents' behaviour in a high-level manner, their partial correctness naturally becomes an important concern. In this paper we propose a sound but incomplete method for automatic verification of partial correctness of Golog programs. We introduce the notion of extended regression, which reduces partial correctness of Golog programs to first-order entailment problems. During the process loop invariants are automatically discovered by heuristic methods. We propose progression of small models wrt Golog programs, which are used to filter out too strong heuristic candidates. In this way we combine the methods of static and dynamic analysis from the software engineering community. Furthermore, our method can also be adapted to verify state constraints. Experiments show that our method can not only handle sequential and nested loops uniformly in a reasonable among of time, but also be used to discover succinct and comprehensible loop invariants and state constraints.

Introduction

In the field of autonomous agents, Golog serves as a powerful language for describing high-level behavior based on the situation calculus. However, ensuring that these programs are "correct"—meaning they achieve their goals without violating domain rules—is a significant challenge. This paper specifically addresses partial correctness: the guarantee that if a program begins in a state satisfying certain properties, those properties (or desired post-conditions) will hold upon termination.

The primary obstacle in verifying partial correctness is the "loop invariant" problem. Proving loop correctness requires identifying properties that remain true throughout every iteration. Manually identifying these invariants is tedious, and existing automated methods often struggle with complexity or lack formal soundness. The authors propose a hybrid approach that integrates static analysis with dynamic testing to automate this discovery process.

Methodology

The proposed method mimics human reasoning by alternating between formal proof attempts and empirical testing. It consists of three primary components:

  1. Extended Regression: This static analysis technique takes a desired post-condition and "regresses" it backward through the program logic. This process transforms the verification task into a first-order logic entailment problem.
  2. Heuristic Loop Invariant Discovery: When encountering loops, the system iteratively strengthens candidate invariants using heuristics such as sub-disjunction (selecting parts of logical OR statements), unification (identifying equivalent variables), and constant heuristics (replacing variables with known domain objects).
  3. Small Model Progression: To prevent heuristics from generating invariants that are too strong to be provable, the system employs "small models"—mini-simulations that act as a dynamic filter. If a candidate invariant fails in a small model, it is immediately discarded.

Additionally, the framework is adapted for State Constraint Discovery, identifying fundamental laws of the world (e.g., a robot cannot hold two objects in one hand) to serve as background knowledge, which significantly accelerates the main verification process.

Experimental Evaluation

The system was evaluated on 22 programs across 9 standard AI planning domains, including CornerA, Delivery, Green (a blocks-world variant), Gripper, Logistics, and Transport. The results demonstrate that the hybrid static-dynamic approach is both effective and efficient.

Experimental results for state constraint discovery and program verification across nine domains.

As shown in the experimental data, the system successfully verified all test programs. For instance, in the complex "Green" domain, the system discovered 17 state constraints in 103 seconds and completed program verification with a maximum time of 46.0 seconds. This represents a significant speedup over previous state-of-the-art methods, which often required much longer to find fewer constraints. Notably, the method handles sequential and nested loops uniformly and produces succinct, human-readable invariants.

Conclusion

This research presents a robust framework for the automatic verification of Golog programs by combining extended regression with small model progression. While the current system excels at handling complex logical structures, it faces limitations with programs involving intensive arithmetic or counting. Future work will focus on integrating arithmetic-specific heuristics and expanding the framework to address total correctness, which includes proving program termination. Despite these limitations, the current method provides a scalable and non-trivial solution for ensuring agent behavior aligns with intended specifications.

Summary updated

BibTeX
@inproceedings{li2015automatic,
  author = {Naiqi Li and Yongmei Liu},
  title = {{Automatic Verification of Partial Correctness of Golog Programs}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2015},
  url = {https://openreview.net/forum?id=Hybo04M_WH},
}
Figure