[net.lang.prolog] More on Referential Transparency of =..

U-Reddy%UTAH-20@sri-unix.UUCP (11/08/83)

From:  Uday Reddy <U-Reddy@UTAH-20>

Re: Pereira, Referential Transparency, PROLOG Digest V1 #49 (11.7.83)

Fernando Pereira states that =.. is referentially transparent because
the function symbols in Prolog are uninterpreted.  This argument is
valid provided =.. is used only with terms constructed by function
symbols, not predicate symbols.  If p is a predicate symbol, then

        p(A) =.. X

is not referentially transparent.

Since this condition is not adhered to in Prolog, Pereira's argument
merely transfers the blemish from =.. to call.

Provided =.. is used in a referentially transparent way, is it
first-order or second-order ?  The answer is naturally that it
is second-order, because one of its arguments contains a function.

Incidentally, I don't see why "is" is referentially opaque.
One can extend the semantics to include integers, interpreting
"is" as a relation mapping Herbrand terms to integers.

-- Uday Reddy