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. -DAEReceived on Thu Jun 17 2021 - 00:22:24 CEST
This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:21 CEST