Đang chuẩn bị liên kết để tải về tài liệu:
learn prolog now phần 9

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Một ngôn ngữ chính thức là chỉ đơn giản là một tập hợp các chuỗi. Ngôn ngữ chính thức 'Thuật ngữ được thiết kế để tương phản với các thuật ngữ tự nhiênBài giảng này có hai mục tiêu chính: 1. Để thảo luận về các thao tác cơ sở dữ liệu trong Prolog | 140 Chapter 9. A Closer Look at Terms X term no - termtype dead zed X . X complex_term X term no Exercise 9.4 Write a program that defines the predicate groundterm Term which tests whether Term is a ground term. Ground terms are terms that don t contain variables. Here are examples of how the predicate should behave - groundterm X . no - groundterm french bic_mac le_bic_mac . yes - groundterm french whopper X . no Exercise 9.5 Assume that we have the following operator definitions. - op 300 xfx are is_a . - op 300 fx likes . - op 200 xfy and . - op 100 fy famous . Which of the following is a wellformed term What is the main operator Give the bracketing. - X is_a witch. - harry and ron and hermione are friends. - harry is_a wizard and likes quidditch. - dumbledore isa famous famous wizard. 9.6 Practical Session In this practical session we want to introduce some built-in predicates for printing terms onto the screen. The first predicate we want to look at is display 1 which takes a term and prints it onto the screen. - display loves vincent mia . loves vincent mia Yes - display jules eats a big kahuna burger . jules eats a big kahuna burger Yes More strictly speaking display prints Prolog s internal representation of terms. 9.6. Practical Session 141 - display 2 3 4 . 2 3 4 Yes In fact this property of display makes it a very useful tool for learning how operators work in Prolog. So before going on to learn more about how to write things onto the screen try the following queries. Make sure you understand why Prolog answers the way it does. - display a b c . - display 3 is 4 5 3 . - display 3 is 4 5 3 . - display a -b c d . - display a -b c d . So display is nice to look at the internal representation of terms in operator notation but usually we would probably prefer to print the user friendly notation instead. Especially when printing lists it would be much nicer to get a b c instead of . a. b. c . This is what the built-in predicate write 1 does. It takes a term .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.