A controlling scheme for Prolog through count terms

Young K. Nam*, Lawrence J. Henschen

*Corresponding author for this work

Research output: Contribution to journalArticlepeer-review


We propose an extension to Prolog called the count term for controlling Prolog execution. The purpose is to allow the programmers as well as the users to have greater flexibility in controlling the execution behavior of Prolog programs and for limiting the number of answers or proofs retrieved when Prolog is used as a database query language. Both syntax and operational semantics of the count term are defined. An implementation strategy based on WAM (Warren Abstract Machine) is provided. We analyze the possible meanings one might associate with the count term. The possible replacement of cut and fail by the count term is presented. The ease of analysis of programs with count terms is discussed.

Original languageEnglish (US)
Pages (from-to)235-245
Number of pages11
JournalComputer Languages
Issue number4
StatePublished - Oct 1993


  • Prolog control
  • count term
  • cut
  • programming languages

ASJC Scopus subject areas

  • General Computer Science


Dive into the research topics of 'A controlling scheme for Prolog through count terms'. Together they form a unique fingerprint.

Cite this