RosettaCodeData/Task/Apply-a-callback-to-an-array/Picat/apply-a-callback-to-an-array-2.picat
2023-07-01 13:44:08 -04:00

9 lines
196 B
Text

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.