0
votes

I'm trying to write a program with SWI-Prolog. I have a predicate that converts English words to Spanish.

listtran([],[]). 
listtran([Head|Tail],[Trans|Spanish]) :-
   diccionario(Head,Trans),
   listtran(Tail,Spanish).

And I have a predicate that verifies a sentence structure.

sentence(W1,W2,W3) :-
   word(noun,W1),
   word(verb,W2),
   word(adjective,W3).

Now I want to join them in the same predicate, any ideas?

1

1 Answers

1
votes
translatedsentence(W1,W2,W3) :-
   sentence(V1,V2,V3),
   listtran([V1,V2,V3], [W1,W2,W3]).