ISO/IEC JTC1 SC22 WG17 N250
Draft for further corrigenda.

(Version for Istanbul, 2013-08-23)

This document is an attempt to look at all issues that might be part of the next corrigendum. (The numbering of items changes, when new items are inserted, so please always refer to the content in addition to the number)

  1. (m)
    3.146 read-option: A compound term with uninstanti-
    ated
    * arguments which amplifies the results produced
    by the built-in predicate read-term/3 (8.14.1) and the
    bootstrapped * built-in predicates based on it (see 7.10.3).
    Does this mean that every read-option even as an extension has to have uninstantiated arguments? How many such arguments? Augments?
  2. 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).
    Reconsider this for variable_names/1.
  3. 5.5 Extensions: replace "in the part of" by this.
  4. 5.5.10 Change 2nd sentence
    A processor may support the value of an expression being a value of an additional type instead of an exceptional value.
    to
    A processor may support the value of an expression being some value including a value of an additional type instead of an exceptional value or error.
    Illustrative example from IF, SWI, YAP:
    ?- X is (1 rdiv 2) - (1 rdiv 2), integer(X).
    X = 0.
    
    This could be controversial and definitely needs an explicit resolution!
  5. 5.5.10 Note, replace is/2 by (is)/2.
  6. 5.5.12 Add new subclause

    5.5.12 Input/output.

    A processor may support one or more additional 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.
  7. 6.3.1.2 Negative Numbers. There is some perceived ambiguity that maybe needs clarification:
    A term which is the name - followed directly by a numeric
    constant denotes the corresponding negative constant.
    What means "directly" and what is a "numeric constant". 6.1.2 c and d defined them - they have no sign. A numeric constant is either an integer constant (* 6.4.4 *) or a float number token (* 6.4.5 *). There is even a separate Note in 6.4.5 to insist that a float number token is unsigned.

    Compatibility: integer(- /**/ 1).: Succeeds in B, Ciao, IF, Minerva, SICStus, YAP, XSB, GNU (new!). Fails in ECLiPSe, GNU, SWI.

    History:

    N92 1st CD 1992-03
    The prefix operator - with a numeric constant as operand
    denotes the corresponding negative constant.
    N110 revised CD 1993-03
    idem
    N128 DIS 13211-1 1994-03
    A term which is the name - followed directly by a numeric
    constant denotes the corresponding negative constant.
    ISO/IEC 13211-1 1995-06-01
    A term which is the name - followed directly by a numeric
    constant denotes the corresponding negative constant.
    On the other hand the EBNF-rules in 6.3.1.2 for negative numbers are very clear:
    term = name, integer ;
    
    term = name, float number ;
    
    The nonterminals integer and float number are defined in 6.4 Tokens. Thus, both permit an optional layout text sequence.
    integer (* 6.4 *)
       = [ layout text sequence (* 6.4.1 *) ] ,
         integer token (* 6.4.4 *) ;
    float number (* 6.4 *)
       = [ layout text sequence (* 6.4.1 *) ] ,
         float number token (* 6.4.5 *) ;
    
    Would it have been intended to disallow spaces between - and the numeric constant, then the rules in 6.3.1.2 would have been:
    term = name, integer token ;
    
    term = name, float number token;
    
    Further, the Prolog text - 1. cannot be misread as a compound term (-)/1, because in 6.3.4.2 Operators as functors, the minus sign is explicitly excluded.
              term = op, term ;
    Abstract: f(a)   f   a
    Priority: n      n   n
    Specifier:       fy
    Condition:If a is a numeric constant, f is not -
    Condition:The first token of a is not open ct
    
              lterm = op, term ;
    Abstract: f(a)    f   a
    Priority: n       n   n-1
    Specifier:        fx
    Condition:If a is a numeric constant, f is not -
    Condition:The first token of a is not open ct
    
  8. 6.3.4.4 Note 2: (,)/2 by (',')/2
  9. 6.4.2 up to 6.5.3 add graphic solo: (probably no longer needed, provided graphic characters in the extended character set are never solos).
    1. 6.4.2 Names. In definition of name token: Replace
         | semicolon token (* 6.4.2 *)
         | cut token (* 6.4.2 *) ;
      
      by
         | graphic solo token (* 6.4.3 *) ;
      
      (@@@ Also update 6.1.2 b 3)
    2. 6.4.2 Names. At the end. Replace
      semicolon token (* 6.4.2 *)
         = semicolon char (* 6.5.3  *) ;
      
      cut token (* 6.4.2 *)
         = cut char (* 6.5.3 *) ;
      
      by
      graphic solo token (* 6.4.2 *)
         = graphic solo char (* 6.5.3 *)
      
    3. 6.5.3 Solo characters. In definition of solo char: Replace
         = cut char (* 6.5.3 *)
      
      by
         = graphic solo char (* 6.5.3 *)
      
      Delete line
         | semicolon char (* 6.5.3 *)
      
      Replace definitions
      cut char (* 6.5.3 *) = "!" ;
      semicolon char (* 6.5.3 *) = ";" ;
      
      by
      graphic solo char = "!" | ";" ;
      
      or by
      graphic solo char = cut char | semicolon char ;
      
    This change is only needed if there is a need for more graphic solo chars in extended character sets.
  10. Small Prolog text: Related to outputting .. Testfiles, they should all compile!
  11. 6.5.4 2 times dependent replace by defined. But: horizontal tab char is not strictly needed. See 6.4.2.1. A control escape sequence... Similarily replace 7.10.2.6
    followed by an implementation dependent new line character (6.5,
    6.5.4).
    
  12. 7.1.2 Note 3: A processor may provide as an extension more than one integer type. Each integer type shall have a distinct set of the operations described in 9.1.3. Where is equality between different integer types defined?
  13. 7.1.6.3 Iterated-goal term. Add to subclause
    a) If T is not a variable and unifies with ^(_, G) then ...
    alternatively
    a) If T has the form ^(_, G) then ...
  14. 7.1.6.8 Predicate indicator list: The empty list is not allowed. Shouldn't it be allowed? Otherwise, shouldn't a domain_error(non_empty_list, []) be defined?
  15. 7.4.3, last paragraph: replace "directive indicating" by "indicating".
  16. 7.7.12 d: replace "(see 8) This" by "(see 8). This"
  17. 7.8 Control constructs, second par:
    The format and notation of the definition of each control
    construct is consistent with that used for built-in predicates
    (8.1) except that a mode goal indicates that the argument
    is a goal rather than a term.
    It is not clear, why goal is called a mode. It is type and mode at the same time, in addition it indicates arguments where cuts cut to the outside. It indicates arguments that are converted to a goal. (Maybe its only a mode and no type, because there are no type errors associated?)

    This is the case for 7.8.5.2, 7.8.6.2, 7.8.7.2, 7.8.8.2, but not for 7.8.3.2 and 7.8.9.2.

  18. 7.8.3.4, Table 22: Replace ((G, N-1), ...) by ((goal, N-1), ...) where goal is obtained from G via 7.6.2.
  19. 7.8.7 (if-then) delete entire control construct. Demand error instead. 7.8.9 (if-then-else) is enough. (Warning: Potentially controversial) Discussion
  20. 7.8.9.4 (catch/3 Examples), last example: Remove is in
       ['throw(X)' is causes a goal
    
  21. 7.9.2 Errors. Several explanations why E is -(-(_)). should result in an instantiation error. Subclause a vs. b. This leads to ambiguities in 5.5.10 extensions. Consider a new evaluable functor zero/1 such that 0 is zero(_). The argument shall be ignored. Due to subclause b this would be an instantiation error. but zero(-_) would be no instantiation error.

    Even worse:

    X is 1/0+_.
    X is _+1/0.
    
    These examples should never produce a zero_divisor, since subclause b is always "faster" than subclause a. But all systems produce that error.

  22. 7.10.2.11 eof_action(Action):
    error — There shall be a Permission Error
    (7.12.2 e) signifying that no more input exists in this stream.
    GNU and B is fine, SICStus: wrong error, SWI, YAP: ignored.
  23. 7.10.2.11 Note 2: remove second "it".
  24. 7.10.4 add missing write-option variable_names(VN_list) in analogy to the read-option variable_names(VN_list).

    Systems supporting this option are MINERVA (Manual dated 1997-06-22 (c) 1996-2009, local copy), Jekejeke, GNU, B, YAP, SWI, SICStus.

    7.10.4 add:

    variable_names(VN_list) — Each variable V is written with a variable name A iff a term A = V is an element of the list VN_list. If there are multiple elements A = V, the leftmost element is the one which applies.
    NOTE 2 — For write-option variable_names(VN_list) any instance (3.95) of the corresponding read-option is well defined.
  25. 7.10.5 add before a):
    pre-a) 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 representing a valid variable name, then A is output with effective write-option quoted(false).
  26. 7.10.5 d
    the sequence of characters forming the atom followed by a layout character could not be input as a valid atom.
    Alternatively, a dot at the end (without a layout char and without a %) is an end token only.

    Alternatively, replace in 6.4.2 Names:

    A graphic token shall not be the single character . (dot)
    when . is followed by a layout char or single line
    comment.
    by
    A graphic token shall not be the single character . (dot)
    when . is followed by a layout char or single line
    comment or when . is the last character
    6.4.8 other tokens. Replace
    An end char shall be followed by a layout character or a
    %.
    by
    An end char shall be followed by a layout character or a
    % or it shall be the last character
  27. 7.10.5 subclause e: Replace: If Term has the form '$VAR'(N) for some pos-
    itive
    integer N, ... by non-negative.
  28. 7.10.5 subclause f 3 must mention the required open char, close char.
  29. 7.10.5 subclause g must precede subclause f. Otherwise, writeq([a]) always has to write '.'(a,[]). That is, rename subclause g to subclause e1.
  30. 7.10.5 new subclause for {X} needed (Already noted in DTC1). Tentative new clause
    e2) 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
  31. 7.10.5 h Replace
    h) If Term has a principal functor ...
    by Else if
  32. 7.10.5 h
    h) 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.
    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 (
    (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
    same set of current operators, or (ii) the argument is
    an atom which is a current operator.
    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).
    2. The cases - (1) and - (1^a) are not mentioned explicitly.
    3. The cases (1,2) and (1|2) are not mentioned.
    Tentative new formulation:
    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 positive 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.
  33. 7.11.1.1 Flag: bounded, last paragraph.
    If the value of this flag is false, inte-
    ger arithmetic is always performed correctly (ex-
    cept when there is a system_error),
    This should probably be a resource error. Integers, as defined as type (7.1) in (7.1.2) are accompanied with Note 1 which suggest a resource error "because of exhaustion of resource".
  34. 7.11.1.3 Flag: min_integer, note
    NOTE - The possible values are required to be -M or -(M+1) where M is the value of the flag max_integer.
    In 13211-1 1.1 Notes it is defined that "Notes in this part of ISO/IEC 13211 have no effect on the language, Prolog text or Prolog processors that are defined as conforming to this part of ISO/IEC 13211". Reasons are only cross references and warnings for differences to existing implementations. This note has however a very strong effect on an implementation. For this reason it should be accompanied with a cross reference towards 7.1.2.
  35. 7.12.2 e: PermissionType ∈ { binary_stream flag,
  36. 7.12.2 g: There shall be a Evaluation Error
  37. 8.5.1.4 Examples second last: Missing alternative error type_error(evaluable,unbound) when Prolog flag bounded is false.
  38. 8.5.2.1 Decide for N-th or Nth.
  39. 8.9.2.1
    e) Constructs the clause with head H and body B,
    Replace by G.
  40. 8.11.4.1 Add subclause
    b) the goal succeeds.
  41. 8.12.1.3 g&h, 8.12.3.3 g&h, 8.12.3.3 i, 8.13.1.3 f&g, 8.13.2.3 f&g, 8.13.3.3 g, 8.14.1.3 h, 8.14.2.3 h. The usage of target stream (7.10.2.5) is quite inconsistent and appears unmotivated. Reason why not: TS is used when the stream can be S_or_a or the implicit one. Most errors only apply when S_or_a is explicitly present.
  42. 8.12.X.4, 8.13.X.4 all implicitly assume a text resp. binary stream. Maybe add a remark. But not clear where.
  43. 8.12.3.3 both f and g apply for an atom that is not associated to an open stream. C.f. 3.5 alias. Currently: SICStus, XSB.
  44. 8.12.3.4
    put_char(my_file, C).
       If a stream is associated with my_file
       instantiation_error.
    put_char(st_o, 'ty').
       If a stream is associated with st_o
       type_error(character, ty).
    put_code(my_file, C).
       If a stream is associated with my_file
       instantiation_error.
    put_code(st_o, 'ty').
       If a stream is associated with st_o
       type_error(integer, ty).
    
  45. 8.13.3.4
    put_byte(my_file, C).
       If a stream is associated with my_file
       instantiation_error.
    
  46. 8.14.1.1 k
    k) Parses C_Seq as a read-term (6.4) T.,
    by
    k) Parses C_seq as a read-term (6.2.2) T.,
  47. 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))
    write_term(1,[quoted(B)]).
       domain_error(write_option,quoted(_))
    
    The second case seems to be particularly problematic because a further instantiation would make this goal succeed.
    B = true, write_term(1,[quoted(B)]).
       Succeeds, outputting the character 1.
    
  48. 8.14.3.3
    f) Operator is neither a partial list nor a list nor an atom
    type_error(list, Operator).
    Should be atom_or_list or atom_or_atom_list. 8.1.2.1 has type atom_or_atom_list. There is also a type character_list. atom_or_list is simpler, but then it is nowhere used. (This would affect also 7.12.2 b!). Alternatively it might be preferable to issue type_error(atom,Xs) to "advertise" that one does not need a list.
  49. 8.14.3.4 type_error(list, Operator). The actual type should be changed to atom_or_atom_list.
  50. 8.16.7.1: The "declarative" description demands
    a character sequence of Number which could be output (7.10.5 b, 7.10.5 c).
    But the procedural description:
    b) Else parses the list of the characters of the name of the one-char atoms according to the syntax rules for numbers and negative numbers (6.3.1.1, 6.3.1.2) to give a value N,
    So the declarative description is not true for "01", while the procedural description succeeds. There are many other examples of that kind.

    Maybe add a new subclause:

    Additionally is true, if Number unifies with N obtained by 8.16.7.1 b.
  51. 9.2.3 Errors, Note. Replace defined in clause 7.12 by subclause.
  52. 9.3.1.2 NOTE. Replace "an infix predefined operator" by "a predefined infix operator".
  53. 9.3.1.3 c) VX is negative and Y is not. Replace by VY.
  54. Other open issues: implementation definedness of error/2
ISO/IEC 10967-1:1994, Floats discussion, Symbols

Minutes

Uppsala 1996, Schliersee 1997, Chiswick 1999, Sitges 2005, Seattle 2006, builtins, Oporto 2007, Udine 2008, Pasadena 2009, Edinburgh 2010, Lexington 2011, Budapest 2012.
Version control
Validated HTML