This is the final state of the document as it was used for the resolutions in Edinburgh. In the meantime many systems adopted accordingly. This document is superseded by DTC2.In 13211-1:1995 evaluable functors (9) are used for evaluating an expression (7.9) within Arithmetic evaluation (8.6) and Arithmetic comparison (8.7). This document provides an overview of the current practice of evaluable functors that are not part of 13211-1 but are compliant (5.1) due to:
5.5.10 Evaluable functors
A processor may support one or more additional evaluable
functors (9) as an implementation specific feature.
Implementors interested in standardization who wish to see their system listed in this table are asked to provide a table in HTML with the complete first row and one row for their system. If the same function is provided with an alternate name, the entry shall be labelled "alt". Functions added since the Pasadena meeting shall be labelled "new".
(#)/2 is conflicting or irritating w.r.t constraints.
(><)/2 suggests to be something similar to a
relational operator like
xor/2 says what it is, but isn't an operator.
xor as operator seems problematic. This
voids Prolog text like (a, b, xor).
2 Original name:
atan/2. In favor of atan2/2: All other
languages/libraries call it atan2. Cannot be confused
atan/1 of 13211-1:1995.
(^)/2 - missing for unbounded integers.
(**)/2 has as result type float only. This is useful for
arguments of type float or bounded integers. But for unbounded
integers the result type should be an unbounded integer. To avoid
compatibility problems a new name seems to be the best.
(**)/2 is declared as
in the operator table 184.108.40.206. This means that
is invalid Prolog text, whereas
7^7^7. is valid with the
^ is used also in Haskell. An
addition seems to be less problematic than a change.
4 Instead of
e one can write
5 div/2 is defined as:
div(X, Y, Z) :- Z is (X - X mod Y) // Y.
signum/1 and sgn/1 always return an integer (-1, 0 or 1).
In ECLiPSe native mode, floor, ceiling, round and truncate always return a result of the same type as the argument.
integer/1 is a pure type conversion (like float/1). It converts its argument to integer type iff it has an integral value. Otherwise it raises an exception. The purpose is to convert the results of sign/1 or float_integer_part/1 (and non-standard versions of round, truncate, floor, ceiling) to integers, if needed.
setbit(X,Y) sets bit Y in X. Bits are counted from 0 (lsb).
div/2 is the division that goes with mod/2, while (//)/2 goes with rem/2.
eval/1 is used to mark variables that may be instantiated to a symbolic expression (rather than a number) at runtime. See this thread in comp.lang.prolog.
In ECLiPSe, any deterministic predicate that returns a number as its last argument can be used as an arithmetic function, e.g. atom_length(hello) will evaluate to 5 via calling atom_length/2. Arguments of such expressions are not recursively evaluated (unless this is done explicitly by the corresponding predicate), and therefore do not need to be arithmetic expressions themselves.
X is contestedarithmeticfunction(A,B).
X > tan(Y)
>=<(E1, E2)is true iff the corresponding evaluated values
EV2are comparable numbers.
It succeeds if V1 and V2 are comparable numbers. It fails if V1 and V2 are numbers that are not comparable.
It needs some standardese around to it allow for the possibility that V1, V2, or both might be constrained and the constraints might be such as to determine the order.
This is intended to be the IEEE "?" comparison, but needs to be described so that a Prolog that allows complex numbers (as C99 does, which could be used to implement it) could use it to avoid trying to order complex numbers.
At least one Prolog with rational arithmetic had rational ±infinity and rational NaN, so it would have had a use for this too.