head 1.53; access; symbols; locks ulrich:1.53; strict; comment @# @; 1.53 date 2024.06.18.18.49.10; author ulrich; state Exp; branches; next 1.52; 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.53 log @*** empty log message *** @ text @
3.146 read-option: A compound term with uninstanti-Does this mean that every read-option even as an extension has to have uninstantiated arguments? How many such arguments? Augments?
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).
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!
is/2
by (is)/2
.
A term which is the name - followed directly by a numericWhat 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.
constant denotes the corresponding negative constant.
Compatibility:
integer(- /**/ 1).
: Succeeds in B, Ciao, IF, Minerva,
SICStus, YAP, XSB, GNU (new!). Fails in
ECLiPSe, GNU, SWI.
History:
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
(',')/2
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)
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 *)
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 ;
term
and read term
is defined in (* 6.2.2 *) but
also in (* 6.4 *). The definition in 6.4 defines it as a sequence of
tokens. E.g., ")." whereas
3.148 defines it as a term followed by an end token.
single line comment
: A single line comment ends
with a new line char
or with EOF (@@@@@@ better formulation
needed!)
3.140 Prolog data: A sequence of read-terms (seeMaybe extend this by followed by an optional layout sequence (???).
6.2.2).3.141 Prolog text: A sequence of read-terms denoting
directives and clauses (see 6.2, 7.4).
An end char shall be followed by a layout character or %.by
An end char shall be followed by a layout character, %, or it shall be the last character.
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).
domain_error(non_empty_list, [])
be defined?
The format and notation of the definition of each controlIt is not clear, why
construct is consistent with that used for built-in predicates
(8.1) except that a modegoal
indicates that the argument
is a goal rather than a term.
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.
is
in ['throw(X)'iscauses a goal
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.
eof_action(Action)
:
GNU and B is fine, SICStus: wrong error, SWI, YAP: ignored.error
— There shall be a Permission Error
(7.12.2 e) signifying that no more input exists in
this stream.
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)by
when . is followed by a layout char or single line
comment.
A graphic token shall not be the single character . (dot)6.4.8 other tokens. Replace
when . is followed by a layout char or single line
comment or when . is the last character
An end char shall be followed by a layout character or aby
%.
An end char shall be followed by a layout character or a
% or it shall be the last character
If the value of this flag is false, inte-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".
ger arithmetic is always performed correctly (ex-
cept when there is a system_error),
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.
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).
put_byte(my_file, C). If a stream is associated with my_file instantiation_error.
type_error(list, Operator)
.
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.
type_error(list, Operator)
. The
actual type should be changed to atom_or_atom_list
.
a character sequence of Number
which could be output
(7.10.5 b, 7.10.5 c).
But the procedural description:
So the declarative description is not true for "01", while the procedural description succeeds. There are many other examples of that kind.
- 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,
Maybe add a new subclause:
Additionally is true, ifNumber
unifies withN
obtained by 8.16.7.1 b.
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.
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.
- (1).
1
, (1)
, ((1))
are all
the same.
- -1.
- 1^3.
A term which is the name-
followed directly by a numeric
constant denotes the corresponding negative constant.
Same for last syntax production for
term =
op, term ;
Abstract: f(a) f a Priority: n n n Specifier: fy
Condition: If a is a numeric constant
the first token of a isinteger
orfloat number
, f is not-
Condition: The first token of a is not open ct
fx
operators.
Add Note 3
3 The condition "If the first token of a isinteger
orfloat 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)
.
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 |
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
isneither a variable noran integer but not a character code
(7.1.2.2)
—representation_error(character_code).
... is based onaan execution stack
An atomic term, a variable, and a
compound term expressed in functional notation have a
zero priority.
T.
(Paulo
Moura, 2021-08-21)
end_of_file
.
i) If(2022-01-17)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 parsesC_Seq
as an optional layout text sequence (6.4.1) and @@@@@@T = end_of_file
,
lssIF(n, y) =(Yutaka Ichibangase, 2022-03-13)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)
'/'(7, 35). Evaluates to(2023-03-25)the value 0a value approximately equal to 0.2.
(2023-05-06)2.78182.71828
7.8.8.1 DescriptionSolution is not problematic, as long as there are no redundant solutions. Like in 8.8.2.4 Examples
';'('->'(If, Then), Else)
is true iff (1a)If
is true,
and (1b)Then
is true for the firstsolutionanswer ofIf
, or (2)
If
is false andElse
is true.
current_predicate(Name/1). Succeeds, unifying Name with elk. On re-execution, succeeds, unifying Name with insect. [The order of solutions is implementation dependent]
toward_zero
, since down
is now
realized with (div)/2
.
(:-)/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). % proposedThere 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
e)(2023-09-03)Flag
is a valid flag andValue
is inappropriate forFlag
and
there is no appropriate instance ofValue
.
—domain_error(flag_value, Flag+Value).
...
g)Value
is inappropriate forFlag
but an instance ofValue
is appropriate
or
Value
has a component which is a variable and an instantiated component is required
—instantiation_error.
pair_list
in place of list
which then
would also extend 8.1.2.1 with a definition
for pair_list
.
(2023-09-10)
Value
is appropriate, or Value
d879 1
a879 1
required.Please comment on WDCor.3 for the current working draft for Technical Corrigendum 3!d104 1 a104 1
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
a326 145.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.
p text = ;by
p text = [ layout text sequence (* 6.4.1 *) ] ;(Restrictions on the layout: 6.4.8 end char) a380 10
a) If T unifies with ^(_, G) then ...by
a) If T has the form ^(_, G) then ...a406 6
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 termA = V
, and
(2)V
is a named variable of the term, and (3)A
is an
atom whose name is the characters ofV
.
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 termA = 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 ofV
.
The elements appear in left-to-right traversal order.
numbervars(Bool
add:
numbervars(Bool)
- IffBool
(7.1.4.2) istrue
a
term of the form'$VAR'(N)
, whereN
is an a non-negative integer, is
output as a variable name consisting of a capital letter
possibly followed by an integer.
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 variableV
is written with a variable nameA
iff a termA = V
is an element of the listVN_list
. If there are multiple elementsA = V
, the leftmost element is the one which applies.
variable_names(VN_list)
any instance (3.95) of the corresponding read-option is well defined.
a1) IfTerm
is a variable and there is an effective write-optionvariable_names(VN_list)
and there is an elementA = Term
of the listVN_list
withA
an atom representing a valid variable name, thenA
is output with effective write-optionquoted(false)
.
Term
has the
form '$VAR'(N)
for some pos-e2) Else ifTerm
has the form'{}'(Arg)
, and there is an effective write-optionignore_ops(false)
, thenTerm
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
h) If Term
has a principal functor ...
by Else if
h) If Term has a principal functor which is anAdd:
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.
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.
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 operatora495 7-
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.
float
to the set ValidType
.
character_code_list
from
the set ValidDomain
.
PermissionType ∈ { binary_stream flag,
a497 4
type_error(evaluable,unbound)
when Prolog flag
bounded is false.
a499 24
e) Constructs the clause with headReplace byH
and bodyB
,
G
.
[a, b, f(b), f(a)]
as in IS 13211-1:1995.
b) the goal succeeds.
Same for 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b. a535 59
- 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.
by
- k) Parses
C_Seq
as a read-term (6.4)T.
,
- k) Parses
C_Seq
as a read-term (6.2.2)T.
,
- e) An element
E
of theOptions
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.
Replace
bywrite_canonical([1,2,3]). Succeeds, outputting the characters .(1,.(2,.(3,[ ]))) to the current output stream.
a577 61write_canonical([1,2,3]). Succeeds, outputting the characters '.'(1,'.'(2,'.'(3,[]))) to the current output stream.
VX
is negative and Y is not. Replace
by VY
.
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.e | ty.e | -1 | e.u | 1 | ty.e | ty.e | |
-2 | ty.e | ty.e | 1 | e.u | 1 | ty.e | ty.e | |
-3 | ty.e | ty.e | -1 | e.u | 1 | ty.e | ty.e | |
X | -3 | -2 | -1 | 0 | 1 | 2 | 3 |
VX
and VY
are integers
and VX
is not equal to 1 and VY
is less than
-1.
type_error(float, VX).
VX
and VY
are integers
and VY
is negative
and VX
is greater than 1 or less than -1
type_error(float, VX).
VX
and VY
are integers
and VY
is negative
and VX
is not equal to 1, 0, or -1
type_error(float, VX).
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
Term
has the
d594 1
a594 1
float
to the set ValidType
.
d725 1
a725 1
character_code_list
from
d738 1
a738 1
VX
is negative and Y is not. Replace
d903 1
a903 1
a) If T is not a variable and unifies with ^(_, G) d409 3 a411 3 alternativelya) 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 17.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 1d653 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 1k) Parses C_Seq
as a read-term (6.4)T.
, d761 1 a761 1d763 2 a764 2k) 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 andVX
is greater than 1 or less than -1 d896 1 a896 1d898 2 a899 2 and
VY
is negative andVX
is not equal to 1, 0, or -1. d905 1 a905 1d907 1 a907 1 evaluation_error(undefined). d912 1 a912 1d914 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 17.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 17.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 corrigenda N245
d680 3 d699 4 d823 1 a823 19.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 d838 1 a838 1 y @ 1.29 log @*** empty log message *** @ text @d838 1 a838 1 and x -3 -2 -1 0 1 2 3 VY
is less than 0 d847 1 a847 1 andVY
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.e ty.e -1 0 1 ty.e ty.e -2 ty.e ty.e 1 0 1 ty.e ty.e @ 1.27 log @corr to N250 @ text @d7 1 a7 1 -3 ty.e ty.e -1 0 1 ty.e ty.e N250 stc. Draft for further technical corrigenda N250
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 corrigenda N234
@ 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 17.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 corrigenda span 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 17.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 15.5.10 Note, replace is/2
by(is)/2
. d146 1 a146 1d157 1 a157 1 There is some perceived ambiguity that needs clarification: d253 1 a253 16.3.4.4 Note 2: (,)/2 by (',')/2 d263 1 a263 1 d268 1 a268 1d276 1 a276 1d284 1 a284 1d291 1 a291 1d295 1 a295 1d300 1 a300 1d310 1 a310 1d314 5 d334 1 a334 1d338 1 a338 1d346 1 a346 1 also in (* 6.4. *). The definition in 6.4 defines it as a sequence of d351 2 a352 26.4.1 single line comment
: A single line comment ends with anew 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 bydefined
. 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 17.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 97.10.4 add the following write-option d477 22 a498 7 GNUvariable_names(VN_list)
— Each variableV
is written as atomA
(withquoted(false)
) iff a termA = V
is an element of the listVN_list
. (Ensure thatA
is an atom of valid syntax. Pairs A = I where I is nonvar are ignored. Define priority when ['A1' = V, 'A2' = V])7.10.5 a) IfTerm
is a variable and there is an elementA = Term
of the listVN_list
thenA
is output with effective write-option quoted(false) else ... d501 2 a502 17.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 2e) Constructs the clause with head H and body B, d664 1 a664 1 Replace by G. d667 1 a667 1b) 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 byVY
. d750 1 a750 1 @ 1.13 log @*** empty log message *** @ text @d124 2 d322 5 a326 2Remark 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 thatA
is an atom of valid syntax) d453 7 d621 6 a708 276x.y.z between/3
x.y.z.1 Description
between(Lower, Upper, X)
is true iffX
is greater or equalLower
and less or equalupper.
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 iffS
is the successor of the natural numberX
.
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 andS
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 iffX
is greater or equalLower
and less or equalupper.
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 andZ
is a variable
—instantiation_error.
- b)
Y
is a variable andZ
is a variable
—instantiation_error.
- c)
X
is a variable andY
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 iffX
is greater or equalLower
and less or equalupper.
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 ;byread 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 = ;byp 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 ;byread 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 atype_error(callable,1)
forcatch(1,_,true).
It does not justify theinstantiation_error
forcatch(_,_,true)
.Suggestion: change 7.8.9.2 to
catch(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 1stc. Draft for the second technical corrigendum part 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 5d69 2 a70 8 of a second corrigendum. It contains some parts of N208 of 2008-11-17.
- Ulrich Neumerkel 2009-09-21 (Version history)
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
- N213 An error class for unexpected instantiations d72 1 d74 1 a74 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- Three steps to syntax harmony, Noname operators, A syntax extension for |.
- Evaluable functors, current practice d111 1 d124 68 a191 1
- 6.3.4.3
op = atom
replace byop = name
(discussed) d195 57 d255 7 d270 5 d279 2 a280 47.3.4, last paragraph: replace "directive indicating" by "indicating".- 7.4.3 End:
directiveindicating d295 2 a296 1 a goal. d301 3 a303 3- 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- 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 1The mode ?callable_term does not d332 9 a340 1 would be no instantiation error. Example X is 1/0+_. d351 32 a418 10
- 8.10.1.2 Replace
findall(?term, +callable_term, ?list)
byfindall(@@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.- 8.10.2.2 Replace
bagof(?term, +callable_term, ?list)
bybagof(@@term, +callable_term, ?list)
. d435 2 a436 1 Alternatively it might be preferable to issue type_error(atom,Xs). d441 2 a442 12- 8.14.3.3, add new error condition, per analogiam j, k.
m)Op_specifier
is a specifier such that an elementEl
of theOperator
list would have an invalid set of specifiers (see 6.3.4.3)
—permission_error(create, operator, El).
- 8.16.5.3 d, 8.16.8.3 d These subclauses suggests that
atom_codes
ornumber_codes(N,[1+2])
produces arepresentation_error(character_code)
. This looks much like adomain_error(character_code_list,[1+2])
or (less probable) atype_error(integer,1+2)
. d444 1 a444 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 ofE
. It is not defined for arguments of arguments!b)E
is a compound term and an argument ofE
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 31mo 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 8ISO/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 @