On correctness and completeness of an n queens program
W{\l}odzimierz Drabent

TL;DR
This paper provides a formal declarative specification and proofs of correctness and completeness for a concise Prolog program solving the n queens problem, illustrating precise reasoning about logic program semantics.
Contribution
It offers the first formal correctness and completeness proofs for a well-known concise Prolog n queens program, using declarative reasoning.
Findings
The program is correct and complete with respect to the specification.
Declarative proofs validate the program's correctness and completeness.
The approach demonstrates precise semantic reasoning for logic programs.
Abstract
Thom Fr\"uhwirth presented a short, elegant and efficient Prolog program for the n queens problem. However the program may be seen as rather tricky and one may not be convinced about its correctness. This paper explains the program in a declarative way, and provides proofs of its correctness and completeness. The specification and the proofs are declarative, i.e. they abstract from any operational semantics. The specification is approximate, it is unnecessary to describe the program's semantics exactly. Despite the program works on non-ground terms, this work employs the standard semantics, based on logical consequence and Herbrand interpretations. Another purpose of the paper is to present an example of precise declarative reasoning about the semantics of a logic program. Under consideration in Theory and Practice of Logic Programming (TPLP).
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, Reasoning, and Knowledge · Logic, programming, and type systems · Advanced Algebra and Logic
