domains
x = integer
l = integer*
w = symbol
wl = symbol*
predicates
means(x,w)
translate(l,wl)
clauses
means(0,zero).
means(1,one).
means(2,two).
means(3,three).
means(4,four).
means(5,five).
means(6,six).
means(7,seven).
means(8,eight).
means(9,nine).
translate([],[]).
translate([X|List],[What|ConvertedList]) :-
means(X,What),
translate(List,ConvertedList).
Output :
Goal: translate([1,2,3,4],ConvertedL)
ConvertedL=["one","two","three","four"]
1 Solution