Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Swi-Prolog Suppose we are given a knowledge base with the following facts: Write a predicate listtran(G,E) which translates a list of German number words

image text in transcribedUsing Swi-Prolog

Suppose we are given a knowledge base with the following facts: Write a predicate listtran(G,E) which translates a list of German number words to the corresponding list of English number words. tran(eins,one). tran(zweitwo). tran(drei,three). tran(vier,four). tran(fuenf,five). tran(sechs,six). tran(sieben,seven). tran(acht,eight). tran(neun,nine). For example: listtran([eins, neun, zwei],x). should give: X = [one, nine, two]. Your program should also work in the other direction. For example: listtran(x,[one, seven, six, two]). should return: X = [eins, sieben, sechs, zwei]. Hint: to answer this question, first ask yourself 'How do I translate the empty list of number words?' That's the base case. For non-empty lists, first translate the head of the list, and then use recursion to translate the tail

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security XI Status And Prospects

Authors: T.Y. Lin, Shelly Qian

1st Edition

0412820900, 978-0412820908

More Books

Students also viewed these Databases questions

Question

Discuss the key people management challenges that Dorian faced.

Answered: 1 week ago

Question

How fast should bidder managers move into the target?

Answered: 1 week ago