Question: Prolog Write a procedure map(List,PredName, Result) that applies the predicate PredName (Arg,Res) to all the elements in List, and returns the result in the lst
Prolog
Write a procedure map(List,PredName, Result) that applies the predicate PredName (Arg,Res) to all the elements in List, and returns the result in the lst Result The elements in List can be assumed to all be integers. For example: let test be defined as test(N,R) - R 1s N*N ?- map ([3,5,-2],test,L) L= [9, 25, 4]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
