pl_search_cpp 1.4
Loading...
Searching...
No Matches
pl_search_cpp Documentation

Introduction

pl_search_cpp is a C++ library that approximates Prolog predicates using a continuation-passing style. It provides a framework for defining and executing Prolog-like predicates, including support for backtracking, choice points, and unification. Its intended use is to support backtrack search in a wide range of problem domains, not as a pathway to a Prolog implementation.

Features

  • Prolog-like predicates
  • Continuation-passing style execution
  • Backtracking and choice points
  • Unification of terms
  • Support for variables, integers, floats, atoms, and C-like lists as well as user defined term types.

Usage

To use the pl_search_cpp library, include the necessary headers in your project and link against the library.

Definition of the CList class.
Definition of the Engine class and related structures.
Definition of the PAtom class.
Definition of the PFloat class.
Definition of the PInt class.
Definition of the Pred class and its derived classes.
Definition of the PVar class.
Definition of common typedefs used in the pl_search library.

Examples

The examples directory contains the following examples of using the library.

  • A solver for the SEND+MORE=MONEY puzzle (send_more_money.cpp).
  • An example of a user defined Term type (prolog_list.hpp).
  • An implementation of the Prolog append predicate using the above type (append_pred.hpp).
  • A main program ( prolog_list.cpp) that exercises the definitions above.

License

This project is licensed under the MIT License - see the LICENSE file for details.