Created
December 22, 2018 09:56
-
-
Save DonaldKellett/6812cc8594ce7433ef8b3be5f53426c2 to your computer and use it in GitHub Desktop.
Learn Prolog Now! - Chapter 4 - Exercise 4.5 - Deutsch <-> English
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Deutsch <-> English translation of 1-9 (provided) | |
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). | |
% listtran/2 - Given two lists G, E, is each element in G an exact translation in German of the corresponding English word in E? (Domain: 1-9 in German/English) | |
listtran([], []). | |
listtran([X | G], [Y | E]) :- tran(X, Y), listtran(G, E). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment