head 1.43; access; symbols; locks ulrich:1.43; strict; comment @# @; 1.43 date 2016.09.29.14.42.39; author ulrich; state Exp; branches; next 1.42; 1.42 date 2016.09.29.14.36.37; author ulrich; state Exp; branches; next 1.41; 1.41 date 2016.09.28.08.36.44; author ulrich; state Exp; branches; next 1.40; 1.40 date 2016.09.28.08.20.19; author ulrich; state Exp; branches; next 1.39; 1.39 date 2016.09.23.18.06.26; author ulrich; state Exp; branches; next 1.38; 1.38 date 2016.09.20.15.16.53; author ulrich; state Exp; branches; next 1.37; 1.37 date 2016.09.20.09.08.34; author ulrich; state Exp; branches; next 1.36; 1.36 date 2016.09.11.15.00.16; author ulrich; state Exp; branches; next 1.35; 1.35 date 2016.09.09.08.38.27; author ulrich; state Exp; branches; next 1.34; 1.34 date 2016.09.08.10.28.05; author ulrich; state Exp; branches; next 1.33; 1.33 date 2016.09.07.16.24.09; author ulrich; state Exp; branches; next 1.32; 1.32 date 2016.09.07.16.21.18; author ulrich; state Exp; branches; next 1.31; 1.31 date 2016.09.03.16.20.30; author ulrich; state Exp; branches; next 1.30; 1.30 date 2016.08.22.20.54.10; author ulrich; state Exp; branches; next 1.29; 1.29 date 2016.08.22.16.55.31; author ulrich; state Exp; branches; next 1.28; 1.28 date 2016.08.12.09.48.11; author ulrich; state Exp; branches; next 1.27; 1.27 date 2016.04.11.11.05.24; author ulrich; state Exp; branches; next 1.26; 1.26 date 2016.04.07.13.53.12; author ulrich; state Exp; branches; next 1.25; 1.25 date 2016.04.07.13.49.58; author ulrich; state Exp; branches; next 1.24; 1.24 date 2016.03.28.06.43.15; author ulrich; state Exp; branches; next 1.23; 1.23 date 2016.03.26.12.19.10; author ulrich; state Exp; branches; next 1.22; 1.22 date 2016.03.21.21.14.39; author ulrich; state Exp; branches; next 1.21; 1.21 date 2016.01.01.12.27.33; author ulrich; state Exp; branches; next 1.20; 1.20 date 2015.09.26.14.56.45; author ulrich; state Exp; branches; next 1.19; 1.19 date 2015.09.26.14.51.59; author ulrich; state Exp; branches; next 1.18; 1.18 date 2015.09.26.13.30.53; author ulrich; state Exp; branches; next 1.17; 1.17 date 2015.09.12.13.44.41; author ulrich; state Exp; branches; next 1.16; 1.16 date 2015.09.12.13.40.44; author ulrich; state Exp; branches; next 1.15; 1.15 date 2015.08.12.12.09.17; author ulrich; state Exp; branches; next 1.14; 1.14 date 2015.08.04.11.24.44; author ulrich; state Exp; branches; next 1.13; 1.13 date 2015.07.30.13.42.23; author ulrich; state Exp; branches; next 1.12; 1.12 date 2015.07.21.11.45.58; author ulrich; state Exp; branches; next 1.11; 1.11 date 2015.07.19.16.54.07; author ulrich; state Exp; branches; next 1.10; 1.10 date 2015.06.19.21.52.29; author ulrich; state Exp; branches; next 1.9; 1.9 date 2015.06.16.12.10.58; author ulrich; state Exp; branches; next 1.8; 1.8 date 2015.06.16.11.31.34; author ulrich; state Exp; branches; next 1.7; 1.7 date 2015.06.01.17.19.59; author ulrich; state Exp; branches; next 1.6; 1.6 date 2015.01.29.11.13.22; author ulrich; state Exp; branches; next 1.5; 1.5 date 2015.01.28.12.21.45; author ulrich; state Exp; branches; next 1.4; 1.4 date 2014.08.29.15.20.28; author ulrich; state Exp; branches; next 1.3; 1.3 date 2014.08.12.17.20.45; author ulrich; state Exp; branches; next 1.2; 1.2 date 2014.07.28.14.22.23; author ulrich; state Exp; branches; next 1.1; 1.1 date 2014.07.22.07.48.51; author ulrich; state Exp; branches; next ; desc @WDCor3 starting immediately after WG17 meeting @ 1.43 log @DCor.3 @ text @ WDCor3 Working draft technical corrigendum 3

