DRAFT TECHNICAL CORRIGENDUM 3

This document is prepared in fulfillment of WG 17 resolutions in Istanbul 2013 and Vienna 2014.

~~Deleted~~ text is marked as strike-through text, inserted text
is underlined.

C1

## 5.5.12 Options

A processor may support one or more additional options such as stream-options (7.10.2.11), close-options (7.10.2.12), read-options (7.10.3), and write-options (7.10.4) as an implementation specific feature. An invalid option`E`

shall be associated with only two error conditions: an instantiation error when there is an instance (3.95) of`E`

that is a valid option, and a domain error for the domain`when there is no instance of`

optname_option`E`

that is a valid option. Further, an instantiation error may occur in place of the domain error if a component of`E`

is a variable, and an instantiated component is required.

- NOTE — A valid option may be associated with other error conditions like 8.11.5.3 l and m.

C2

p text = [ layout text sequence (* 6.4.1 *) ] ;

C3

a) If T~~unifies with~~has the form`^(_, G)`

then ...

C4

Table 21 and 22 show the execution stack before and

after executing the control construct`call(G)`

withgoal

obtained from`G`

in step 7.8.3.1 f via 7.6.2.

N+ 1 ( (`G`

goal,N– 1), Σnil

C5

`variable_names/1`

and `singletons/1`

`variables/1`

.
`variables(Vars)`

— After inputting a term,`Vars`

shall be unified with a list of the variables in the term input, in left-to-right traversal order.

`variable_names(VN_list)`

— After inputting a

term,`VN_list`

shall be unified with a list of ele-

ments where: (1) each element is a term`A = V`

, and

(2)`V`

is a named variable of the term, and (3)`A`

is an

atom whose name is the characters of`V`

, and (4) there is exactly one element for each named variable, and (5) the elements appear in the order of the first occurrence of their variables`V`

in the term input, in left-to-right traversal order.

`singletons(VN_list)`

— After inputting a term,

`VN_list`

shall be unified with a list of elements

where: (1) each element is a term`A = V`

, and (2)`V`

is

a named variable which occurs only once in the term,

and (3)`A`

is an atom whose name is the characters of`V`

,

and (4) there is exactly one element for each named variable occuring only once, and (5) the elements appear in the order of the first occurrence of their variables`V`

in the term input, in left-to-right traversal order.

C6

`variable_names(VN_list)`

before
`numbervars(Bool)`

in analogy to
the read-option.
Modify write-option`numbervars(Bool)`

3.206 write-option:A~~ground~~term that controls the

output produced by the built-in predicate`write_term/3`

(8.14.2) and its bootstrapped * built-in predicates (see

7.10.4, 7.1.4.2).

`variable_names(VN_list)`

— Each variable`V`

is output as the sequence of characters defined by the syntax for the atom`A`

iff a term`A = V`

is an element of the list`VN_list`

. If more than one element applies, the leftmost is used.`VN_list`

is a list of terms`A = T`

with`A`

an atom and`T`

any term, possibly a variable.

`numbervars(Bool)`

— Iff`Bool`

(7.1.4.2) is`true`

a

term of the form`'$VAR'(N)`

, where`N`

is~~an~~a non-negative integer, is

output as a variable name consisting of a capital letter

possibly followed by an integer.

- NOTE 2 — Many Prolog processors modified write option
`numbervars/1`

to print arbitrary variable names. The write option`variable_names/1`

serves this purpose and avoids vulnerabilities.

C7

`variable_names/1`

, correct terminology and writing of {}, lists,
extra round bracketsa1) If`Term`

is a variable and there is an effective write-option`variable_names(VN_list)`

and there is an element`A = Term`

of the list`VN_list`

with`A`

an atom, then`A`

is output with effective write-option`quoted(false)`

.

~~a) If~~a2) Else if`Term`

is a variable, a character sequence repre-

senting that variable is output. The sequence begins

with _ (underscore) and the remaining characters are

implementation dependent. During the execution of`write_term/3`

, the

~~The~~same character sequence

is used for each occurrence of a particular variable~~in~~and a different character sequence is used for each

`Term`

. A

distinct variable~~in~~.`Term`

~~e)~~e1) If`Term`

has the form`'$VAR'(N)`

for some~~pos-~~non-negative integer

itiveN`N`

, and there is an effective write-option

`numbervars(true)`

, a variable name as defined in

subclause 7.10.4 is output,

~~g)~~e2) Else if`Term`

has the form`'.'(Head, Tail)`

, and

there is an effective write-option`ignore_ops(false)`

,

then`Term`

is output using list notation, that is:

- 1)
`[`

(open list char) is output.- 2)
`Head`

is output by recursively applying these

rules.`Head`

is preceded by`(`

(open char)

and followed by`)`

(close char), if the term could not be

