Hi everyone,
I'm new to prolog and I just can't figure it out.
I'm trying to build a simple program that receives a list of predicates, searchs for a specific predicate in the list, and applies a function to that predicate parameters.
something along these lines:
?- program([pred1(a,b,p), pred2(d,b,p), pred2 (a,c,p)]).
program (list1) :-
search(pred2(X,Y,p),list1).
doSomething (X,Y) % with the X and Y returned from search function, both of them.
Basically, I want to use all values that would return from an objective search(pred2(X,Y,p),list1)
and use them on another function.
Thanks in advance