head 1.43; access; symbols; locks ulrich:1.43; strict; comment @# @; 1.43 date 2016.09.29.14.42.39; author ulrich; state Exp; branches; next 1.42; 1.42 date 2016.09.29.14.36.37; author ulrich; state Exp; branches; next 1.41; 1.41 date 2016.09.28.08.36.44; author ulrich; state Exp; branches; next 1.40; 1.40 date 2016.09.28.08.20.19; author ulrich; state Exp; branches; next 1.39; 1.39 date 2016.09.23.18.06.26; author ulrich; state Exp; branches; next 1.38; 1.38 date 2016.09.20.15.16.53; author ulrich; state Exp; branches; next 1.37; 1.37 date 2016.09.20.09.08.34; author ulrich; state Exp; branches; next 1.36; 1.36 date 2016.09.11.15.00.16; author ulrich; state Exp; branches; next 1.35; 1.35 date 2016.09.09.08.38.27; author ulrich; state Exp; branches; next 1.34; 1.34 date 2016.09.08.10.28.05; author ulrich; state Exp; branches; next 1.33; 1.33 date 2016.09.07.16.24.09; author ulrich; state Exp; branches; next 1.32; 1.32 date 2016.09.07.16.21.18; author ulrich; state Exp; branches; next 1.31; 1.31 date 2016.09.03.16.20.30; author ulrich; state Exp; branches; next 1.30; 1.30 date 2016.08.22.20.54.10; author ulrich; state Exp; branches; next 1.29; 1.29 date 2016.08.22.16.55.31; author ulrich; state Exp; branches; next 1.28; 1.28 date 2016.08.12.09.48.11; author ulrich; state Exp; branches; next 1.27; 1.27 date 2016.04.11.11.05.24; author ulrich; state Exp; branches; next 1.26; 1.26 date 2016.04.07.13.53.12; author ulrich; state Exp; branches; next 1.25; 1.25 date 2016.04.07.13.49.58; author ulrich; state Exp; branches; next 1.24; 1.24 date 2016.03.28.06.43.15; author ulrich; state Exp; branches; next 1.23; 1.23 date 2016.03.26.12.19.10; author ulrich; state Exp; branches; next 1.22; 1.22 date 2016.03.21.21.14.39; author ulrich; state Exp; branches; next 1.21; 1.21 date 2016.01.01.12.27.33; author ulrich; state Exp; branches; next 1.20; 1.20 date 2015.09.26.14.56.45; author ulrich; state Exp; branches; next 1.19; 1.19 date 2015.09.26.14.51.59; author ulrich; state Exp; branches; next 1.18; 1.18 date 2015.09.26.13.30.53; author ulrich; state Exp; branches; next 1.17; 1.17 date 2015.09.12.13.44.41; author ulrich; state Exp; branches; next 1.16; 1.16 date 2015.09.12.13.40.44; author ulrich; state Exp; branches; next 1.15; 1.15 date 2015.08.12.12.09.17; author ulrich; state Exp; branches; next 1.14; 1.14 date 2015.08.04.11.24.44; author ulrich; state Exp; branches; next 1.13; 1.13 date 2015.07.30.13.42.23; author ulrich; state Exp; branches; next 1.12; 1.12 date 2015.07.21.11.45.58; author ulrich; state Exp; branches; next 1.11; 1.11 date 2015.07.19.16.54.07; author ulrich; state Exp; branches; next 1.10; 1.10 date 2015.06.19.21.52.29; author ulrich; state Exp; branches; next 1.9; 1.9 date 2015.06.16.12.10.58; author ulrich; state Exp; branches; next 1.8; 1.8 date 2015.06.16.11.31.34; author ulrich; state Exp; branches; next 1.7; 1.7 date 2015.06.01.17.19.59; author ulrich; state Exp; branches; next 1.6; 1.6 date 2015.01.29.11.13.22; author ulrich; state Exp; branches; next 1.5; 1.5 date 2015.01.28.12.21.45; author ulrich; state Exp; branches; next 1.4; 1.4 date 2014.08.29.15.20.28; author ulrich; state Exp; branches; next 1.3; 1.3 date 2014.08.12.17.20.45; author ulrich; state Exp; branches; next 1.2; 1.2 date 2014.07.28.14.22.23; author ulrich; state Exp; branches; next 1.1; 1.1 date 2014.07.22.07.48.51; author ulrich; state Exp; branches; next ; desc @WDCor3 starting immediately after WG17 meeting @ 1.43 log @DCor.3 @ text @
Deleted text is marked as strike-through text, inserted text
is underlined.
5.5.12 Options
A processor may support one or more additional options such as stream-options (7.10.2.11), close-options (7.10.2.12), read-options (7.10.3), and write-options (7.10.4) as an implementation specific feature. An invalid optionE
shall be associated with only two error conditions: an instantiation error when there is an instance (3.95) ofE
that is a valid option, and a domain error for the domainoptname_option
when there is no instance ofE
that is a valid option. Further, an instantiation error may occur in place of the domain error if a component ofE
is a variable, and an instantiated component is required.
- NOTE — A valid option may be associated with other error conditions like 8.11.5.3 l and m.
p text = [ layout text sequence (* 6.4.1 *) ] ;
a) If Tunifies withhas the form^(_, G)
then ...
Table 21 and 22 show the execution stack before and
after executing the control constructcall(G)
with goal
obtained fromG
in step 7.8.3.1 f via 7.6.2.
N + 1 ( (goal, N – 1), Σ nilG
variable_names/1
and singletons/1
.
Clarify unification for variables/1
.
variables(Vars)
— After inputting a term,Vars
shall be unified with a list of the variables in the term input, in left-to-right traversal order.
variable_names(VN_list)
— After inputting a
term,VN_list
shall be unified with a list of ele-
ments where: (1) each element is a termA = V
, and
(2)V
is a named variable of the term, and (3)A
is an
atom whose name is the characters ofV
, and (4) there is exactly one element for each named variable, and (5) the elements appear in the order of the first occurrence of their variablesV
in the term input, in left-to-right traversal order.
singletons(VN_list)
— After inputting a term,
VN_list
shall be unified with a list of elements
where: (1) each element is a 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
,
and (4) there is exactly one element for each named variable occuring only once, and (5) the elements appear in the order of the first occurrence of their variablesV
in the term input, in left-to-right traversal order.
variable_names(VN_list)
before
numbervars(Bool)
in analogy to
the read-option.
Modify write-optionnumbervars(Bool)
.
3.206 write-option: Agroundterm that controls the
output produced by the built-in predicatewrite_term/3
(8.14.2) and its bootstrapped * built-in predicates (see
7.10.4, 7.1.4.2).
variable_names(VN_list)
— Each variableV
is output as the sequence of characters defined by the syntax for the atomA
iff a termA = V
is an element of the listVN_list
. If more than one element applies, the leftmost is used.VN_list
is a list of termsA = T
withA
an atom andT
any term, possibly a variable.
numbervars(Bool)
— IffBool
(7.1.4.2) istrue
a
term of the form'$VAR'(N)
, whereN
isana non-negative integer, is
output as a variable name consisting of a capital letter
possibly followed by an integer.
- NOTE 2 — Many Prolog processors modified write option
numbervars/1
to print arbitrary variable names. The write optionvariable_names/1
serves this purpose and avoids vulnerabilities.
variable_names/1
, correct terminology and writing of {}, lists,
extra round brackets
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, thenA
is output with effective write-optionquoted(false)
.
a) Ifa2) Else ifTerm
is a variable, a character sequence repre-
senting that variable is output. The sequence begins
with _ (underscore) and the remaining characters are
implementation dependent. During the execution ofwrite_term/3
, the
Thesame character sequence
is used for each occurrence of a particular variableinand a different character sequence is used for each
Term
. A
distinct variablein.Term
e)e1) IfTerm
has the form'$VAR'(N)
for somepos-non-negative integer
itiveNN
, and there is an effective write-option
numbervars(true)
, a variable name as defined in
subclause 7.10.4 is output,
g)e2) Else ifTerm
has the form'.'(Head, Tail)
, and
there is an effective write-optionignore_ops(false)
,
thenTerm
is output using list notation, that is:
- 1)
[
(open list char) is output.- 2)
Head
is output by recursively applying these
rules.Head
is preceded by(
(open char)
and followed by)
(close char), if the term could not be
re-input correctly with same set of current operators.- 3) If
Tail
has the form'.'(H,T)
then,
(comma
char) is output, setHead:=H
,Tail:=T
, and goto (2).- 4) If
Tail
is[]
then a closing bracket]
(close list
char) is output,- 5) Else a
|
(head tail separator char) is output,
Tail
is output by recursively applying these rules,.
Tail
is preceded by(
(open char)
and followed by)
(close char), if the term could not be
re-input correctly with same set of current operators.
andAnd finally,]
(close list char) is output.
e3) Else 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.
f) Else ifTerm
has a principal functor which is not
a current operator, or if there is an effective write-
optionignore_ops(true)
, then the term is output in
canonical formfunctional notation (6.3.3), that is:h)
- 1) The atom of the principal functor is output.
- 2)
(
(open char) is output.- 3) Each argument of the term is output by recursively
applying these rules. The argument is preceded by(
(open char) and followed by)
(close char), if the term could not be re-input correctly with the same set of current operators.- 4)
,
(comma char) is output between each successive
pair of arguments.- 5)
)
(close char) is output.IfElse ifTerm
has a principal functor which is an
operator, and there is an effective write-option
ignore_ops(false)
, then the term is output in operator
form, that is:1) The atom of the principal functor is output
in front of its argument (prefix operator), between
its arguments (infix operator), or after its argument
(postfix operator). In all cases, a space is output
to separate an operator from its argument(s) if any
ambiguity could otherwise arise.Operators
','
and'|'
are output as,
(comma char) and|
(bar char) respectively.2) Each argument of the term is output by recursively
applying these rules.When anAn argumentis itselfis preceded by (
to be output in operator form, it
(open char) and followed by ) (close char) if: (i) the argument's
principal functor is an operator whose priority is so
high that the term could not be re-input correctly with
same set of current operators, or (ii) the argument is
an atom which is a current operator, or (iii) the principal functor is output as a prefix operator-
and the argument is a non-negative number, or (iv) the principal functor is output as a prefix operator-
and the argument is output in infix or postfix operator form.
float
to the set ValidType
.
character_code_list
ValidDomain
.
PermissionType ∈ {
binary_stream, flag
_list
to types close_options
and stream_options
. Add Note 7 for options lists
close_options_list
— a list of close options (8.11.6),
...
stream_options_list
— a list of stream options (7.10.2.11),
7 When a built-in predicate has an argumentOptions
whose type is a list of optname-options as input, the argument is always+optname_options_list
. It is always associated with:A valid option may be associated with other error conditions.
- an instantiation error, when
Options
is a partial list, or an element of a list prefix ofOptions
is not a valid option but an instance of the element is a valid option;- a type error of the form
type_error(list, Options)
, whenOptions
is neither a partial list nor a list;- a domain error of the form
domain_error(optname_option, E)
, when an elementE
of a list prefix ofOptions
is neither a valid option nor any instance ofE
is a valid option; an instantiation error may occur in place of the domain error, if a component is a variable, and an instantiated component is required.
open(@@source_sink, @@io_mode, -stream, @@stream_options_list)
close(@@stream_or_alias, @@close_options_list)
current_prolog_flag(max_arity, A), X is A + 1, functor(T, foo, X). If the Prolog flag max_arity has the value unbounded type_error(evaluable, unbounded/0) else representation_error(max_arity).
B
by G
e) Constructs the clause with headH
and bodyB
G
[a, b, f(b),
f(a)]
as it originally was in IS 13211-1:1995.
b) the goal succeeds.
Add to the four subclauses 8.11.5.3 i, 8.11.6.3 e, 8.14.1.3 e, 8.14.2.3 e using in place of stream-option for the latter three close-option, read-option, and write-option respectively:
- c/b)
Options
is a partial list or has a list prefix with an element
E
which is a variable or which has a component
which is a variable, and an instantiated component is required.
—instantiation_error.
- i/e) An element
E
of a list prefix of theOptions
list is neither a
variable nor a stream-option and there is no instance ofE
that is a stream-option.
—domain_error(stream_option, E).
- k) Parses
C_Seq
as a read-term(6.4)(6.2.2)T.
,
write_canonical([1,2,3]). Succeeds, outputting the characters.(1,.(2,.(3,[ ]'.'(1,'.'(2,'.'(3,[]))) to the current output stream.
write_term(1,[quoted(non_boolean)]). domain_error(write_option,quoted(non_boolean)), write_term(1,[quoted(B)]). instantiation_error. B = true, write_term(1,[quoted(B)]). Succeeds, unifying B with true, and outputting the character 1.
set_prolog_flag(date, 'July 1988'). domain_error(flagprolog_flag, date).
Y
by VY
:
c)VX
is negative andY
VY
is not.
(^)/2
when resulting value is not an
integer but still a real number. Adjust example
- e)
VX
andVY
are integers andVX
is not equal to 1 andVY
is less than -1VX
is not equal to 1, 0, or -1 andVY
is negative.
—type_error(float, VX).
- NOTE — Error condition 9.3.10.3 e is satisfied when a float as an argument is needed for a defined result.
2^(-1).evaluation_error(undefined).type_error(float, 2). 2.0^(-1). Evaluates to the value 0.5.
V
,
and (4) the elements appear in the order of the first occurrence
of their variables V
in the term input, in left-to-right traversal order.
d189 4
a192 4
and (3) A
is an atom whose name is the characters
of V
,V
in the term input, in left-to-right traversal order.
d219 2
d300 1
a300 1
re-input correctly with the same set of current operators.
d310 1
a310 1
rules,]
(close list char) is output.
d404 12
a415 1
+optname_options
.
d427 1
a427 1
when the argument is a partial list, or an element of a list prefix
d430 1
a430 1
type_error(list, Options)
, when the argument is neither a partial list nor
d441 1
a441 1
Other error conditions may be associated with valid options.
d445 15
d591 1
a591 2
-1 VY
is negative
and VX
is not equal to 1, 0, or -1.
d594 10
@
1.38
log
@*** empty log message ***
@
text
@d81 1
a81 1
+optname_options_list
.
d409 1
a409 1
That argument will always be associated with:
d412 2
a413 1
when the argument is a partial list, or an element is not a valid
d419 2
a420 1
an element E
of a list prefix is neither a valid option nor any instance is a valid
d422 2
a423 2
{
(open curly char) is output
Arg
is output by recursively applying these rules
}
(close curly char) is output
d375 1
a375 1
(open char) and followed by ) (close char) if: (i) thedomain_error(optname_option, E)
), when
d419 1
a419 1
option.
@
1.35
log
@*** empty log message ***
@
text
@d410 1
a410 1
an element of a list prefix is neither a valid option nor any instance is a valid
@
1.34
log
@*** empty log message ***
@
text
@d398 1
a398 1
a list of options as input, that argument will be an
@
1.33
log
@One more list prefix
@
text
@d410 1
a410 1
an element is neither a valid option nor any instance is a valid
@
1.32
log
@*** empty log message ***
@
text
@d465 1
a465 1
Options
is a partial list or a list with an element7 When a built-in predicate has an argument whose type is d412 1 a412 1additionally, an instantation error may occur in place of the d417 1 d451 5 a455 1 b) the goal succeeds.d462 1 a462 1 8.14.2.3 b repectively: d511 1 d521 1 @ 1.29 log @Remove alternative token. Justification: http://stackoverflow.com/a/36971593/772868 @ text @d219 7 a225 11NOTE 2 — For write-option variable_names(VN_list)
any instance (3.95) (obtained via unification) of a term obtained with the corresponding read-option is well defined. @@@@@@ Actually, only the selection of the variable names to be printed is well defined.NOTE 3 — Many Prolog processors had modified the write option numbervars/1 to permit printing arbitrary variable names. The write option variable_names/1 should be used for this purpose to avoid vulnerabilities. @@@@@@ d407 1 a407 1
C10 add alternate error to second last example d423 1 a423 1
d425 1 a425 1a426 1
- (WDCor.3) 8.9.2.1 d432 3 d436 2 a437 5
- (WDCor.3) 8.10.3.4 example no. 20 undo the change introduced in Cor.1. That is, keep the list
[a, b, f(b), f(a)]
as in IS 13211-1:1995.- (WDCor.3) 8.11.4.1 Add subclause d440 1 a440 1
- d442 4 a445 1 8.11.5.3 c, 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b repectively: d448 1 a448 1
- c)
Options
is a partial list or a list with an element
d464 1 a464 1- i) An element
E
of a list prefix d471 2 a473 4- (WDCor.3) 8.14.1.1 k replace reference 6.4 by 6.2.2. d480 3 a482 2
- (WDCor.3) 8.14.2.4 Examples
Modify example. Add further examples d505 1 a505 2
- 8.17.1.4 Examples
Replace domain in error in fourth d507 1 d515 2 a516 2
- 9.3.1.3 c
Replace
Y
byVY
: d522 1 a522 3
CXXX @ 1.28 log @*** empty log message *** @ text @a131 12
C2x Add a further alternative totoken (* 6.4. *)
@ 1.27 log @*** empty log message *** @ text @d92 1 a92 1... | comma (* 6.4 *) | bar (* 6.4 *) ;Deletedtext is in Strikethrough, inserted text d132 12 d206 1 a206 1 Add write-optionvariable_names(VN_list)
before option d208 2 a209 3 the read-optionvariable_names(VN_list)
. Replace an by a non-negative in write-optionnumbervars(Bool)
. d229 1 a229 1 d243 1 a243 1 d410 1 a410 1a type error list, when the argument is neither a partial list nor d413 1 a413 1 form domain_error(optname_option, Culprit)
), when d420 1 a420 2 Errors caused by a well-formed/valid option are not subsumed by the domain error. They are reported using different errors. d459 1 a459 1 8.11.5.3 c, 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b: d496 2 a497 2Add examples to 8.14.2.4. a498 3 (WDCor.3) 8.14.2.4 Examples Replace three times
.
by','
and remove a space. a507 2 Add further examples d521 4 a524 2Replace domain in error in fourth example:
d528 1 a528 2 d540 1 a540 1 Replace error condition for(^)/2
, when resulting value is not an d556 3 a558 1d562 1 @ 1.26 log @*** empty log message *** @ text @d240 3 a242 1
Add as first subclause: a251 3
Rename subclause a to a2 d257 1 a257 1 ofwrite_term/3
, the
thesame character sequence
d263 3 a265 1
Rename subclause e to e1 and replace: d268 1 a268 1e)e1) IfTerm
has d272 1 a272 4 subclause 7.10.4 is output,
a304 3d342 1 a342 4
Add new 7.10.5 subclause e3 for {X} (Already noted in DTC1) a317 4
7.10.5 Replace canonical form by functional notation ; subclause f 3 must mention the required open char, close char. a340 1
h)IfElse ifTerm
has a principal functor which is an
a392 2 (There should be a typeoptname_options_list
used in Template and Modes, and a correspondingdomain_error(optname_option, Culprit)
). d401 4 a404 2a domain error, when an element is neither a valid option nor any instance is a valid option. @ 1.25 log @Precision for variable names, Feliks Kluzniak @ text @d258 1 a258 1 of write_term/3
,
the same character sequence
@ 1.24 log @*** empty log message *** @ text @d253 11 @ 1.23 log @*** empty log message *** @ text @d470 2 a471 2i) An element E
of (@@@@@@ a list prefix ofOptions
) theOptions
list is neither a
@ 1.22 log @*** empty log message *** @ text @d403 2 d411 1 a411 1 Errors caused by a well-formed option are not subsumed by the @ 1.21 log @*** empty log message *** @ text @d393 1 a393 1 a list of options (@@@@@@ as input?), that argument will be an d410 1 a410 1 domain error. They are reported differently. @@@@@@using different errors. @ 1.20 log @*** empty log message *** @ text @d101 3 a103 3 A processor may support one or more additional options such as stream options (7.10.2.11), stream close options (7.10.2.12), read options (7.10.3), and write options (7.10.4) as an implementation specific d107 1 a107 1 for the domainxxx_option
d152 1 a152 2 obtained fromG
via 7.6.2 Converting a term to the body of a clause@@@@@@ according to 7.8.3.1 f. d165 1 d170 4 d210 1 a210 1numbervars(Bool)
- IffBool
(7.1.4.2) istrue
a
d218 1 d232 1 d300 1 d349 1 a349 1 1) The atom of the principal functor is output
d391 1 a391 18.1.3 Errors
. d394 3 a396 3 +oname_options_list. (There should be a type oname_options_list used in Template and Modes, and a corresponding domain_error(oname_option, Culprit)). d417 2 a418 1d427 1 a427 1d468 2 a469 1i) An element E
of the Options list is neither a
d489 14 d510 2 a511 1 Succeeds, outputting the character 1. a514 11(WDCor.3) 8.14.2.4 Examples Replace three times
.
by','
and remove a space.write_canonical([1,2,3]). Succeeds, outputting the charactersd535 1 a535 1 integer but still a real number. d538 1 a538 1.(1,.(2,.(3,[ ]'.'(1,'.'(2,'.'(3,[]))) to the current output stream.9.3.10.3 e
a548 2
CXXX Replace example error @ 1.19 log @Comments by Jonathan Hodgson of 2015-09-25 @ text @d399 2 a400 1 domain error, if ...@@ @ 1.18 log @*** empty log message *** @ text @d153 1 a153 1 body of a clause. d199 2 a200 2 variableV
is output as the unquoted atom (@@@@@@better: is output as the sequence of characters defined by the syntax for the atom)A
d382 1 a382 1
C9 Add Note 7 for options lists. d405 1 d407 1 d409 10 d420 1 a422 38.5.1.4 Examples second last: Missing alternative error type_error(evaluable,unbound)
when Prolog flag bounded is false. @@@@@@ @ 1.17 log @*** empty log message *** @ text @d138 1 a138 1 a) If Tunifies withhas the form ^(_, G) d199 2 a200 1 variableV
is output as the unquoted atomA
d228 1 a228 1
C7 Add writing d257 1 a257 1
7.10.5 subclause g: Rename rename subclause g to subclause e2. d353 1 a353 12) Each argument of the term is output by recursively
d365 1 a365 1 argument is to be output in infix or postfix operator form. @ 1.16 log @*** empty log message *** @ text @d397 2 @ 1.15 log @*** empty log message *** @ text @d92 2 a93 1deletedtext, inserted text. d110 1 a110 1 Further, an instantation error may occur in place of a d175 1 a175 1 and (4) the elements appear in the order of the first occurence d184 1 a184 1 and (4) the elements appear in the order of the first occurence d386 3 a388 3 +xxx_options_list. (There should be a type name_options_list used in Template and Modes, and a corresponding domain_error(name_option)). d398 2 a399 2 Errors that are caused by a well-formed option are not subsumed by the domain error but are signalled separately. @ 1.14 log @*** empty log message *** @ text @d14 2 a15 2 del {background: #ffe4e4 } ins {background: #e4ffe4 } a75 6 u { background: #ff0000 } s { background: #ff0000 } d143 2 a144 2 example. Add to the first paragraph, and replace in Table 22 G by goal: d173 3 a175 3 atom whose name is the characters ofV
, and (4) the elements appear in the order of their variablesV
in the term input, in left-to-right traversal order. d183 2 a184 2 and (4) the elements appear in the order of their variablesV
in the term input, in left-to-right traversal order. d221 3 a223 2NOTE 3 — Many processors had @@@@@@abused the write option numbervars/1 for printing arbitrary variable names. @@@@@@ d226 1 a226 1
C7 Add writing a229 1 d232 1 a232 1
Add as first subclause: d304 1 a304 1 ; subclause f 3 must mention the required open char, close a363 2 a366 11d424 3 a426 1
- Condition (ii) never applies, because there is a further contradicting condition in front: "When an argument is itself to be output in operator form". If we have an argument which is an atom then that atom is not be output in operator form. Only certain principal functors of arity one and two are to be output in operator form. Thus, we will never get to condition (ii).
(WDCor.3) 8.11.5.3 c: d428 1 a428 1 byd434 17 a450 1 Same for 8.11.6.3 b, 8.14.1.3 b, 8.14.2.3 b. d462 7 a468 11
(WDCor.3) 8.14.2.3 e
- e) An element
E
of 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)) d470 1 a470 5 domain_error(write_option,quoted(_))The second case seems to be particularly problematic because a further instantiation would make this goal succeed.d474 2 a475 1 See also write options. d488 1 a488 1Replace error in fourth example: d491 1 a491 1
domain_error(flag, date).domain_error(prolog_flag, date). d505 1 a505 1
C@@@@@@ d521 1 a521 1
C@@@@@@ d537 14 a550 16All error subclauses (X.Y.Z.3) starting with C1: Mdash: — C3 8.2.4.1: Theta: θ C5 8.4.2: Ndash: – C14 9.1.3:
- Times: ×
- Rightwards arrow: →
- Union: ∪
- Floor: ⌊ ⌋
- Inequality: ≠
- Logical and: ∧
- Element of, not in: ∈, ∉
C15 9.3.11.1, 9.3.12.1, 9.3.13.1, C16: @ 1.13 log @*** empty log message *** @ text @d317 1 a317 1
- Pi: π
- Less or equal: ≤
canonical formfunctional notation, that is: d341 1 a341 1 h) Else ifTerm
has a principal functor which is an
@ 1.12 log @*** empty log message *** @ text @d109 1 a109 1 feature. An invalid optionE
is associated with only two @ 1.11 log @*** empty log message *** @ text @d20 1 d112 1 d117 7 a123 1 instantiated argument is required. d126 3 a128 1
C2 a130 3 Add an optional layout text sequence to the fourth and last production d138 2 a141 2 Replace unified with by has the form d148 4 a151 1
C4 Add missing term-to-body conversion in example a153 2 Add to the first paragraph: a159 1Replace in Table 22 G by goal: ((
goal, N-1), ...) d161 9 a169 1G
C5 Specify missing left-to-right traversal order to lists in d172 1 a172 17.10.3 Read-options lists
d195 5 a201 6 add missing write-optionvariable_names(VN_list)
in analogy to the read-optionvariable_names(VN_list)
. Replace an integer bya non-negative integer in write-optionnumbervars(Bool)
.7.10.4 add before option
numbervars(Bool)
: d231 4 a234 1
C7 a236 2 Add writing withvariable_names/1
, correct writing {}, lists, extra round brackets d238 1 a238 1
7.10.5 add as first subclause: d249 1 a249 1
7.10.5 subclause a: Rename subclause a to a2 d251 1 a251 1
7.10.5 subclause e: Rename subclause e to e1 and replace: d309 2 a310 1
7.10.5 subclause f 3 must mention the required open char, close d396 1 a396 1
7.12.2 e: add missing commaPermissionType ∈ { @ 1.10 log @
d395 1 d419 1 a419 1 body@ text @d114 2 a115 13 domain error if there exists terms @@@@@@G
andO
such thata117 1 d147 1 a147 1 Table 21 and 22 how the execution stack before and
O
is a valid option- both
E
andO
are an instance ofG
; (using idempotent substitutions θ. That is, with θ.θ = θ)G
contains one or more variables ofE
- unifying
G
withO
gives a substitution affecting one or more variables that occur inG
andE
. (and there is no otherO
that would not require this...)
after executing the @ 1.9 log @Edit markups are nowand @ text @d99 2 a100 3
C1 Allow explicitly extensions to options in 5.5 Extensions.
5.5 Add new subclause d153 3 a155 2
C47.8.3.4
d164 1 a164 1 Replace in Table 22: ((Ggoal, N-1), ...) d210 1 a210 1 is a non-negative d395 4 a398 3
- 8.1.3 Errors. Add Note 7:
7 When a built-in predicate has an argument whose type is d412 2 d416 5 d482 2 a483 3Replace three times
.
by','
; remove a space.a489 1d491 7 a497 4- 8.14.3.3 Examples, fourth example: Replace domain_error(flag, date). by domain_error(prolog_flag, date). d500 2 d503 1 a503 1
- Replace in 9.3.1.3 c)
VX
is negative d505 1 d507 1 a507 4- (WDCor.3) 9.3.10.3 e. Error condition needs to be reformulated to cover all cases where the resulting value cannot be in I but still is in R.
Here are the values for
X^Y
forX, Y in -3..3
. d509 3 a511 11Replace
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 d513 4 a516 4 X
-3 -2 -1 0 1 2 3 d519 2 a520 9 -1.
—type_error(float, VX).
by
- e)
VX
andVY
are integers andVY
is negative andVX
is greater than 1 or less than -1 d523 1 d525 3 a527 11 alternativelyReplace error in 9.3.10.4 Examples, a531 2 @ 1.8 log @*** empty log message *** @ text @d14 3 d96 2 a97 1 d139 1 a139 1 p text = [ layout text sequence (* 6.4.1 *) ] ; d146 2 a147 1 Replace d149 1 a149 1 a) If T
- e)
VX
andVY
are integers andVY
is negative andVX
is not equal to 1, 0, or -1
—type_error(float, VX).
unifies with^(_, G) d152 1 a152 4 bya) If T has the form ^(_, G) then ...d160 1 a160 1 control constructcall(G)
with goal
d162 1 a162 1 body of a clause. d164 1 a164 3 Replace in Table 22((G, N-1), ...)by ((goal, N-1), ...). d176 1 a176 1 atom whose name is the characters ofV
, and (4) d178 1 a178 1 in the term input, in left-to-right traversal order. d186 2 a187 2 and (4) the elements appear in the order of their variablesV
in the term input, in left-to-right traversal order. d210 1 a210 1 is a non-negative d251 3 a253 3e)e1) IfTerm
has the form'$VAR'(N)
for somepos-non-negative integer N, and there is an effective write-option
itive
d261 1 a261 1g)e2) Else ifTerm
has the form'.'(Head, Tail)
, and
d269 1 a269 1 rules.Head
d272 1 a272 1 re-input correctly with the same set of current operators.
d283 1 a283 1Tail
d286 1 a286 1 re-input correctly with the same set of current operators,
d313 1 a313 1canonical formfunctional notation, that is: d322 1 a322 1 The argument d325 1 a325 1 re-input correctly with the same set of current operators. d337 1 a337 1 h) Else ifTerm
has a principal functor which is an
d349 1 a349 1Operators
','
d351 1 a351 1 and|
(bar char) respectively. d354 3 a356 3 applying these rules.WhenAn argumentis itselfis preceded by (
to be output in operator form, it
d361 1 a361 1 an atom which is a current operator, or (iii) the d365 1 a365 1 argument is to be output in infix or postfix operator form. d387 1 a387 1 7.12.2 b: Addfloat
to the setValidType
. d389 1 a389 1
7.12.2 c: Removefrom d393 1 a393 2 binary_stream flag,character_code_list
, d421 1 a421 1 Replace byB
G
. d435 2 a436 2E
which is a variable or which has a component
which is a variable, and an instantiated component is required. d447 1 a447 8k) Parses C_Seq
as a read-term (6.4)T.
,by
- k) Parses
C_Seq
as a read-term (6.2.2)T.
, d474 2 a475 1Replace d480 1 a480 10 .(1,.(2,.(3,[ ]))) to the current output stream.
Add: d348 1 a348 3write_canonical([1,2,3]). Succeeds, outputting the characters '.'(1,'.'(2,'.'(3,[]))) d492 2 a493 2(WDCor.3) 9.3.1.3 c) VX
is negative and Y is not. Replace byVY
. d517 2 a518 2 andVX
is not equal to 1 andVY
is less than -1. d525 2 a526 2 andVY
is negative andVX
is greater than 1 or less than -1 d534 2 a535 2 andVY
is negative andVX
is not equal to 1, 0, or -1 d539 1 a539 1 Replace in 9.3.10.4 Examples, d543 1 a543 1 evaluation_error(undefined). d546 1 a546 9 by2^(-1). type_error(float, 2).@ 1.7 log @2015/02/09 01:54:08 @ text @d110 2 a111 1 @@@@@@ Further, an instantation error may occur if there exists terms @ 1.6 log @*** empty log message *** @ text @d6 1 a6 1Working draft technical corrigendum 3 d27 1 a27 1 max-width: 32em; d73 4 a76 1 { background: #ffd8d8 } d110 2 a111 1 @@@@@@ Further, an instantation error may occur if d113 9 a121 8there exists a term O
that is a valid optionthere exists a term G
with bothE
andO
an instance ofG
, andG
contains variables ofE
.such that unifying G
withO
gives a substitution affecting some variables that occur inG
andE
.all instances are using idempotent substitutions θ. That is, with θ.θ = θ. d129 2 a130 1 Replace the fourth and last production d132 3 a134 6 p text = ;byp text = [ layout text sequence (* 6.4.1 *) ] ; d136 1 d143 1 a143 1 a) If T unifies with ^(_, G) d154 1 a154 3 Replace in Table 22 ((G, N-1), ...) by ((goal, N-1), ...). Add to: d156 2 a157 2 Table 21 and 22 how the execution stack before and after executing the control constructcall(G)
with goal d159 5 a163 1 body of a clause. a190 137.10.4 Write-option
replace an integer bya non-negative integer.numbervars(Bool)
numbervars(Bool)
- IffBool
(7.1.4.2) istrue
a
term of the form'$VAR'(N)
, whereN
is a non-negative integer, is
output as a variable name consisting of a capital letter
possibly followed by an integer.
C7 d195 2 d198 1 a198 1 7.10.4 add: d206 8 d218 1 a218 1 any instance (3.95) of a term obtained with the corresponding d228 1 a228 1
C8 d249 17 a265 3 IfTerm
has the form'$VAR'(N)
for some pos-
itive integer N, ... by non-negative. d267 24 a290 1
Add new 7.10.5 subclause e for {X} (Already noted d294 1 a294 1 e2) Else ifTerm
has the form'{}'(Arg)
, and d305 13 a317 2(WDCor.3) 7.10.5 subclause f 3 must mention the required open char, close char. d319 6 a324 3 (WDCor.3) 7.10.5 subclause g must precede subclause f. Otherwise, writeq([a]) always has to write '.'(a,[]). That is, rename subclause g to subclause e3. d326 2 d329 2 a330 3 7.10.5 h Replace h) IfTerm
has a principal functor ... a331 1 by Else if d333 2 a334 17.10.5 h d336 1 a336 1 h) If Term has a principal functor which is an
d338 1 a338 1 ignore_ops(false), then the term is output in operator
a346 4d352 4 a355 5Operators','
d350 1 a350 4 and|
(bar char) respectively.2) Each argument of the term is output by recursively
applying these rules. When an argument is itself
to be output in operator form, it is preceded by (
d360 7 a366 1 an atom which is a current operator. d379 1 d381 1 a381 2The cases - (1) and - (1^a) are not mentioned explicitly. d383 1 a383 2 The cases (1,2) and (1|2) are not mentioned. a384 1 d386 1 a386 1 Tentative new formulation: d388 2 a389 12 2) Each argument of the term is output by recursively applying these rules. 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 operatord391 2 a392 4-
and the argument is a non-negative number, or (iv) the principal functor is output as a prefix operator-
and the argument is to be output in infix or postfix operator form.(WDCor.3) 7.12.2 b: Add float
to the setValidType
.(WDCor.3) 7.12.2 c: Remove character_code_list
from the setValidDomain
. a393 37.12.2 e: PermissionType ∈ { binary_stream flag,
add comma. d418 1 a418 1 bodyB
, d420 1 a420 1 Replace byG
. @ 1.5 log @*** empty log message *** @ text @d89 1 a89 1 Istanbul 2013/Vienna 2014. d102 16 a117 4 feature. Invalid options are associated with only two kinds of error conditions: an instantiation error when there is an instance which is a valid option or @@@@@@, and a domain error when there is no instance that is a valid option. See 8.1.2 Errors, Notes. d148 1 a148 17.8.3.4, Table 22
: d150 8 a157 3 Replace ((G, N-1), ...) by ((goal, N-1), ...) where goal is obtained from G via 7.6.2. @ 1.4 log @Renumbering, new C2 @ text @d104 1 a104 1 a valid option, and a domain error when there is no instance that is a d447 7 @ 1.3 log @(sofar) @ text @d108 1 d110 13 d135 1 a135 1
C3 d139 1 a139 1 by ((goal, N-1), ...) where goal is d142 1 a142 1
C4 Specify missing left-to-right traversal order to lists in d167 3 a169 2
C57.10.4 Write-option
add: d171 1 a171 1numbervars(Bool)
d174 1 a174 1 is an a non-negative d180 1 a180 1
C6 d204 1 a204 1NOTE 3 &mdahs; Many processors had @@@@@@abused the write option d206 1 d208 1 a208 1 d211 2 a212 3 The following changes d214 1 a214 1 7.10.5 add as first subclause: d225 1 a225 2 7.10.5 subclause a
. Rename subclause a to a2. d227 3 a229 1(WDCor.3) 7.10.5 subclause e: Replace: If Term
has the d233 2 a234 4(WDCor.3) 7.10.5 subclause e. Rename subclause to e1. (WDCor.3) 7.10.5 new subclause for {X} needed (Already noted in DTC1). Tentative new clause a247 2 d389 4 a392 1 (WDCor.3) 8.14.1.1 k d555 1 a555 1
October 2013 - June 2014 @ 1.2 log @1st change thereafter @ text @a107 11 @@@@@@@@d128 2 a129 2
- NOTE — write-option
variable_names(VN_list)
any instance (3.95) of a term obtained with the corresponding read-option is well defined. @@@@@@ Actually, only the selection of the variable names to be printed is well defined.
C4 Add left-to-right traversal order to lists in read-options. d146 4 a149 2 and (3)A
is an atom whose name is the characters ofV
.
@@@@@@ idem d153 1 d165 2 d168 2 a169 3 add missing write-optionvariable_names(VN_list)
in analogy to the read-optionvariable_names(VN_list)
. @ 1.1 log @Initial revision @ text @d92 1 a92 2
C1 Allow explicitly extensions to options in 5.5 Extensions. d94 1 a94 15.5.12 Add new subclause d99 7 a105 8 A processor may support one or more additional options, like stream options (7.10.2.11), stream close options (7.10.2.12), stream properties (7.10.2.13), read options (7.10.3), and write options (7.10.4) as an implementation specific feature. @@@@@@ The processing of options is associated only with instantiation errors and domain errors for the specific option domain. (Refer to 8.1.2 Notes) d108 10 d119 1 d132 1 d139 4 a142 1
7.10.3
a151 2 @