Linguistics 482 - Computational Linguistics Prolog Notes A. C. Brett acbrett@uvic.ca
Department of Linguistics
University of Victoria
Clearihue C139
Last updated: 23 October 1999

Strings

Strings are morpheme-like entities in the Prolog language that can be used to represent information consisting of sequences of characters that will not normally be operated upon, or be used as names, as is the case with atoms.

Strings are represented by beginning, and ending, a sequence of characters with dollar signs, $, as in the following examples:

   $This is a String.$
   $# of nouns:$
   $They spent $$20.00 on this %#*\+@ thing?!$
Strings are often used as the argument of the write/1 predicate to display messages or other information as a Prolog program is processed by the interpreter, such as in the following examples:
   write($# of Plural Nouns: $).
   write($Value on the NUM feature: $), NUM .

Linguistics 482 Prolog Introductory Notes Top of Page