🤖 AI Summary
This work proposes a novel method for the automated verification of termination and partial correctness of pure Prolog programs. By translating first-order logic axioms from the LPTP system into standard first-order formulas (FOF) and leveraging general-purpose automated theorem provers for reasoning, the approach achieves the first fully automatic verification pipeline, migrating away from LPTP’s specialized interactive framework. The method integrates Prolog semantic modeling, axiomatic representations, and an FOF intermediate format, demonstrating its effectiveness on the LPTP benchmark suite comprising approximately 400 properties. This significantly enhances both verification efficiency and scalability. The accompanying compiler and dataset have been publicly released to support further research and reproducibility.
📝 Abstract
LPTP (Logic Program Theorem Prover) is an interactive natural-deduction-based the- orem prover for pure Prolog programs with negation as failure, unification with the occurs check, and a restricted but extensible set of built-in predicates. With LPTP, one can formally prove termination and partial correctness of such Prolog programs. LPTP was designed in the mid 90’s by Robert F. Sta ̈rk. It is written in ISO-Prolog and comes with an Emacs user-interface.From a theoretical point of view, in his publications about LPTP, Sta ̈rk associates a set of first-order axioms IND(P) to the considered Prolog program P. IND(P) contains the Clark’s equality theory for P, definitions of success, failure and termination for each user-defined logic procedure in P , axioms relating these three points of view, and an axiom schema for proving inductive properties. LPTP is thus a dedicated proof editor where these axioms are hard-wired.We propose to explicit these axioms as first-order formulas (FOFs), and apply auto- mated theorem provers to check the property of interest. Using FOF as an intermediary language, we experiment the use of automated theorem provers for Prolog program veri- fication. We evaluate the approach over a benchmark of about 400 properties of Prolog programs from the library available with LPTP. Both the compiler which generates a set of FOF files from a given input Prolog program together with its properties and the benchmark are publicly available.