re-input correctly with same set of current operators.- 3) If
`Tail`

has the form`'.'(H,T)`

then`,`

(comma

char) is output, set`Head:=H`

,`Tail:=T`

, and goto (2).- 4) If
`Tail`

is`[]`

then a closing bracket`]`

(close list

char) is output,- 5) Else a
`|`

(head tail separator char) is output,

`Tail`

is output by recursively applying these rules~~,~~.

`Tail`

is preceded by`(`

(open char)

and followed by`)`

(close char), if the term could not be

re-input correctly with same set of current operators.

~~and~~And finally,`]`

(close list char) is output.

e3) Else if`Term`

has the form`'{}'(Arg)`

, and there is an effective write-option`ignore_ops(false)`

, then`Term`

is output as a curly bracketed term (6.3.6), that is:

- 1)
`{`

(open curly char) is output.- 2)
`Arg`

is output by recursively applying these rules.- 3)
`}`

(close curly char) is output.

f) Else if`Term`

has a principal functor which is not

a current operator, or if there is an effective write-

option`ignore_ops(true)`

, then the term is output in

~~canonical form~~functional notation (6.3.3), that is:h)

- 1) The atom of the principal functor is output.
- 2)
`(`

(open char) is output.- 3) Each argument of the term is output by recursively

applying these rules. The argument is preceded by`(`

(open char) and followed by`)`

(close char), if the term could not be re-input correctly with the same set of current operators.- 4)
`,`

(comma char) is output between each successive

pair of arguments.- 5)
`)`

(close char) is output.~~If~~Else if`Term`

has a principal functor which is an

operator, and there is an effective write-option

`ignore_ops(false)`

, then the term is output in operator

form, that is:1) The atom of the principal functor is output

in front of its argument (prefix operator), between

its arguments (infix operator), or after its argument

(postfix operator). In all cases, a space is output

to separate an operator from its argument(s) if any

ambiguity could otherwise arise.Operators

`','`

and`'|'`

are output as`,`

(comma char) and`|`

(bar char) respectively.2) Each argument of the term is output by recursively

applying these rules.~~When an~~An argument~~is itself~~is preceded by (

to be output in operator form, it

(open char) and followed by ) (close char) if: (i) the argument's

principal functor is an operator whose priority is so

high that the term could not be re-input correctly with

same set of current operators, or (ii) the argument is

an atom which is a current operator, or (iii) the principal functor is output as a prefix operator`-`

and the argument is a non-negative number, or (iv) the principal functor is output as a prefix operator`-`

and the argument is output in infix or postfix operator form.

C8

`float`

to the set `ValidType`

.
7.12.2 c: Remove

`character_code_list`

`ValidDomain`

.
7.12.2 e: add comma to

```
PermissionType ∈ {
binary_stream, flag
```

C9

`_list`

to types `close_options`

and `stream_options`

. Add Note 7 for options lists`close_options_list`

— a list of close options (8.11.6),

...

`stream_options_list`

— a list of stream options (7.10.2.11),

7 When a built-in predicate has an argument`Options`

whose type is a list ofoptname-options as input, the argument is always`+`

. It is always associated with:optname_options_listA valid option may be associated with other error conditions.

- an instantiation error, when
`Options`

is a partial list, or an element of a list prefix of`Options`

is not a valid option but an instance of the element is a valid option;- a type error of the form
`type_error(list, Options)`

, when`Options`

is neither a partial list nor a list;- a domain error of the form
`domain_error(`

, when an elementoptname_option, E)`E`

of a list prefix of`Options`

is neither a valid option nor any instance of`E`

is a valid option; an instantiation error may occur in place of the domain error, if a component is a variable, and an instantiated component is required.

open(@@source_sink, @@io_mode, -stream, @@stream_options_list)

close(@@stream_or_alias, @@close_options_list)

C10

current_prolog_flag(max_arity, A), X is A + 1, functor(T, foo, X). If the Prolog flag max_arity has the value unbounded type_error(evaluable, unbounded/0) else representation_error(max_arity).

C11

`B`

by `G`

e) Constructs the clause with head`H`

and body`B`

`G`

C12

```
[a, b, f(b),
f(a)]
```

as it originally was in IS 13211-1:1995.C13

b) the goal succeeds.

C14

- c/b)
`Options`

is a partial list or has a list prefix with an element

`E`

which is a variable or which has a component

which is a variable, and an instantiated component is required.

—`instantiation_error.`

- i/e) An element
`E`

of a list prefix of the`Options`

list is neither a

variable nor a stream-option and there is no instance of`E`

that is a stream-option.

—`domain_error(stream_option, E).`

C15

- k) Parses
`C_Seq`

as a read-term~~(6.4)~~(6.2.2)`T.`

,

C16

