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

10 lines
196 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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.