head 1.108; access; symbols; locks ulrich:1.108; strict; comment @# @; 1.108 date 2011.06.22.12.26.41; author ulrich; state Exp; branches; next 1.107; 1.107 date 2011.06.22.12.25.43; author ulrich; state Exp; branches; next 1.106; 1.106 date 2011.05.24.21.48.00; author ulrich; state Exp; branches; next 1.105; 1.105 date 2011.05.15.21.36.49; author ulrich; state Exp; branches; next 1.104; 1.104 date 2011.05.14.18.32.38; author ulrich; state Exp; branches; next 1.103; 1.103 date 2011.05.14.18.24.31; author ulrich; state Exp; branches; next 1.102; 1.102 date 2011.05.14.10.14.14; author ulrich; state Exp; branches; next 1.101; 1.101 date 2011.04.28.07.25.04; author ulrich; state Exp; branches; next 1.100; 1.100 date 2011.04.28.07.12.47; author ulrich; state Exp; branches; next 1.99; 1.99 date 2011.04.27.21.21.23; author ulrich; state Exp; branches; next 1.98; 1.98 date 2011.04.26.23.31.28; author ulrich; state Exp; branches; next 1.97; 1.97 date 2011.04.12.19.02.12; author ulrich; state Exp; branches; next 1.96; 1.96 date 2011.03.22.15.02.39; author ulrich; state Exp; branches; next 1.95; 1.95 date 2010.12.08.23.20.34; author ulrich; state Exp; branches; next 1.94; 1.94 date 2010.12.07.17.07.02; author ulrich; state Exp; branches; next 1.93; 1.93 date 2010.12.06.23.25.58; author ulrich; state Exp; branches; next 1.92; 1.92 date 2010.12.06.22.42.39; author ulrich; state Exp; branches; next 1.91; 1.91 date 2010.11.30.22.23.58; author ulrich; state Exp; branches; next 1.90; 1.90 date 2010.11.30.22.23.21; author ulrich; state Exp; branches; next 1.89; 1.89 date 2010.11.30.22.22.56; author ulrich; state Exp; branches; next 1.88; 1.88 date 2010.11.30.22.22.15; author ulrich; state Exp; branches; next 1.87; 1.87 date 2010.11.30.22.21.26; author ulrich; state Exp; branches; next 1.86; 1.86 date 2010.11.30.22.17.08; author ulrich; state Exp; branches; next 1.85; 1.85 date 2010.11.29.17.57.23; author ulrich; state Exp; branches; next 1.84; 1.84 date 2010.11.26.17.55.17; author ulrich; state Exp; branches; next 1.83; 1.83 date 2010.11.26.15.50.29; author ulrich; state Exp; branches; next 1.82; 1.82 date 2010.11.26.15.46.04; author ulrich; state Exp; branches; next 1.81; 1.81 date 2010.11.26.15.38.11; author ulrich; state Exp; branches; next 1.80; 1.80 date 2010.11.26.15.31.02; author ulrich; state Exp; branches; next 1.79; 1.79 date 2010.11.10.04.29.43; author ulrich; state Exp; branches; next 1.78; 1.78 date 2010.11.10.03.25.13; author ulrich; state Exp; branches; next 1.77; 1.77 date 2010.11.10.02.40.17; author ulrich; state Exp; branches; next 1.76; 1.76 date 2010.11.10.01.07.10; author ulrich; state Exp; branches; next 1.75; 1.75 date 2010.10.14.18.33.23; author ulrich; state Exp; branches; next 1.74; 1.74 date 2010.10.14.17.39.19; author ulrich; state Exp; branches; next 1.73; 1.73 date 2010.10.14.17.34.43; author ulrich; state Exp; branches; next 1.72; 1.72 date 2010.10.11.22.18.58; author ulrich; state Exp; branches; next 1.71; 1.71 date 2010.10.07.13.12.37; author ulrich; state Exp; branches; next 1.70; 1.70 date 2010.10.06.20.30.18; author ulrich; state Exp; branches; next 1.69; 1.69 date 2010.10.06.07.40.10; author ulrich; state Exp; branches; next 1.68; 1.68 date 2010.10.05.00.26.00; author ulrich; state Exp; branches; next 1.67; 1.67 date 2010.10.05.00.22.49; author ulrich; state Exp; branches; next 1.66; 1.66 date 2010.10.05.00.10.51; author ulrich; state Exp; branches; next 1.65; 1.65 date 2010.09.30.17.10.27; author ulrich; state Exp; branches; next 1.64; 1.64 date 2010.09.30.12.34.20; author ulrich; state Exp; branches; next 1.63; 1.63 date 2010.09.30.09.29.17; author ulrich; state Exp; branches; next 1.62; 1.62 date 2010.09.30.09.27.47; author ulrich; state Exp; branches; next 1.61; 1.61 date 2010.09.28.17.56.05; author ulrich; state Exp; branches; next 1.60; 1.60 date 2010.09.27.18.11.38; author ulrich; state Exp; branches; next 1.59; 1.59 date 2010.09.24.19.28.25; author ulrich; state Exp; branches; next 1.58; 1.58 date 2010.09.24.19.03.13; author ulrich; state Exp; branches; next 1.57; 1.57 date 2010.09.24.10.19.18; author ulrich; state Exp; branches; next 1.56; 1.56 date 2010.09.23.22.10.27; author ulrich; state Exp; branches; next 1.55; 1.55 date 2010.09.23.22.07.35; author ulrich; state Exp; branches; next 1.54; 1.54 date 2010.09.23.21.40.47; author ulrich; state Exp; branches; next 1.53; 1.53 date 2010.09.23.12.37.20; author ulrich; state Exp; branches; next 1.52; 1.52 date 2010.09.21.22.54.43; author ulrich; state Exp; branches; next 1.51; 1.51 date 2010.09.21.22.54.30; author ulrich; state Exp; branches; next 1.50; 1.50 date 2010.09.21.20.49.22; author ulrich; state Exp; branches; next 1.49; 1.49 date 2010.09.20.08.59.19; author ulrich; state Exp; branches; next 1.48; 1.48 date 2010.09.18.14.50.21; author ulrich; state Exp; branches; next 1.47; 1.47 date 2010.09.18.14.27.23; author ulrich; state Exp; branches; next 1.46; 1.46 date 2010.09.18.14.19.42; author ulrich; state Exp; branches; next 1.45; 1.45 date 2010.09.18.13.00.51; author ulrich; state Exp; branches; next 1.44; 1.44 date 2010.09.18.12.41.24; author ulrich; state Exp; branches; next 1.43; 1.43 date 2010.09.17.18.19.58; author ulrich; state Exp; branches; next 1.42; 1.42 date 2010.09.17.16.58.06; author ulrich; state Exp; branches; next 1.41; 1.41 date 2010.09.17.14.10.27; author ulrich; state Exp; branches; next 1.40; 1.40 date 2010.09.17.00.06.10; author ulrich; state Exp; branches; next 1.39; 1.39 date 2010.09.17.00.05.18; author ulrich; state Exp; branches; next 1.38; 1.38 date 2010.09.17.00.05.06; author ulrich; state Exp; branches; next 1.37; 1.37 date 2010.09.16.23.54.16; author ulrich; state Exp; branches; next 1.36; 1.36 date 2010.09.16.22.04.44; author ulrich; state Exp; branches; next 1.35; 1.35 date 2010.09.16.16.22.07; author ulrich; state Exp; branches; next 1.34; 1.34 date 2010.09.16.12.25.50; author ulrich; state Exp; branches; next 1.33; 1.33 date 2010.09.15.20.20.55; author ulrich; state Exp; branches; next 1.32; 1.32 date 2010.09.15.20.19.07; author ulrich; state Exp; branches; next 1.31; 1.31 date 2010.09.15.20.18.41; author ulrich; state Exp; branches; next 1.30; 1.30 date 2010.09.15.18.09.34; author ulrich; state Exp; branches; next 1.29; 1.29 date 2010.09.15.18.05.57; author ulrich; state Exp; branches; next 1.28; 1.28 date 2010.09.15.16.45.51; author ulrich; state Exp; branches; next 1.27; 1.27 date 2010.09.15.13.15.56; author ulrich; state Exp; branches; next 1.26; 1.26 date 2010.09.15.13.13.46; author ulrich; state Exp; branches; next 1.25; 1.25 date 2010.09.14.14.22.33; author ulrich; state Exp; branches; next 1.24; 1.24 date 2010.09.14.10.59.49; author ulrich; state Exp; branches; next 1.23; 1.23 date 2010.09.14.00.59.59; author ulrich; state Exp; branches; next 1.22; 1.22 date 2010.09.14.00.17.46; author ulrich; state Exp; branches; next 1.21; 1.21 date 2010.09.14.00.16.46; author ulrich; state Exp; branches; next 1.20; 1.20 date 2010.09.13.22.52.59; author ulrich; state Exp; branches; next 1.19; 1.19 date 2010.09.13.13.32.50; author ulrich; state Exp; branches; next 1.18; 1.18 date 2010.09.13.13.27.56; author ulrich; state Exp; branches; next 1.17; 1.17 date 2010.09.12.22.10.28; author ulrich; state Exp; branches; next 1.16; 1.16 date 2010.09.12.12.09.38; author ulrich; state Exp; branches; next 1.15; 1.15 date 2010.09.11.22.40.32; author ulrich; state Exp; branches; next 1.14; 1.14 date 2010.09.11.18.14.13; author ulrich; state Exp; branches; next 1.13; 1.13 date 2010.09.11.17.31.35; author ulrich; state Exp; branches; next 1.12; 1.12 date 2010.09.11.15.33.35; author ulrich; state Exp; branches; next 1.11; 1.11 date 2010.09.10.19.31.21; author ulrich; state Exp; branches; next 1.10; 1.10 date 2010.09.10.19.19.06; author ulrich; state Exp; branches; next 1.9; 1.9 date 2010.09.10.18.09.44; author ulrich; state Exp; branches; next 1.8; 1.8 date 2010.09.10.13.36.45; author ulrich; state Exp; branches; next 1.7; 1.7 date 2010.09.10.12.39.30; author ulrich; state Exp; branches; next 1.6; 1.6 date 2010.09.10.11.46.17; author ulrich; state Exp; branches; next 1.5; 1.5 date 2010.09.09.20.56.08; author ulrich; state Exp; branches; next 1.4; 1.4 date 2010.09.09.13.04.48; author ulrich; state Exp; branches; next 1.3; 1.3 date 2010.09.07.23.23.11; author ulrich; state Exp; branches; next 1.2; 1.2 date 2010.09.07.23.14.14; author ulrich; state Exp; branches; next 1.1; 1.1 date 2010.09.07.22.06.02; author ulrich; state Exp; branches; next ; desc @@ 1.108 log @*** empty log message *** @ text @
A 1. Resolved that the missing error corresponding to
a call to open/3,4 in which the stream variable is instantiated be called
uninstantiation_error and that a corrigendum to this effect be submitted.
[C1]
A 2. Resolved that the predicates in the following list, compare/3,
sort/2, keysort/2, ground/1, call/2-8, false/0, callable/1, subsumes_term/2,
acyclic_term/1, term_variables/2, and retractall/1,
unaccountably omitted from part 1 but present in most implementations
be added as corrigenda. [C3, C4, C5, C6, C8, C9]
A 6. Resolved that the evaluable functors on the following list be
added by means of a corrigendum:
(+)/1, max/2, min/2, acos/1, asin/1, tan/1, pi/0, xor/2 (as functor only),
atan2/2, (^)/2, and (div)/2. [C14, C15, C16, C17]
A 7. Resolved to change 6.3.4.3 of part 1 to allow the
bar character | as an operator, but only if its precedence
is greater than or equal to 1001. [C2]
A 8. Resolved to change 6.3.4.3 to forbid the creation of operators
called '{}' or '[]'. [C2]
Additional corrections:
variable from the enumerated
set ValidType.
k) There shall be an Uninstantiation Error when an argument or one of its components is not a variable, and a variable or a component as variable is required. It has the formuninstantiation_error(Culprit)whereCulpritis the argument or one of its components which caused the error.
5 When a built-in predicate has a single mode and template,the words
an argument whose mode is-is always associated with an error
condition: a type error when the argument is not a variable.
a type errorby
an uninstantiation error
by
- f) Stream is not a variable
—type_error(variable, Stream).
- f) Stream is not a variable
—uninstantiation_error(Stream).
A bar (6.4) shall be equivalent to the atomAdd the syntax rule:'|'when'|'is an operator.
Add at the end of 6.3.4.3 before NOTES:
op =bar ;Abstract: |Priority: n n Specifier: s s Condition: '|'is an operator
There shall not be an operatorAdd to note 1'{}'or'[]'.
An operator'|'shall be only an infix operator with priority greater than or equal to 1001.
Bar is also a solo character (6.5.3), and a token (6.4) but not an atom.Replace note 3
3 The third argument ofbyop/3(8.14.3) may be any atom
except ',' so the priority of the comma operator cannot be
changed.
3 The third argument ofop/3(8.14.3) may be any atom except',','[]', and'{}'so the priority of the comma operator cannot be changed, and so empty lists and curly bracket pairs cannot be declared as operators.
bar (* 6.4 *)
= [ layout text sequence (* 6.4.1 *) ] ,
bar token (* 6.4.8 *) ;
bar token (* 6.4.8 *) = bar char (* 6.5.3 *) ;
solo char:
Add as the last syntax rule:| bar char (* 6.5.3 *)
bar char (* 6.5.3 *) = "|" ;
l)byOp_specifieris a specifier such thatOperator
would have an invalid set of specifiers (see 6.3.4.3).
—permission_error(create, operator, Operator).
l)Add additional error:Operatoris an atom,Priorityis a priority, andOp_specifieris a specifier such thatOperatorwould have an invalid set of priorities and specifiers (see 6.3.4.3).
—permission_error(create, operator, Operator).
m)Operatoris a list,Priorityis a priority, andOp_specifieris a specifier such that an elementOpof the listOperatorwould have an invalid set of priorities and specifiers (see 6.3.4.3).
—permission_error(create, operator, Op).
op(500, xfy, {}).
permission_error(create, operator, {}).
op(500, xfy, [{}]).
permission_error(create, operator, {}).
op(1000, xfy, '|').
permission_error(create, operator, '|').
op(1000, xfy, ['|']).
permission_error(create, operator, '|').
op(1150, fx, '|').
permission_error(create, operator, '|').
op(1105,xfy,'|').
Succeeds, making | a right associative
infix operator with priority 1105.
op(0,xfy,'|').
Succeeds, making | no longer an infix operator.
8.2.4 subsumes_term/2
This built-in predicate provides a test for syntactic one-sided unification.8.2.4.1 Description
subsumes_term(General, Specific)is true iff there is a substitution θ such that
- a)
Generalθ andSpecificθ are identical, and- b)
Specificθ andSpecificare identical.
Procedurally,subsumes_term(General, Specific)simply succeeds or fails accordingly. There is no side effect or unification.8.2.4.2 Template and modes
subsumes_term(@@term, @@term)8.2.4.3 Errors
None.8.2.4.4 Examples
subsumes_term(a, a). Succeeds. subsumes_term(f(X,Y), f(Z,Z)). Succeeds. subsumes_term(f(Z,Z), f(X,Y)). Fails. subsumes_term(g(X), g(f(X))). Fails. subsumes_term(X, f(X)). Fails. subsumes_term(X, Y), subsumes_term(Y, f(X)). Succeeds.
- NOTES
- 1 The final two examples show that
subsumes_term/2is not transitive. A transitive definition corresponding to the term-lattice partial order isterm_instance/2(3.95). term_instance(Term, Instance) :- copy_term(Term, Copy), subsumes_term(Copy, Instance). term_instance(g(X), g(f(X))). Succeeds.- 2 Many existing processors implement a built-in predicate
subsumes/2which unifies the arguments. This often leads to erroneous programs. The following definition is mentioned only for backwards compatibility. subsumes(General, Specific) :- subsumes_term(General, Specific), General = Specific.
8.3.9 callable/1
8.3.9.1 Description
callable(Term)is true iffTermis a callable term (3.24).
- NOTE — Not every callable term can be converted to the body of a clause, for example
(1,2).8.3.9.2 Template and modes
callable(@@term)8.3.9.3 Errors
None.8.3.9.4 Examples
callable(a). Succeeds. callable(3). Fails. callable(X). Fails. callable((1,2)). Succeeds.8.3.10 ground/1
8.3.10.1 Description
ground(Term)is true iffTermis a ground term (3.82).8.3.10.2 Template and modes
ground(@@term)8.3.10.3 Errors
None.8.3.10.4 Examples
ground(3). Succeeds. ground(a(1, _)). Fails.8.3.11 acyclic_term/1
8.3.11.1 Description
acyclic_term(Term)is true iffTermis acyclic, that is, it is a variable or a term instantiated (3.96) with respect to the substitution of a set of equations not subject to occurs check (7.3.3).8.3.11.2 Template and modes
acyclic_term(@@term)8.3.11.3 Errors
None.8.3.11.4 Examples
acyclic_term(a(1, _)). Succeeds. X = f(X), acyclic_term(X). Undefined. [STO 7.3.3, does not succeed in many implementations, but fails, produces an error, or loops]
pair to the set ValidType.
order to the set ValidDomain.
These built-in predicates compare and sort terms based on the ordering of terms (7.2).
8.4.2 compare/3 – three-way comparison
8.4.2.1 Description
compare(Order, X, Y)is true iffOrderunifies withRwhich is one of the following atoms:'='iffXandYare identical terms (3.87),'<'iffXterm_precedesY(7.2), and'>'iffYterm_precedesX.
Procedurally,compare(Order, X, Y)is executed as follows:
- a) If
XandYare identical, then letRbe the atom'='and proceeds to 8.4.2.1 d.- b) Else if
Xterm_precedesY(7.3), then letRbe the atom'<'and proceeds to 8.4.2.1 d.- c) Else let
Rbe the atom'>'.- d) If
Runifies withOrder, then the goal succeeds.- e) Else the goal fails.
8.4.2.2 Template and modes
compare(-atom, ?term, ?term)
compare(+atom, @@term, @@term)8.4.2.3 Errors
- a)
Orderis neither a variable nor an atom
—type_error(atom, Order).- b)
Orderis an atom but not<,=, or>
—domain_error(order, Order).8.4.2.4 Examples
compare(Order, 3, 5). Succeeds, unifying Order with (<). compare(Order, d, d). Succeeds, unifying Order with (=). compare(Order, Order, <). Succeeds, unifying Order with (<). compare(<, <, <). Fails. compare(1+2, 3, 3.0). type_error(atom, 1+2). compare(>=, 3, 3.0). domain_error(order, >=).8.4.3 sort/2
8.4.3.1 Description
sort(List, Sorted)is true iffSortedunifies with the sorted list ofList(7.1.6.5).
Procedurally,sort(List, Sorted)is executed as follows:
- a) Let
SLbe the sorted list of listList(7.1.6.5).- b) If
SLunifies withSorted, then the goal succeeds.- c) Else the goal fails.
- NOTE — The following definition defines the logical and procedural behaviour of
sort/2when no error conditions are satisfied and assumes thatmember/2is defined as in 8.10.3.4. sort([], []). sort(List, Sorted) :- setof(X, member(X,List), Sorted). /* 8.10.3, 8.10.3.4 */8.4.3.2 Template and modes
sort(@@list, -list)
sort(+list, +list)8.4.3.3 Errors
- a)
Listis a partial list
—instantiation_error.- b)
Listis neither a partial list nor a list
—type_error(list, List).- c)
Sortedis neither a partial list nor a list
—type_error(list, Sorted).8.4.3.4 Examples
sort([1, 1], Sorted). Succeeds, unifying Sorted with [1]. sort([1+Y, z, a, V, 1, 2, V, 1, 7.0, 8.0, 1+Y, 1+2, 8.0, -a, -X, a], Sorted). Succeeds, unifying Sorted with [V, 7.0, 8.0, 1, 2, a, z, -X, -a, 1+Y, 1+2] sort([X, 1], [1, 1]). Succeeds, unifying X with 1. sort([1, 1], [1, 1]). Fails. sort([V], V). Undefined. [STO 7.3.3, corresponds to the goal [V] = V. In many implementations this goal succeeds and violates the mode sort(@@list, -list).] sort([f(U),U,U,f(V),f(U),V],L). Succeeds, unifying L with [U,V,f(U),f(V)] or [V,U,f(V),f(U)]. [The solution is implementation dependent.]8.4.4 keysort/2
8.4.4.1 Description
keysort(Pairs, Sorted)is true iffPairsis a list of compound terms with principal functor(-)/2andSortedunifies with a permutationKVsofPairssuch that theKeyentries of the elementsKey-ValueofKVsare in weakly increasing term order (7.2). Elements with an identicalKeyappear in the same relative sequence as inPairs.
Procedurally,keysort(Pairs, Sorted)is executed as follows:
- a) Let
Tsbe the sorted list (7.1.6.5) containing as elements termst(Key, P, Value)for each elementKey-ValueofPairswithPsuch thatKey-Valueis theP-th element inPairs.- b) Let
KVsbe the list with elementsKey-Valueoccurring in the same sequence as elementst(Key, _, Value)inTs.- c) If
KVsunifies withSorted, then the goal succeeds.- d) Else the goal fails.
- NOTE — The following definition defines the logical and procedural behaviour of
keysort/2when no error conditions are satisfied. The auxiliary predicatenumbered_from/2is not needed in many existing processors becausePshappens to be a sorted list of variables. keysort(Pairs, Sorted) :- pairs_ts_ps(Pairs, Ts, Ps), numbered_from(Ps,1), sort(Ts, STs), /* 8.4.3 */ pairs_ts_ps(Sorted, STs, _). pairs_ts_ps([], [], []). pairs_ts_ps([Key-Value|Pairs], [t(Key,P,Value)|Ts], [P|Ps]) :- pairs_ts_ps(Pairs, Ts, Ps). numbered_from([], _). numbered_from([I0|Is], I0) :- I1 is I0 + 1, numbered_from(Is, I1).8.4.4.2 Template and modes
keysort(@@list, -list)
keysort(+list, +list)8.4.4.3 Errors
- a)
Pairsis a partial list
—instantiation_error.- b)
Pairsis neither a partial list nor a list
—type_error(list, Pairs).- c)
Sortedis neither a partial list nor a list
—type_error(list, Sorted).- d) An element of a list prefix of
Pairsis a variable
—instantiation_error.- e) An element
Eof a list prefix ofPairsis neither a variable nor a compound term with principal functor(-)/2
—type_error(pair, E).- f) An element
Eof a list prefix ofSortedis neither a variable nor a compound term with principal functor(-)/2
—type_error(pair, E).8.4.4.4 Examples
keysort([1-1, 1-1], Sorted). Succeeds unifing Sorted with [1-1, 1-1]. keysort([2-99, 1-a, 3-f(_), 1-z, 1-a, 2-44], Sorted). Succeeds unifying Sorted with [1-a, 1-z, 1-a, 2-99, 2-44, 3-f(_)]. keysort([X-1,1-1],[2-1,1-1]). Succeeds unifying X with 2. Pairs = [1-2|Pairs], keysort(Pairs, Sorted). Undefined. [STO 7.3.3. type_error(list, [1-2,1-2,...]) or loops in many implementations.] keysort([V-V], V). Undefined. [STO 7.3.3, corresponds to the goal [V-V] = V. In many implementations this goal succeeds and violates the mode keysort(@@list, -list).]
7.1.1.5 Witness variable list of a term
The witness variable list of a termTis a list of variables and a witness of the variable set (7.1.1.2) ofT. The variables appear according to their first occurrence in left-to-right traversal ofT.
- NOTES
- 1 For example,
[X, Y]is the witness variable list of each of the termsf(X,Y),X+Y+X+Y,X+Y+X, andX*Y+X*Y.- 2 The concept of a witness variable list of a term is required when defining
term_variables/2(8.5.5).8.5.5 term_variables/2
8.5.5.1 Description
term_variables(Term, Vars)is true iffVarsunifies with the witness variable list ofTerm(7.1.1.5).
Procedurally,term_variables(Term, Vars)is executed as follows:
- a) Let
TVarsbe the witness variable list ofTerm(7.1.1.5).- b) If
Varsunifies withTVars, then the goal succeeds.- c) Else the goal fails.
- NOTE — The order of variables in
Varsensures that, for every termT, the following goals are true: term_variables(T, Vs1), term_variables(T, Vs2), Vs1 == Vs2. term_variables(T, Vs1), term_variables(Vs1, Vs2), Vs1 == Vs2.8.5.5.2 Template and modes
term_variables(@@term, -list)
term_variables(?term, ?list)8.5.5.3 Errors
- a)
Varsis neither a partial list nor a list
—type_error(list, Vars).8.5.5.4 Examples
term_variables(t, Vars). Succeeds, unifying Vars with []. term_variables(A+B*C/B-D, Vars). Succeeds, unifying Vars with [A, B, C, D]. term_variables(t, [_, _|a]). type_error(list, [_, _|a]). S=B+T, T=A*B, term_variables(S, Vars). Succeeds, unifying Vars with [B, A], T with A*B, and S with B+A*B. T=A*B, S=B+T, term_variables(S, Vars). Same answer as above example. term_variables(A+B+B, [B|Vars]). Succeeds, unifying A with B and Vars with [B]. term_variables(X+Vars, Vars), Vars = [_, _]. Undefined. [STO 7.3.3, corresponds to the goal [X, Vars] = Vars.]
by
—permission_error(access, static_procedure, Pred).
—permission_error(modify, static_procedure, Pred).
8.9.5 retractall/1
8.9.5.1 Description
retractall(Head)is true.
Procedurally,retractall(Head)is executed as follows:
- a) Searches sequentially through each dynamic user-defined procedure in the database and removes all clauses whose head unifies with
Head, and the goal succeeds.
- NOTES
- 1 The dynamic predicate remains known to the system as a dynamic predicate even when all of its clauses are removed.
- 2 Many existing processors define
retractall/1as follows. retractall(Head) :- retract((Head :- _)), fail. retractall(_).8.9.5.2 Template and modes
retractall(@@callable_term)8.9.5.3 Errors
- a)
Headis a variable
—instantiation_error.- b)
Headis neither a variable nor a callable term
—type_error(callable, Head).- c) The predicate indicator
PredofHeadis that of a static procedure
—permission_error(modify, static_procedure, Pred).8.9.5.4 Examples
The examples defined in this subclause assume the database has been created from the following Prolog text::- dynamic(insect/1). insect(ant). insect(bee). retractall(insect(bee)). Succeeds, retracting the clause 'insect(bee)'. retractall(insect(_)). Succeeds, retracting all the clauses of predicate insect/1. retractall(insect(spider)). Succeeds. retractall(mammal(_)). Succeeds. retractall(3). type_error(callable, 3). retractall(retractall(_)). permission_error(modify, static_procedure, retractall/1).
8.15.4 call/2..8
These built-in predicates provide support for higher-order programming.
- NOTE — A built-in predicate
apply/2was implemented in some processors. Most uses can be directly replaced bycall/2..8.8.15.4.1 Description
call(Closure, Arg1, ...)is true iffcall(Goal)is true whereGoalis constructed by appendingArg1, ... additional arguments to the arguments (if any) ofClosure.
Procedurally, a goal of predicatecall/NwithN≥ 2. is executed as follows:
- a) Let
call(p(X1,...,XM), Y2, ..., YN)be the goal to be executed,M≥ 0,- b) Execute
call(p(X1, ..., XM, Y2, ..., YN))instead.8.15.4.2 Template and modes
call(+callable_term, ?term, ...)8.15.4.3 Errors
- a)
Closureis a variable
—instantiation_error.- b)
Closureis neither a variable nor a callable term
—type_error(callable, Closure).- c) The number of arguments in the resulting goal exceeds the implementation defined maximum arity (7.11.2.3)
—representation_error(max_arity).- d)
call/Nis called withN≥ 9 and it shall be implementation dependent whether this error condition is satisfied
—existence_error(procedure,call/N).- e)
Goalcannot be converted to a goal
—type_error(callable, Goal).
- NOTE — A standard-conforming processor may implement call/N in one of the following ways because error condition d is implementation dependent (3.91).
- 1) Implement only the seven built-in predicates
call/2up tocall/8.- 2) Implement
call/2..Nup to anyNthat is within8..max_arity(7.11.2.3). Produce existence errors for larger arities belowmax_arity.- 3) Implement
call/9and above only for certain execution modes.8.15.4.4 Examples
call(integer, 3). Succeeds. call(functor(F,c), 0). Succeeds, unifying F with c. call(call(call(atom_concat, pro), log), Atom). Succeeds, unifying Atom with prolog. call(;, X = 1, Y = 2). Succeeds, unifying X with 1. On re-execution, succeeds, unifying Y with 2. call(;, (true->fail), X=1). Fails. The following examples assume that maplist/2 is defined with the following clauses: maplist(_Cont, []). maplist(Cont, [E|Es]) :- call(Cont, E), maplist(Cont, Es). maplist(>(3), [1, 2]). Succeeds. maplist(>(3), [1, 2, 3]). Fails. maplist(=(X), Xs). Succeeds, unifying Xs with []. On re-execution, succeeds, unifying Xs with [X]. On re-execution, succeeds, unifying Xs with [X, X]. On re-execution, succeeds, unifying Xs with [X, X, X]. Ad infinitum.8.15.5 false/0
8.15.5.1 Description
falseis false.8.15.5.2 Template and modes
false8.15.5.3 Errors
None.8.15.5.4 Examples
false. Fails.
7.1.6.9 List prefix of a term
LPis a list prefix of a termPif:
- a)
LPis an empty list, or- b)
Pis a compound term whose principal functor is the list constructor and the heads ofLPandPare identical, and the tail ofLPis a list prefix of the tail ofP.
- NOTE — For example,
[],[1], and[1,2]are all list prefixes of[1,2,3],[1,2|X], and[1,2|nonlist].
- a)
Atomis a variable andListis a partial list.
—instantiation_error.- c)
Listis neither a partial list nor a list
—type_error(list, List).- d)
Atomis a variable and an element of a list prefix ofListis a variable.
—instantiation_error.- e) An element
Eof a list prefix ofListis neither a variable nor a one-char atom
—type_error(character, E).
- a)
Atomis a variable andListis a partial list.
—instantiation_error.- c)
Listis neither a partial list nor a list
—type_error(list, List).- d)
Atomis a variable and an element of a list prefix ofListis a variable.
—instantiation_error.- e) An element
Eof a list prefix ofListis neither a variable nor an integer
—type_error(integer, E).- f) An element of a list prefix of
Listis neither a variable nor a character code
—representation_error(character_code).
- a)
Numberis a variable andListis a partial list.
—instantiation_error.- c)
Listis neither a partial list nor a list
—type_error(list, List).- d)
Numberis a variable and an element of a list prefix ofListis a variable.
—instantiation_error.- f) An element
Eof a list prefix ofListis neither a variable nor a one-char atom
—type_error(character, E).
- a)
Numberis a variable andListis a partial list.
—instantiation_error.- c)
Listis neither a partial list nor a list
—type_error(list, List).- d)
Numberis a variable and an element of a list prefix ofListis a variable.
—instantiation_error.- f) An element
Eof a list prefix ofListis neither a variable nor an integer
—type_error(integer, E).- g) An element of a list prefix of
Listis neither a variable nor a character code
—representation_error(character_code).
by
- i) The value of an argument Culprit is not a member of the set I
—type_error(integer, Culprit).- j) The value of an argument Culprit is not a member of the set F
—type_error(float, Culprit).
- i)
Eis a compound term with no corresponding operator in step 7.9.1 c but there is an operator corresponding to the same principal functor with different types such that
- a) the i-th argument of the corresponding operator has type
Type, and- b) the value
Culpritof the i-th argument ofEhas a different type
—type_error(Type, Culprit).
b(X) :- Y = (write(X), X), call(Y).replace
byb(3). Outputs '3', then type_error(callable, 3).
b(3). type_error(callable, (write(3),3)).
by7.8.9.2 Template and modes
catch(+callable_term, ?term, ?term)7.8.9.3 Errors
- a)
Gis a variable
—instantiation_error.- b)
Gis neither a variable nor a callable term
—type_error(callable, G)
7.8.9.2 Template and modes
catch(goal, ?term, goal)7.8.9.3 Errors
None.
Priority Specifier Operator(s) 400 yfxdiv200 fy+
Add
Evaluable functor Operation (div)/2intfloordivI (+)/1posI, posF
'div' to enumeration in Note. Add to Note:
'+', '-' are prefix predefined operators.
intfloordivI : I × I → I ∪ {int_overflow, zero_divisor}
posI : I → IAdd as axioms:
intfloordivI(x,y) = ⌊x/y⌋ if y ≠ 0 ∧ ⌊x/y⌋ ∈ I = int_overflow if y ≠ 0 ∧ ⌊x/y⌋ ∉ I = zero_divisor if y = 0
posI (x) = x
posF : F → FAdd as axiom:
posF (x) = x
9.3.8 max/2 – maximum
9.3.8.1 Description
max(X, Y)evaluates the expressionsXandYwith valuesVXandVYand has the value of the maximum ofVXandVY. IfVXandVYhave the same type then the value R satisfies R ∈ {VX,VY}.
IfVXandVYhave different types then letVIandVFbe the values of type integer and float. The value R shall satisfy
R ∈ {VI,float(VI),VF, undefined}
and the value shall be implementation dependent.
- NOTE — The possible values of
float(VI)include the exceptional value float_overflow ∉ F (9.1.6).9.3.8.2 Template and modes
max(float-exp, float-exp) = float max(float-exp, int-exp) = number max(int-exp, float-exp) = number max(int-exp, int-exp) = integer9.3.8.3 Errors
- a)
Xis a variable
—instantiation_error.- b)
Yis a variable
—instantiation_error.- c)
VXandVYhave different type and it shall be implementation dependent whether this error condition is satisfied
—evaluation_error(undefined).- d)
VXandVYhave different type and one of them is an integerVIwith
floatI→F(VI) = float_overflow (9.1.6) and it shall be implementation dependent whether this error condition is satisfied
—evaluation_error(float_overflow).9.3.8.4 Examples
max(2, 3). Evaluates to 3. max(2.0, 3). Evaluates to 3, 3.0, or evaluation_error(undefined). [The result is implementation dependent.] max(2, 3.0). Evaluates to 3.0 or evaluation_error(undefined). [The result is implementation dependent.] max(0, 0.0). Evaluates to 0, 0.0, or evaluation_error(undefined). [The result is implementation dependent.]9.3.9 min/2 – minimum
9.3.9.1 Description
min(X, Y)evaluates the expressionsXandYwith valuesVXandVYand has the value of the minimum ofVXandVY. IfVXandVYhave the same type then the value R satisfies R ∈ {VX,VY}.
IfVXandVYhave different types then letVIandVFbe the values of type integer and float. The value R shall satisfy
R ∈ {VI,float(VI),VF, undefined}
and the value shall be implementation dependent.
- NOTE — The possible values of
float(VI)include the exceptional value float_overflow ∉ F (9.1.6).9.3.9.2 Template and modes
min(float-exp, float-exp) = float min(float-exp, int-exp) = number min(int-exp, float-exp) = number min(int-exp, int-exp) = integer9.3.9.3 Errors
- a)
Xis a variable
—instantiation_error.- b)
Yis a variable
—instantiation_error.- c)
VXandVYhave different type and it shall be implementation dependent whether this error condition is satisfied
—evaluation_error(undefined).- d)
VXandVYhave different type and one of them is an integerVIwith
floatI→F(VI) = float_overflow (9.1.6) and it shall be implementation dependent whether this error condition is satisfied
—evaluation_error(float_overflow).9.3.9.4 Examples
min(2, 3). Evaluates to 2. min(2, 3.0). Evaluates to 2, 2.0, or evaluation_error(undefined). [The result is implementation dependent.] min(2.0, 3). Evaluates to 2.0 or evaluation_error(undefined). [The result is implementation dependent.] min(0, 0.0). Evaluates to 0, 0.0, or evaluation_error(undefined). [The result is implementation dependent.]9.3.10 (^)/2 – integer power
9.3.10.1 Description
^(X, Y)evaluates the expressionsXandYwith valuesVXandVYand has the value ofVXraised to the power ofVY. IfVXandVYare both zero then the value shall be one.9.3.10.2 Template and modes
^(int-exp, int-exp) = integer ^(float-exp, int-exp) = float ^(int-exp, float-exp) = float ^(float-exp, float-exp) = float
- NOTE — '^' is an infix predefined operator (see 6.3.4.4).
9.3.10.3 Errors
- a)
Xis a variable
—instantiation_error.- b)
Yis a variable
—instantiation_error.- c)
VXis negative andVYis neither an integer nor a float with an integer value.
—evaluation_error(undefined).- d)
VXis zero andVYis negative
—evaluation_error(undefined).- e)
VXandVYare integers andVXis not equal to 1 andVYis less than -1.
—type_error(float, VX).- f)
VXorVYis a float and the magnitude ofVXraised to the power ofVYis too large
—evaluation_error(float_overflow).- g)
VXorVYis a float and the magnitude ofVXraised to the power ofVYis too small and not zero
—evaluation_error(underflow).9.3.10.4 Examples
^(0,0). Evaluates to 1. 3^1.0. Evaluates to 3.0. 3^3. 27. 3^27. Evaluates to 7625597484987. 3^3^3. Evaluates to 7625597484987. 2^(-1). evaluation_error(undefined). 1^(-1). Evaluates to 1. 0^0. Evaluates to 1. 2^ -1.5. Evaluates to a value approximately equal to 0.353553.9.3.11 asin/1 – arc sine
9.3.11.1 Description
asin(X)evaluates the expressionXwith valueVXand has the principal value of the arc sine ofVX(measured in radians), that is, the value R satisfies
-π/2 ≤ R ≤ π/29.3.11.2 Template and modes
asin(float-exp) = float asin(int-exp) = float9.3.11.3 Errors
- a)
Xis a variable
—instantiation_error.- b)
VXis greater than 1 or less than -1
—evaluation_error(undefined).9.3.11.4 Examples
asin(0.5). Evaluates to a value approximately equal to 0.523599. 2*asin(1). Evaluates to a value approximately equal to 3.14159. asin(2). evaluation_error(undefined).9.3.12 acos/1 – arc cosine
9.3.12.1 Description
acos(X)evaluates the expressionXwith valueVXand has the principal value of the arc cosine ofVX(measured in radians), that is, the value R satisfies
0 ≤ R ≤ π9.3.12.2 Template and modes
acos(float-exp) = float acos(int-exp) = float9.3.12.3 Errors
- a)
Xis a variable
—instantiation_error.- b)
VXis greater than 1 or less than -1
—evaluation_error(undefined).9.3.12.4 Examples
acos(-1). Evaluates to a value approximately equal to 3.14159. acos(0.5). Evaluates to a value approximately equal to 1.047197. acos(1.5). evaluation_error(undefined).9.3.13 atan2/2 – arc tangent
9.3.13.1 Description
atan2(Y, X)evaluates the expressionsYandXwith valuesVYandVXand has the principal value of the arc tangent ofVY/VX(measured in radians), using the signs of both arguments to determine the quadrant of the value R, that is, the value R satisfies
-π ≤ R ≤ π9.3.13.2 Template and modes
atan2(int-exp, int-exp) = float atan2(float-exp, int-exp) = float atan2(int-exp, float-exp) = float atan2(float-exp, float-exp) = float9.3.13.3 Errors
- a)
Xis a variable
—instantiation_error.- b)
Yis a variable
—instantiation_error.- c)
Xis equal to zero andYis equal to zero
—evaluation_error(undefined).9.3.13.4 Examples
atan2(1,0). Evaluates to a value approximately equal to 1.570796. atan2(0,-1). Evaluates to a value approximately equal to 3.14159. atan2(0,0). evaluation_error(undefined).9.3.14 tan/1 – tangent
9.3.14.1 Description
tan(X)evaluates the expressionXwith valueVXand has the value of the tangent ofVX(measured in radians).9.3.14.2 Template and modes
tan(float-exp) = float tan(int-exp) = float9.3.14.3 Errors
- a)
Xis a variable
—instantiation_error.9.3.14.4 Examples
tan(0.5). Evaluates to a value approximately equal to 0.5463.
by
- 1 An error occurs if T is an atom or variable.
- 1 An error occurs if T is a variable or if there is no operation F in step 7.9.1 c).
9.3.15 pi/0 – pi
9.3.15.1 Description
pihas the value of π which is the ratio of a circle's circumference to its diameter.9.3.15.2 Template and modes
pi = float9.3.15.3 Errors
None.9.3.15.4 Examples
pi Evaluates to a value approximately equal to 3.14159.
9.4.6 xor/2 – bitwise exclusive or
9.4.6.1 Description
xor(B1, B2)evaluates the expressionsB1andB2with valuesVB1andVB2and has the value such that each bit is set iff exactly one of the corresponding bits inVB1andVB2is set.
The value shall be implementation defined ifVB1orVB2is negative.9.4.6.2 Template and modes
xor(int-exp, int-exp) = integer9.4.6.3 Errors
- a)
B1is a variable
—instantiation_error.- b)
B2is a variable
—instantiation_error.- c)
B1is not a variable andVB1is not an integer
—type_error(integer, VB1).- d)
B2is not a variable andVB2is not an integer
—type_error(integer, VB2).9.4.6.4 Examples
xor(10, 12). Evaluates to the value 6. xor(125, 255). Evaluates to the value 130. xor(-10, 12). Evaluates to an implementation defined value.
write_canonical/1 does not correspond to
7.10.5 Writing a term. The functor ('.')/2 is written in
functional notation as .(H,T) and not
as '.'(H,T) (three times). The constant []
is written with a space between the opening and closing bracket. It
should be written without the space, because 7.10.5 d demands that it
is output "as the sequence of characters defined by the syntax for the
atom (6.1.2b, 6.4.2)". 7.10.5 f demands for '.'(H,T)
that the atom of the principal functor is output. That means
that '.' is now written according to 7.10.5 d. Since a
single unquoted '.' is misread as the
nonterminal end it must be quoted. In many situations,
it could be disambiguated by using round brackets. However, only
quoting is allowed in 7.10.5 d.
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.
term_variables/2.
d1568 1
a1568 1
In this manner all errors of the goal can be caught by catch/3
@
1.104
log
@Forgotten E
@
text
@d1394 2
a1395 3
Atom is a variable and either List is a
partial list or an element of a list prefix of List
is a variable.
@
1.103
log
@Split error condtion a of number_chars/2 (4 times)
@
text
@d1378 2
a1379 2
List is neither a
variable nor a one-char atom
d1424 1
a1424 1
Replace error condition a, c, and d. Add error conditon e.
d1444 1
a1444 1
E of a list prefix of List
@
1.102
log
@Remove ambiguity in error condition a for number_chars(1, [C])
and 3 others
@
text
@d1359 1
a1359 1
Replace error condition a, c, and d by:
d1364 2
a1365 3
Atom is a variable and either List is a
partial list or an element of a list prefix of List
is a variable.
d1373 6
a1378 1
List is neither a
d1389 1
a1389 1
Replace error condition a, c, and d. Add error conditon f.
d1404 6
a1409 1
E of a list prefix of List
d1424 1
a1424 1
Replace error condition a, c, and d by:
d1430 2
a1431 3
Number is a variable and either List is a
partial list or an element of a list prefix of List is
a variable.
d1439 6
a1444 1
E of a list prefix of List
d1455 1
a1455 1
Replace error conditions a, c, and d. Add error condition f.
d1461 2
a1462 3
Number is a variable and either List is a
partial list or an element of the list prefix of List
is a variable.
d1470 6
a1475 1
E of a list prefix of List
d1480 1
a1480 1
List is neither a
@
1.101
log
@Introduced Else if
@
text
@d1364 1
a1364 1
Atom is a variable and List is a
d1390 1
a1390 1
Atom is a variable and List is a
d1421 1
a1421 1
Number is a variable and List is a
d1448 1
a1448 1
Number is a variable and List is a
@
1.100
log
@m
@
text
@d652 1
a652 1
X term_precedes Y (7.3), then
d656 1
a656 1
R be the atom '>'.
@
1.99
log
@Make procedural definition of compare/3 clearer. Roger Scowen
@
text
@d656 1
a656 1
R be the atom '>'.
@
1.98
log
@Simple changes. Roger Scowen
@
text
@d648 3
a650 6
R be the atom
'=', '<', or '>'
if X and Y are
identical, X term_precedes Y (7.3),
or
Y term_precedes X respectively.
d652 7
a658 1
R unifies with Order, then the
d661 1
a661 1
'<' iff X term_precedes Y (7.3), and
d1017 1
a1017 1
Same answer.
d1337 1
a1337 1
the list prefix of the tail of P.
d1693 1
a1693 1
max(X, Y) evaluates the expression X and
d1775 1
a1775 1
min(X, Y) evaluates the expression X and
@
1.96
log
@post N4587
@
text
@d139 1
a139 1
KVs unifies with Sorted, then the
d967 1
a967 1
TVars be the list of variables
d1218 4
@
1.93
log
@Better example for callable/1
@
text
@d2344 1
a2344 1
(1,1).
d545 1
a545 1
callable((1,1)).
@
1.91
log
@Back - this should be the real final version
@
text
@d89 1
a89 1
d93 1 a93 1
d175 1 a175 1
Remove in subclause b variable from the enumerated
d178 1
a178 1
Add additional error class: d273 1 a273 1
d415 1 a415 1
d436 3 a438 2
Procedurally, subsumes_term(General, Specific)
simply succeeds or fails accordingly. There is no side effect or
d507 1
a507 1
d627 1 a627 1
d642 1 a642 1
d712 1 a712 1
d808 1 a808 1
d930 1 a930 1
d961 2 a962 1
d1054 1 a1054 1
d1065 2 a1066 1
Procedurally, retractall(Head) is executed as follows:
d1156 1
a1156 1
d1178 2 a1179 1
Procedurally, a goal of predicate call/N
d1316 1
a1316 1
d1602 1 a1602 1
Add in Table 7 - The operator table: d1680 1 a1680 1
d1695 1 a1695 1
d1777 1 a1777 1
d2150 1 a2150 1
d2186 1 a2186 1
d2202 1 a2202 1
d2261 1 a2261 1
@ 1.90 log @Style removed @ text @d10 67 @ 1.89 log @Missed PRE @ text @a9 67 @ 1.88 log @Final html @ text @d81 1 a81 1 PRE-DRAFT TECHNICAL CORRIGENDUM 2 @ 1.87 log @Actual delivery draft @ text @d10 67 @ 1.86 log @Final @ text @d6 1 a6 1
Remove in subclause b variable from the enumerated
set.
d178 1
a178 1
Add additional error class:
d193 1
a193 1
Replace in Note 5
d201 1
a201 1
the words
d207 1
a207 1
by
d215 1
a215 1
Replace error condition f
d227 1
a227 1
by
d248 1
a248 1
Add prior to syntax rules:
d255 1
a255 1
Add the syntax rule:
d267 1
a267 1
Add at the end of 6.3.4.3 before NOTES:
d279 1
a279 1
Add to note 1
d286 1
a286 1
Replace note 3
d294 1
a294 1
by
d305 1
a305 1
Add as the last syntax rule:
d317 1
a317 1
Add as the last syntax rule:
d328 2
a329 1
Add alternative for solo char:
d336 1
a336 1
Add as the last syntax rule:
d345 1
a345 1
Replace
d355 1
a355 2
by
d368 1
a368 1
Add additional error:
d382 1
a382 1
Add the following examples:
d416 1
a416 1
Add the new subclauses into the place indicated by their number:
d507 1
a507 1
Add the new subclauses into the place indicated by their number
d610 1
a610 1
Add pair to the set ValidType.
d614 1
a614 1
Add order to the set ValidDomain.
d618 2
a619 2
Move the two paragraphs from subclause 8.4 to subclause 8.4.1.
Add into subclause 8.4:
d627 1
a627 1
Add the new subclauses into the place indicated by their number:
a766 3
d912 2
a913 2
[STO 7.3.3. type_error(list, [1-2,1-2,...]) or loops
in many implementations.]
d917 4
a920 7
[STO 7.3.3, corresponds to the goal [V-V] = V. In
many implementations this goal succeeds and
violates the mode keysort(@@list, -list).]
d930 1
a930 1
Add the new subclauses into the place indicated by their number:
d1032 1
a1032 1
Replace in error condition c
d1040 1
a1040 1
by
d1053 1
a1053 1
Add the new subclauses into the place indicated by their number:
d1154 1
a1154 1
Add the new subclauses into the place indicated by their number:
d1313 1
a1313 1
Add the new sublauses into the place indicated by their number:
d1348 1
a1348 1
Replace error condition a, c, and d by:
d1374 1
a1374 1
Replace error condition a, c, and d. Add error conditon f.
d1404 1
a1404 1
Replace error condition a, c, and d by:
d1431 1
a1431 1
Replace error conditions a, c, and d. Add error condition f.
d1467 2
a1468 2
Replace error condition i and j (which both were added in Technical
Corrigendum 1)
d1482 1
a1482 1
by
d1512 1
a1512 1
For program
d1519 1
a1519 1
replace
d1529 1
a1529 1
by
d1545 1
a1545 1
Replace
d1569 1
a1569 1
by
d1598 1
a1598 1
Add in Table 7 - The operator table:
d1610 1
a1610 1
Add to table:
d1620 1
a1620 1
Add 'div' to enumeration in Note. Add to Note:
d1628 1
a1628 1
Add specifications:
d1639 1
a1639 1
Add as axioms:
d1659 1
a1659 1
Add specification:
d1665 1
a1665 1
Add as axiom:
d1677 1
a1677 1
Add the new subclauses into the place indicated by their number:
d1944 1
a1944 1
write_canonical/1 does not correspond to
d2271 1
a2271 1
quoting is allowed in 7.10.5 d.
d2275 1
a2275 1
Replace
d2286 1
a2286 1
by
d2305 16
a2320 9
f(X,Y), X+Y+X,
and X*X+Y*X.
@
1.83
log
@*** empty log message ***
@
text
@d484 1
@
1.82
log
@Added anchors
@
text
@d97 2
a98 1
A5, A6, A7, A8 in Edinburgh, 2010:
d105 1
a105 1
[1C2C2C10111213718atan2/2, (^)/2, and (div)/2.
d129 1
a129 1
is greater than or equal to 1001.
d132 1
a132 1
called '{}' or '[]'.
d141 1
d144 1
d147 1
d150 1
d153 1
d163 1
@
1.80
log
@*** empty log message ***
@
text
@d153 1
d226 1
d395 1
d484 1
d587 1
d914 1
d1016 1
d1037 1
d1138 1
d1297 1
d1451 1
d1496 1
d1528 1
d1579 1
d1660 1
d2110 1
d2165 1
d2239 1
@
1.79
log
@*** empty log message ***
@
text
@d141 9
d2216 1
d2220 24
d2245 19
@
1.78
log
@*** empty log message ***
@
text
@d706 1
a706 1
setof(X, member(X,List), Sorted). /* 8.10.3 */
a2215 3
Version control d2228 1 a2228 1
E of the partial list or
list Sorted is neither a variable nor a compound term with
@
1.76
log
@*** empty log message ***
@
text
@d137 2
d144 2
a145 2
d900 2 a901 3d1279 6 a1284 4
Add built-in predicate term_variables/2 and retractall/1 (Part of resolution A2, Edinburgh 2010), related minor correction for retract/1 d1001 3 a1003 18.9.3.3 Errors (retract/1)
d1021 4 d1118 11 d1279 1 a1279 1
Correct error conditions of atom_chars/2, atom_codes/2, d1432 1 a1432 1
Correct error conditions for evaluating an expression. d1476 1 a1476 1
Correct example for call/1 d1507 1 a1507 1
Adjust Template and Modes of catch/3, remove error xconditions. d1557 4 a1560 4
Add evaluable functors (+)/1 (unary plus) and (div)/2 (flooring integer division) to simple arithmetic functors (9.1). Add operators corresponding to (-)/1 and (//)/2 (integer division) (Part of resolution A6, Edinburgh 2010) d1637 1 a1637 1
Add evaluable functors max/2, min/2, (^)/2, asin/1, acos/1, d2085 2 a2086 1
Add evaluable atom pi/0 (Part of resolution A6, Edinburgh d2103 1 a2103 11 An error occurs if T is a variable and if there is no d2140 1 a2140 1
Add evaluable functor xor/2 (Part of resolution A6, Edinburgh d2143 3 @ 1.75 log @Min added. Klaus Däßler @ text @d844 1 a844 1d) Pairsis a list with an element which is a variable d848 3 a850 3e) An element Eof the partial list or listPairsis neither a variable nor a compound term with principal functor(-)/2d1341 2 a1342 2f) An element of a list prefix of Listis neither a variable nor a character code d1367 2 a1368 2d) An element Eof a list prefix ofListis neither a variable nor a one-char atom d1394 2 a1395 2d) An element Eof a list prefix ofListis neither a variable nor an integer d1399 2 a1400 2f) An element of a list prefix of Listis neither a variable nor a character code d1615 1 a1615 1 atan2/2, tan/1, pi/0, xor/2 (Part of resolution A6, Edinburgh a1704 4 @@@@@@idem a1788 2 @@@@@@ Shall this be defined for floats or not? d1801 3 a1803 3 ^(float-exp, int-exp) = float @@@@@@ ^(int-exp, float-exp) = float @@@@@@ ^(float-exp, float-exp) = float @@@@@@ d1823 1 a1823 1 integer nor a float with an integer value. @@@@@@ d1870 1 a1870 1 Evaluates to 0.5 or error @@@@@@. d1873 1 a1873 1 Evaluates to 1 or 1.0 or error @@@@@@. d1880 1 a1880 1 equal to 0.353553 or evaluation_error(undefined). @@@@@@ d2060 29 d2114 5 d2227 1 a2227 1
August - September 2010 @ 1.74 log @*** empty log message *** @ text @d1706 3 d1710 80 a1789 1 @@@@@@idem @ 1.73 log @catch/3 change is fix @ text @d135 1 a135 1Template and modes, and error conditions of catch/3. @ 1.72 log @Renumbering - Ulrich Geske @ text @d135 2 d1483 48 a2072 41 7.8.9
Replaceby7.8.9.2 Template and modes
catch(+callable_term, ?term, ?term)7.8.9.3 Errors
- a)
Gis a variable
—instantiation_error.- b)
Gis neither a variable nor a callable term
—type_error(callable, G)@ 1.71 log @*** empty log message *** @ text @d1711 1 a1711 17.8.9.2 Template and modes
catch(goal, ?term, goal)7.8.9.3 Errors
None.e) VXorVYis a float and the magnitude d1717 1 a1717 1f) VXorVYis a float and the magnitude @ 1.70 log @*** empty log message *** @ text @d2078 1 a2078 1Rightwards arrow: → d2085 1 a2085 1 Pi, Theta: &pi, θ @ 1.69 log @*** empty log message *** @ text @d1291 1 a1291 1 8.16.4.3 Errors (atom_chars/2)
d1317 1 a1317 18.16.5.3 Errors (atom_codes/2)
d1319 1 a1319 1 Replace error condition a, c, and d by: d1339 1 a1339 1e) An element of a list prefix d1347 1 a1347 1 8.16.7.3 Errors (number_chars/2)
d1374 1 a1374 18.16.8.3 Errors (number_codes/2)
d1376 1 a1376 1 Replace error conditions a, c, and d by: d1397 1 a1397 1e) An element of a list prefix of @ 1.68 log @*** empty log message *** @ text @d1299 1 a1299 1 partial list or an element of the list prefix of Listd1308 2 a1309 2d) An element Eof the partial list or listListis neither a variable nor a one-char atom d1325 1 a1325 1 partial list or an element of the list prefix ofListd1334 2 a1335 2d) An element Eof the partial list or listListis neither a variable nor an integer d1339 2 a1340 2e) An element Eof the partial list or listListis neither a variable nor a character code d1356 1 a1356 1 partial list or an element of the list prefix ofListis d1365 2 a1366 2d) An element Eof the partial list or listListis neither a variable nor a one-char atom d1392 2 a1393 2d) An element Eof the partial list or listListis neither a variable nor an integer d1397 2 a1398 2e) An element Eof the partial list or listListis neither a variable nor a character code @ 1.67 log @List prefix @ text @d1276 1 a1276 1
[], [1],
and [1,2] are all list prefixes of [1,2,3],
[1,2|X],
and
d1286 3
a1289 1
@
1.66
log
@prefix list
@
text
@d1265 10
a1274 4
The list prefix of a term T is the empty list, if T is
not a compound term whose principal functor is the list constructor.
The list prefix of a term .(E, U) is a compound
term .(E, W) with W being the list prefix of U.
d1278 9
@
1.65
log
@*** empty log message ***
@
text
@d900 1
a900 1
G is neihter a variable nor a callable term
@
1.63
log
@*** empty log message ***
@
text
@d1963 47
a2009 1
Culprit of the
i-th argument of E has a type for which there is
no corresponding operator with that type in the i-th argument
but there is a corresponding operator with type Type in
the i-th argument
a1391 1
a1536 7
If float(VI) ∈ F and VF
> float(VI)
then the value R shall satisfy R ∈ {VF, undefined}.
@@@@@@
@
1.59
log
@call/1 has precise (original) error
@
text
@d1539 2
a1540 2
float(VX)
and float(VY) include the exceptional
@
1.58
log
@Mats Carlsson
@
text
@d133 1
a133 1
d1415 1 a1415 3 type_error(callable, (write(3),3)) or type_error(callable, 3). [The answer is implementation dependent.] a1418 23 Replace the final three example by:
- d)
Gcannot be converted to a goal and while executing the conversion (7.6.2) a termTis not callable.
—type_error(callable, T).
@ 1.57 log @*** empty log message *** @ text @d342 1 a342 1 is a specifier such that an element of the list @ 1.56 log @*** empty log message *** @ text @d1753 1 a1753 1 satisfiescall((fail, 1)). type_error(callable, (fail, 1)) or type_error(callable, 1). [The answer is implementation dependent.] call((write(3), 1)). type_error(callable, (write(3), 1)) or type_error(callable, 1). [The answer is implementation dependent.] call((1;true)). type_error(callable, (1;true)) or type_error(callable, 1). [The answer is implementation dependent.]
retractall/1 are as
@
1.50
log
@Stricter mode for sort/2 and keysort/2. Paulo Moura
@
text
@d779 3
a781 3
satisfied. In many implementations, the auxiliary
predicate numbered_from/2 is not needed,
since Ps happens to be a sorted list of variables.
d1021 1
a1021 1
retractall/1 are as
@
1.49
log
@typo, Fred Mesnard
@
text
@d691 1
a691 1
sort(+list, ?list)
d806 1
a806 1
keysort(+list, ?list)
@
1.48
log
@Typo Mats Carlsson
@
text
@d896 1
a896 1
retractall(Head) :- retract((Head :- _)), fail. retractall(_). @ 1.43 log @*** empty log message *** @ text @d109 1 a109 2 (+)/1, max/2, min/2, acos/1, asin/1, tan/1, pi/0, xor/2 (as functor only), @ 1.42 log @Program error - which does not even show! Markus Triska @ text @d1168 1 a1168 1 of the following ways because the error in subclause d is implementation @ 1.41 log @*** empty log message *** @ text @d793 1 a793 1 pairs_ts_ps([Key-Value|Pairs], [t(Key,P,Value)|Ts], Ps) :- @ 1.40 log @*** empty log message *** @ text @d677 1 a677 1
keysort/3 when no error conditions are
@
1.38
log
@*** empty log message ***
@
text
@d678 1
a678 1
behaviour of sort/3 when no error conditions are
@
1.37
log
@WG17
@
text
@d678 1
a678 1
behaviour of setof/3 when no error conditions are
@
1.36
log
@*** empty log message ***
@
text
@d1610 2
a1649 12
@ 1.35 log @Pre-Jonathan @ text @a14 1 d130 2 d162 8 d182 1 a182 1 Replace in error condition f d186 3 d190 1 d198 2 d201 1 d331 1 a331 1 @@@@@@ or modify a343 1 @@@@@@ or modify d347 1 a347 14 @@@@@@ discuss usecatch(X is-1**1.5,error(E,_),true).
evaluation_error(undefined): SICStus, SWI, IF, ECLiPSe, Qu,
nan: GNU, YAP, B, CIAO, CX, XSB, H,
catch(X is-1**1.0,error(E,_),true).
permission_error(modify, operator, _)
instead, since currently op(10, fx, ',') has two
different error conditions: j (modify) and l (create).
Con: the last example of 13211-1:1995, 8.14.3.4
op(30,xfy,++), op(50,yf,++).produces a permission_error(create, operator, _), in IF, GNU
No error in YAP, SICStus, B, Ciao, ECLiPSe, CX, XSB, H, Qu. But they consider this certainly as an implementation specific extension in the sense of 5.5.1 note.
member/2 is defined
as in 8.10.3.4.
sort([], []). sort(List, Sorted) :- setof(X, member(X,List), Sorted). /* 8.10.3 */d776 28 d846 3 a870 26
keysort(Pairs, Sorted) :- pairs_ts_ps(Pairs, Ts, Ps), numbered_from(Ps,1), sort(Ts, STs), /* 8.4.3 */ pairs_ts_ps(Sorted, STs, _). /* Auxiliary predicates, not defined */ pairs_ts_ps([], [], []). pairs_ts_ps([Key-Value|Pairs], [t(Key,P,Value)|Ts], Ps) :- pairs_ts_ps(Pairs, Ts, Ps). numbered_from([], _). numbered_from([I0|Is], I0) :- I1 is I0 + 1, numbered_from(Is, I1).
numbered_from(Ps,1) is not needed, since Ps will be a
sorted list of variables.
@ 1.34 log @*** empty log message *** @ text @d300 2 a303 1d316 1 d341 3 a343 1
—permission_error(create, operator, Operator).a312 1
No error in YAP, SICStus, B, Ciao, ECLiPSe, CX, XSB, H, Qu.
d835 1
d843 2
@
1.33
log
@*** empty log message ***
@
text
@d297 3
a299 2
l) Op_specifier is a specifier such that Operator
would have an invalid set of specifiers (see 6.3.4.3).
d302 2
d307 5
a311 3
l) Priority is a priority and Op_specifier
is a specifier such that Operator would have an
invalid set of priorities and specifiers (see 6.3.4.3).
d314 3
d321 4
a324 3
m) Priority is a priority and Op_specifier
is a specifier such that an element of the Operator list
would have an invalid set of priorities and specifiers (see 6.3.4.3).
d326 2
a327 1
— permission_error(create, operator, Operator).
d331 3
d335 4
d340 1
d537 2
a538 2
[STO, does not succeed in many implementations, but
fails, loops, or produces an error]
d560 2
a561 2
These built-in predicates test, compare, and sort terms based on
the ordering of terms (7.2).
d568 1
a568 1
sort/2 assumes
that member/2 is defined as in 8.10.3.4.
d728 1
a728 1
setof(X, member(X,List), Sorted).
d735 1
a735 1
keysort(List, Sorted) is true iff List is a
d738 1
a738 1
of List such that the
d742 1
a742 1
relative sequence as in List.
d745 1
a745 1
Procedurally, keysort(List, Sorted) is executed as
d750 5
a754 5
KNVs be the sorted list (7.1.6.5) containing
as elements terms t(Key, N, Value) for each
element Key-Value of List
with N such that Key-Value is
the N-th element in List.
d758 1
a758 1
elements t(Key, N, Value) in KNVs.
d776 1
a776 1
List is a partial list
d780 1
a780 1
List is neither a partial list nor a list
d782 1
a782 1
type_error(list, List).
d788 1
a788 1
List is a list with an element which is a variable
d793 1
a793 1
list List is neither a variable nor a compound term with
d816 1
a816 1
List = [1-2|List], keysort(List, Sorted).
d831 23
d866 1
a866 1
T is a list of variables
d876 1
a876 1
[X, Y] is the variable list of each of
d890 1
a890 1
unifies with the list of variables
d1348 1
a1348 1
type_error(integer, Culprit)
d1351 1
a1351 1
type_error(float, Culprit)
d1368 1
a1368 1
type_error(Type, Culprit)
d1545 1
a1545 1
[The actual result is implementation dependent]
d1549 1
a1549 1
[The actual result is implementation dependent]
d1553 1
a1553 1
[The actual result is implementation dependent]
d1574 3
a1576 3
^(float-exp, int-exp) = float
^(int-exp, float-exp) = float
^(float-exp, float-exp) = float
@
1.32
log
@op/3 undefining '|'
@
text
@d349 1
a349 2
Succeeds, make | no longer an
infix operator.
@
1.31
log
@(^)/2 improvements
@
text
@d347 4
@
1.30
log
@Add Pasadena 2009 resolution A1n
@
text
@d1524 1
a1524 1
zero, the value is 1 or 1.0.
d1529 1
a1529 1
^(int-exp, int-exp) = int @@@@@@ or number
d1551 2
a1552 1
VX is negative and VY is not an integer
d1572 6
@
1.29
log
@(^)/2 tests
@
text
@d461 3
@
1.28
log
@*** empty log message ***
@
text
@d1552 12
d1612 1
@
1.27
log
@m
@
text
@d201 2
a202 1
A bar (6.4) shall be equivalent to the atom '|' when '|' is an operator.
d630 17
d726 1
a726 1
KNVs (7.1.6.5) containing
d732 3
a734 3
KVs with elements Key-Value
occurring in the same sequences as elements t(Key, N,
Value in KNVs.
d736 2
a737 2
KVs unifies with Sorted, then the goal
succeeds.
d768 9
a776 2
E of List is neither a
variable nor a compound term with principal functor (-)/2
d859 1
a859 1
that, for every term T, the following goals are true.
d1437 1
a1437 1
undefined}
d1445 1
@
1.26
log
@Almost finished, (^)/2 open
@
text
@d418 2
a419 2
copy_term(Term, TermC),
subsumes_term(TermC, Instance).
@
1.25
log
@Nachm
@
text
@d11 5
d28 2
a29 1
max-width: 30em;
d123 9
a131 2
Additioncal corrections: Error conditions
of number_chars/2 and friends.
d135 2
a136 2
pair to the set ValidType.
d527 1
a527 1
Add order to the set ValidDomain.
d554 20
d677 12
d694 12
a705 2
list of compound terms Sorted
unifies with a list KVs.
d708 5
a712 3
KV is an element of KVs
iff KV is an element of List
KV1
d714 3
a716 1
d718 2
d721 1
a721 1
d723 1
a723 9
List is a
list of elements Key-Value@@@@@@
and containing the elements
of List sorted according to Key
Sorted is a list
in ascending order of Key following term order (7.2). The elements
of List with the same key shall appear
in the same order the Sorted list.
d764 3
d769 2
a770 2
[STO. type_error(list, [1-2,1-2,...]) or looping in
many implementations.]
d774 3
a776 3
[STO, corresponds to the goal [V-V] = V. In many
implementations this goal succeeds and violates
the mode keysort(@@list, -list).]
a781 1
d785 3
a787 1
call/N is called with N ≥ 9. It
shall be implementation dependent whether or not this error condition
is satisfied.
d1168 3
a1170 6
atom_chars/2,
atom_codes/2,
number_chars/2,
number_codes/2
d1264 39
d1305 5
a1309 6
(+)/1 (unary plus)
and (div)/2 (flooring integer division) to simple
arithmetic functors (9.1). Add operators corresponding
to (-)/1 and (//)/2 (integer division)
(Resolution A6, Edinburgh 2010)
d1386 3
d1390 1
a1390 2
VX and VY have different types then the
value R shall satisfy R
∈
{VX, VY, float(VX), float(VY),
undefined} and the value shall be implementation dependent.
d1416 4
a1419 1
@@@@@@ One further case being defined is...
d1424 1
a1424 1
value float_overflow (9.1.6).
d1455 4
a1458 4
of them is an integer VI
and floatI→F(VI)
= float_overflow (9.1.6). It shall be implementation dependent
whether this error condition is satified
d1495 1
a1495 1
zero, the value is 1 (@@@@@@ or 1.0).
d1500 1
a1500 1
^(int-exp, int-exp) = int
d1522 19
a1540 1
@@@@@@reconsider the errors of (**)/2.
d1550 3
d1561 13
d1857 1
@
1.24
log
@Tamas' first round!
@
text
@d117 3
d398 1
a398 1
term-lattice partial order is term_instance/2 (3.95):
d404 3
d638 1
a638 1
implementations this goal succeeds, thereby violating
d646 11
a656 2
keysort(List, Sorted) is true iff Sorted
unifies with a list of@@@@@@
d717 1
a717 1
implementations this goal succees, thereby violating
d774 1
a774 1
that, for every term T, the following goal is true.
d777 3
a779 3
term_variables(T, Vs1), term_variables(T, Vs2),
term_variables(Vs1, Vs3), term_variables(Vs2, Vs4),
Vs1 == Vs2, Vs1 == Vs3, Vs1 == Vs4.
d781 1
d1069 6
a1074 4
atom_chars/2, atom_codes/2, number_chars/2, number_codes/2
d1308 12
a1319 2
shall be implementation dependent whether or not this error condition
is then satisfied @@@@@@
@
1.23
log
@number_chars/2 & co reformulation, including partial lists for
elements.
@
text
@d403 4
a406 7
subsumes/2
which binds the first argument to be identical to the second.
This binding often leads to erroneous programs.
The following definition is deprecated and mentioned
only for backwards compatibility.
d469 3
a471 3
acyclic_term(Term) is true iff Term is an acyclic
term, that is, Term has been obtained by a finite set of
equations that are not subject to occurs-check (7.3.3).
d489 2
a490 2
[Does not succeed in most implementations, but fails,
loops, or produces an error]
d619 1
a619 1
8.0, +a, +X, a], Sorted).
d621 1
a621 1
[V, 7.0, 8.0, 1, 2, a, z, +X, +a, 1+Y, 1+2]
d631 3
a633 1
[STO, corresponds to the goal [V] = V.]
d646 8
a653 6
list of elements with the format Key-Value
and Sorted is a list containing the elements
of List sorted according to the value of Key
in ascending order following term order (7.2). The relative order
of elements of List with the same key shall not change in
the Sorted list.
d693 11
d722 1
a722 1
which is a witness of the variable set (7.1.1.2) of T.
d757 10
d955 2
a956 2
shall be implementation dependent whether or not this error is
produced.
d958 1
a958 1
existence_error(procedure,call/9).
d964 1
a964 1
of the following ways because the error in subclause d is implement
d972 1
a972 1
call/2..N up to any N that is within
d1060 1
a1060 1
Replace subclause c and d by:
d1080 1
a1080 1
Replace subclause c and d by:
d1248 1
a1248 1
If VX and VY are of same type then the
d1259 3
d1264 2
a1265 1
and float(VY) include the exceptional value float_overflow.
d1289 4
@
1.22
log
@one inconsistent name from N208
@
text
@d131 1
a131 1
d146 1 a146 1d152 1 a152 1d160 1 a160 1d168 1 a168 1d185 1 a185 1d191 1 a191 1d203 1 a203 1d215 1 a215 1d222 1 a222 1d230 1 a230 1d241 1 a241 1d253 1 a253 1d263 1 a263 1d271 1 a271 1d280 1 a280 1d287 1 a287 1d295 1 a295 1d311 1 a311 1d338 1 a338 1d516 1 a516 1d524 1 a524 1d575 2 a576 2 compare(==, 3, 3.0). domain_error(order, ==). d582 1 a582 1d705 1 a705 1d932 3 a934 2d) call/9is called. It is implementation dependent whether or not this error is produced. d1040 1 a1040 1d1047 2 a1048 2d) An element Eof the listListis neither a variable nor a one-char atom d1060 1 a1060 1d1067 2 a1068 2d) An element Eof the listListis neither a variable nor an integer code d1072 2 a1073 7e) An element Eof the listListis neither a variable nor a character code
—representation_error(character_code).@@@@@@ e) An element Eof the listListis an integer but not a character code d1080 1 a1080 18.16.6.3 Errors (char_code/2)
d1082 3 a1084 1 @@@@@@ Replace subclause d by: a1085 1d1088 1 a1088 2d) Codeis an integer but not a character code (7.1.2.2) d1090 6 a1095 1
—representation_error(character_code).d1098 1 d1101 1 a1101 1 Pro: IF, GNU, YAP, SICStus, SWI, B, ECLiPSe, XSB. d1103 2 a1104 18.16.7.3 Errors (number_chars/2)
d1106 1 a1106 1 Replace subclause c by: d1114 2 a1115 1 d1117 1 a1117 18.16.7.3 Errors (number_codes/2)
d1119 2 a1120 1 Replace subclause c by: d1122 1 a1122 5
- c)
Listis neither a partial list nor a list
—type_error(list, List).d1126 1 a1126 2 d1141 1 a1141 1d1153 1 a1153 1d1163 1 a1163 1d1171 1 a1171 1d1175 2 a1176 1d1182 1 a1182 1d1193 1 a1193 1d1202 1 a1202 1d1208 1 a1208 1d1217 1 a1217 1@ 1.21 log @HTML-formatting @ text @d833 1 a833 1
—type_error(callable, Generate).d921 1 a921 1
—instantiation error.@ 1.20 log @instance! by Feliks Kluzniak @ text @d7 65 d161 3 a163 1 —type_error(variable, Stream).d169 3 a171 1 —uninstantiation_error(Stream).d186 1 a186 1 A bar (6.4) shall be equivalent to the atom '|'
when '|' is an operator. d216 1 a216 1 Bar is also a solo character (6.5.3), and a token (6.4) but
d232 3 a234 3
except ',', '[]', and '{}' so the priority of the comma
operator cannot be changed, and so empty lists and curly
bracket pairs cannot be declared as operators. d289 1 a289 1 is a
specifier such thatOperatorwould have an
d296 1 d298 4 a301 2 is a
specifier such that an element of theOperator
list would have an invalid set of priorities and
specifiers (see 6.3.4.3). a302 2
—permission_error(create, operator, Operator).d347 6 a352 4d389 1 a389 2Generalθ andSpecificθ are identical, and
Specificθ andSpecificd354 1 a354 1NOTES d391 3 a393 1d539 1 a539 1
1 The final two examples show thatsubsumes_term/2is d395 1 a395 1 term-lattice partial order is: d397 1 a397 1d403 1 a403 1
2 d410 2 a411 1d416 1 a416 1compare(+atom, @@term, @@term) d545 3 a547 2be the goal to be executed, M ≥ 0, N ≥ 2. d855 1 a855 1 call(atom_concat(pro), log, Atom). @ 1.7 log @retractall/1 ambiguities @ text @d321 7 a327 1 examples above illustrate this. d704 1 a704 1 predicate. even when all of its clauses are removed. @ 1.6 log @retractall &ct @ text @d754 10 @ 1.5 log @sort/2 and keysort/2 got a home @ text @d341 2 a342 1- a)
Orderis neither a variable nor an atom
—type_error(atom, Order).d551 3 a553 1>
—domain_error(order, Order).d601 7 a607 1 list
—instantiation_error.d609 1 a609 2- b)
Listis neither a partial list nor a list
—type_error(list, List).d611 1 a611 2- c)
Sortedis neither a partial list nor a list
—type_error(list, Sorted).d663 7 a669 2- a)
Listis a partial list
—instantiation_error.d671 1 a671 2- b)
Listis neither a partial list nor a list
—type_error(list, List).d673 1 a673 2- c)
Sortedis neither a partial list nor a list
—type_error(list, Sorted).d676 1 d679 4 a682 3- e) An element
EofListis neither a variable nor a compound term with principal functor(-)/2
—type_error(pair, E).d714 5 a718 5NOTESd736 3 a738 11 For example,
[X, Y]is the variable list of each of the termsf(X,Y),X+Y+X, d721 4 a724 42 The concept of a variable list of a term is required when defining
term_variables/2
a) LetTVarsbe the list of variables d740 4 a743 2
b) IfVarsunifies withTVars, then the goal succeeds.
c) Else the goal fails. d755 1 a804 1NOTES d806 3 a808 1
1 d810 1 a810 1 The dynamic predicate remains known to the system as a dynamic d814 2 a815 1
2 d817 1 a817 2 If no corresponding procedure was found, the database remains unaltered. @@@@@@ or not d827 5 a831 2- a)
Headis a variable
—instantiation_error.d833 1 a833 2- b)
Headis neither a variable nor a callable term
—type_error(callable, Generate).d836 3 a838 2 is that of a static procedure
—permission_error(modify, static_procedure, Pred).d887 2 a888 2NOTE — A built-in predicated919 3 a921 2apply/2was implemented d891 1 a891 1- a)
Closureis a variable
—instantiation error. d923 3 a925 2- b)
Closureis neither a variable nor a callable term
—type_error(callable, Closure). d928 3 a930 2 implementation defined maximum arity (7.11.2.3)
—representation_error(max_arity). d933 3 a935 2 whether or not this error is produced.
—existence_error(procedure,call/9). d939 2 a940 2NOTE — A standard-conforming processor may implement call/N in one d943 1 a943 1 d957 1 a958 1d1042 3 a1044 2- c)
Listis neither a partial list nor a list
—type_error(list, List).d1047 5 a1051 2 neither a variable nor a one-char atom
—type_error(character, E).d1062 3 a1064 2- c)
Listis neither a partial list nor a list
—type_error(list, List).d1067 3 a1069 2 neither a variable nor an integer code
—type_error(integer, E).d1072 3 a1074 2 neither a variable nor a character code
—representation_error(character_code).d1077 3 a1079 2 an integer but not a character code
—representation_error(character_code).d1092 3 a1094 1 (7.1.2.2)
—representation_error(character_code).d1107 3 a1109 2- c)
Listis neither a partial list nor a list
—type_error(list, List).d1119 3 a1121 2- c)
Listis neither a partial list nor a list
—type_error(list, List).d1236 2 a1237 2NOTE — The possible values of
float(VX)d1239 1 d1254 5 a1258 1- a)
Xis a variable
—instantiation_error.d1260 1 a1260 1- b)
Yis a variable
—instantiation_error.d1306 3 a1308 1 NOTE — '^' is an infix predefined operator (see 6.3.4.4). d1314 3 a1316 1- a)
Xis a variable
—instantiation_error.d1318 3 a1320 1- b)
d1344 1 a1344 1Yis a variable
—instantiation_error.d1324 1 a1324 19.3.1.1 Description
d1351 1 a1351 19.3.1.2 Template and modes
d1358 1 a1358 19.3.11.3 Errors
d1362 1 a1362 1- a)
Xis a variable
—instantiation_error.d1364 5 a1368 2- b)
VXis greater than 1 or less than -1
—evaluation_error(undefined).d1372 1 a1372 19.3.11.4 Examples
d1389 1 a1389 19.3.12.1 Description
d1396 1 a1396 19.3.12.2 Template and modes
d1403 1 a1403 19.3.12.3 Errors
d1407 5 a1411 1- a)
Xis a variable
—instantiation_error.d1413 1 a1413 2- b)
VXis greater than 1 or less than -1
—evaluation_error(undefined).d1417 1 a1417 19.3.12.4 Examples
d1442 1 a1442 19.3.13.2 Template and modes
d1455 1 a1455 1- a)
Xis a variable
—instantiation_error.d1457 5 a1461 1- b)
Yis a variable
—instantiation_error.d1464 3 a1466 1 zero
—evaluation_error(undefined).d1493 1 a1493 19.3.14.2 Template and modes
d1500 1 a1500 19.3.14.3 Errors
d1504 3 a1506 1- a)
Xis a variable
—instantiation_error.d1510 1 a1510 19.3.14.4 Examples
d1569 1 a1569 1- a)
B1is a variable
—instantiation_error.d1571 5 a1575 1- b)
B2is a variable
—instantiation_error.d1578 3 a1580 1 an integer
—type_error(integer, VB1).d1583 3 a1585 1 an integer
—type_error(integer, VB2).@ 1.19 log @*** empty log message *** @ text @d322 1 a322 1 term-lattice partial order would be d324 4 a327 3 subsumes_term_transitive(X, Y) :- copy_term(Y, YC), subsumes_term(X, YC). d399 2 a400 1 term. d536 3 d540 2 a541 1 sort([1+Y, z, a, V, 1, 2, V, 1, 7.0, 8.0, 1+Y, 1+2, 8.0, +a, +X, a], Sorted). d543 1 a543 1 [V, 7.0, 8.0, 1, 2, a, z, +X, +a, 1+Y, 1+2] d604 2 a605 1 Succeeds unifying Sorted with [1-a, 1-z, 1-a, 2-99, 2-44, 3-f(_)]. d607 4 @ 1.18 log @Markus Triska @ text @d320 3 a322 3
1subsumes_term/2is not transitive. The last two examples above illustrate this. A transitive definition corresponding to the term-lattice partial order would be @ 1.17 log @*** empty log message *** @ text @d109 1 a109 1 Allow bar character | as infix operator, forbid '{}' and '[] as d372 2 a373 1ground(Term)is true iffTermis a ground term. @ 1.16 log @Better modes for sort/2 and keysort/2 @ text @d546 1 a546 1 [STO, corresponds to the goal [V] = V] d645 1 @ 1.15 log @atom_chars/2 etc. Errors @ text @d513 1 d568 1 d977 1 a977 1 Pro: GNU, YAP, SICStus, SWI, B, ECLiPSe, XSB. @ 1.14 log @*** empty log message *** @ text @a600 3 d859 2 a860 2 Succeeds, unifying X with 1. On backtracking, it succeeds, unifying Y with 2. d916 86 d1456 1 a1456 1- Dash: — @ 1.13 log @Comments from Feliks Kluzniak @ text @d829 1 a829 1 NOTE — A conforming processor may implement call/N in one @ 1.12 log @ndash @ text @d139 2 a140 2 There shall not be an operator '|' except as an
infix with priority greater than or equal to 1001. d170 1 a170 1 Add as last syntax rule: d182 1 a182 1 Add as last syntax rule: d200 1 a200 1 Add as last syntax rule: d829 3 a831 3 NOTE — Due to the error in subclause d being implementation dependent (3.91), a conforming processor may implement call/N in one of the following ways. d1021 1 a1021 1 IfVXandVYare of different type then the d1057 1 a1057 1 Evaluates to 3, 3.0, or undefined. d1061 1 a1061 1 Evaluates to 3.0 or undefined. d1065 1 a1065 1 Evaluates to 0, 0.0, or undefined. @ 1.11 log @keysort errors @ text @d1009 1 a1009 19.3.8 max/2 - maximum
d1070 1 a1070 19.3.9 min/2 - minimum
d1073 1 a1073 19.3.10 (^)/2 - integer power
d1122 1 a1122 19.3.11 asin/1 - arc sine
d1164 1 a1164 19.3.12 acos/1 - arc cosine
d1206 1 a1206 19.3.13 atan2/2 - arc tangent
d1253 1 a1253 19.3.14 tan/1 - tangent
d1284 1 a1284 19.3.15 pi/0 - pi
d1309 1 a1309 19.4.6 xor/2 - bitwise exclusive or
@ 1.10 log @Better modes and templates! @ text @d509 1 a509 1 unifies with the sorted list of listList(7.1.6.5). d574 1 a574 2 list or a list with an element which is a variable
—instantiation_error.d582 4 a585 1- d) An element
EofListis neither @ 1.9 log @compare templace and modes @ text @d461 2 a462 1compare(?atom, ?term, ?term)d513 1 a513 1sort(?list, ?list)d567 1 a567 1keysort(@@list, ?list)@ 1.8 log @subsumes_term/2 transitive definition note. John Gallagher @ text @d461 1 a461 1compare(?atom, @@term, @@term)d761 1 a761 1 retractall(nonexistent), inexistant. d789 2 a790 2Procedurally, a goal of predicate
call/Nis executed as follows: d795 1 a795 1 YN)callable(Term)is true iffTermis a callable term. a683 2 @@@@@@ d686 4 a689 12- a) Determines the principal functor
Pand arityNassociated withHead.P/Nis the associated predicate indicator- b) If the database contains a dynamic procedure whose predicate indicator is
P/N, then proceeds to 8.9.5.1 d,- c) Else the goal succeeds.
- d) Retracts from the database all clauses whose head unifies with
Headand the goal succeeds d697 3 a699 2 The dynamic predicate shall continue to be known by the system even when all of its clauses are removed. d703 2 a704 2 This predicate leaves the referenced predicate dynamic even when all of its clauses are removed. d751 3 @ 1.4 log @*** empty log message *** @ text @d416 6 d424 1 d427 10 d492 102 d624 1 a624 1 unifies withTVarswhich is the list of variables a903 113
Add the new subclauses into the place indicated by their number:8.x.y sort/2
@@@@@@determine x.y@@@@@@8.x.y.1 Description
sort(List, Sorted)is true iffSortedunifies with the sorted list (7.1.6.5) ofList.8.x.y.2 Template and modes
sort(?list, ?list)8.x.y.3 Errors
- a)
Listis a partial list
—instantiation_error.- b)
Listis neither a partial list nor a list
—type_error(list, List).- c)
Sortedis neither a partial list nor a list
—type_error(list, Sorted).8.x.y.4 Examples
sort([1+Y, z, a, V, 1, 2, V, 1, 7.0, 8.0, 1+Y, 1+2, 8.0, +a, +X, a], Sorted). Succeeds, unifying Sorted with [V, 7.0, 8.0, 1, 2, a, z, +X, +a, 1+Y, 1+2] sort([X, 1], [1, 1]). Succeeds, unifying X with 1. sort([1, 1], [1, 1]). Fails. sort([V], V). Undefined. [STO, corresponds to the goal [V] = V]8.x.z keysort/2
@@@@@@determine x.z@@@@@@8.x.z.1 Description
@@@@@@keysort(List, Sorted)is true iffSortedunifies with a list of@@@@@@
Listis a list of elements with the formatKey-ValueandSortedis a list containing the elements ofListsorted according to the value ofKeyin ascending order following term order (7.2). The relative order of elements ofListwith the same key shall not change in theSortedlist.8.x.z.2 Template and modes
keysort(@@list, ?list)8.x.z.3 Errors
- a)
Listis a partial list or a list with an element which is a variable
—instantiation_error.- b)
Listis neither a partial list nor a list
—type_error(list, List).- c)
Sortedis neither a partial list nor a list
—type_error(list, Sorted).- d) An element
EofListis neither a variable nor a compound term with principal functor(-)/2
—type_error(pair, E).7.12.2 b
Addpairto the setValidType. Add the new subclauses into the place indicated by their number:a988 2 d1043 1 a1043 1 Evaluates to 3 or 3.0. d1047 2 a1048 1 Evaluates to 3.0. d1051 1 a1051 1 Evaluates to 0 or 0.0. d1382 2 a1383 18.x.z.4 Examples
keysort([2-99, 1-a, 3-f(_), 1-z, 1-a, 2-44], Sorted). Succeeds unifying Sorted with [1-a, 1-z, 1-a, 2-99, 2-44, 3-f(_)].
E185/1, TU Wien @ 1.3 log @Numbering corrected @ text @d535 1 a535 1 Succeeds, unifying Vars with [A,B,C,D]. d537 2 a538 2 term_variables(t, [_,_|a]). type_error(list, [_,_|a]). d541 1 a541 1 Succeeds, unifying Vars with [B,A], T with A*B, d550 1 a550 1 term_variables(Vars+Vars, Vars). d552 1 a552 1 [STO, corresponds to goal [Vars] = Vars.] d592 2 a593 4 This predicate does not change any of the standard predicate properties of the referenced predicate (as reported bypredicate_property(Head, Property)), even when all of its clauses are removed. d744 1 a744 1 maplist(<(3), [1,2]). d747 1 a747 1 maplist(<(3), [1,2,3]). d756 1 a756 1 unifying Xs with [X,X]. d758 1 a758 1 unifying Xs with [X,X,X]. d820 3 a822 2 sort([1, 2, 1, 8, 4], Sorted). Succeeds, unifying Sorted with [1, 2, 4, 8]. d826 7 d843 6 a848 1keysort(List, Sorted)is true iffListis a d875 2 a876 2 a variable nor a(-)/2compound term
—type_error(pair, E).d905 1 a905 1 to(-)/1and(//)/1(integer division)
max(X, Y) evaluates the expression X with
value VX, the expression Y with
value VY, and has the value of the maximum
of VX and VY. When used with expressions of
mixed-types, the result is implementation dependent; an implementation
may chose either to return a value or to throw an exception.
d1026 1
a1026 2
X is a variable or Y is a
variableinstantiation_error.
d1028 1
a1028 5
X is not a variable and VX is not a
numbertype_error(number, VX).
Y is not a variable and VY is not a
numbertype_error(number, VY).
d1073 1
a1073 1
NOTE - '^' is a right associative infix predefined operator (see 6.3.4.4).
d1077 10
d1091 10
a1100 5
Evaluates to 0.
^(7,7).
Evaluates to 823543.
7^7^7.
Evaluates to @@@@@@
a1102 1
d1125 1
a1125 4
X is not a variable and VX is not a
numbertype_error(number, VX).
VX is greater than 1 or less than
a1160 1
d1167 1
a1167 4
X is not a variable and VX is not a
numbertype_error(number, VX).
VX is greater than 1 or less than
d1193 1
a1193 1
arguments to determine the quadrant of the return value. The
d1210 1
a1210 5
X is a variable or Y is a
variableinstantiation_error.
X is not a variable and VX is not a
numbertype_error(number, VX).
d1212 1
a1212 2
Y is not a variable and VY is not a
numbertype_error(number, VY).
d1214 1
a1214 1
X is equal to zero and Y is equal to
d1239 1
a1239 1
value VX and has value of the tangent
a1254 3
X is not a variable and VX is not a
numbertype_error(number, VX).
d1269 1
a1269 1
pi has value of π whose value is the ratio of a
d1316 1
a1316 2
B1 is a
variableinstantiation_error.
d1318 1
a1318 2
B2 is a
variableinstantiation_error.
a1330 3
xor(77, N)
instantiation_error.
@
1.2
log
@*** empty log message ***
@
text
@d11 1
a11 1
PRE-DRAFT TECHNICAL CORRIGENDUM 1
d15 1
d17 1
a17 1
Draft technical corrigendum 1 to International Standard 13211-1:1995
@
1.1
log
@Initial revision
@
text
@d40 1
a40 1
atan2/2, (^)/2, and (div)/2.
d1034 1
a1034 1
@@@@@@
d1037 33
a1069 1
@@@@@@
d1164 4
a1167 4
atan2(Y, X) evaluates the expression Y with
value VY, the expression X with
value VX, and computes the principal value of the arc
tangent of VY/VX (in radians), using the signs of both
d1335 3
@