write_canonical([1,2,3]). Succeeds, outputting the characters~~.(1,.(2,.(3,[ ]~~'.'(1,'.'(2,'.'(3,[]))) to the current output stream.

write_term(1,[quoted(non_boolean)]). domain_error(write_option,quoted(non_boolean)), write_term(1,[quoted(B)]). instantiation_error. B = true, write_term(1,[quoted(B)]). Succeeds, unifying B with true, and outputting the character 1.

C17

set_prolog_flag(date, 'July 1988'). domain_error(~~flag~~prolog_flag, date).

C18

`Y`

`VY`

:
c)`VX`

is negative and`Y`

`VY`

is not.

C19

`(^)/2`

when resulting value is not an
integer but still a real number. Adjust example

- e)
`VX`

and`VY`

are integers and`VX`

is not equal to 1 and`VY`

is less than -1`VX`

is not equal to 1, 0, or -1 and`VY`

is negative.

—`type_error(float, VX).`

- NOTE — Error condition 9.3.10.3 e is satisfied when a float as an argument is needed for a defined result.

2^(-1).~~evaluation_error(undefined).~~type_error(float, 2). 2.0^(-1). Evaluates to the value 0.5.

Editorial notes

- Mdash: — (C1),
- Sigma: Σ (C4),
- Element of: ∈ (C8),
- Ndash: – (C19).

Ulrich Neumerkel (editor)

Institut für Computersprachen E185/1

TU Wien

Argentinierstr. 8

A-1040 Wien

Austria

Telephone: +43 1 58801 18513

E-Mail: Ulrich.Neumerkel@@tuwien.ac.at

October 2013 - September 2016

Validated HTML @ 1.42 log @*** empty log message *** @ text @d82 1 a82 1 WORKING DRAFT TECHNICAL CORRIGENDUM 3 @ 1.41 log @*** empty log message *** @ text @d598 2 a599 2

`V`

,
and (4) the elements appear in the order of the first occurrence
of their variables `V`

in the term input, in left-to-right traversal order.
d189 4
a192 4
and (3) `A`

is an atom whose name is the characters
of `V`

,and (4) the elements appear in the order of the first occurrence of their variables

`V`

in the term input, in left-to-right traversal order.
d219 2
d300 1
a300 1
re-input correctly with the same set of current operators.
d310 1
a310 1
rules,d314 3 a316 2 re-input correctly with the same set of current operators,

and finally,

`]`

(close list char) is output.
d404 12
a415 1
C9

`+`*optname*_options

.
d427 1
a427 1
when the argument is a partial list, or an element of a list prefix
d430 1
a430 1
`type_error(list, Options)`

, when the argument is neither a partial list nor
d441 1
a441 1
Other error conditions may be associated with valid options.
d445 15
d591 1
a591 2
-1 `VY`

is negative
and `VX`

is not equal to 1, 0, or -1.
d594 10
@
1.38
log
@*** empty log message ***
@
text
@d81 1
a81 1
General Core

d111 1 a111 1 Further, an instantiation error may occur in place of a d116 1 a116 1

`+`*optname*_options_list

.
d409 1
a409 1
That argument will always be associated with:
d412 2
a413 1
when the argument is a partial list, or an element is not a valid
d419 2
a420 1
an element `E`

of a list prefix is neither a valid option nor any instance is a valid
d422 2
a423 2
(informative)

Editorial notes

d297 1 a297 1 re-input correctly with the same set of current operators.

d324 3 a326 3

`{`

(open curly char) is output
`Arg`

is output by recursively applying these rules
`}`

(close curly char) is output
d375 1
a375 1
(open char) and followed by ) (close char) if: (i) thed398 1 a398 1 binary_stream flag, d409 1 a409 1 That argument will always be associated with d413 1 a413 1 option but an instance of the element is a valid option. d415 1 a415 1 a list. d417 1 a417 1 form

`domain_error(`*optname*_option, E)

), when
d419 1
a419 1
option.
@
1.35
log
@*** empty log message ***
@
text
@d410 1
a410 1
an element of a list prefix is neither a valid option nor any instance is a valid
@
1.34
log
@*** empty log message ***
@
text
@d398 1
a398 1
a list of options as input, that argument will be an
@
1.33
log
@One more list prefix
@
text
@d410 1
a410 1
an element is neither a valid option nor any instance is a valid
@
1.32
log
@*** empty log message ***
@
text
@d465 1
a465 1
`Options`

is a partial list or a list with an element@ 1.31 log @Minor typos, layout @ text @d225 1 a225 1

October 2013 - @ 1.30 log @N269 @ text @d92 1 a92 1

7 When a built-in predicate has an argument whose type is d412 1 a412 1additionally, an instantation error may occur in place of the d417 1 d451 5 a455 1 b) the goal succeeds.d462 1 a462 1 8.14.2.3 b repectively: d511 1 d521 1 @ 1.29 log @Remove alternative token. Justification: http://stackoverflow.com/a/36971593/772868 @ text @d219 7 a225 11NOTE 2 — For write-option `variable_names(VN_list)`

