[eclipse-clp-users] X is p(a) +1. from Apt/Wallace book

From: Doug Edmunds <dougedmunds_at_...6...>
Date: Wed, 16 Jun 2021 17:22:10 -0700
In the Apt/Wallace book Constraint Log Programming Using Eclipse (2007),
Ch 3 "Arithmetic in Prolog" on pages 45-46 there is this code:
-------
To save explicitly introducing such extra variables, ECLiPSe supports 
for is/2 a functional syntax. Let us suppose p/2 is a predicate whose 
last argument is numeric, viz.

p(a, 1).
p(b, 2).

Then p/1 can be used as a function when it occurs on the right-hand side
of is, for example:

[eclipse 10]: X is p(a)+1.

X = 2
Yes (0.00s cpu)

--------

How does this work?  I don't understand how p(a,1) becomes numeric.

Can you point me to some reference to "predicate whose last
argument is numeric" in the manuals?

Thanks.

-DAE
Received on Thu Jun 17 2021 - 00:22:24 CEST

This archive was generated by hypermail 2.3.0 : Thu Feb 22 2024 - 18:13:20 CET