A Prolog Program for Bottom-up Evaluation

Fuente: arXiv
Saved in:
Bibliographic Details
Main Author: Warren, David S.
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866929713666064384
author Warren, David S.
author_facet Warren, David S.
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2502_09223
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle A Prolog Program for Bottom-up Evaluation
Warren, David S.
Programming Languages
Databases
Logic in Computer Science
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.
title A Prolog Program for Bottom-up Evaluation
topic Programming Languages
Databases
Logic in Computer Science
url https://arxiv.org/abs/2502.09223