Hi, I'm trying to write some predicates to solve the following task (learnprolognow.com)
Suppose we are given a knowledge base with the following facts:
tran(eins,one).
tran(zwei,two).
tran(drei,three).
tran(vier,four).
tran(fuenf,five).
tran(sechs,six).
tran(sieben,seven).
tran(acht,eight).
tran(neun,nine).
Write a predicate listtran(G,E) which translates a list of German number words to the corresponding list of English number words. For example:
listtran([eins,neun,zwei],X).
should give:
X = [one,nine,two].
I've written:
listtran(G,E):- G=[], E=[].
listtran(G,E):- G=[First|T], tran(First, Mean), listtran(T, Eng), E = [Mean|Eng).
But I get the error: "illegal start of term" when compiling. Any suggestions?