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

PrologProlog Write a procedure map(List,PredName, Result) that applies the predicate PredName (Arg,Res)

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!