WIPIVERSE All articles

YAP (Prolog)

YAP (Yet Another Prolog) is an open-source, high-performance implementation of the Prolog programming language, developed at LIACC/Universidade do Porto (Portugal) and at COPPE Sistemas/UFRJ (Brazil). It is widely regarded as one of the fastest available Prolog systems.

Overview

YAP's Prolog engine is based on the Warren Abstract Machine (WAM), incorporating several optimizations to improve performance. The system follows the Edinburgh tradition of Prolog and was originally designed to be largely compatible with DEC-10 Prolog, Quintus Prolog, and especially C-Prolog. Over time, it has also worked toward compatibility with SICStus Prolog and SWI-Prolog.

YAP implements most of the ISO-Prolog standard and provides a range of features, including:

  • Stream input/output
  • Socket support
  • A module system
  • Exception handling
  • A Prolog debugger
  • A C-interface for foreign code
  • Dynamic code
  • An internal database
  • Definite Clause Grammars (DCGs)
  • Saved states
  • Co-routining
  • Arrays
  • Threads

History and Development

YAP has been continuously developed since 1985. The original version was written in assembly, C, and Prolog, achieving high performance on m68k-based machines. The system was originally developed by Luís Damas and Vítor Santos Costa at Universidade do Porto, with contributions from numerous developers, including contributors from the Edinburgh Prolog library and the C-Prolog manual authors.

A notable technical paper, "The YAP Prolog System" (arXiv:1102.3896), authored primarily by Vítor Santos Costa, describes the general structure and design of the system and highlights its contributions to the logic programming community.

Releases and Platform Support

  • Stable release: 6.3.3 (21 January 2013)
  • Preview release: 7.1 (9 January 2016)
  • Operating systems supported: Linux, Windows, Solaris, macOS
  • License: Perl Artistic License 2.0

The license explicitly permits both commercial and non-commercial use of YAP.

Relationship with SWI-Prolog

YAP and SWI-Prolog have expressed a shared ambition to enhance portability beyond trivial Prolog examples, including complex libraries involving foreign code. This collaboration has informed ongoing discussion about dialect compatibility between the two systems.

Usage

YAP has been used in academic teaching and research settings. For example, the University of Wisconsin–Madison has used YAP as the primary Prolog system in its course work, noting it as "one of the fastest and most widely-used Prolog compilers."

External Links

  • Official reference manual: https://www.dcc.fc.up.pt/~vsc/yap/
  • GitHub repository: https://github.com/vscosta/yap
  • SourceForge project page: https://sourceforge.net/projects/yap/
Browse

More topics to explore

    Browse all articles