Information technology - Programming languages - Prolog - Part 1: General Core
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 Allow explicitly extensions to options in 5.5 Extensions. Add new subclause

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 optname_option when there is no instance of 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 Add an optional layout text sequence to the fourth and last production

6.2.1 Prolog text

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

C3 Replace unifies with by has the form

7.1.6.3 Iterated-goal term

a) If T unifies with has the form ^(_, G) then ...

C4 Add term-to-body conversion in example. Add to the first paragraph, and replace in Table 22 G by goal :

7.8.3.4 Examples

Table 21 and 22 show the execution stack before and
after executing the control construct call(G) with goal
obtained from G in step 7.8.3.1 f via 7.6.2
.

Table 22

N + 1     ( (G goal, N – 1),     Σ    nil

C5 Specify left-to-right traversal order in read-options variable_names/1 and singletons/1. Clarify unification for variables/1.

7.10.3 Read-options list

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 Add write-option variable_names(VN_list) before numbervars(Bool) in analogy to the read-option. Modify write-optionnumbervars(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).

7.10.4 Write-options list

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 Add writing with variable_names/1, correct terminology and writing of {}, lists, extra round brackets

7.10.5 Writing a term


Add as first subclause a1, rename subclause a to a2 and modify:
a1) 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
Term. A
and a different character sequence is used for each
distinct variable in Term.

Rename subclause e to e1 and replace, rename subclause g to e2 and add, add new subclause e3 for {X} already noted in DTC1, modify subclauses f and h:
e) e1) If Term has the form '$VAR'(N) for some pos-
itive
non-negative integer N 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.

andAnd 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:
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.
h) 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
to be output in operator form, it
is preceded by (
(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

7.12.2 Error classification

7.12.2 b: Add float to the set ValidType.
7.12.2 c: Remove character_code_list from the set ValidDomain.
7.12.2 e: add comma to PermissionType ∈ { binary_stream, flag
C9 Add _list to types close_options and stream_options. Add Note 7 for options lists

8.1.2.1 Type of an argument

close_options_list — a list of close options (8.11.6),
...
stream_options_list — a list of stream options (7.10.2.11),

8.1.3 Errors

7 When a built-in predicate has an argument Options whose type is a list of optname-options as input, the argument is always +optname_options_list. It is always associated with:
  1. 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;
  2. a type error of the form type_error(list, Options), when Options is neither a partial list nor a list;
  3. a domain error of the form domain_error(optname_option, E), when an element 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.
A valid option may be associated with other error conditions.

8.11.5.2 Template and modes

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

8.11.6.2 Template and modes

close(@@stream_or_alias, @@close_options_list)

C10 Add alternate error to second last example

8.5.1.4 Examples

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 Replace B by G

8.9.2.1 Description (assertz/1)

e) Constructs the clause with head H and body B G

C12 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 it originally was in IS 13211-1:1995.
C13 add subclause

8.11.4.1

b) the goal succeeds.

C14 Add to the four subclauses 8.11.5.3 c, 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b respectively:
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.
Add to the four subclauses 8.11.5.3 i, 8.11.6.3 e, 8.14.1.3 e, 8.14.2.3 e using in place of stream-option for the latter three close-option, read-option, and write-option respectively:
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 Replace reference 6.4 by 6.2.2.

8.14.1.1 k

k) Parses C_Seq as a read-term (6.4) (6.2.2) T.,

C16 Modify example. Add three further examples

8.14.2.4 Examples

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 Replace domain in error in fourth example:

8.17.1.4 Examples

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

C18 Replace Y by VY:

9.3.1.3 c

c) VX is negative and Y VY is not.

C19 Replace error condition for (^)/2 when resulting value is not an integer but still a real number. Adjust example

9.3.10 (^)/2 – integer power

9.3.10.3 Errors

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.

9.3.10.4 Examples

2^(-1).
   evaluation_error(undefined). type_error(float, 2).

2.0^(-1).
   Evaluates to the value 0.5.

Annex B (informative)
Editorial notes

Check that there are no @@@@@@.

Unusual characters

Check the following characters are correctly printed.
Mdash: — (C1),
Sigma: Σ (C4),
Element of: ∈ (C8),
Ndash: – (C19).

Background

These faults were noted after preparing for publication the text of Technical Corrigendum 2 ISO/IEC 13211-1:1995 Cor.2:2012.

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

