A Prolog Program for Bottom-up Evaluation
David S. Warren (Stony Brook University)

TL;DR
This paper presents a simple Prolog metainterpreter that performs bottom-up evaluation of positive Horn clause programs, illustrating an intuitive approach to logic program semantics.
Contribution
It introduces a novel Prolog program that efficiently computes bottom-up semantics using a transformation into metarules, highlighting Prolog's assert/1 as an intrinsic tool.
Findings
The program implements semi-naive bottom-up evaluation.
Prolog's assert/1 is effectively used for clarity and simplicity.
The approach offers an intuitive method for bottom-up logic programming.
Abstract
This short paper describes a simple and intuitive Prolog program, a metainterpreter, that computes the bottom up meaning of a simple positive Horn clause definition. It involves a simple transformation of the object program rules into metarules, which are then used by a metainterpreter to compute bottom up the model of the original program. The resulting algorithm is a form of semi-naive bottom-up evaluation. We discuss various reasons why this Prolog program is particularly interesting. In particular, this is perhaps the only Prolog program for which I find the use of Prolog's assert/1 to be intrinsic, easily understood, and the best, most perspicuous, way to program an algorithm. This short paper might be best characterized as a Prolog programming pearl.
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.