any instance (3.95) (obtained via unification) of a term obtained with the corresponding read-option is well defined. @@@@@@ Actually, only the selection of the variable names to be printed is well defined.NOTE 3 — Many Prolog processors had modified the write option numbervars/1 to permit printing arbitrary variable names. The write option variable_names/1 should be used for this purpose to avoid vulnerabilities. @@@@@@ d407 1 a407 1

C10add alternate error to second last exampled423 1 a423 1

d425 1 a425 1a426 1

- (WDCor.3) 8.9.2.1 d432 3 d436 2 a437 5
- (WDCor.3) 8.10.3.4 example no. 20
undo the change introduced in Cor.1.That is, keep the list`[a, b, f(b), f(a)]`

as in IS 13211-1:1995.- (WDCor.3) 8.11.4.1 Add subclause d440 1 a440 1
- d442 4 a445 1 8.11.5.3 c, 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b repectively: d448 1 a448 1
- c)
`Options`

is a partial list or a list with an element

d464 1 a464 1- i) An element
`E`

of a list prefix d471 2 a473 4- (WDCor.3) 8.14.1.1 k
replace reference6.4by6.2.2. d480 3 a482 2- (WDCor.3) 8.14.2.4 Examples

Modify example. Add further examplesd505 1 a505 2- 8.17.1.4 Examples

Replace domain in error in fourth d507 1 d515 2 a516 29.3.1.3 c

Replace`Y`

by`VY`

: d522 1 a522 3

CXXX @ 1.28 log @*** empty log message *** @ text @a131 12

C2xAdd a further alternative to`token (* 6.4. *)`

@ 1.27 log @*** empty log message *** @ text @d92 1 a92 1... | comma (* 6.4 *) | bar (* 6.4 *) ;~~Deleted~~text is in Strikethrough, inserted text d132 12 d206 1 a206 1Add write-option`variable_names(VN_list)`

before option d208 2 a209 3 the read-option`variable_names(VN_list)`

.Replaceanbya non-negativein write-option. d229 1 a229 1 d243 1 a243 1 d410 1 a410 1`numbervars(Bool)`

a type error list, when the argument is neither a partial list nor d413 1 a413 1 formd496 2 a497 2`domain_error(`

), when d420 1 a420 2 Errors caused by a well-formed/valid option are not subsumed by the domain error. They are reported using different errors. d459 1 a459 1 8.11.5.3 c, 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b:optname_option, Culprit)Add examples to 8.14.2.4. a498 3 (WDCor.3) 8.14.2.4 Examples

Replace three times`.`

by`','`

and remove a space.a507 2Add further examplesd521 4 a524 2

Replace domain in error in fourth example:d528 1 a528 2 d540 1 a540 1Replace error condition for`(^)/2`

, when resulting value is not an d556 3 a558 1d562 1 @ 1.26 log @*** empty log message *** @ text @d240 3 a242 1Add as first subclause: a251 3Rename subclause a to a2d257 1 a257 1 of`write_term/3`

, the

~~the~~same character sequence

d263 3 a265 1Rename subclause e to e1 and replace:d268 1 a268 1~~e)~~e1) If`Term`

has d272 1 a272 4 subclause 7.10.4 is output,

a304 3d342 1 a342 4Add new 7.10.5 subclause e3 for {X} (Already noted in DTC1)a317 47.10.5 Replacecanonical formbyfunctional notation ;subclause f 3 must mention the required open char, close char.a340 1

h)~~If~~Else if`Term`

has a principal functor which is an

a392 2 (There should be a type`used in Template and Modes, and a corresponding`

optname_options_list`domain_error(`

). d401 4 a404 2optname_option, Culprit)a domain error, when an element is neither a valid option nor any instance is a valid option. @ 1.25 log @Precision for variable names, Feliks Kluzniak @ text @d258 1 a258 1 of`write_term/3`

,

the same character sequence

@ 1.24 log @*** empty log message *** @ text @d253 11 @ 1.23 log @*** empty log message *** @ text @d470 2 a471 2i) An element `E`

of (@@@@@@ a list prefix of`Options`

) the`Options`

list is neither a

@ 1.22 log @*** empty log message *** @ text @d403 2 d411 1 a411 1 Errors caused by a well-formed option are not subsumed by the @ 1.21 log @*** empty log message *** @ text @d393 1 a393 1 a list of options (@@@@@@ as input?), that argument will be an d410 1 a410 1 domain error. They are reported differently. @@@@@@using different errors. @ 1.20 log @*** empty log message *** @ text @d101 3 a103 3 A processor may support one or more additional options such as stream options (7.10.2.11), stream close options (7.10.2.12), read options (7.10.3), and write options (7.10.4) as an implementation specific d107 1 a107 1 for the domain`xxx_option`