Document history

Version control
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
NOTE — Error condition 9.3.10.3 e is satisfied when only a float as an argument has a defined result. d612 3 @ 1.40 log @!001.22#2 edits+ @ text @d117 1 a117 1 as in 8.11.5.3 l and m. @ 1.39 log @!001.22 edits @ text @d116 1 a116 1
NOTE — Other error conditions may be associated with valid options d180 4 a183 3 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. 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 Add Note 7 for options lists d422 1 a422 1 +optname_options. d427 1 a427 1 when the argument is a partial list, or an element of a list prefix d430 1 a430 1
  • a type error of the form 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
    NOTE — A valid option may still imply further errors ; d209 1 a209 1

    7.10.4 Write-option list

    d405 3 a407 3 7 When a built-in predicate has an argument whose type is a list of optname-options as input, that argument will be a +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
  • additionally, an instantiation error may occur in place of the domain error, if a component is a variable and an instantiated d426 1 a426 1 Errors caused by a valid option are reported due to other error conditions. d576 1 a576 1

    Annex B
    (informative)
    Editorial notes

    d593 1 a593 4 the text of ISO/IEC 13211-1:1995 Prolog: Part 1 - General Core, subsequent lists of errors noted by WG17 and after preparing for publication the text of Technical Corrigendum 1 and Technical Corrigendum 2. @ 1.37 log @*** empty log message *** @ text @d424 1 a424 1 Errors caused by a valid option are reported using different errors. @ 1.36 log @*** empty log message *** @ text @d20 1 a20 1 max-width:45em; d31 1 a31 1 max-width:35em; d42 1 a42 1 max-width:35em; d201 8 d281 1 a281 1 itive non-negative integer N, and there is an effective write-option
    d297 1 a297 1 re-input correctly with the same set of current operators.
    d324 3 a326 3
    1) { (open curly char) is output
    2) Arg is output by recursively applying these rules
    3) } (close curly char) is output d375 1 a375 1 (open char) and followed by ) (close char) if: (i) the
    d398 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
    c/b) Options is a partial list or a list with an element
    @ 1.31 log @Minor typos, layout @ text @d225 1 a225 1
    NOTE 2 — Many Prolog processors provided a modified write option d574 4 a577 14
    All error subclauses (X.Y.Z.3)
    Mdash: —, Theta: θ, Ndash: –, Times: ×, Rightwards arrow: →, Union: ∪, Floor: ⌊ ⌋, Inequality: ≠, Logical and: ∧, Element of, not in: ∈, ∉, Pi: π Less or equal: ≤ d597 1 a597 1
    October 2013 - @ 1.30 log @N269 @ text @d92 1 a92 1 Deleted text is marked as strikethrough text, inserted text d99 1 a99 1

    5.5.12 Options.

    d101 1 d119 1 d203 1 d210 1 d222 1 d232 1 d245 1 d253 1 d309 1 d320 1 d395 3 a397 1
    7 When a built-in predicate has an argument whose type is d412 1 a412 1
  • additionally, 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 11
    NOTE 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
    C10 add alternate error to second last example d423 1 a423 1
    d425 1 a425 1
      a426 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 reference 6.4 by 6.2.2. d480 3 a482 2
    • (WDCor.3) 8.14.2.4 Examples

      Modify example. Add further examples d505 1 a505 2

    • 8.17.1.4 Examples

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

    • 9.3.1.3 c

      Replace Y by VY: d522 1 a522 3


    CXXX @ 1.28 log @*** empty log message *** @ text @a131 12
    C2x Add a further alternative to token (* 6.4. *)
       ...
       | comma (* 6.4 *)
       | bar (* 6.4 *)
       ;
    
    @ 1.27 log @*** empty log message *** @ text @d92 1 a92 1 Deleted text is in Strikethrough, inserted text d132 12 d206 1 a206 1 Add write-option variable_names(VN_list) before option d208 2 a209 3 the read-option variable_names(VN_list). Replace an by a non-negative in write-option numbervars(Bool). d229 1 a229 1 d243 1 a243 1 d410 1 a410 1
  • a type error list, when the argument is neither a partial list nor d413 1 a413 1 form domain_error(optname_option, Culprit)), 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: d496 2 a497 2
  • 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 2 Add further examples d521 4 a524 2

    Replace domain in error in fourth example:

    d528 1
    a528 2
    
    
    d540 1
    a540 1
    Replace error condition for (^)/2, when resulting value is not an 
    d556 3
    a558 1
    
    d562 1
    @
    
    
    1.26
    log
    @*** empty log message ***
    @
    text
    @d240 3
    a242 1
    
    Add as first subclause: a251 3
    Rename subclause a to a2 d257 1 a257 1 of write_term/3, the
    the same character sequence
    d263 3 a265 1
    Rename 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,

  • 7.10.5 subclause g: Rename subclause g to subclause e2. d274 1 a274 1
    a304 3
    Add new 7.10.5 subclause e3 for {X} (Already noted in DTC1) a317 4
    7.10.5 Replace canonical form by functional notation ; subclause f 3 must mention the required open char, close char. a340 1
    d342 1 a342 4
    7.10.5 h
    h) If Else if Term has a principal functor which is an
    a392 2 (There should be a type optname_options_list used in Template and Modes, and a corresponding domain_error(optname_option, Culprit)). d401 4 a404 2
  • 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 2
    i) 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 1
    d427 1
    a427 1
    
    d468 2 a469 1
    i) 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 characters
    .(1,.(2,.(3,[ ] '.'(1,'.'(2,'.'(3,[])))
        to the current output stream.
    
    d535 1 a535 1 integer but still a real number
    . d538 1 a538 1

    9.3.10.3 e

    a548 2
    CXXX Replace 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 3
  • 8.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
    C7 Add writing d257 1 a257 1
    7.10.5 subclause g: Rename rename subclause g to subclause e2. d353 1 a353 1

    2) Each argument of the term is output by recursively
    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 22
    G by goal: 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 2

    NOTE 3 — Many processors had @@@@@@abused the write option numbervars/1 for printing arbitrary variable names. @@@@@@ d226 1 a226 1
    C7 Add writing a229 1 d232 1 a232 1
    Add as first subclause: d304 1 a304 1 ; subclause f 3 must mention the required open char, close a363 2 a366 11
    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).
    d424 3 a426 1
  • (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 16
    All 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:
    Pi: π
    Less or equal: ≤
    @ 1.13 log @*** empty log message *** @ text @d317 1 a317 1 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 2 Replace unified with by has the form d148 4 a151 1
    C4 Add missing term-to-body conversion in example a153 2 Add to the first paragraph: a159 1

    Replace in Table 22 G by goal: ((G goal, N-1), ...) d161 9 a169 1


    C5 Specify missing left-to-right traversal order to lists in d172 1 a172 1

    7.10.3 Read-options lists

    d195 5 a201 6 add missing write-option variable_names(VN_list) in analogy to the read-option variable_names(VN_list). Replace an integer bya non-negative integer in write-option numbervars(Bool).

    7.10.4 add before option numbervars(Bool): d231 4 a234 1


    C7 a236 2 Add writing with variable_names/1, correct writing {}, lists, extra round brackets d238 1 a238 1
    7.10.5 add as first subclause: d249 1 a249 1
    7.10.5 subclause a: Rename subclause a to a2 d251 1 a251 1
    7.10.5 subclause e: Rename subclause e to e1 and replace: d309 2 a310 1
    7.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 that
    • 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...)
    a117 1 d147 1 a147 1 Table 21 and 22 how the execution stack before and
    after executing the @ 1.9 log @Edit markups are now and @ text @d99 2 a100 3
    C1 Allow explicitly extensions to options in 5.5 Extensions.

    5.5 Add new subclause d153 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 1
      d491 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 4
      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.ety.e -1e.u 1ty.ety.e
      -2 ty.ety.e 1e.u 1ty.ety.e
      -3 ty.ety.e -1e.u 1ty.ety.e
       
      X -3 -2 -1 0 1 2 3
      Replace

      d519 2 a520 9 -1.
      type_error(float, VX).
      by
      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 alternatively
      e) VX and VY are integers and VY is negative and VX is not equal to 1, 0, or -1
      type_error(float, VX).
      Replace error in 9.3.10.4 Examples, a531 2
    @ 1.8 log @*** empty log message *** @ text @d14 3 d96 2 a97 1 d139 1 a139 1 p text = [ layout text sequence (* 6.4.1 *) ] ; d146 2 a147 1 Replace d149 1 a149 1 a) If T unifies with ^(_, G) d152 1 a152 4 by
    a) If T has the form ^(_, G) then ...
    d160 1 a160 1 control construct call(G) with goal
    d162 1 a162 1 body of a clause.
    d164 1 a164 3 Replace in Table 22 ((G, N-1), ...) by ((goal, N-1), ...). d176 1 a176 1 atom whose name is the characters of V, and (4) d178 1 a178 1 in the term input, in left-to-right traversal order. d186 2 a187 2 and (4) the elements appear in the order of their variables V in the term input, in left-to-right traversal order. d210 1 a210 1 is a non-negative d251 3 a253 3 e) e1) If Term has the form '$VAR'(N) for some pos-
    itive
    non-negative integer N, and there is an effective write-option
    d261 1 a261 1 g) e2) Else if Term has the form '.'(Head, Tail), and
    d269 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 canonical form functional notation, that is: d322 1 a322 1 The argument d325 1 a325 1 re-input correctly with the same set of current operators. d337 1 a337 1 h) Else if Term has a principal functor which is an
    d349 1 a349 1

    Operators ',' d351 1 a351 1 and | (bar char) respectively. d354 3 a356 3 applying these rules. When An argument is itself
    to be output in operator form, it
    is preceded by (
    d361 1 a361 1 an atom which is a current operator, or (iii) the d365 1 a365 1 argument is to be output in infix or postfix operator form. d387 1 a387 1 7.12.2 b: Add float to the set ValidType. d389 1 a389 1
    7.12.2 c: Remove character_code_list from d393 1 a393 2 binary_stream flag,
    d395 1 d419 1 a419 1 body B, d421 1 a421 1 Replace by G. d435 2 a436 2 E which is a variable or which has a component
    which is a variable, and an instantiated component is required.
    d447 1 a447 8

    k) Parses C_Seq as a read-term (6.4) T.,
  • by
    k) Parses C_Seq as a read-term (6.2.2) T., d474 2 a475 1

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

    by
    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 and Y is not. Replace by VY. d517 2 a518 2 and VX is not equal to 1 and VY is less than -1. d525 2 a526 2 and VY is negative and VX is greater than 1 or less than -1 d534 2 a535 2 and VY is negative and VX is not equal to 1, 0, or -1 d539 1 a539 1 Replace in 9.3.10.4 Examples, d543 1 a543 1 evaluation_error(undefined). d546 1 a546 9 by
    2^(-1).
       type_error(float, 2).
    
    @ 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 1 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 8
  • there exists a term O that is a valid option
  • there 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 6
    p text = ;
    
    by
    p text = [ layout text sequence (* 6.4.1 *) ] ;
    d136 1
    d143 1
    a143 1
    a) If T unifies with ^(_, G)
    d154 1
    a154 3
    Replace in Table 22 ((G, N-1), ...)
    by ((goal, N-1), ...).
    Add to:
    d156 2
    a157 2
    Table 21 and 22 how the execution stack before and after executing the
    control construct call(G)  with goal
    d159 5
    a163 1
    body of a clause.
    a190 13
    

    7.10.4 Write-option numbervars(Bool)

    replace an integer bya non-negative integer.
    numbervars(Bool) - Iff Bool (7.1.4.2) is true a
    term of the form '$VAR'(N), where N is a non-negative integer, 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 some pos-
    itive
    integer N, ... by non-negative. d267 24 a290 1
    Add 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 by Else if d333 2 a334 1
  • 7.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
  • Add: d348 1 a348 3
    Operators ',' d350 1 a350 4 and | (bar char) respectively.
    d352 4 a355 5
    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 2
  • The 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. An argument is 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.
    d391 2 a392 4
  • (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 3
  • 7.12.2 e: PermissionType ∈ { binary_stream flag, add comma. d418 1 a418 1 body B, d420 1 a420 1 Replace by 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), ...) where goal is 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), ...) where goal is d142 1 a142 1
    C4 Specify missing left-to-right traversal order to lists in d167 3 a169 2
    C5

    7.10.4 Write-option numbervars(Bool)

    add: d171 1 a171 1
    d174 1 a174 1 is an a non-negative d180 1 a180 1
    C6 d204 1 a204 1
    NOTE 3 &mdahs; Many processors had @@@@@@abused the write option d206 1 d208 1 a208 1 d211 2 a212 3 The following changes d214 1 a214 1
  • 7.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 @@@@@@@@
    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.
    d128 2 a129 2
    C4 Add 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.
    @@@@@@ idem d153 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
    C1 Allow explicitly extensions to options in 5.5 Extensions. d94 1 a94 1
  • 5.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 @