head 1.52; access; symbols; locks ulrich:1.52; strict; comment @# @; 1.52 date 2024.02.14.10.21.36; author ulrich; state Exp; branches; next 1.51; 1.51 date 2023.09.10.18.43.26; author ulrich; state Exp; branches; next 1.50; 1.50 date 2023.07.07.08.04.58; author ulrich; state Exp; branches; next 1.49; 1.49 date 2023.06.05.15.45.35; author ulrich; state Exp; branches; next 1.48; 1.48 date 2022.05.18.09.38.08; author ulrich; state Exp; branches; next 1.47; 1.47 date 2022.03.25.20.25.11; author ulrich; state Exp; branches; next 1.46; 1.46 date 2021.08.24.15.40.23; author ulrich; state Exp; branches; next 1.45; 1.45 date 2021.08.24.15.39.48; author ulrich; state Exp; branches; next 1.44; 1.44 date 2021.04.16.09.39.30; author ulrich; state Exp; branches; next 1.43; 1.43 date 2017.08.02.18.15.40; author ulrich; state Exp; branches; next 1.42; 1.42 date 2017.08.02.17.51.17; author ulrich; state Exp; branches; next 1.41; 1.41 date 2017.07.19.13.14.57; author ulrich; state Exp; branches; next 1.40; 1.40 date 2017.07.18.19.00.13; author ulrich; state Exp; branches; next 1.39; 1.39 date 2016.11.23.13.40.51; author ulrich; state Exp; branches; next 1.38; 1.38 date 2016.09.09.11.11.54; author ulrich; state Exp; branches; next 1.37; 1.37 date 2014.01.30.21.54.16; author ulrich; state Exp; branches; next 1.36; 1.36 date 2013.12.28.10.01.05; author ulrich; state Exp; branches; next 1.35; 1.35 date 2013.12.28.10.00.55; author ulrich; state Exp; branches; next 1.34; 1.34 date 2013.11.25.03.42.33; author ulrich; state Exp; branches; next 1.33; 1.33 date 2013.11.24.00.38.50; author ulrich; state Exp; branches; next 1.32; 1.32 date 2013.11.21.21.14.48; author ulrich; state Exp; branches; next 1.31; 1.31 date 2013.11.21.21.14.31; author ulrich; state Exp; branches; next 1.30; 1.30 date 2013.11.06.14.35.27; author ulrich; state Exp; branches; next 1.29; 1.29 date 2013.11.06.14.33.19; author ulrich; state Exp; branches; next 1.28; 1.28 date 2013.11.05.20.44.53; author ulrich; state Exp; branches; next 1.27; 1.27 date 2013.08.24.13.43.48; author ulrich; state Exp; branches; next 1.26; 1.26 date 2013.08.24.13.42.45; author ulrich; state Exp; branches; next 1.25; 1.25 date 2013.08.22.23.43.23; author ulrich; state Exp; branches; next 1.24; 1.24 date 2013.08.22.23.39.35; author ulrich; state Exp; branches; next 1.23; 1.23 date 2013.08.22.23.38.46; author ulrich; state Exp; branches; next 1.22; 1.22 date 2013.08.20.17.41.22; author ulrich; state Exp; branches; next 1.21; 1.21 date 2013.07.02.11.46.11; author ulrich; state Exp; branches; next 1.20; 1.20 date 2013.07.02.10.37.02; author ulrich; state Exp; branches; next 1.19; 1.19 date 2013.07.02.10.24.59; author ulrich; state Exp; branches; next 1.18; 1.18 date 2012.08.21.11.59.18; author ulrich; state Exp; branches; next 1.17; 1.17 date 2012.08.21.11.57.59; author ulrich; state Exp; branches; next 1.16; 1.16 date 2012.08.13.10.26.23; author ulrich; state Exp; branches; next 1.15; 1.15 date 2012.08.11.22.17.29; author ulrich; state Exp; branches; next 1.14; 1.14 date 2012.07.05.15.17.46; author ulrich; state Exp; branches; next 1.13; 1.13 date 2011.11.08.13.40.30; author ulrich; state Exp; branches; next 1.12; 1.12 date 2011.06.26.13.55.35; author ulrich; state Exp; branches; next 1.11; 1.11 date 2011.05.14.14.40.34; author ulrich; state Exp; branches; next 1.10; 1.10 date 2011.05.02.17.41.38; author ulrich; state Exp; branches; next 1.9; 1.9 date 2011.04.27.14.14.05; author ulrich; state Exp; branches; next 1.8; 1.8 date 2011.03.04.15.18.58; author ulrich; state Exp; branches; next 1.7; 1.7 date 2011.03.04.15.15.35; author ulrich; state Exp; branches; next 1.6; 1.6 date 2011.02.05.18.39.09; author ulrich; state Exp; branches; next 1.5; 1.5 date 2010.12.22.03.32.32; author ulrich; state Exp; branches; next 1.4; 1.4 date 2010.07.22.17.29.14; author ulrich; state Exp; branches; next 1.3; 1.3 date 2009.10.16.12.41.47; author ulrich; state Exp; branches; next 1.2; 1.2 date 2009.10.16.12.41.32; author ulrich; state Exp; branches; next 1.1; 1.1 date 2009.10.15.14.14.33; author ulrich; state Exp; branches; next ; desc @@ 1.52 log @*** empty log message *** @ text @ post-N289 stc. Draft for further technical corrigenda

