ISO/IEC 13211-1:1995
(Main)Information technology — Programming languages — Prolog — Part 1: General core
Information technology — Programming languages — Prolog — Part 1: General core
Designed to promote the applicability and portability of Prolog text and data among a variety of data processing systems. Specifies: the representation of Prolog text; the syntax and constraints of the Prolog language; the semantic rules for interpreting Prolog text; the representation of input data to be processed by Prolog; the representation of output produced by Prolog and the restrictions and limits imposed on a conforming Prolog processor.
Technologies de l'information — Langages de programmation — Prolog — Partie 1: Noyau général
General Information
Standards Content (Sample)
INTERNATIONAL
ISO/IEC
STANDARD
13211-1
First edition
1995-06-01
Information technology - Programming
languages - Prolog -
Part 1:
General core
Technologies de I’informa tion
- Langages de programmation -
Prolog -
Partie 1: Noyau g&Gral
ISO/IEC 13211-1 : 1995(E)
Page
Contents
. . .
~111
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ix
Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
1 Scope .
..........................................
1.1 Notes
2 Normative references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
.............................. 10
4 Symbols and abbreviations
........................................ 10
4.1 Notation
....................... 10
4.1.1 Basic mathematical types
................... 10
4.1.2 Mathematical and set Operators
.............................. 10
4.1.3 Other functions
............................ 11
Abstract data type: Stack
4.2
.......................... 11
4.3 Abstract data type: mapping
......................................... 11
5 Compliance
.................................. 11
5.1 Prolog processor
...................................... 12
5.2 Prolog text
...................................... 12
Prolog goal
5.3
...................................
5.4 Documentation.
....................................... 12
5.5 Extensions
.................................... 12
5.5.1 Syntax
.......................... 12
5.5.2 Predefined Operators
.................... 12
5.5.3 Character-conversion mapping
.................................... 12
5.5.4 Types.
.................................. 13
5.5.5 Directives
................................ 13
5.5.6 Side effects
............................ 13
5.5.7 Control constructs
..................................... 13
5.5.8 Flags
............................ 13
5.5.9 Built-in predicates
@ ISO/IEC 1995
Unless otherwise specified, no part of this publication may be
All rights reserved.
reproduced or utilized in any form or by any means, electronie or mechanical, including
photocopying and microfilm, without Permission in writing from the publisher.
ISO/IEC Copyright Office l Case Postale 56 l CH-l 211 Geneve 20 l Switzerland
Printed in Switzerland
ii
ISO/IEC 132114 : 1995(E)
@ ISO/IEC 1995
5.510 Evaluable functors . 13
55.11 Reserved atoms. . 13
6 Syntax .
........................................ 13
6.1 Notation
........................... 13
6.1.1 Backus Naur Form
.......................... 14
6.1.2 Abstract term Syntax
............................... 15
6.2 Prolog text and data.
................................. 15
6.2.1 Prolog text
................................ 15
6.2.2 Prolog data.
.......................................... 15
6.3 Terms
............................... 16
6.3.1 Atomic terms
..................................
6.3.2 Variables 16
6.3.3 Compound terms - functional notation . 16
6.3.4 Compound terms - Operator notation .
6.3.5 Compound terms - list notation . 19
............ 20
6.3.6 Compound terms - curly bracketed term
............... 20
6.3.7 Terms - double quoted list notation
......................................... 20
6.4 Tokens
................................ 21
6.4.1 Layout text.
.................................... 21
6.4.2 Names
.................................. 23
6.4.3 Variables
............................. 23
6.4.4 Integer numbers
6.4.5 Floating Point numbers . 23
........................... 24
6.4.6 Double quoted lists
........................... 24
6.4.7 Back quoted strings
................................ 24
6.4.8 Other tokens
.............................. 24
6.5 Processor Character set
............................ 25
6.5.1 Graphit characters
6.5.2 Alphanumeric characters . 25
6.5.3 Solo characters . 25
6.5.4 Layout characters . 25
6.5.5 Meta characters . 26
6.6 Collating sequence . 26
......................... 26
7 Language concepts and semantics
.......................................... 27
7.1 Types
................................... 27
7.1.1 Variable
.................................... 27
7.1.2 Integer
............................... 28
7.1.3 Floating Point
7.1.4 Atom . 29
7.1.5 Compound term . 29
7.1.6 Related terms . 29
...................................... 30
7.2 Term Order
7.2.1 Variable . 31
...............................
7.2.2 Floating Point 31
.................................... 31
7.2.3 Integer
..................................... 31
7.2.4 Atom
7.2.5 Compound . 31
......................................
7.3 Unification 31
..................... 31
7.3.1 The mathematical definition
...........................
7.3.2 Herbrand algorithm 31
7.3.3 Subject to occurs-check (STO) and not subject to occurs-
check (NSTO) .
.................... 33
7.3.4 Normal unification in Prolog
...................................... 33
7.4 Prolog text
7.4.1 Undefined features . 34
. . .
@ ISO/IEC 1995
ISO/IEC 13211-1 : 1995(E)
..................................
7.4.2 Directives
................................... 35
7.4.3 Clauses
........................................ 36
7.5 Database
.............. 36
7.5.1 Preparing a Prolog text for execution
...................
7.5.2 Static and dynamic procedures
....................
Private and public procedures
7.5.3
......................
A logical database update
7.5.4
........ 37
7.6 Converting a term to a clause, and a clause to a term
........... 37
7.6.1 Converting a term to the head of a clause
.......... 37
7.6.2 Converting a term to the body of a clause.
........... 37
7.6.3 Converting the head of a clause to a term
.......... 38
7.6.4 Converting the body of a clause to a term.
............................. 38
7.7 Executing a Prolog goal
.................................. 38
7.7.1 Execution
............... 38
7.7.2 Data types for the execution model-
................................ 39
7.7.3 Initialization
............................. 39
7.7.4 A goal succeeds
................................ 39
7.7.5 A goal fails
........................... 39
7.7.6 Re-executing a goal
.................. 40
7.7.7 Selecting a clause for execution
................................ 40
7.7.8 Backtracking
................................ 40
7.7.9 Side effects
................ 40
7.7.10 Executing a user-defined procedure
7.7.11 Executing a user-defined procedure with no more clauses
.................... 42
7.7.12 Executing a built-in predicate
................................. 43
7.8 Control constructs
.................................... 43
7.8.1 truel0.
..................................... 43
7.8.2 fail/O
.....................................
7.8.3 callll
7.8.4 !/O - tut .
..........................
7.8.5 (‘,‘)/2 - conjunction
............................ 47
(;)/2 - disjunction
7.8.6
.............................. 49
(->)/2 - if-then
7.8.7
............................ 50
7.8.8 (;)/2 - if-then-else
.................................... 51
7.8.9 catch/3
................................... 53
7.8.10 throwfl
.............................
7.9 Evaluating an expression
................................. 54
7.9.1 Description
.................................... 54
7.9.2 Errors
...................................... 54
7.10 Input/output
............................ 54
7.10.1 Sources and sinks
................................... 55
7.10.2 Streams
............................. 58
7.10.3 Read-Options list
............................ 58
7.10.4 Write-Options list
.............................. 59
7.10.5 Writing a term
.......................................... 60
7.11 Flags
.................... 60
7.11.1 Flags defining integer type 1
................................. 61
7.11.2 Other flags
.......................................... 61
7.12 Errors
......................... 62
7.12.1 The effect of an error
........................... 62
7.12.2 Error classification
.................................... 63
8 Built-in predicates
................
8.1 The format of built-in predicate definitions
................................. 63
8.1.1 Description
.......................... 64
S.l.2 Template and modes
.................................... 64
8.1.3 Errors
iv
@ ISO/IEC 1995 ISO/IEC 132114 : 1995(E)
.................................. 65
8.1.4 Examples
8.1.5 Bootstrapped built-in predicates . , , , , , . , , , . , , , , , , ,
................................... 65
8.2 Term unification
.......................... 65
8.2.1 (=)/2 - Prolog unify
8.2.2 unify_with_occurs_check/2 - unify . . , , , , , , , , , , , , , . .
8.2.3 (\=)/2 - . 67
not Prolog unifiable
..................................... 67
8.3 Type testing
..................................... 67
8.3.1 var/l
.................................... 68
8.3.2 atom/l
................................... 68
8.3.3 integer/1
.................................... 68
8.3.4 floatll
................................... 68
8.3.5 atomic/l
................................ 69
8.3.6 compound/l
................................... 69
8.3.7 nonvar/l
.................................. 69
8.3.8 number/l
.................................. 70
8.4 Term comparison
8.4.1 (@=<)/2 - term less than or equal, (==)/2 - term identical,
(\==)/2 - term not identical, (@<)/2 - term less than,
(@>)/2 - term greater than, (@>=)/2 - term greater than
or equal . 70
....................... 71
8.5 Term creation and decomposition
.................................. 71
8.5.1 functor/3
8.5.2 arg/3 . 72
8.5.3 (=.)/ 2 - univ . 72
8.5.4 copy-term/2 . 73
............................... 74
8.6 Arithmetic evaluation
8.6.1 (is)/2 - evaluate expression . 74
8.7 Arithmetic comparison . 74
8.7.1 (=:=)/2 - arithmetic equal, (=\=)/2 - arithmetic not equal,
(<)/2 - arithmetic less than, (=<)/2 - arithmetic less
than or equal, (>)/2 - arithmetic greater than, (>=)/2 -
arithmetic greater than or equal . 76
8.8 Clause retrieval and information . 77
................................... 77
8.8.1 clause/2
............................ 78
8.8.2 current-predicate/l
........................ 78
8.9 Clause creation and destruction
................................... 78
8.9.1 asserta/l
................................... 79
8.9.2 assertz/l
................................... 80
8.9.3 retract/l
.................................. 81
8.9.4 abolishll
..................................... 82
8.10 All solutions
................................... 82
8.10.1 findall/
................................... 83
8.10.2 bagof/3
.................................... 84
8.10.3 setof/3
.......................... 86
8.11 Stream selection and control
8.11.1 currenL.input/l . 86
8.11.2 current-output/1 . 86
................................. 87
8.11.3 set-input/l
................................ 87
8.11.4 set-output/1
8.11.5 open/4, open/3 . 87
8.11.6 close/2, close/l . 88
.................... 89
8.11.7 flush-output/l, flush-output/0
8.11.8 stream_property/2, at-end-ofstream/O, at-end-of-strearn/l . 89
.......................... 90
8.11.9 set_stream_position/2
.............................. 9 1
8.12 Character input/output
8.12.1 get_char/2, getcharll , get-Code/1 , get-Code/2 . 9 1
8.12.2 peek_char/2, peek-charll , peek-codell , peekcodel2 . 92
V
@ ISO/IEC 1995
ISO/IEC 13211-1 : 1995(E)
8.12.3 put-charl2, put-charll, put-codell, putcodel2, nl/O, nlll ,
.................................. 95
8.13 Byte inputloutput
.......................... 95
8.13.1 get-bytel2, get-bytell
....................... 96
8.13.2 peek-bytel2, peek-bytell
......................... 97
8.13.3 put-bytel2, put-bytell
.................................. 98
8.14 Term inputloutput
............. 98
8.14.1 read_term/3, read_term/2, readll, readl2
8.14.2 write_term/3, write_term/2, writell, writel2, writeqll,
......... 99
writeql2, writecanonicalll, write-canonicall2
...................................... 101
8.14.3 op/3
................................ 102
8.14.4 current-op/3
............................ 103
8.14.5 char-conversionl2
....................... 103
8.14.6 currentcharconversionl2
................................. 104
8.15 Logic and control
......................... 104
8.15.1 (\+)/l - not provable
.................................... 105
8.15.2 oncell
................................... 105
8.15.3 repeat/O
............................. 105
8.16 Atomic term processing
............................... 106
8.16.1 atomJengthl2
............................... 106
8.16.2 atomconcatl3
................................. 107
8.16.3 sub-atom/5
................................
8.16.4 atomcharsl2
............................... 109
8.16.5 atomcodes
................................. 109
8.16.6 char-codel2
.............................. 110
8.16.7 numbercharsl2
.............................. 111
8.16.8 numbercodesl2
......................... 112
8.17 Implementation defined hooks
............................. 112
8.17.1 set-prologflagl2
.......................... 112
8.17.2 current-prologflagl2
..................................... 113
8.17.3 halt/0
..................................... 113
8.17.4 halt/1
.................................... 114
9 Evaluable functors
........................ 114
9.1 The simple arithmetic functors
................. 114
9.1.1 Evaluable functors and operations
............................ 114
9.1.2 Exceptional values
................... 114
9.1.3 Integer operations and axioms
..............
9.1.4 Floating Point operations and axioms
............... 116
9.1.5 Mixed mode operations and axioms
.....................
9.1.6 Type conversion operations
.................................. 117
9.1.7 Examples
........... 119
9.2 The format of other evaluable functor definitions
.................................
9.2.1 Description
..........................
9.2.2 Template and modes
....................................
9.2.3 Errors
..................................
9.2.4 Examples
............................ 119
9.3 Other arithmetic functors
.............................. 119
9.3.1 (**)/2 - power
.....................................
9.3.2 sin/1
..................................... 120
9.3.3 cos/1
....................................
9.3.4 atanll
..................................... 121
9.3.5 expll
..................................... 121
9.3.6 log/1
.....................................
9.3.7 sqrtll
9.4 Bitwise functors . , , , , , , , , , , , , , , . , , . , , , , , , , , , , , , , , . . 122
......................
9.4.1 (>>)/2 - bitwise right shift
......................
9.4.2 (<<)/2 - bitwise left shift
vi
@ ISO/IEC 1995 ISO/IEC 13211-1 : 1995(E)
9.4.3 (/\)/2 - bitwise and . 123
9.4.4 (\/)/2 - bitwise or . 123
9.4.5 (\)/l - bitwise complement . 124
Annex
A Formal semantics . 125
A.l Introduction . 125
A.l.l Specification language: Syntax . 125
A.1.2 Specification language: semantics . 126
A.1.3 Comments in the formal specification . 126
A.1.4 About the style of the Formal Specification . 127
A.l.5 References . 127
A.2 An informal description . 127
A.2.1 Search-tree for “pure” Prolog . 128
A.2.2 Search tree for “pure” Prolog with tut . 13 1
A.2.3 Search-tree for kerne1 Prolog . 132
A.2.4 Database and database update view . 134
A.2.5 Exception handling . 135
A.2.6 Environments . 135
A.2.7 The semantics of a Standard program . 136
A.2.8 Getting acquainted with the formal specification . 136
A.2.9 Built-in predicates . 137
A.2.10 Relationships with the informal semantics of 7.7 and 7.8 138
A.3 Data structures . 138
A.3.1 Abstract databases and terms . 138
A.3.2 Predicate indicator . 143
A.3.3 Forest . 143
A.3.4 Abstract lists, atoms, characters and lists . 146
A.3.5 Substitutions and unification . 148
A.3.6 Arithmetic . 149
A.3.7 Differente lists and environments . 149
A.3.8 Built-in predicates and packets . 150
A.3.9 Input and output . 154
A.4 The Formal Semantics . 155
.................................
A.4.1 The kerne1 155
A.5 Control constructs and built-in predicates . 170
............................ 170
A.5.1 Control constructs
............................. 171
A.5.2 Term unification
................................ 172
A.5.3 Type testing
A.5.4 Term comparison . 172
................. 173
A.5.5 Term creation and decomposition
.................... 174
A.5.6 Arithmetic evaluation - (is)/2
......................... 174
A.5.7 Arithmetic comparison
.................. 174
A.5.8 Clause retrieval and information
A.5.9 Clause creation and destruction . 175
A.5.10 All solutions . 178
A.5.11 Stream selection and control . 180
A.5.12 Character inputloutput . 183
A.5.13 Byte inputloutput . 189
A.5.14 Term inputloutput . 192
A.5.15 Logic and control . 194
........................
A.5.16 Atomic term processing 195
A.5.17 Implementation defined hooks . 198
vii
ISO/IEC 132114 : 1995(E) @ ISO/IEC 1995
Foreword
ISO (the International Organization for Standardization) and IEC (the International
Electrotechnical Commission) form the specialized System for worldwide
standardization. National bodies that are members of ISO or IEC participate
in the development of International Standards through technical committees
established by the respective organization to deal with particular fields of
technical activity. ISO and IEC technical committees collaborate in fields
of mutual interest. Other international organizations, governmental and non-
governmental, in liaison with ISO and IEC, also take part in the work.
In the field of information technology, ISO and IEC have established a joint
technical committee ISOIIEC JTC 1. Draft International Standards adopted
by the joint technical committee are circulated to national bodies for voting.
Publication as an International Standard requires approval by at least 75% of
the national bodies casting a vote.
International Standard ISOIIEC 13211 was prepared by Joint Technical Committee
ISOIIEC JTC 1, Information technology, Subcommittee SC 22, Programming
languages, their environments and System software interfaces.
Annex A of this part of ISOIIEC 13211 is for information only.
. . .
VI11
@ ISO/IEC 1995
ISO/IEC 132114 : 1995(E)
Introduction
This is the first International Standard for Prolog, Part 1 (General Core). It was
produced on 20 April 1995.
There is no other International Standard for Prolog.
Prolog (Programming in Logic) combines the concepts of logical and algorithmic
programming, and is recognized not just as an important tool in AI (Artificial
Intelligente) and expert Systems, but as a general purpose high-level programming
language with some unique properties.
The language originates from work in the early 1970s by Robert A. Kowalski
while at Edinburgh University (and ever since at Imperial College, London) and
Alain Colmerauer at the University of Aix-Marseilles in France. Their efforts
led in 1972 to the use of formal logic as the basis for a programming language.
Kowalski’s research provided the theoretical framework, while Colmerauer’s
gave rise to the programming language Prolog. Colmerauer and his team then
built the first interpreter, and David Warren at the AI Department, University of
Edinburgh, produced the first Compiler.
The crucial features of Prolog are unification and backtracking. Unification
Shows how two arbitrary structures tan be made equal, and Prolog processors
employ a search strategy which tries to find a Solution to a Problem by
backtracking to other paths if any one particular search Comes to a dead end.
Prolog is good for windowing and multimedia because of the ease of building
complex data structures dynamically, and also because the concept of backing
out of an Operation is built into the language.
Prolog is taught in more UK university computing degrees than any other
programming language,
This part of ISOIIEC 13211 defines the general core features of Prolog, and
part 2 will define modules.
ix
This page intentionally left blank
INTERNATIONAL STANDARD 0 ISO/IEC ISO/IEC 13211=1:1995(E)
- Programming languages
Information technology - Prolog -
Part 1:
General core
1 Scope 1.1 Notes
Notes in this part of ISOIIEC 13211 have no effect on the
ISOIIEC 13211 is designed to promote the applicability
language, Prolog text or Prolog processors that are defined
and portability of Prolog text and data among a variety of
as conforming to this part of ISOIIEC 13211. Reasons for
data processing Systems.
including a note include:
This part of ISOIIEC 13211 specifies:
a) Cross references to other clauses and subclauses of
this part of ISOIIEC 13211 in Order to help readers find
a) The representation of Prolog text,
their way around,
b) Warnings when a built-in predicate as defined in
b) The Syntax and constraints of the Prolog language,
this part of ISOIIEC 13211 has a different meaning in
some existing implernentations.
c) The semantic rules for interpreting Prolog text,
d) The representation of input data to be processed by
2 Normative references
Prolog,
The following Standards contain provisions which, through
e) The representation of output produced by Prolog,
reference in this text, constitute provisions of this part of
and
ISOIIEC 13211. At the time of publication, the editions
indicated were valid. All Standards are subject to revision,
f) The restrictions and limits imposed on a conforming
and Parties to agreements based on this part of ISOIIEC
Prolog processor.
13211 are encouraged to investigate the possibility of
applying the most recent editions of the Standards listed
below. Members of IEC and ISO maintain registers of
NOTE - This part of ISOAEC 13211 does not specify:
currently valid International Standards.
a) the size or complexity of Prolog text that will exceed the
ISOIIEC 646 : 1991, Information technology - ISO 7-bit
capacity of any specific data processing System or language
processor, or the actions to be taken when the corresponding
coded Character set for information interchange.
limits are exceeded;
ISO 2382-15 : 1985, Data processing - Vocabulary -
b) the minimal requirements of a data processing System
Part 15: Programming languages.
that is capable of supporting an implementation of a Prolog
processor;
ISO 8859-1 : 1987, Information technology - a-bit
Single-byte coded graphic Character sets - Part I: Latin
c) the methods of activating the Prolog processor or the
alphabet No. 1.
set of commands used to control the environment in which
Prolog text is prepared for execution and executed;
ISOIIEC 9899 : 1990, Programming languages - C.
d) the mechanisms by which Prolog text is prepared for
ISOIIEC TR 10034 : 1990, Guidelines for the prepara-
use by a data processing System;
tion of conformity clauses in programming language
Standards.
e) the typographical representation of Prolog text published
for human reading;
ISOIIEC 10967-1 : 1994, Information technology - Lan-
guage independent arithmetic - Part I: Integer and
1) the user environment (top level loop, debugger, library
Joating Point arithmetic.
System, editor, Compiler etc.) of a Prolog processor.
BS 6154 : 198 1, Method of defining - Syntactic meta-
This part of ISOAEC 13211 is intended for use by implernentors
language.
and knowledgeable programmers, and is not a tutorial.
@ ISO/IEC 1995
ISO/IEC 13211-1 : 1995(E)
arity: The number of arguments of a compound
3 Definitions 39
k-m. Syntactically, a non-negative integer associated with
a functor or predicate.
This terminology for Prolog has a format modelled on that
of ISO 2382.
3.10 assert, to: To assert a clause is to add it to the
An entry consists of a Phrase (in bold type) being defined,
user-defined procedure in the database defined by the
followed by its definition. Words and phrases defined in
predicate of that clause.
the glossary are printed in italics when they are used in
other entries. When a definition contains two words or
It is unnecessary for the user-dejrzed procedure to
NOTE -
phrases defined in separate entries directly following each
already exist.
other (or separated only by a punctuation sign), * (an
asterisk) separates them.
3.11 associativity (of an Operator): Property of being
non-associative, right-associative, or left-associative (see
Words and phrases not defined in this glossary are assumed
63.4, table 4).
to have the meaning given in ISO 2382-15; if they do not
appear in ISO 2382- 15, then they are assumed to have
their usual meaning.
3.12 atom: A basic Object, denoted by an identifier
(see 6.1.2 b, 7.1.4).
For the purposes of ISO/IEC 13211, the following defini-
tions apply:
3.13 atom, null: See 3.117 - null atom.
3.1 A: The set of atoms (see 61.2 b, 7.1.4).
3.14 atom, one-char: See 3.119 - one-char atom.
32 . activation: The process of executing an activator.
3.15 atomic term: An atom or a number.
33 activator: The result of preparing a goal for exe-
3.16 axiom: A rule satisfied an operati on and all
bY
cution (see 7.7.3).
belongs.
values of the data type to which the Operation
3.4 algorithm, Herbrand: See 3.85 - Herbrand al-
backtrack, to: To return to the choicepoint of the
3.17
gorithm.
current goal in Order to attempt to re-execute it (see 7.7.8).
3.5 alias: An atom associated with an open stream (see
3.18 bias, exponent: See 3.68 - exponent bias.
7.10.2.2).
3.19 body: A goal, distinguished by its context as part
The Standard input stream has the alias user-input, and
of a rule (see 3.154).
the Standard output stream has the alias User-output (see
7.10.2.3).
3.20 bootstrapped (built-in predicate): Defined as a
NOTE - A s tream tan have many aliases, but an atom tan be
special case of a more general buiZt-in predicate (see
at most one stream.
the alias of
8.15).
36 . anonymous variable: A variable (represented in a
A procedure whose execution
3.21 built-in predicate:
term or Prolog text by -) which differs from every other
is implemented by the processor (see 8).
variable (and anonymous variable) (see 6.1.2, 6.4.3).
3.22 byte: An integer in the range [0.255] (see 7.1.2.1).
37 argument: A term which is associated with a
piedication or compound term.
3.23 C: The set of characters (see 7.1.4.1).
38 arithmetic data type: A data type whose values
3.24 callable term: An atonz or a compound term.
a;e members of 2 or R.
@ ISO/IEC 1995
ISO/IEC 132114 : 1995(E)
3.25 CC: The set of Character Codes (see 7.1.2.2). 3.37 compound term:
A functor of arity N, N positive,
together with a sequence of N arguments (see 6.1.2 e,
7.1.5).
3.26 Character: A member of C - an implementation
defined Character set (see 6.5, 7.1.4.1).
3.38 configuration: Host and target Computers, any op-
erating System(s) and Software used to operate a processor.
3.27 Character, quoted: See 3.144 - quoted charac-
ter.
3.39 conforming processor: A processor which con-
forms to all the compliance clauses (see 5.1) for processors
in this part of ISO/IEC 13211.
3.28 Character, unquoted: See 3.194 - unquoted
Character.
3.40 conforming Prolog data: Sequences of characters
and bytes that conform to all the compliance clauses for
3.29 Character-conversion mapping: A mapping on
ProZog data in this part of ISO/IEC 13211 (see 5, 6.2.2).
the set of characters, C, which specifies that, in some
Prolog text units and sources, some characters are intended
to be equivalent to other characters, and converted to those
3.41 conforming Prolog text: A sequence of characters
characters (see 3.46, 7.4.2.5, 8.14.5).
that conforms to all the compliance clauses for Prolog text
in this part of ISO/IEC 13211 (see 5, 6.2).
3.30 choicepoint: A state during execution from which
a goal tan be executed in more than one way.
3.42 construct, control: See 3.45 - control construct.
3.31 class (of an Operator): The class of an Operator
3.43 constructor, list: See 3.100 - list constructor.
defines whether it is a prefix, infix, or postfix Operator
(see 6.3.4).
A term Tl contains another term T2 if
3.44 contain, to:
either ~1 and T2 are identical terms, or Tl is a compound
3.32 clause: A fact or a rule. It has two Parts: a head,
term, one of whose arguments contains T2.
and a body.
NOTE - In ISO/IEC International Standards “clause” has the
3.45 control construct: A procedure whose definition
meaning: one of the numbered Paragraphs of a Standard. In
is part of the Prolog processor (see 7.8).
this part of ISO/IEC 13211, the context distinguishes the two
meanings.
3.46 Convc: The Character-conversion mapping on C
3.33 clause-term: A read-term T. in Prolog text where (the set of charactersj which specifies that, in some Prolog
text units and sources, some characters are converted to
T does not have principal functor ( : - ) / 1 (see 6.2.1.2).
other characters (see 3.29, 7.4.2.5, 8.14.5).
3.34 collating sequence: An implementation deflned or-
The initial value of Convc shall be identity-mappingc.
dering defined on the set C of characters (see . .
6 6)
NOTES
The set of procedures with
3.35 complete database:
directive or goal char-conversion(In,
1 A
respect to which execution is performed (see 7.5).
8.14.5) replaces Convc by
out) (7.4.2.5,
update-mappingc (In, Out, Convc).
3.36 composition (of two Substitutions): The mapping
2 Any unquoted Character c that is part of a read-term which
resulting from the application of the first Substitution
is input by read-term/ 3 (8.14.1) or as Prolog text is replaced
followed by the application of the second. Composition
by appl y-mappingc (c, Convc ).
of the Substitutions cr1 and 02 is denoted 01 o 02. When
the composition acts on a term t, it is denoted by Tat-,
3 Convc tan be inspected by calling
current_char,conversion/2 (8.14.6).
with the meaning ((tai)az).
@ ISO/IEC 1995
ISO/IEC 13211-1 : 1995(E)
3.58 directive-term: A read-term T. in Prolog text
4 The rationale for providing this facilitv is because some
extended Character sets (for example, Japanese JIS Character
where T has principal functor ( : - > / 1 (see 6.2.1.1).
Sets) are used with the basic Character set and contain the
characters equivalent to those in the basic Character set with
different encoding. In such cases, users will often wish the
3.59 dynamic (of a procedure): A dynamic procedure
meaning of characters in Prolog data and Prolog text to be the
is one whose clauses tan be inspected or altered during
same regardless of the encoding.
execution, for example by asserting or retracting * clauses
(see 7.5.2).
3.47 convert (from type A to type B): An Operation
whose signature is
convert&+B : A + B U {error}
3.60 effect, side: See 3.157 - side effect.
which converts a value of type A to type B. It shall be
an error if the conversion cannot be made.
3.61 element (of a Zist): An element of a non-empty
For example, see converting a ternz to a clause and vice
List is either the head of the Zist or an element of the taiZ
versa (7.6), Character-conversion (3.29, 7.4.2.5, 8.14.5)
of the Zist. The empty Zist has no elements.
and converting a Joating Point value to an integer value
and vice versa (9.1.6).
3.62 empty list: The atonz [ 1 (nil).
3.48 copy, renamed (of a term): See 3.150 - re-
named copy (of a term).
3.63 error: A special circumstance which Causes the
normal process of execution to be interrupted (see 7.12).
3.49 CT: The set of compound terms (see 6.1.2 e,
7.1.5).
3.64 evaluable functor: The principal functor of an
expression (see 7.9, 9).
3.50 tut: A control construct whose effect is to remove
all choicepoints back to a deeper execution state defined
by its cutparent (see 7.7.2, 7.8.4).
3.65 evaluate: To reduce an expression to its value.
(see 7.9, 8.6.1, 9).
3.51 data, conforming Prolog: See 3.40 - conform-
ing Prolog data.
3.66 exceptional value: A non-numeric value of an
expression: float-overflow, int-Overflow, underflow,
Zero-divisor, or undefined (see 7.9).
3.52 database: The set of user-defined procedures
which currently exist during execution (see 7.5).
NOTE - It is an evakation-error (E) when the value
of an expression is an exceptional value.
3.53 database, complete: See 3.35 - complete
database.
3.67 execution (Verb: to execute): The process by
which a Prolog processor tries to satisfy a goal (see 7.7.1).
type: A set of values and a set of operations
3.54 data
ate tho se values.
that manipul
3.68 exponent bias: A number added to the exponent
of a floating Point number, usually to convert the exponent
3.55 data type, arithmetic: See 3.8 - arithmetic
to an unsigned integer.
data type.
3.69 expression: An atomic term or a compo lund term
3.56 denormalized value: A jloating Point value of
which may be evaluated to produce a value (see 8.6.1, 9).
type F providing less than the full precision allowed by
F (see FD, 7.1.3).
3.70 extension: A facility provided by the processor
3.57 directive: A term D which affects the meaning of that is not specified in this part of ISO/IEC 13211 but that
Prolog text (see 7.4.2), and is denoted in that Prolog text would not Cause any ambiguity or contradiction if added
by a directive-term : - (D) . to this part of ISO/IEC 13211.
@ ISO/IEC 1995 ISO/IEC 13211-1 : 1995(E)
3.71 1”: The set of jloating Point values (see 6.1.2 d, 3.85 Herbrand algorithm: An algorithm which com-
7.1.3). putes the most general unifier MGU of a set of equations
(see 7.3.2).
true.
3.72 fact: A clause whose body is the goal
3.86 1: The set of integers (see 6.1.2 c, 7.1.2).
represented in Prolog text b y a ternz
NOTE - A fact tan be
whose princ+al functor is neither ( : - ) /l nor (:-)/2.
3.87 identical terms: Two terms are identical if they
have the same abstract Syntax (see 6.1.2).
3.73 fail, to: Execution of a goal fails if it is not
sati@ed.
muctured Object used to
3.88 identifier: A basic unstr
denote an atom, functor name or predicate name.
3.74 file name: An implementation deflned * ground
term which identifies to the processor a file which will be
used for inputloutput during the execution of the Prolog
3.89 iff: If and only if.
text.
3.90 implementation defined: Defined partly by this
3.75 flag: An atom which is associated with an imple-
part of ISO/IEC 13211, and partly by the documentation
mentation deflned or user-defined value (see 7.11).
accompanying a processor (see 5).
3.76 floating Point value: A member of the set F
.on dependent: An implernen tation
3.91 implementati
(see 6.1.2 d, 7.1.3).
dependent feature is dependent on the processor.
NOTE - This part of ISO/IEC 13211 does not require
3.77 functor: An identijier together with an arity.
an implementation dependent feature to be defined in the
accompanying processor documentation.
3.78 functor name: The identifier of a functor.
UndeJined by this part of
3.92 implementation specific:
ISO/IEC 13211 but supported by a conforming processor.
3.79 function, rounding: See 3.153 - rounding func-
tion.
NOTE - This part of ISO/IEC 13211 does not require an
implementation specific feature to be supported by a conforming
processor, but it preserves the Syntax and semantics of a strictly
conforming Prolog text which does not use it, for example,
3.80 functor, principal: See 3.134 - principal func-
defining a term Order on variables, or defining unification for
tor.
terms which are STO (3.165).
3.81 goal: A predication which is to be executed (see
3.93 indicator, predicate: See 3.13 1 - predicate in-
body, quer-y, and 7.7.3).
dicator.
3.82 ground term: An atomic term or a compound term
3.94 input/output mode: An atom which represents an
whose ,uments are all ground. A term is ground with
arg
attribute of a stream. A processor shall support the
respect to a Substitution if application of the Substitution
read, write, append (see 8.11.5,
input/output modes:
yields a ground term.
7.10.1.1).
3.83 head (of a list): The first argument of a non-empty
3.95 instance (of a term): The result of applying a
list.
Substitution to the term.
t is a term and 0 a Substitution, the instance of t by CT
3.84 head (of a rule): A predication, distinguished by If
denoted ta.
its context. is
@ ISO/IEC 1995
ISO/IEC 132114 : 1995(E)
3.110 name, file: See 3.74 - file name.
3.96 instantiated: A variable is instantiated with re-
spect to a Substitution if application of the Substitution
yields an atomic ternz or a compound term.
3.111 name, functor: See 3.78 - functor name.
A term is instantiated if any of its variables are instantiated.
name, predicate: See 3.132 - predicate name.
3.112
integer value: A member of the set 1 (see 6.1.2 c,
3.97
named variable: A variable which is not an
3.113
7.1.2).
anonymous variable (see 6 1.2 a, 6.4.3).
3.98 level, top: See 3.185 - top level.
non-empty list: A compound term whose prin-
3.114
cipal functor is the Zist constructor and whose second
argument is a List.
3.99 list: Either the empty list or a non-empty List.
NOTE - Examples: [] , [a, X] , [l, 2, -1 , [a 1 [b] ]
3.115 normalized value: A jloating Point value of type
F providing the full precision allowed by F (see 7.1.3).
3.100 list constructor: The principal functor ’ . f /2
used for constructing Zists.
3.116 NSTO: Not subject to occurs-check (see 7.3.3).
3.101 list, empty: See 3.62 - empty list.
3.117 null atom: The atonz ’ I.
3.102 list, non-empty: See 3.114 - non-empty list.
number:
3.118 An integer value orfloating Point value.
one-char atom: An atonz whose is a Single
3.103 list, partial: See 3.125 - partial list. 3.119
Character.
3.104 list, read-Options: See 3.147 - read-Options
3.120 Operand (of a compound term or predication):
list.
An argument of a compound term (predication) whose
functor name (predicate name) is an Operator.
3.105 list, write-Options: See 3.207 - write-Options
list.
3.121 Operand (of an Operation): A value supplied to
an Operation defined by a signature and one or more
axioms.
mapping: A data type MT where T is a data
3.106
type (see 4.3).
3.122 Operator: A functor name or predicate name
which allows compound terms or predications respectively,
3.107 mode, input/output: See 3.94 - inputioutput
to be expressed in prefix, infix or postfix form (see 6.3.4).
mode.
3.123 Operator, predefined: See 3.128 - predefined
3.108 most general unifier (MGU): The most general
Operator.
unifier (MGU) of terms is a minimal Substitution which
acts on the terms to make them identical. Any unifier is
an instance of some MGU. 3.124 Options, stream: See 3.167 - stream-Options.
NOTE - It is defined up to a renaming of the variables. If
3.125 partial list: A variable, or a compound term
idempotent no variable of its domain appears in the resulting
terms. An idempotent MGU tan be computed by the Herbrand whose principal functor is the List constructor and whose
algorithm (see 7.3.2).
second argument is a partial list.
NOTE - The concept of a partial list is used in 8.5.3.
3.109 name (of atom): A sequence of characters which
Examples: A, [a 1 X] , [ 1, 2 1 B]
distinguishes an atom from any different atom (see 6.1.2 b).
@ ISO/IEC 1995 ISO/IEC 132114 : 1995(E)
3.126 Position, stream: See 3.168 - stream Position. 3.140 Prolog data: A sequence of read-terms (see
6.2.2).
3.127 precision: The number of digits in the fraction
of a Jloating Point value (see 7.1.3).
3.141 Prolog text: A sequence of read-terms denoting
directives and clauses (see 6.2, 7.4).
3.128 predefined Operator: An Operator which is ini-
tially provided by the processor.
3.142 public (of a procedure): A public procedure is
one whose clauses tan be inspected during execution, for
example by calling the built-in predicate clause/Z (see
3.129 predicate: An identifier together with an arity.
7.5.3, 8.8.1).
3.130 predicate, built-in: See 3.21 - built-in predi-
3.143 query: A goal given as interactive input to the
cate.
top level.
NOTE - This part of ISO/IEC 13211 does not define or
3.131 predicate indicator: A compound term A/N,
require a processor to support the concept of top Level.
where A is an atom and N is a non-negative integer,
denoting one particular procedure (see 7.1.6.6).
3.144 quoted Character: A Character in Prolog text
or Prolog data which is a Single quoted Character
The identifier of a predicate.
3.132 predicate name:
or a double qyuoted Character or a back quoted
Character (see 6.4.2.1).
A predicate with arity N and a
3.133 predication:
NOTE - For example, ’ a ’ ‘b\ ’ c I contains 5 quoted characters
sequence of N arguments.
(3) b, (4) ’ (a meta escape sequence), (5) c.
(1) a, 69 I,
3.134 principal functor: The principal functor of a
3.145 R: The set of real numbers (see 4.1 .l).
compound term is F/N if the functor of the compound
ternz is F and its arity is N.
3.146 read-Option: A compound term with uninstanti-
The principal functor of an atomic term is C/ o if the
ated * arguments which amplifies the results produced
atomic term is C.
by the built-in predicate read-term/3 (8.14.1) and the
bootstrapped * built-in predicates based on it (see 7.10.3).
3.135 private (of a procedure): A private procedure is
one whose clauses cannot be inspected during execution.
(see 7.5.3).
A list of read-Options.
3.147 read-Options list:
A control construct, a built-in pred-
3.136 procedure:
read-term: A term followed by an end token.
3.148
icate, or a user-deBned procedure. A procedure is either
(see 6.2.2, 6.4.8).
static or dynamic. A procedure is either private or
...








Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.
Loading comments...