d152 1 a152 2 obtained from`G`

via 7.6.2 Converting a term to the body of a clause@@@@@@ according to 7.8.3.1 f. d165 1 d170 4 d210 1 a210 1`numbervars(Bool)`

- Iff`Bool`

(7.1.4.2) is`true`

a

d218 1 d232 1 d300 1 d349 1 a349 1 1) The atom of the principal functor is output

d391 1 a391 1## 8.1.3 Errors

. d394 3 a396 3 +oname_options_list. (There should be a type oname_options_list used in Template and Modes, and a corresponding domain_error(oname_option, Culprit)). d417 2 a418 1d427 1 a427 1d468 2 a469 1i) An element`E`

of the Options list is neither a

d489 14 d510 2 a511 1 Succeeds, outputting the character 1. a514 11(WDCor.3) 8.14.2.4 Examples

Replace three times`.`

by`','`

and remove a space.write_canonical([1,2,3]). Succeeds, outputting the charactersd535 1 a535 1 integer but still a real number. d538 1 a538 1~~.(1,.(2,.(3,[ ]~~'.'(1,'.'(2,'.'(3,[]))) to the current output stream.## 9.3.10.3 e

a548 2

CXXXReplace example error@ 1.19 log @Comments by Jonathan Hodgson of 2015-09-25 @ text @d399 2 a400 1 domain error, if ...@@ @ 1.18 log @*** empty log message *** @ text @d153 1 a153 1 body of a clause. d199 2 a200 2 variable`V`

is output as the unquoted atom (@@@@@@better: is output as the sequence of characters defined by the syntax for the atom)`A`

d382 1 a382 1

C9 Add Note 7 for options lists. d405 1 d407 1 d409 10 d420 1 a422 38.5.1.4 Examples second last: Missing alternative error `type_error(evaluable,unbound)`

when Prolog flag bounded is false. @@@@@@ @ 1.17 log @*** empty log message *** @ text @d138 1 a138 1 a) If T~~unifies with~~has the form ^(_, G) d199 2 a200 1 variable`V`

is output as the unquoted atom`A`

d228 1 a228 1

C7Add writing d257 1 a257 17.10.5 subclause g: Rename rename subclause g to subclause e2.d353 1 a353 1

2) Each argument of the term is output by recursivelyG

d365 1 a365 1 argument is to be output in infix or postfix operator form. @ 1.16 log @*** empty log message *** @ text @d397 2 @ 1.15 log @*** empty log message *** @ text @d92 2 a93 1~~deleted~~text, inserted text. d110 1 a110 1 Further, an instantation error may occur in place of a d175 1 a175 1 and (4) the elements appear in the order of the first occurence d184 1 a184 1 and (4) the elements appear in the order of the first occurence d386 3 a388 3 +xxx_options_list. (There should be a type name_options_list used in Template and Modes, and a corresponding domain_error(name_option)). d398 2 a399 2 Errors that are caused by a well-formed option are not subsumed by the domain error but are signalled separately. @ 1.14 log @*** empty log message *** @ text @d14 2 a15 2 del {background: #ffe4e4 } ins {background: #e4ffe4 } a75 6 u { background: #ff0000 } s { background: #ff0000 } d143 2 a144 2 example. Add to the first paragraph, and replace in Table 22bygoal: d173 3 a175 3 atom whose name is the characters of`V`

, and (4) the elements appear in the order of their variables`V`

in the term input, in left-to-right traversal order. d183 2 a184 2 and (4) the elements appear in the order of their variables`V`

in the term input, in left-to-right traversal order. d221 3 a223 2NOTE 3 — Many processors had @@@@@@abused the write option numbervars/1 for printing arbitrary variable names. @@@@@@ d226 1 a226 1

C7Add writing a229 1 d232 1 a232 1Add as first subclause: d304 1 a304 1 ; subclause f 3 must mention the required open char, close a363 2 a366 11d424 3 a426 1

- Condition (ii) never applies, because there is a further contradicting condition in front: "When an argument is itself to be output in operator form". If we have an argument which is an atom then that atom is not be output in operator form. Only certain principal functors of arity one and two are to be output in operator form. Thus, we will never get to condition (ii).
(WDCor.3) 8.11.5.3 c: d428 1 a428 1 d434 17 a450 1 Same for 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b. d462 7 a468 11

(WDCor.3) 8.14.2.3 e

- e) An element
`E`

of the`Options`

list is neither a

variable nor a valid write-option

—`domain_error(write_option, E).`

write_term(1,[quoted(nonbool)]). domain_error(write_option,quoted(nonbool)) d470 1 a470 5 domain_error(write_option,quoted(_))The second case seems to be particularly problematic because a further instantiation would make this goal succeed.d474 2 a475 1 See also write options. d488 1 a488 1

Replace error in fourth example:d491 1 a491 1~~domain_error(flag, date).~~domain_error(prolog_flag, date). d505 1 a505 1

C@@@@@@ d521 1 a521 1

C@@@@@@ d537 14 a550 16All error subclauses (X.Y.Z.3) starting with C1: Mdash: — C3 8.2.4.1: Theta: θ C5 8.4.2: Ndash: – C14 9.1.3:

- Times: ×
- Rightwards arrow: →
- Union: ∪
- Floor: ⌊ ⌋
- Inequality: ≠
- Logical and: ∧
- Element of, not in: ∈, ∉
C15 9.3.11.1, 9.3.12.1, 9.3.13.1, C16: @ 1.13 log @*** empty log message *** @ text @d317 1 a317 1

- Pi: π
- Less or equal: ≤
~~canonical form~~functional notation, that is: d341 1 a341 1 h) Else if`Term`

