tailieunhanh - Learn Prolog Now phần 3

Truy vấn làm bạn phải đặt ra để tìm ra được câu ngữ pháp có thể tạo ra? Danh sách tất cả các câu ngữ pháp này có thể tạo ra trong Prolog đặt hàng sẽ tạo ra chúng. Hãy chắc chắn rằng bạn hiểu lý do tại sao Prolog tạo ra chúng theo thứ tự này. | 32 Chapter 2. Matching and Proof Search Draw the search tree for the fifth query magic Hermione Exercise Here is a tiny lexicon and mini grammar with only one rule which defines a sentence as consisting of five words an article a noun a verb and again an article and a noun. word article a . word article every . word noun criminal . word noun big kahuna burger . word verb eats . word verb likes . sentence Word1 Word2 Word3 Word4 Word5 - word article Word1 word noun Word2 word verb Word3 word article Word4 word noun Word5 . What query do you have to pose in order to find out which sentences the grammar can generate List all sentences that this grammar can generate in the order Prolog will generate them. Make sure that you understand why Prolog generates them in this order. Exercise Here are six English words abalone abandon anagram connect elegant enhance. They are to be arranged in a crossword puzzle like fashion in the grid given below. The following knowledge base represents a lexicon containing these words. word abalone a b a l o n e . word abandon a b a n d o n . word enhance e n h a n c e . word anagram a n a g r a m . word connect c o n n e c t . word elegant e l e g a n t . . Practical Session 2 33 Write a predicate crosswd 6 that tells us how to fill the grid . the first three arguments should be the vertical words from left to right and the following three arguments the horizontal words from top to bottom. Practical Session 2 By this stage you should have had your first taste of running Prolog programs. The purpose of the second practical session is to suggest two sets of keyboard exercises which will help you get familiar with the way Prolog works. The first set has to do with matching the second with proof search. First of all start up your Prolog interpreter. That is get a screen displaying the usual I m ready to start prompt which probably looks something like - Now verify your answers to Exercise the matching examples. You don t .

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.