I am trying to develop a prolog procedure that will convert numbers in any given list to a list of their square roots, using the univ (=..). So far I have
convert(X,Y): number(X), Y is X^2.
use([],_,[]).
use([_|X],convert,L):-
convert(X,Y),
L =..[convert,X,Y].
This evaluates false, what could be wrong in my logic or execution?
convert(X,Y): number(X)...-->convert(X,Y) :- number(X).... Do you mean square roots or squares? Your code is doing squares. Why are you using=../2? It's purpose is to provide an equivalence between a term and a list. It's unclear how you think this would solve your problem. - lurker