has a principal functor which is an

@ 1.12 log @*** empty log message *** @ text @d109 1 a109 1 feature. An invalid option`E`

is associated with only two @ 1.11 log @*** empty log message *** @ text @d20 1 d112 1 d117 7 a123 1 instantiated argument is required. d126 3 a128 1

C2 a130 3 Add an optional layout text sequence to the fourth and last production d138 2 a141 2Replaceunified withbyhas the form d148 4 a151 1

C4Add missing term-to-body conversion in examplea153 2 Add to the first paragraph: a159 1

Replace in Table 22Gbygoal: ((`G`

goal,N-1), ...) d161 9 a169 1

C5Specify missing left-to-right traversal order to lists in d172 1 a172 1## 7.10.3 Read-options lists

d195 5 a201 6add missing write-option`variable_names(VN_list)`

in analogy to the read-option`variable_names(VN_list)`

.Replacean integerbya non-negative integer in write-option`numbervars(Bool)`

.7.10.4 add before option

`numbervars(Bool)`

: d231 4 a234 1

C7 a236 2Add writing withd238 1 a238 1`variable_names/1`

, correct writing {}, lists, extra round brackets7.10.5 add as first subclause: d249 1 a249 17.10.5 subclause a: Rename subclause a to a2d251 1 a251 17.10.5 subclause e: Rename subclause e to e1 and replace:d309 2 a310 17.10.5 subclause f 3 must mention the required open char, close d396 1 a396 1

7.12.2 e: add missing comma`PermissionType ∈ { @ 1.10 log @`

~~@ text @d114 2 a115 13 domain error if there exists terms @@@@@@~~`G`

and`O`

such thata117 1 d147 1 a147 1 Table 21 and 22 how the execution stack before and

`O`

is a valid option- both
`E`

and`O`

are an instance of`G`

; (using idempotent substitutionsθ. That is, withθ.θ=θ)`G`

contains one or more variables of`E`

- unifying
`G`

with`O`

gives a substitution affecting one or more variables that occur in`G`

and`E`

. (and there is no other`O`

that would not require this...)

after executing the @ 1.9 log @Edit markups are now~~and @ text @d99 2 a100 3~~

C1Allow explicitly extensions to options in 5.5 Extensions.5.5 Add new subclaused153 3 a155 2

C4## 7.8.3.4

d164 1 a164 1 Replace in Table 22: ((~~G~~goal, N-1), ...) d210 1 a210 1 is a non-negative d395 4 a398 3

- 8.1.3 Errors. Add Note 7:
7 When a built-in predicate has an argument whose type is d412 2 d416 5 d482 2 a483 3

Replace three times`.`

by`','`

; remove a space.a489 1d491 7 a497 4- 8.14.3.3 Examples, fourth example: Replace domain_error(flag, date). by domain_error(prolog_flag, date). d500 2 d503 1 a503 1
- Replace in 9.3.1.3 c)
`VX`

is negative d505 1 d507 1 a507 4- (WDCor.3) 9.3.10.3 e. Error condition needs to be reformulated to cover all cases where the resulting value cannot be in I but still is in R.
Here are the values for

`X^Y`

for`X, Y in -3..3`

. d509 3 a511 11 d513 4 a516 4Replace

`Y`

3 -27 -8 -1 0 1 8 27 2 9 4 1 0 1 4 9 1 -3 -2 -1 0 1 2 3 0 1 1 1 1 1 1 1 -1 ty.e ty.e -1 e.u 1 ty.e ty.e -2 ty.e ty.e 1 e.u 1 ty.e ty.e -3 ty.e ty.e -1 e.u 1 ty.e ty.e `X`

-3 -2 -1 0 1 2 3 d519 2 a520 9 -1.

by

—`type_error(float, VX).`

- e)
`VX`

and`VY`

are integers and`VY`

is negative and`VX`

