Tập thể dục 2,4 Dưới đây là sáu từ tiếng Anh: bào ngư, từ bỏ, đảo chữ, kết nối, thanh lịch, tăng cường. Họ được bố trí trong một câu đố ô chữ như thời trang trong lưới đưa ra dưới 2. Kết hợp và Bằng chứng Vẽ cây tìm kiếm sự kỳ diệu truy vấn thứ năm (Hermione). | 50 Chapters. Recursion kata ri na olga natsha ỉrỉna Define a predicate in 2 that tells us which doll is directly or indirectly contained in which other doll. . the query in katarina natasha should evaluate to true while in olga katarina should fail. Exercise Define a predicate greater_than 2 that takes two numerals in the notation that we introduced in this lecture . 0 succ 0 succ succ 0 . as arguments and decides whether the first one is greater than the second one. - greater_than succ succ succ 0 succ 0 . yes - greater_than succ succ 0 succ succ succ 0 . no Exercise We have the following knowledge base directTrain forbach saarbruecken . directTrain freyming forbach . directTrain fahlquemont stAvold . directTrain stAvold forbach . directTrain saarbruecken dudweiler . directTrain metz fahlquemont . directTrain nancy metz . That is this knowledge base holds facts about towns it is possible to travel between by taking a direct train. But of course we can travel further by chaining together direct train journeys. Write a recursive predicate travelBetween 2 that tells us when we can travel by train between two towns. For example when given the query travelBetween nancy saarbruecken . . Practical Session 3 51 it should reply yes . It is furthermore plausible to assume that whenever it is possible to take a direct train from A to B it is also possible to take a direct train from B to A. Can you encode this in Prolog You program should . answer yes to the following query travelBetween saarbruecken nancy . Do you see any problems you program may run into Practical Session 3 By now you should feel more at home with writing and runnning basic Prolog programs. The purpose of Practical Session 3 is twofold. First we suggest a series of keyboard exercises involving trace which will help you get familiar with recursive definitions in Prolog. We then give a number of programming problems for you to solve. First the keyboard exercises. As recursive .