RosettaCodeData/Task/Apply-a-callback-to-an-array/Picat/apply-a-callback-to-an-arra...

10 lines
196 B
Plaintext

go2 =>
L = 1..10,
% Define the predicate _in the bp space_.
bp.assert( $(fun2(X,Y) :- Y is X*X) ),
% Use bp.fun2 to call the function.
println([B : A in L, bp.fun2(A,B)]),
nl.