is greater than 1 or less than -1 d523 1 d525 3 a527 11 alternativelyReplace error in 9.3.10.4 Examples, a531 2

- e)
`VX`

and`VY`

are integers and`VY`

is negative and`VX`

is not equal to 1, 0, or -1

—`type_error(float, VX).`

a) If Td160 1 a160 1 control constructhas the form^(_, G) then ...

`call(G)`

d162 1 a162 1 body of a clause.

`V`

, `V`

in the term input, in left-to-right traversal order.`Term`

has
the form `'$VAR'(N)`

for some itive

d261 1 a261 1

`Term`

has the form `'.'(Head, Tail)`

, andd269 1 a269 1 rules.

`Head`

d272 1
a272 1
re-input correctly with the same set of current operators.d283 1 a283 1

`Tail`

d286 1
a286 1
re-input correctly with the same set of current operators,d313 1 a313 1

`Term`

has a principal functor which is and349 1 a349 1

d395 1
d419 1
a419 1
body __Operators ','
d351 1
a351 1
and | (bar char) respectively.__
d354 3
a356 3
applying these rules.

to be output in operator form, it

d361 1 a361 1 an atom which is a current operator,

`float`

`ValidType`

.
d389 1
a389 1
7.12.2 c: Remove

`character_code_list`

`B`

`G`

`E`

which is a variable which is a variable, and an instantiated component is required.

`C_Seq`

as a read-term `T.`

,

- k) Parses
`C_Seq`

as a read-term(6.2.2)`T.`

, d474 2 a475 1

Replaced480 1 a480 10.(1,.(2,.(3,[]))) to the current output stream.

write_canonical([1,2,3]). Succeeds, outputting the characters'.'(1,'.'(2,'.'(3,[]))) d492 2 a493 2(WDCor.3) 9.3.1.3 c) `VX`

is negative andYis not. Replace by`VY`

. d517 2 a518 2 andd525 2 a526 2 and`VX`

is not equal to 1 and`VY`

is less than -1.d534 2 a535 2 and`VY`

is negative and`VX`

is greater than 1 or less than -1d539 1 a539 1 Replace in 9.3.10.4 Examples, d543 1 a543 1`VY`

is negative and`VX`

is not equal to 1, 0, or -1evaluation_error(undefined).d546 1 a546 9 by2^(-1).@ 1.7 log @2015/02/09 01:54:08 @ text @d110 2 a111 1 @@@@@@ Further, an instantation error may occur if there exists terms @ 1.6 log @*** empty log message *** @ text @d6 1 a6 1type_error(float, 2).Working draft technical corrigendum 3 d27 1 a27 1 max-width: 32em; d73 4 a76 1 { background: #ffd8d8 } d110 2 a111 1 @@@@@@ Further, an instantation error may occur if d113 9 a121 8there exists a term `O`

that is a valid optionthere exists a term `G`

with both`E`

and`O`

an instance of`G`

, and`G`

contains variables of`E`

.such that unifying `G`

with`O`

gives a substitution affecting some variables that occur in`G`

and`E`

.all instances are using idempotent substitutions θ. That is, withθ.θ=θ. d129 2 a130 1 Replace the fourth and last production d132 3 a134 6p text = ;byp text =[ layout text sequence (* 6.4.1 *) ]; d136 1 d143 1 a143 1 a) If Tunifies with^(_, G) d154 1 a154 3 Replace in Table 22((G, N-1), ...)by((. Add to: d156 2 a157 2 Table 21 and 22 how the execution stack before and after executing the control constructgoal, N-1), ...)`call(G)`

withgoald159 5 a163 1 body of a clause. a190 13## 7.10.4 Write-option

`numbervars(Bool)`

replacean integerbya non-negative integer.`numbervars(Bool)`

- Iff`Bool`

(7.1.4.2) is`true`

a

term of the form`'$VAR'(N)`

, where`N`

isa non-negativeinteger, is

output as a variable name consisting of a capital letter

possibly followed by an integer.

C7 d195 2 d198 1 a198 1 7.10.4 add: d206 8 d218 1 a218 1 any instance (3.95) of a term obtained with the corresponding d228 1 a228 1

C8 d249 17 a265 3 If`Term`

has the form`'$VAR'(N)`

for somepos-integer N, ... by

itivenon-negative. d267 24 a290 1Add new 7.10.5 subclause e for {X} (Already noted d294 1 a294 1 e2) Else if`Term`

has the form`'{}'(Arg)`

, and d305 13 a317 2(WDCor.3) 7.10.5 subclause f 3 must mention the required open char, close char. d319 6 a324 3 (WDCor.3) 7.10.5 subclause g must precede subclause f. Otherwise, writeq([a]) always has to write '.'(a,[]). That is, rename subclause g to subclause e3. d326 2 d329 2 a330 3 7.10.5 h Replace h)If`Term`