ISO/IEC JTC1 SC22 WG17 post-N289
Draft for further corrigenda.

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. 5.5 Extensions: replace "in the part of" by this.
  3. 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!
  4. 5.5.10 Note, replace is/2 by (is)/2.
  5. 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
    
  6. 6.3.4.4 Note 2: (,)/2 by (',')/2
  7. 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.
  8. Small Prolog text: Related to outputting .. Testfiles, they should all compile!
  9. 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).
    
  10. 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?
  11. 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?
  12. 7.4.3, last paragraph: replace "directive indicating" by "indicating".
  13. 7.7.12 d: replace "(see 8) This" by "(see 8). This"
  14. 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.

  15. 7.8.7 (if-then) delete entire control construct. Demand error instead. 7.8.9 (if-then-else) is enough. (Warning: Potentially controversial) Discussion
  16. 7.8.9.4 (catch/3 Examples), last example: Remove is in
       ['throw(X)' is causes a goal
    
  17. 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.

  18. 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.
  19. 7.10.2.11 Note 2: remove second "it".
  20. 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
  21. 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".
  22. 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.
  23. 7.12.2 g: There shall be a Evaluation Error
  24. 8.5.2.1 Decide for N-th or Nth.
  25. 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.
  26. 8.12.X.4, 8.13.X.4 all implicitly assume a text resp. binary stream. Maybe add a remark. But not clear where.
  27. 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.
  28. 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).
    
  29. 8.13.3.4
    put_byte(my_file, C).
       If a stream is associated with my_file
       instantiation_error.
    
  30. 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.
  31. 8.14.3.4 type_error(list, Operator). The actual type should be changed to atom_or_atom_list.
  32. @@@@@@ 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.
  33. 9.2.3 Errors, Note. Replace defined in clause 7.12 by subclause.
  34. 9.3.1.2 NOTE. Replace "an infix predefined operator" by "a predefined infix operator".
    The following items were detected after WDCor.3
  35. Implementation definedness of error/2. Currently, any throwing of error/2 depends on the implementation definded second argument. In other words, signalling an error is not portable.
  36. missing bar in token rule
    Source: SO

    Nature of defect: the non-terminal token (* 6.4 *) could include bar for reasons of consistency.

    Solution: Add bar to token (* 6.4 *). However, this leads to ambiguity, since ht sep (* 6.4 *) describes the very same text as bar (* 6.4 *) So further clarification would be required.

  37. Body to term conversion incorrect. Description of clause/2 inconsistent
    Source: SO

    Nature of defect: The declarative and procedural descriptions of clause/2 in 8.8.1.1 are inconsistent. The error is in the procedural description that does not take into account the sharing of variables between the head and body of a rule.
    Similarly, 7.6.4 body to term conversion is incorrect.

    Example:

    :- dynamic(a/1).
    :- dynamic(c/0).
    
    a(X) :- b(X).
    
    c :- a(X), b(X).
    
    ?- clause(a(A), b(B)), A == B.
    ?- clause(c, ( a(A), b(B) )), A == B.
    
    The declarative description demands correctly that both queries should succeed. However, the current procedural description demands that A and B are independent copies of the same variable, thus A == B fails.

    Solution: Reword 7.6.4 and 8.8.1.1.

  38. Problem with variable identity and clause/2, 7.6.3 and 7.6.4 must probably be reformulated completely.
  39. (After discussion with Jan Burse, note that several of my comments were deleted) The following terms are invalid or ambiguous Prolog text but should be valid and unambiguous.
    - (1).
    Invalid due to the condition for prefix operators. The condition refers to abstract syntax, but in abstract syntax 1, (1), ((1)) are all the same.
    - -1.
    Maybe invalid. Might be excluded by that same rule, depending on what a numeric constant (no definition anywhere), is. Is it only non-negative numbers or not? E.g. 6.1.2 talks about integer constants only. That is, no negative integers are defined as abstract terms. On the other hand, there are rules to produce negative numbers!
    - 1^3.
    Ambiguous. It might mean (-1)^3 and - (1^3) since the validity of the minus prefix operators only depends on the abstract syntax. And (1^3) is definitely not a numeric constant.

    6.1.2

    Modify c and d to include negative numbers. @@@@@@

    6.3.1.2

    A term which is the name - followed directly by a numeric
    constant denotes the corresponding negative constant.

    6.3.4.2

    term =op, term ;
    Abstract: f(a)fa
    Priority: nnn
    Specifier:fy
    Condition:If a is a numeric constant
    the first token of a is integer
    or float number
    , f is not -
    Condition:The first token of a is not open ct
    Same for last syntax production for fx operators.

    Add Note 3

    3 The condition "If the first token of a is integer or float number, f is not -" defines the use of - in the term - 1 meaning -1, - (1) meaning -(1), - -1 meaning -(-1), and - 1^2 meaning ^(-1,2).
  40. the syntax of float numbers is defined without giving a precise meaning to values that are not exactly representable. The rounding process is left undefined. (indirectly reported 2016-12-06 by Harry Stoteles Jan Burse on comp.lang.prolog)
    System\Query writeq(
    244124086793065425827.0).
    X is 244124086793065425827
    -244124086793065425827.0.
    IF V5.1B 2.4412408679306543e+020 -32768.0
    SWI 6.3.18-3 2.4412408679306543e+20 -32768.0
    YAP 6.3.4 2.4412408679306543e+20 -32768.0
    B 7.8#5 2.44124e+20 0.0
    GNU 1.4.5 2.4412408679306543e+20 ovl.
    SICStus 4.3.5 2.4412408679306543E+20 0.0
    Minerva 2.4 2.4412408679306543E20 ovl.
    XSB 3.7 244124086793065431040.0000 ovl.
    Ciao 1.15 2.441240867930654e20 32768.0
    IV 1.4.2 2.4412408679306543e+020 0.0
    Jekejeke 2.4412408679306543E20 0.0
    ECLiPSe 6.2#21 2.4412408679306543e+20 0.0
  41. Directives op/3 and set_prolog_flag/3 must effectively precede the text they apply to. Some correction to this end is needed. Source: SO.
  42. Missing floatI→F conversion for sin/1, cos/1 etc al (Per Mildner, 2017-08-10).
  43. 8.15.1 Note: s/infix operator/prefix operator/ (Jan Burse, 2018-06-02)
  44. 8.16.6.3 d (2018-07-08)
    char_code(Ch, c) may be both a Type Error (8.16.6.3 c) and a Representation Error (8.16.6.3 d). However, 7.12.2 f only permits a Representation Error
    when an implementation defined limit has been breached.
    But a character can never be a character code.
    d) Code is neither a variable nor an integer but not a character code
    (7.1.2.2)
    representation_error(character_code).
  45. 7.7.2 (Markus Triska, 2018-07-10)
    ... is based on aan execution stack
  46. 3.200 variable: add NOTE about the notion logic variable. (Markus Triska, 2018-09-19).
  47. 6.1.1, facet Priority, add at end: A variable has a zero priority. or
    An atomic term, a variable, and a
    compound term expressed in functional notation have a
    zero priority.
  48. 8.14.1.1 l, "instantiates" collides with query read_term(T, [variables([])]) and input T. (Paulo Moura, 2021-08-21)
  49. 8.14.1.1 read_term/3 never produces end_of_file.
    i) If C_next represents an end token (6.4.8) or an optional layout text sequence (6.4.1) at the end @@@@@@, then proceeds to 8.14.1.1 k,

    ...

    k) Parses C_Seq as a read-term (6.2.2) T. or parses C_Seq as an optional layout text sequence (6.4.1) and @@@@@@T = end_of_file,

    (2022-01-17)
  50. 8.7 Arithmetic comparison, four incorrect axioms.
    lssIF(n, y) = geqFI(y, n) grtFI(y, n)
    leqIF(n, y) = gtrFI(y, n) geqFI(y, n)
    gtrIF(n, y) = leqFI(y, n) lssFI(y, n)
    geqIF(n, y) = lssFI(y, n) leqFI(y, n)
    (Yutaka Ichibangase, 2022-03-13)
  51. 9.1.7 Examples, The simple arithmetic functors.
    '/'(7, 35).
       Evaluates to the value 0 a value approximately equal to 0.2.
    
    (2023-03-25)
  52. 9.3.5.4, 9.3.6.4 (twice)
    2.7818 2.71828
    
    (2023-05-06)
  53. 7.8.7.1, 7.8.8.1 and more. The notion of solution is misleading here, it would be preferable to call these uses answers.
    7.8.8.1 Description

    ';'('->'(If, Then), Else) is true iff (1a) If is true,
    and (1b) Then is true for the first solution answer of If, or (2)
    If is false and Else is true.

    Solution is not problematic, as long as there are no redundant solutions. Like in 8.8.2.4 Examples
    current_predicate(Name/1).
       Succeeds, unifying Name with elk.
       On re-execution, succeeds,
       unifying Name with insect.
       [The order of solutions is
          implementation dependent]
    
  54. 9.3.1.1, 9.3.10.1 power. In LIA-2, the value for zero raised to the power of zero is invalid(1). So far however, this has been defined as one. (Daniel Diaz, 2023-07-07)
  55. 7.11.1.4 Flag: integer_rounding_function. Fix value to toward_zero, since down is now realized with (div)/2.
  56. 7.5.2 Static and dynamic procedures. (:-)/2 and (:-)/1 are neither control constructs nor built-in. Still, issue a permission error for:
    6 ?- (:-B).
         existence_error(procedure,(:-)/1).
    6 ?- (A:-B).
         existence_error(procedure,(:-)/1).
    
    
    3 ?- call((A:-B)).
         existence_error(procedure,(:-)/2).
    4 ?- (A:-B).
         existence_error(procedure,(:-)/2).
    1 ?- asserta(((a:-b):-true)).
         permission_error(modify,static_procedure,(:-)/2). % proposed
    2 ?- asserta(((:-b):-true)).
         permission_error(modify,static_procedure,(:-)/1). % proposed
    
    
    
    
    There is a slight inconsistence, as modification is not permitted which somewhat implies its existence, but then there is an existence error upon calling it. And does this also apply to directives? (2023-07-09)

    Scryer,Trealla OK SICStus OK 1,2 - context_error 3,4,5 IF OK 1,2 IV OK 1,2 ex YAP OK 2 call((:-X=1)). X = 1. ECLiPSe i.e. for 6

    GNU,Minerva,SWI,Ichiban,B succ 1,2

  57. 9.1.7 Examples. The last five examples are only for bounded integers. For unbounded integers all five examples fail. (2023-08-12)
  58. 8.17.1.3 Errors (of set_prolog_flag/2). Missing instantiation error.
    e) Flag is a valid flag and Value is inappropriate for Flag and
    there is no appropriate instance of Value
    .
    domain_error(flag_value, Flag+Value).
    ...

    g) Value is inappropriate for Flag but an instance of Value is appropriate
    or
    Value has a component which is a variable and an instantiated component is required
    instantiation_error.

    (2023-09-03)
  59. 8.4.4.2 could use pair_list in place of list which then would also extend 8.1.2.1 with a definition for pair_list. (2023-09-10)
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, Istambul 2013, Vienna 2014, Dresden 2015, WebEx 2017, 2018, Zoom 2019, JITSI 2020, Zoom 2021, 2022, 2023.
Version control
Validated HTML @ 1.51 log @*** empty log message *** @ text @d692 1 a692 1
  • the syntax of float numbers d717 1 a717 1
  • Directives op/3 and set_prolog_flag/3 must effectively precede the d876 2 a877 1 instance of Value is appropriate, or Value d879 1 a879 1 required.
    @ 1.50 log @*** empty log message *** @ text @d816 73 d893 1 d919 1 a919 1 WebEx 2018, d923 2 a924 1 Zoom 2022. @ 1.49 log @Meeting updates + new item @ text @d795 21 @ 1.48 log @N289 @ text @d7 1 a7 1 pre-N289 stc. Draft for further technical corrigendaN289
    d781 14 d822 7 a828 1 WebEx 2017. @ 1.47 log @*** empty log message *** @ text @d7 1 a7 1 post-N273 stc. Draft for further technical corrigendapost-N273
    @ 1.46 log @m typo @ text @d625 1 a625 1
  • (After discussion d699 3 a701 1 System\Query writeq(
    244124086793065425827.0). X is 244124086793065425827
    -244124086793065425827.0. d723 1 a723 1
  • 8.15.1 Note: s/infix operator/prefix operator/ (Jan Burse, 2018-06-02) d758 22 @ 1.45 log @Paulo Moura read_term @ text @d741 1 a741 1
  • 3.2000 variable: add NOTE about the @ 1.44 log @*** empty log message *** @ text @d752 5 @ 1.43 log @Status after N273 @ text @d719 33 d778 2 a779 1 Dresden 2015. @ 1.42 log @N273 @ text @d7 1 a7 1 pre-N273 stc. Draft for further technical corrigendapre-N273
    @ 1.41 log @pre-N273 @ text @a94 4
    Please comment on WDCor.3 for the current working draft for Technical Corrigendum 3!
    d104 1 a104 1
  • Previous version: N234 d575 45 a619 1
  • Other open issues: implementation definedness of error/2 d621 1 a621 1
  • (WDCor.4) Problem d625 1 a625 2
  • (WDCor.4) (After discussion d692 1 a692 1
  • (WDCor.4) the syntax of float numbers d715 3 @ 1.40 log @*** empty log message *** @ text @d7 1 a7 1 post-N245 stc. Draft for further technical corrigendapost-N245
    a123 9
  • 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. a151 11
  • (WDCor3) 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.
    a326 14
  • 6.2.1 Prolog text Replace
    p text = ;
    
    by
    p text = [ layout text sequence (* 6.4.1 *) ] ;
    
    (Restrictions on the layout: 6.4.8 end char) a380 10
  • (WDCor3) 7.1.6.3 Iterated-goal term. Replace
    a) If T unifies with ^(_, G) then ...
    by
    a) If T has the form ^(_, G) then ...
    a406 6
  • (WDCor.3) 7.8.3.4, Table 22: Replace ((G, N-1), ...) by ((goal, N-1), ...) where goal is obtained from G via 7.6.2. a439 74
  • (WDCor.3) 7.10.3 add:
    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.
    The elements appear 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.
    The elements appear in left-to-right traversal order.

  • (WDCor.3) 7.10.4 Write-option numbervars(Bool add:
    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.
  • (WDCor.3) 7.10.4 Write-option list 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.
  • (WDCor.3) 7.10.5 add as first subclause:
    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 representing a valid variable name, then A is output with effective write-option quoted(false).
  • (WDCor.3) 7.10.5 subclause a. Rename subclause to a2. a469 107
  • (WDCor.3) 7.10.5 subclause e: Replace: If Term has the form '$VAR'(N) for some pos-
    itive
    integer N, ... by non-negative.
  • (WDCor.3) 7.10.5 subclause e. Rename subclause to e1.
  • (WDCor.3) 7.10.5 subclause f 3 must mention the required open char, close char.
  • (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.
  • (WDCor.3) 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
  • 7.10.5 h Replace
    h) If Term has a principal functor ...
    by Else if
  • 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.
    Add:
    Operator ',' and '|' is/are output as , (comma char) 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 (
    (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 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.
    a495 7
  • (WDCor.3) 7.12.2 b: Add float to the set ValidType.
  • (WDCor.3) 7.12.2 c: Remover character_code_list from the set ValidDomain.
  • 7.12.2 e: PermissionType ∈ { binary_stream flag, a497 4
  • 8.5.1.4 Examples second last: Missing alternative error type_error(evaluable,unbound) when Prolog flag bounded is false. a499 24
  • (WDCor.3) 8.9.2.1
    e) Constructs the clause with head H and body B,
    Replace by G.
  • (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
    b) the goal succeeds.
  • (WDCor.3) 8.11.5.3 c:
    c) Options is a partial list or a list with an element
    E which is a variable or which has a component
    which is variable, and an instantiated component is required.

    instantiation_error.
    Same for 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b. a535 59
  • (WDCor.3) 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.,
  • (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))
    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.
    
    See also write options.
  • (WDCor.3) 8.14.2.4 Examples

    Replace

    write_canonical([1,2,3]).
       Succeeds, outputting the characters
    .(1,.(2,.(3,[ ])))
        to the current output stream.
    
    by
    write_canonical([1,2,3]).
       Succeeds, outputting the characters
    '.'(1,'.'(2,'.'(3,[])))
        to the current output stream.
    
    a577 61
  • (WDCor.3) 9.3.1.3 c) VX is negative and Y is not. Replace by VY.
  • (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.
    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

    e) VX and VY are integers and VX is not equal to 1 and VY is less than -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
    type_error(float, VX).
    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 in 9.3.10.4 Examples,
    2^(-1).
       evaluation_error(undefined).
    
    by
    2^(-1).
       type_error(float, 2).
    
    @ 1.39 log @Initial revision @ text @d1039 24 @ 1.38 log @*** empty log message *** @ text @d12 4 d968 10 a977 1 with variable identity and clause/2 d979 59 @ 1.37 log @7.10.3 fixed @ text @d70 3 d91 4 d157 1 a157 1
  • 5.5.12 Add new subclause d411 1 a411 1
  • 7.1.6.3 Iterated-goal term. Replace d447 1 a447 1
  • 7.8.3.4, Table 22: d486 1 a486 1
  • 7.10.3 add: d505 1 d507 8 d516 1 a516 1
  • 7.10.4 Write-option list add missing a529 1 d547 1 a547 1
  • 7.10.5 add as first subclause: d558 1 a558 1
  • 7.10.5 subclause a. Rename subclause to a2. d590 1 a590 1
  • 7.10.5 subclause e: Replace: If Term has the d594 1 a594 1
  • 7.10.5 subclause e. Rename subclause to e1. d596 1 a596 1
  • 7.10.5 subclause f 3 must mention the required open char, close d599 1 a599 1
  • 7.10.5 subclause g must precede subclause f. Otherwise, d603 1 a603 1
  • 7.10.5 new subclause for {X} needed (Already noted a610 1 a615 2 d723 1 a723 1
  • 7.12.2 b: Add float to the set ValidType. d725 1 a725 1
  • 7.12.2 c: Remover character_code_list from d738 1 a738 1
  • 8.9.2.1 d744 1 a744 1
  • 8.10.3.4 example no. 20 d748 1 a748 1
  • 8.11.4.1 Add subclause d751 11 d798 1 a798 1
  • 8.14.1.1 k d812 1 a812 1
  • 8.14.2.3 e d834 1 a834 1
  • 8.14.2.4 Examples d872 1 a872 1
  • 8.16.7.1: The "declarative" description demands d900 1 a900 1
  • 9.3.1.3 c) VX is negative and Y is not. Replace d903 1 a903 1
  • 9.3.10.3 e. Error condition needs to be reformulated to cover all d963 4 d978 1 a978 1

    Minutes

    d991 3 a993 2 Istambul 2013. @ 1.36 log @*** empty log message *** @ text @d479 22 a500 1
  • 7.10.4 add missing @ 1.35 log @2013/12/11 15:04:38 @ text @d611 1 a611 1 Operator ',' @ 1.34 log @Better renaming @ text @d15 2 a54 2 max-width:35em; padding-left:1em; d404 3 a406 3
  • 7.1.6.3 Iterated-goal term. Add to subclause
    a) If T is not a variable and unifies with ^(_, G) d409 3 a411 3 alternatively
    a) If T has the form ^(_, G) then ... d473 1 a473 1 e) signifying that no more input exists in this stream. d483 1 a483 1 Systems supporting this option d511 1 a511 1
  • 7.10.5 add as first subclause: d522 1 a522 1
  • 7.10.5 subclause a. Rename subclause to a2. d570 1 a570 1
    d607 11 d651 1 a651 1
    d653 1 a653 1 these rules. An argument is preceded by ( (open char) and followed d657 1 a657 1 argument is an atom which is a current operator, or (iii) the d661 1 a661 1 argument is to be output in infix or postfix operator form. a663 3 d757 1 a757 1
    k) Parses C_Seq as a read-term (6.4) T., d761 1 a761 1
    d763 2 a764 2
    k) Parses C_seq as a read-term (6.2.2) T., d788 24 d851 1 a851 1 subclause. d878 10 a887 2 Tentative new formulation:
    d889 2 a890 2 and VY is negative and VX is greater than 1 or less than -1 d896 1 a896 1
    d898 2 a899 2 and VY is negative and VX is not equal to 1, 0, or -1. d905 1 a905 1
    d907 1
    a907 1
       evaluation_error(undefined).
    d912 1
    a912 1
    
    d914 1
    a914 1
       type_error(float, 2).
    d936 1
    a936 1
    Seattle 2006, builtins,
    d942 2
    a943 1
    Budapest 2012.
    @
    
    
    1.33
    log
    @*** empty log message ***
    @
    text
    @d511 1
    a511 1
    
  • 7.10.5 add before a): d513 1 a513 1 pre-a) If Term is a variable and there is an effective d521 2 @ 1.32 log @writing - @ text @d511 1 a511 1
  • 7.10.5 add before a): d556 2 d563 1 a563 1 g to subclause e1. d645 4 a648 4 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. @ 1.31 log @*** empty log message *** @ text @d644 1 a644 1 positive number, or (iv) the principal functor is output as a prefix @ 1.30 log @Refinement @ text @d7 1 a7 1 N245 stc. Draft for further technical corrigendaN245
    d680 3 d699 4 d823 1 a823 1
  • 9.3.10.3 e. Error condition needs to be reformulated to cover all d826 1 a826 1 Here are the values for x^y for x, y in -3..3. d829 1 a829 1 y d838 1 a838 1 x -3 -2 -1 0 1 2 3 @ 1.29 log @*** empty log message *** @ text @d838 1 a838 1 and VY is less than 0 d847 1 a847 1 and VY is less than 0 @ 1.28 log @Renumbered to N245, changes 9.3.10.3_e @ text @d678 2 d827 3 a829 3 -1 ty.ety.e -1 0 1ty.ety.e -2 ty.ety.e 1 0 1ty.ety.e -3 ty.ety.e -1 0 1ty.ety.e @ 1.27 log @corr to N250 @ text @d7 1 a7 1 N250 stc. Draft for further technical corrigendaN250
    d81 1 a81 1 (Version for Istanbul, 2013-08-23)

    d814 50 d867 1 @ 1.26 log @N250 @ text @d76 1 a76 1 First draft for further corrigenda. @ 1.25 log @Very final version @ text @d7 1 a7 1 post-N234 stc. Draft for further technical corrigendaN234
    @ 1.24 log @Real version for Istanbul @ text @d811 2 @ 1.23 log @For Istanbul @ text @d78 1 a78 1 (Version for Istanbul, 2013-08-23) @ 1.22 log @*** empty log message *** @ text @d78 1 d794 7 @ 1.21 log @Further correction @ text @d518 2 a519 1

  • 7.10.5 d "the sequence of characters forming d521 2 a522 1 by a layout character could not be input as a valid atom." d779 15 d815 3 d824 2 a825 1 Lexington 2011. @ 1.20 log @Added link to version control @ text @d579 1 a579 1 by Else @ 1.19 log @Including Per Mildner's 7.10.5 h comment @ text @d806 1 @ 1.18 log @*** empty log message *** @ text @d7 1 a7 1 N234 stc. Draft for further technical corrigendaspan class=min>ISO/IEC JTC1 SC22 WG17--> N213
    First draft for futher corrigenda. d93 2 d446 5 d485 5 a489 1 B. d501 6 d515 1 a515 1 output with effective write-option quoted(false). d575 5 d581 1 a581 1
  • 7.10.5 h d726 14 @ 1.17 log @*** empty log message *** @ text @d7 1 a7 1 stc. Draft for further technical corrigenda ??
    (Inofficial) Sketch for technical corrigenda @ 1.16 log @*** empty log message *** @ text @d347 1 a347 1 tokens. E.g., ")." whereas d349 1 a349 1 3.148 define it as a term followed by an end token. @ 1.15 log @*** empty log message *** @ text @d164 1 a164 1 (6.1.2 c and d defined them - they have no sign. A numeric constant @ 1.14 log @*** empty log message *** @ text @d80 3 a82 1 of the next corrigendum. d93 4 d107 12 d129 1 a129 1 A processor may support the value of an expression being some d131 1 a131 1 exceptional value or error. d142 1 a142 1
  • 5.5.10 Note, replace is/2 by (is)/2. d146 1 a146 1
    d157 1 a157 1 There is some perceived ambiguity that needs clarification: d253 1 a253 1
  • 6.3.4.4 Note 2: (,)/2 by (',')/2 d263 1 a263 1
    d268 1
    a268 1
    
    d276 1
    a276 1
    
    d284 1
    a284 1
    
    d291 1
    a291 1
    
    d295 1
    a295 1
    
    d300 1
    a300 1
    
    d310 1
    a310 1
    
    d314 5
    d334 1
    a334 1
    
    d338 1
    a338 1
    
    d346 1
    a346 1
    also in (* 6.4. *).  The definition in 6.4 defines it as a sequence of
    d351 2
    a352 2
    
  • 6.4.1 single line comment: A single line comment ends with a new line char or with EOF (@@@@@@ better formulation d366 1 a366 1 Maybe extend this by followed by an optional layout sequence d378 1 a378 1 An end char shall be followed by a layout character, %, or it d385 1 a385 1 by defined. But: horizontal tab char is not strictly a392 4 (8859-1) d400 6 a405 1 a) If T is not a variable and unifies with ... d412 1 a412 1
  • 7.4.3, last paragraph: replace "directive indicating" by d415 1 a415 1
  • 7.7.12 d: replace "(see 8) This" by "(see 8). This" d418 1 a418 1
    d436 3 a438 3 Replace ((G, N-1), ...) by ((goal, N-1), ...) where goal is obtained from G via 7.6.2. d441 1 a441 1 instead. 7.8.9 (if-then-else) is enough. (Warning: Potientially controversial) d468 4 a471 9
  • 7.10.4 add the following write-option
    variable_names(VN_list) — Each variable V is written as atom A (with quoted(false)) iff a term A = V is an element of the list VN_list. (Ensure that A is an atom of valid syntax. Pairs A = I where I is nonvar are ignored. Define priority when ['A1' = V, 'A2' = V])
    d477 22 a498 7 GNU
  • 7.10.5 a)
    If Term is a variable and there is an element A = Term of the list VN_list then A is output with effective write-option quoted(false) else ... d501 2 a502 1
  • 7.10.5 d "the sequence of characters forming the atom followed d516 1 a516 1 comment or when . is the last character d526 1 a526 1 % or it shall be the last character d529 4 d626 1 a626 1
    d661 2 a662 2
    e) Constructs the clause with head H and body B, d664 1 a664 1 Replace by G. d667 1 a667 1
    b) the goal succeeds.
    d719 2 a720 2 The second case seems to be particularily problematic because a further instantiatiation would make this goal succeed. d734 3 a736 2 Alternatively it might be preferable to issue type_error(atom,Xs) to "advertise" that one does not need a list. d739 1 a739 1 actual type should be changed to atom_or_atom_list. d742 4 a745 1 subclause. d748 1 a748 1 by VY. d750 1 a750 1 @ 1.13 log @*** empty log message *** @ text @d124 2 d322 5 a326 2
  • Remark that read term is defined in (* 6.2.2 *) but also in (* 6.4. *) d412 3 a414 3 Replace ((G, N-1), ...) by ((goal, N-1), ...) where goal is obtained from G via 7.6.2. d450 2 a451 1 (Ensure that A is an atom of valid syntax) d453 7 d621 6 a708 276

    x.y.z between/3

    x.y.z.1 Description

    between(Lower, Upper, X) is true iff X is greater or equal Lower and less or equal upper.

    Procedurally, between(Lower, Upper, X) is executed as follows:
    a)@@@@@@

    between(Lower, Upper, X) is re-executable. On backtracking, continue at x.y.z.1 @@@@@@.

    x.y.z.2 Template and modes

    between(+integer,+integer,?integer)

    x.y.z.3 Errors

    a) Lower is a variable
    instantiation_error.
    b) Upper is a variable
    instantiation_error.
    c) Lower is neither a variable nor an integer
    type_error(integer,Lower).
    d) Upper is neither a variable nor an integer
    type_error(integer,Upper).
    e) X is neither a variable nor an integer
    type_error(integer,X).
    NOTE — There are goals with a unique solution that still require an instantiation error. E.g.: between(X, X, 1).

    x.y.z.4 Examples

    between(1, 2, 0).
       Fails.
    
    between(1, 2, I).
       Succeeds,
          unifying I with 1.
       On re-execution, succeds,
          unifying I with 2.
    
    between(I, I, 0).
       instantiation_error.
    
    between(1, I, 0).
       instantiation_error.
    
    between(I, 1, 0).
       instantiation_error.
    
    between(1, c, 0).
       type_error(integer,c).
    
    between(1+1,2,I).
       type_error(integer,1+1).
    

    x.y.z succ/2

    x.y.z.1 Description

    succ(X, S) is true iff S is the successor of the natural number X.

    Procedurally, succ(X, S) is executed as follows:
    a)@@@@@@

    x.y.z.2 Template and modes

    succ(?integer,?integer)

    x.y.z.3 Errors

    a) X is a variable and S is a varible.
    instantiation_error.
    b) X is a neither a variable nor an integer
    type_error(integer,X).
    c) S is a neither a variable nor an integer
    type_error(integer,S).
    d) X is an integer that is less than zero
    domain_error(not_less_than_zero, X).
    e) S is an integer that is less than zero
    domain_error(not_less_than_zero, S).
    NOTE — succ(X, X) requires an instantiation error although there is no solution.

    x.y.z.4 Examples

    succ(1, S).
       Succeeds, unifying S with 1.
    
    succ(1, 1+1).
       type_error(integer, 1+1).
    
    succ(X, 0).
       Fails.
    
    succ(X, -1).
       domain_error(not_less_than_zero, -1).
    

    x.y.z plus/3

    x.y.z.1 Description

    plus(Lower, Upper, X) is true iff X is greater or equal Lower and less or equal upper.

    Procedurally, plus(Lower, Upper, X) is executed as follows:
    a)@@@@@@

    plus(Lower, Upper, X) is re-executable. On backtracking, continue at x.y.z.1 @@@@@@.

    x.y.z.2 Template and modes

    plus(+integer,+integer,?integer)

    x.y.z.3 Errors

    a) X is a variable and Z is a variable
    instantiation_error.
    b) Y is a variable and Z is a variable
    instantiation_error.
    c) X is a variable and Y is a variable
    instantiation_error.
    d) X is neither a variable nor an integer
    type_error(integer,X).
    e) Y is neither a variable nor an integer
    type_error(integer,Y).
    f) Z is neither a variable nor an integer
    type_error(integer,Z).
    NOTE — There are goals with a unique solution that still require an instantiation error. E.g.: plus(X, X, 1).

    x.y.z.4 Examples

    plus(1, 1, 1+1).
       type_error(integer, 1+1).
    

    x.y.z bip/3

    x.y.z.1 Description

    bip(Lower, Upper, X) is true iff X is greater or equal Lower and less or equal upper.

    Procedurally, bip(Lower, Upper, X) is executed as follows:
    a)@@@@@@

    bip(Lower, Upper, X) is re-executable. On backtracking, continue at x.y.z.1 @@@@@@.

    x.y.z.2 Template and modes

    bip(+integer,+integer,?integer)

    x.y.z.3 Errors

    a) Lower is a variable
    instantiation_error.
    b) Upper is a variable
    instantiation_error.
    c) Lower is neither a variable nor an integer
    type_error(integer,Lower).
    NOTE — There are goals with a unique solution that still require an instantiation error. E.g.: bip(X, X, 1).

    x.y.z.4 Examples

    bip.
       Fails.
    
    @ 1.12 log @*** empty log message *** @ text @d91 1 a91 1
  • d116 1 a116 1 Illustrative example: d405 6 d481 3 d556 1 a556 1
    d647 20 d690 277 d977 1 a977 1 Seattle 2006, d981 2 a982 1 Edinburgh 2010. @ 1.11 log @incl. Jan Burse's comments @ text @d101 1 a101 1
  • 5.5.10 Change 2nd sentence d151 3 a153 3 integer(- /**/ 1).: Succeeds in B, Ciao, IF, Minerva, SICStus, YAP, XSB. Fails in ECLiPSe, GNU, SWI. d540 3 d609 1 a609 1
  • 8.12.X.4, 8.13.X.4 all implicitly assume a text resp. binary d612 3 @ 1.10 log @*** empty log message *** @ text @d121 2 a122 1 This is controversial and definitely needs an explicit resolution! d235 3 a237 1
  • 6.4.2 up to 6.5.3 add graphic solo: (probably no longer needed) d320 2 a321 1
  • 6.2.2 Prolog data d323 17 a339 8 Replace
    read term = term, end ;
    
    by
    read term = term, end, [ layout text sequence (* 6.4.1 *) ] ;
    
    d602 29 a630 1 unmotivated. a631 1
  • 8.14.3.1 Note 4 Add also exception of '|' (DTC2). @ 1.9 log @m @ text @d47 11 a231 25
  • 6.2.1 Prolog text Replace
    p text = ;
    
    by
    p text = [ layout text sequence (* 6.4.1 *) ] ;
    
    (Restrictions on the layout: 6.4.8 end char)
  • 6.2.2 Prolog data Replace
    read term = term, end ;
    
    by
    read term = term, end, [ layout text sequence (* 6.4.1 *) ] ;
    
    d296 32 d341 2 d462 83 a544 2
  • 7.10.5 subclause f and g should be exchanged. Otherwise, writeq([a]) always has to write '.'(a,[]). a545 1
  • 7.10.5 new subclause for {X} needed. d607 3 @ 1.8 log @Remove catch/3 @ text @d138 1 d198 1 a198 1 Further, the Prolog text - 1. cannote be misread as a d248 1 a248 1
  • 6.4.2 up to 6.5.3 add graphic solo: a375 1 d400 1 a400 1
  • 7.10.4 add the following write-option d415 1 a415 1
  • 7.10.5 d "the sequence of characters forming the atom followed @ 1.7 log @*** empty log message *** @ text @a375 21
  • 7.8.9.2 Template and modes: catch(?callable_term, ?term, ?term) should be expained in detail. The first argument is not +callable_term! The last argument is a callable_term, but it is not checked at the time of calling catch/3. In particular, it is unclear why there are two error conditinos for catch/3. catch(_,E,true) succeeds in YAP, GNU, SICStus, CIAO, XSB.

    but instantiation_error in B and IF.

    Probably just replace all errors in 7.8.9.3 by None. And add note to this end: ???

    The mode ?callable_term does only justify a type_error(callable,1) for catch(1,_,true). It does not justify the instantiation_error for catch(_,_,true).

    Suggestion: change 7.8.9.2 tocatch(goal, ?term, goal). and remove all errors in 7.8.9.3. @ 1.6 log @*** empty log message *** @ text @d306 3 @ 1.5 log @*** empty log message *** @ text @d7 1 a7 1 stc. Draft for the second technical corrigendumpart of it. d125 1 a125 1 There is some perceived ambiguity: d132 5 d197 48 d262 2 d306 13 d418 15 d486 1 a486 1 Reasons are only cross references and warnings differences to existing d509 2 @ 1.4 log @WG17 Edinburgh and before @ text @d65 1 a65 1 (Inofficial) Draft for the second technical corrigendum a66 5

    Ulrich Neumerkel 2009-09-21 (Version history)
    d69 2 a70 8 of a second corrigendum. It contains some parts of N208 of 2008-11-17.
    1. N213 An error class for unexpected instantiations d72 1 d74 1 a74 2
    2. Built-in predicates, current practice
      d76 1 a76 9 call/2..8 false/0, callable/1, compare/3, retract-correction, retractall/1, N211 setup_call_cleanup/3
    3. Three steps to syntax harmony, Noname operators, A syntax extension for |.
    4. Evaluable functors, current practice d111 1 d124 68 a191 1
    5. 6.3.4.3 op = atom replace by op = name (discussed) d195 57 d255 7 d270 5 d279 2 a280 4
    6. 7.3.4, last paragraph: replace "directive indicating" by "indicating".
    7. 7.4.3 End: directive indicating d295 2 a296 1 a goal. d301 3 a303 3
    8. 7.8.3.3 c. This type error is very problematic. (1;true) does have one solution semantically. This solution is only overshadowed. a304 2
    9. 7.8.7 (if-then) delete entire control construct. Demand error instead. 7.8.9 (if-then-else) is enough. (Warning: Controversial) d312 2 a313 1 catch(_,E,true) succeeds in YAP, GNU, SICStus, B. d318 8 a325 1

      The mode ?callable_term does not d332 9 a340 1 would be no instantiation error. Example X is 1/0+_. d351 32 a418 10

    10. 8.10.1.2 Replace findall(?term, +callable_term, ?list) by findall(@@term, @@callable_term, ?list). Unclear: What is the meaning of @@term? term will be instantiated during the call. After the call it is left uninstantiated.
    11. 8.10.2.2 Replace bagof(?term, +callable_term, ?list) by bagof(@@term, +callable_term, ?list). d435 2 a436 1 Alternatively it might be preferable to issue type_error(atom,Xs). d441 2 a442 12
    12. 8.14.3.3, add new error condition, per analogiam j, k.
      m) Op_specifier is a specifier such that an element El
      of the Operator list would have an invalid set of specifiers (see 6.3.4.3)
      permission_error(create, operator, El).
    13. 8.16.5.3 d, 8.16.8.3 d These subclauses suggests that atom_codes or number_codes(N,[1+2]) produces a representation_error(character_code). This looks much like a domain_error(character_code_list,[1+2]) or (less probable) a type_error(integer,1+2). d444 1 a444 1
    d457 1 a457 1 Oporto 2007, d460 1 a460 2 @ 1.3 log @*** empty log message *** @ text @d74 2 a75 2 of a second corrigendum. It contains some parts of Paulo Moura's draft core 8.15.4 13211-1:2006 of 2008-11-17. a81 1
  • call/2..8 a82 1
  • false/0 d84 2 a85 1
  • callable/1, compare/3, retract-correction, retractall/1 d87 2 a88 1
  • A syntax extension for | d90 3 a92 1
  • N211 setup_call_cleanup/3 d110 34 d146 6 d161 7 d197 1 a197 2 catch(_,E,true) succeeds in YAP, GNU, SICStus but produces the error in B. d199 2 a200 1 Probably just replace all errors in 7.8.9.3 by None. And add note: d202 1 d204 11 a214 7
  • 7.9.2 Errors. None of the cases explains, why E is -(-(_)). should result in an instantiation error. Subclause b is defined only for arguments of E. It is not defined for arguments of arguments!
    b) E is a compound term and an argument of E is a variable
    instantiation_error. d216 3 d225 1 a225 1 cept when there is a system_error), a249 6
  • 8.1.3: Additional Note: The difference between type nonvar and type term is that an argument of type term has no error associated with it (Note 1), but nonvar does have such an error. On the other hand is/2 has is(?nonvar, @@evaluable). From that perspective, is/2 should have term as first argument. d254 20 d278 5 d285 1 a285 1 actual type expected is atom_or_atom_list. d287 6 a292 1 d294 5 a298 3
    1mo The first part is the real technical corrigendum.  As criteria for
    being in there:
    d300 1
    a300 1
      o no system provides this in a library (as of now, indeed)
    d302 1
    a302 1
      o it cannot be put into a library
    d304 1
    a304 3
      o it is required by some of the current drafts (call/3 for DCGs,
        setup_call_cleanup/3 and error_k for threads) - so the
        corrigendum could remove dependencies that block everything.
    d306 1
    a306 2
      o inherent defect of 13211-1.  This only applies to (^)/2
        and error_k.
    d309 1
    a309 4
        However, I do not agree with the repeated opinion of Klaus, that
        arithmetcs should go into a module.  That implies that arithmetics
        becomes extensible - and that make things much worse.  Otherwise
        it is impossible.
    d311 5
    a316 8
    
    ISO/IEC 10967-1:1994 Floats discussion Symbols @ 1.2 log @*** empty log message *** @ text @d84 1 a84 1
  • forall/2, false/0 @ 1.1 log @Initial revision @ text @d95 3 @