A Refinement Calculus for Logic Programs
Ian Hayes, Robert Colvin, David Hemer, Paul Strooper, Ray Nickson
Abstract
Existing refinement calculi provide frameworks for the stepwise development of imperative programs from specifications. This paper presents a refinement calculus for deriving logic programs. The calculus contains a wide-spectrum logic programming language, including executable constructs such as sequential conjunction, disjunction, and existential quantification, as well as specification constructs such as general predicates, assumptions and universal quantification. A declarative semantics is defined for this wide-spectrum language based on executions. Executions are partial functions from states to states, where a state is represented as a set of bindings. The semantics is used to define the meaning of programs and specifications, including parameters and recursion. To complete the calculus, a notion of correctness-preserving refinement over programs in the wide-spectrum language is defined and refinement laws for developing programs are introduced. The refinement calculus is illustrated using example derivations and prototype tool support is discussed.
Create a lesson
Related papers
PreciseCoder: Faithful and Generalizable Debugging Beyond Unit-Test Rewards
Yunkai Zhan, Miaosen Chai, Shangshang Wang et al.
SolBehave: Evaluating the Behavioural Correctness of LLM-Generated Smart Contracts
Giovanni Pio Delvecchio, Stefano Fantazzini, Giacomo Frisoni et al.
DTScribe: Generating Models for Digital Twin Reporting using Local Large Language Models
Kérian Fiter, Angelica Portocarrero, Bentley Oakes
SWE-MISBEHAVIOR: Benchmarking and Mitigating Boundary Violations in Software Coding Agents
Do Xuan Trong, Duc Anh Nguyen, Do Xuan Long et al.
Assessing the Quality of Concrete Scenarios Generated from Scenario Classes for Automated Driving
Lina Putze, Thies de Graaff, Jan Steffen Becker et al.
Soliduzz: Finding Miscompilations in Smart-Contract Compilers with Assertion-Driven Equivalence Oracles
Alexander Stromberger, Christoph Hochrainer, Valentin Wüstholz et al.