From: Doug E. <dou...@gm...> - 2021-06-17 00:22:24
|
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 |