has a principal functor ... a331 1 byElse ifd333 2 a334 17.10.5 h d336 1 a336 1 h) If Term has a principal functor which is an

d338 1 a338 1 ignore_ops(false), then the term is output in operator

a346 4

d352 4 a355 5Operators`','`

d350 1 a350 4 and`|`

(bar char) respectively.

2) Each argument of the term is output by recursively

applying these rules. When an argument is itself

to be output in operator form, it is preceded by (

d360 7 a366 1 an atom which is a current operator. d379 1 d381 1 a381 2The cases - (1) and - (1^a) are not mentioned explicitly. d383 1 a383 2 The cases (1,2) and (1|2) are not mentioned. a384 1 d386 1 a386 1 Tentative new formulation: d388 2 a389 12 2) Each argument of the term is output by recursively applying these rules.d391 2 a392 4An argumentis preceded by ( (open char) and followed by ) (close char) if: (i) the principal functor is an operator whose priority is so high that the term could not be re-input correctly with the same set of current operators, or (ii) the argument is an atom which is a current operator,or (iii) the principal functor is output as a prefix operator`-`

and the argument is a non-negative number, or (iv) the principal functor is output as a prefix operator`-`

and the argument is to be output in infix or postfix operator form.(WDCor.3) 7.12.2 b: Add `float`

to the set`ValidType`

.(WDCor.3) 7.12.2 c: Remove `character_code_list`

from the set`ValidDomain`

. a393 37.12.2 e: `PermissionType ∈ {`

add comma. d418 1 a418 1 bodybinary_stream flag,, d420 1 a420 1 Replace by`B`

`G`

. @ 1.5 log @*** empty log message *** @ text @d89 1 a89 1 Istanbul 2013/Vienna 2014. d102 16 a117 4 feature. Invalid options are associated with only two kinds of error conditions: an instantiation error when there is an instance which is a valid option or @@@@@@, and a domain error when there is no instance that is a valid option. See 8.1.2 Errors, Notes. d148 1 a148 1## 7.8.3.4, Table 22

: d150 8 a157 3 Replace((G, N-1), ...)by ((goal, N-1), ...) wheregoalis obtained from G via 7.6.2. @ 1.4 log @Renumbering, new C2 @ text @d104 1 a104 1 a valid option, and a domain error when there is no instance that is a d447 7 @ 1.3 log @(sofar) @ text @d108 1 d110 13 d135 1 a135 1

C3 d139 1 a139 1 by ((goal, N-1), ...) wheregoalis d142 1 a142 1

C4Specify missing left-to-right traversal order to lists in d167 3 a169 2

C5## 7.10.4 Write-option

add: d171 1 a171 1`numbervars(Bool)`

d174 1 a174 1 isana non-negatived180 1 a180 1

C6 d204 1 a204 1NOTE 3 &mdahs; Many processors had @@@@@@abused the write option d206 1 d208 1 a208 1 d211 2 a212 3 The following changesd214 1 a214 17.10.5 add as first subclause: d225 1 a225 2 ## 7.10.5 subclause a

. Rename subclause a to a2. d227 3 a229 1(WDCor.3) 7.10.5 subclause e: Replace: If `Term`

has the d233 2 a234 4(WDCor.3) 7.10.5 subclause e. Rename subclause to e1. (WDCor.3) 7.10.5 new subclause for {X} needed (Already noted in DTC1). Tentative new clause a247 2 d389 4 a392 1 (WDCor.3) 8.14.1.1 k d555 1 a555 1

October 2013 - June 2014 @ 1.2 log @1st change thereafter @ text @a107 11 @@@@@@@@d128 2 a129 2

- NOTE — write-option
`variable_names(VN_list)`

any instance (3.95) of a term obtained with the corresponding read-option is well defined. @@@@@@ Actually, only the selection of the variable names to be printed is well defined.

C4Add left-to-right traversal order to lists in read-options. d146 4 a149 2 and (3)`A`

is an atom whose name is the characters of`V`

.

@@@@@@ idemd153 1 d165 2 d168 2 a169 3 add missing write-option`variable_names(VN_list)`

in analogy to the read-option`variable_names(VN_list)`

. @ 1.1 log @Initial revision @ text @d92 1 a92 2

C1Allow explicitly extensions to options in 5.5 Extensions.d94 1 a94 15.5.12 Add new subclause d99 7 a105 8 A processor may support one or more additional options, like stream options (7.10.2.11), stream close options (7.10.2.12), stream properties (7.10.2.13), read options (7.10.3), and write options (7.10.4) as an implementation specific feature.@@@@@@ The processing of options is associated only with instantiation errors and domain errors for the specific option domain. (Refer to 8.1.2 Notes) d108 10 d119 1 d132 1 d139 4 a142 1

## 7.10.3

a151 2 @