1. Trang chủ
  2. » Hoá học lớp 10

Tổ chức xử lí tri thức đồng thời trên các cụm máy của máy tính hiệu năng cao

66 8 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Mô hình dữ liệu quan hệ cho phép chuyển các hệ quản trị cơ sờ dừ liệu từ thế hệ 1 sang thế hệ 2. Tiếp cận lí thuyết chứng minh và tiếp cận logic vị từ cho phép thiết kế hệ thống[r]

(1)

ĐẠI HỌC QUỐC GIA HÀ NỘI

TRƯỜNG ĐẠI HỌC KHOA HỌC T ự NHIÊN

> [ « »2* * t « «1# » [ « wjw » Ị 1* ì ị » *ỊW » Ị » » Ị * r p r ] S « n

TÊN ĐỂ TÀI

Tổ chức xử lí tri thức đ ồn g thời

trên cụm m áy M áy tính h iệu cao

MẢ SỐ: QT 0708

CHỦ TRÌ ĐÊ T À I: PGS TS Đỗ Trung Tuấn CÁC CÁN BỘ THAM GIA:

1 Ths Trần Thị Thúy 2 Ths Đỗ Văn Bình 3 Ks Đỗ Minh Tiến

4 Ks Đỗ Thị Phương Ngân 5 TS Nguyễn Văn Tảo

6 Ths Nguyễn Thị Thanh Duyên 7 Ks Lê Trung Nghĩa

(2)

BÁO CÁO TÓM TẮT

a Tên đề t ỉ :

Tổ chức xử lí tri thức đồng thịi cụm máy Máy tính hiệu cao

b Mã s ố :

QT 0708

c Chủ trì đề t i :

PGS TS Đỗ Trung Tuấn

Các cán tham gia

1 Ths Trần Thị Thúy 2 Ths Đỗ Vãn Bình 3 Ks Đỗ Minh Tiến

4 Ks Đỗ Thị Phương Ngân 5 TS Nguyễn Văn Tảo

6 Ths Nguyễn Thị Thanh Duyên 7 Ks Lê Trung Nghĩa

d Mục tiêu nội dung nghiên cứu

Mục tiêu : Tim hiểu nghiên cứu chương trình xử lí tri thức máy tính cụm Trung tâm tính tốn hiệu cao, Trường Đại học Khoa học Tự nhiên, Đại học Quốc gia Hà Nội.

Nội dung :

■ Tim hiểu hệ thống máy tính hiệu cao; ■ Cài đặt thử nghiệm chương trình GNƯ Prolog; ■ Đề xuất xử lí tri thức máy tính cụm.

e Các kết đạt được

■ Tìm hiểu máy tính cụm Trung tâm Tính tốn hiệu cao, Trường Đại học Khoa học Tự nhiên, Đại học Quốc gia Hà Nội;

■ Cài đặt chương trình cho phép xử lí tri thức GNU Prolog máy tính hiệu cao;

■ Chương trình thử nghiệm ngổn ngữ Prolog máy tính hiệu nãng cao ; ■ Một số luận vãn tốt nghiệp đại học, cao học liên quan đến đề tài;

(3)

f Tình hình kinh phí đề tài

Tổng kinh phí 20.000.000 đ (Hai mươi triệu đồng chẵn) KH OA QUẢN LÝ

(Ký ghi rõ họ tên)

GS TS Nguyễn Hữu D Dỗ Trung T

TRƯ ỜNG ĐẠI H Ọ C KHOA H Ọ C T ự NHIÊN

(4)

BRIEF REPORT

a Project title

Organizing knowledge simultaneously in clusters of High Performance Computer

b Project code

QT 0708

c Responsible

Ass Prof Dr Tuan DoTrung

Participants

■ MA Thuy TranThi ■ MA Binh DoVan ■ Tien DoMinh

■ Ngan DoThiPhuong ■ Dr Tao NguyenVan

* MA Duyen NguyenThiThanh ■ Nghia LeTrung

d Project Objective and Content

Objective : Researching and studying on programs for manipulating knowledge on clusters of High Performance Computer, University of Science, Vietnam National University, Hanoi

C ontent:

■ Studying about High Performance Computer systems; ■ Installing and testing GNU Prolog programs;

■ Proposals of knowledge manipulation in clusters

e Some results

■ Studying about High Performance Computer systems, University of Science, Vietnam National University, Hanoi;

■ Installing and testing GNU Prolog programs on High Performance Computer; ■ Some test programs in GNU Prolog;

(5)

L ời cám ơn

ĐỀ tài nghiên cứu khoa học cấp Đại học Quốc gia Hà Nội mã số QT0708 xin chân thành cảm ơn :

ũ Ban khoa học Đại học Quốc gia Hà Nội;

□ Trường Đại học Khoa học tự nhiên, đặc biệt Phòng quản ỉý khoa học

cơng nghệ, Phịng Tài vụ; Khoa Tốn Cơ Tin học,

đã tạo điều kiện cho cán tham gia đề tài nghiên cứu tìm hiểu, thừ nghiệm tri thức xử ỉỉ tri thức hệ thống mảy tính hiệu cao.

Xin chân thành cám om lãnh đạo, cán nhân viên Trung tâm tính tốn hiệu cao Trường Đại học Khoa học Tự nhiên, Đại học Quốc gia Hà Nội tạo điêu kiện đẻ đề tài thực hiện.

(6)

X f '

Báo cáo kêt đê tàỉ nghiên cứu khoa học câp Đ ại học Q uôc gia Hà N ội

• _

Đề tài mã số QT 07 08

Tên để tài : Tổ chức xử lí tri thức đồng thời cụm máy Máy tính hiệu cao

Chủ nhiệm đề tài : PGS TS Đỗ Trung Tuấn,

Khoa Toán Cơ Tin học, trường Đại học Khoa học tự nhiên Đại học Quốc gia Hà nội

Đe tài nghiên cứu thực nhiệm vụ đăng kí hợp đồng nghiên cứu khoa học, kí

ũ Trường Đại học Khoa học tự nhiên,

Đại diện : GS TS Trần Nghi, Phó Hiệu trường, Trường Đại học Khoa học tự nhiên,

Q Chủ nhiệm đề tài, PGS TS Đỗ Trung Tuấn

Đề tài thực cơng việc với kinh phí cấp năm 2007 20.000.000 đ (hai mươi triệu đồng chẵn)

Các kết kèm theo gồm :

■ Tìm hiểu máy tính cụm Trung tâm Tính tn hiệu cao, Trường Đại học Khoa học Tự nhiên, Đại học Quổc gia Hà Nội;

■ Cài đặt chương trình cho phép xử lí tri thức GNU Prolog máy tính hiệu cao;

■ Chương trình thử nghiệm;

■ Một số luận văn tổt nghiệp đại học, cao học liên quan đến đề tài; ■ Bài báo khoa học

Hà nội, 15 tháng năm 2008 Chù nhiệm đề tài 201606

(7)

M u c lu c

• _#

1 Giới thiệu hệ thống máy tính cao trang Cài đặt phần mềm GNƯ Prolog máy tính hiệu cao trang 11

Phần mềm xử lí tri thức GNU Prolog

3 Thử nghiệm chương trình với phần mềm cài đặt trang 17

4 Một số luận văn trang 40

5 Báo cáo khoa học trang 41

(8)

Các thành VĨ2r L Ì t i

1 Trần Thị Thú'/

2 Đỗ Văn Binh

3 Đỗ Minh Tiến

4 Đỗ Thị phirơng N sln

5 Nguyễn V'ln T ào

6 NgiiVcn thị Thanh Duvên

7 Lê Truns Nghĩaw w

(9)

1 Giới thiệu hệ thống máy tính hiệu nảng cao

1.1 về hệ thống máy tính cụm

Địi hỏi xử lí nhiều liệu, song song cấu trúc liệu phức tạp dẫn đến nhu cầu nhiêu máy tính làm việc đồng thời, có liên kết với Người dùng máy tính người dùng đa dạng, ln có u cầu dịch vụ giá tính tốn Giải pháp tính tốn cụm với cụm nhiều máy tính đáp ứng yêu cầu

Lắp cụm máy tính sử dụng nhiều máy tính tính hiệu cao, đảm bảo khơng tốc độ tính tốn, mà cịn giảm chi phí cho người dùng Đặc biệt số vấn đề trí tuệ nhân tạo, cơng nghệ, tài chính, dự báo, máy tính cụm có tác dụng hẳn nhiều máy tính đơn

Máy tính cụm thực chất liên kết nhiều xử lí để hợp tác việc giải tốn thực thể đom Do quản lí nhiệm vụ xử lí, quản trị tài nguyên, nhớ, thời gian cần đến kĩ thuật phù hợp

Do máy tính cụm làm việc thực thể nên tạo số điểm lợi bật, bao gồm Khả tính tốn cao, kết hợp lực nhiều xử lí thiết bị phức tạp; Quản lí tài nguyên hợp lí Đối với vấn đề yêu cầu tài nguyên, xử lí, thời gian,

bộ nhớ, thiết bị ngoại vi hệ thống điều phối kết hợp nhiều tài nguyên nhỏ lẻ với nhau;

3 Sử dụng tối ưu tài ngun Máy tính cụm chia sẻ nhiều tài ngun, có nhìn tổng quát tài nguyên Điều tạo điều kiện để thực nhiệm vụ cách hợp lí, tiến đến tối ưu;

4 Phục vụ theo vùng địa lí Việc chia sẻ tài nguyên với hạ tầng mạng khơng bị khơng gian địa lí hạn chế;

5 Đảm bảo phục vụ đặn giảm rủi ro Do tập xử lí làm việc liên tục, thay qua hệ thống quản lí tài nguyên, người dùng phục vụ liên tục;

6 Khắc phục lỗi Các sau sót, rủi ro máy tính kiểm định thực đối chứng máy tính khác Một máy tính hỏng máy tính khác chia sẻ nhiệm vụ thay Máy tính khơng thiết vùng có sai sót;

7 Phân tán theo chiều khơng gian thời gian Việc dùng chung xử lí thiết bị ngoại vi cho phép thể tính phân tán theo nhiều chiều;

8 Quản lí hệ thống tập trung Công ty lớn IBM cho phép bảo trì hệ thống cụm phân tán số trạm định Kiến trúc quản lí tập trung hiệu

1.2 Hệ thống máy tính cụm IBM 1600

(10)

v ề liên kết mạng, hệ thống IBM 1600 dùng mạng Ethernet, mạng InfiniBand hay Chuyển mạch hiệu cao IBM Hệ thống phần mềm quản trị cụm CSM quản lí Đây cơng cụ thiết kế phù hợp cho hệ thống máy tính cụm

1.2.1 Một số nét chung

• Các giải pháp AIX 5L hay Linux phù họp đổi với mơ hình hóa tính tốn qui mơ lớn, sở liệu lớn trung tâm liệu hiệu quả, máy tính chủ;

• Hệ thống quản trị cụm CSM cho phép quản lí mềm dẻo, linh động;

• Các tùy chọn kết nối cụm : dùng mạng Ethernet 1/ 10Gb đối với AIX 5L hay Linux, dùng chuyển mạch hiệu cao IBM đổi với AIX 5L CSM;

• Tùy chọn hệ thống điều hành : AIX 5L thể hệ 5.2 hay 5.3, dùng Server Linux SUSE 8/ 9, dùng Linux Red Hat 4;

• Bộ phần mềm hoàn thiện cho phép tạo, tinh chinhe ứng dụng song song ESSL (Engineering & Scientific Subroutine Library), ESSL song song, môi trường song song, Fortran XL, hay VisualAge c++;

• Hệ thong file song song đổi với cụm GPFS, có độ sẵn sàng hiệu cao;

• Phần mềm đặt lịch cơng việc để tối ưu tài nguyên thông lượng truyền thơng cụm; • Phần mềm HACMP™ (High Availability Cluster Multiprocessing) cho phép truy

cập phần mềm ứng dụng

1.2.2 Tổng quát phần cứng

Các máy chủ POWERS+ IBM POWERS phù hợp với :

• IBM System p5™ 595, 590, 575, 570, 560Q, 550Q, 550, 520Q, 520, 510Q, 510, 505Q 505

• IBM eServer™ p5 595, 590, 575, 570, 550, 520, 510

Người ta dùng đến 128 máy chủ hay máy LPAR, tức hệ thống điều hành máy AIX 5L hay Linux, cụm, tùy theo phần cứng

(11)

1.2.3 Tham số xử lí POWER™ dựa AIX 5L™ cụm Linuxm m

Người ta sử dụng xử lí nhằm tính tốn khoa học, kĩ thuật, dùng cho sở dừ liệu

lớn.

Máy dịch vụ : IBM System p5 595, 590, 575, 570, 560Q, 550Q, 550, 520Q, 520, 510Q, 510, 505Q 505

■ Bộ xử lí : 1.5 GHz đến 2.3 GHz IBM POWER5+, POWER5 ■ Số máy tính chủ , phần logic (LPAR):

o Có đến 64 với đến nhân SMPs 128 LPARs o Có đến 32 với 16 đến 32 nhân SMPs 128 LPARs o Có đến 16 với 48 đến 64 nhân SMPs 128 LPARs • Liên kết mạng :

o 10/100Mbps Ethernet (AIX 5L Linux) o 1/10 Gigabit Ethernet (AIX 5L Linux) o 4x/12x GX HCA (AIX 5L Linux) o SP Switch2 (AIX 5L PSSP)

o Chuyển mạch hiệu cao Switch (AIX 5L CSM) o Myrinet-2000 (AIX 5L Linux)

1.3 Hệ thống máy tính cụm IBM 1350

Nhiều ứng dụng xây dựng môi trường Windows Microsoft Linux, Cá hai hệ thống sử dụng tài nguyên, thiết bị cứng hạ tầng mạng máy tính Ngồi hai hệ thống điều hành sử dụng mã nguồn mở, dùng sản phẩm hãng thứ ba khác Để đáp ứng thực khách quan vậy, máy tính cụm cần có khả tốn chi phí

Cơng ty IBM thiết kế máy tính cụm IBM 1350 đáp ứng yêu cầu Người dùng làm việc với máy tính hiệu cao HPC Họ sừ dụng cơng nghệ tiến tiến Intel® Xeon®, AMD Opteron™ IBM Power Architecture™ nút máy tính chủ Phần mềm quản trị cụm với nối kểt IBM 1350 đánh giá sử đụng công nghệ tot IBM hãng khác

Máy tính cụm IBM 1350 thiết kế để ứng dụng nhiều môi trường thiết kế công nghệ, dịch vụ tài Các lĩnh vực cần đến quản lí tốc độ cao khối lượng lớn thao tác xử lí liệu

1.3.1 Tổng quan máy tính cụm IBM 1350

Máy tính IBM System Cluster 1350 có tổng quan hệ thống : Blade servers: HS21, LS21, LS41, JS22, ỌS21; Rack servers: x3455, x3550, x3650, x3655, x3755

về mạng máy tính • Ethernet

(12)

• Cisco, Voltaire • Myrinet, Myricom • Accelerator

• Clearspeed • PCI-X

Bộ nhớ

• Bộ nhớ ngồi; • Bộ nhớ máy chủ;

• Bộ nhớ hệ thống DS4800, DS4700, DS4200, DS3400, DS3200, EXP3000 Thiết bị mở rộng

• Bộ nhớ mở rộng • EXP810

• Storage Expansion Unit

• Chuyển mạch SAN 2005-16B

• Hệ thống lưu trữ IBM SAN 16B-2 SAN Switch Phần mềm

• Red Hat Enterprise Linux (RHEL) , SUSE Linux Enterprise Server (SLES) 10, Microsoft®) Windows, Microsoft Windows Compute Cluster Server

• Phần mềm quản trị cụm

• Phần mềm quản trị cụm IBM (CSM) cho Linux V I.5.1 (tùy chọn)

• Hệ thống quản trị tệp song song IBM (GPFS) cho Linux V3.2 (tùy chọn)

1.3.2 Lắp đặt IBM 1350

Các hộp nối ghép

• Nối mở rộng thứ cập với sơ cấp 42U : 79.5" H X 25.2" w X 43.3" D (2020 mm X

640 mm X 1100 mm); 574.2 bảng Anh (tức 261 kg)

• Nối 25Ư : 49.0" H X 23.8" w X 39.4" D (1344 mm X 605 mm X 1001 mm);

221 bảng Anh (tức 100.2 kg);

• Hệ thống nguồn hệ thống làm mát : rãnh xoắn làm mát, cung cấp điện, xử lí lượng, quản lí lượng, cấu hình IBM, chẩn đốn nhiệt độ

Qui mơ

• Hệ thơng trang bị nút quản trị nút dự trữ Tùy theo yêu cầu người dùng, dùng hai đến tối đa 1,024 nút Tuy nhiên, số quyền phần mềm hạn chế số nút, Có thể sử dụng đến 64 nút phép lưu trữ • Cấu hình tối đa 1,026 nút, gồm nút tính tốn, nút lưu trừ nút qn trị Có

thể sử dụng cấu hình cao với xử lí đặc biệt Các dịch vụ

• Phần cứng cụm 1350 thiết 42Ư 25Ư.

(13)

sàng, dịch vụ miễn phí

• Các dịch vụ trợ giúp cài đặt có thơne qua CET (Cluster Enablement Team), phần mềm miễn phí

1.3.3 Thơng tin k ĩ th uật chi tiết cùa m áy tính cụm IBM 1350

Máy tính cụm IBiM 1350 có xử lí Intel® Xeon®, AMD Opteron™ dùno nút cụm HPC với công nehệ dựa IBM Power Architecture™, cho phép thực giải pháp Linux hay Windows để tăng hiệu tính tốn

Máy chủ lựa chọn :

■ IBM System x3650, x3550, x3455, x3655, x3755

■ IBM BladeCenter® HS21, HS21 XM, JS22, LS21, LS41, QS21 Bộ xử lí

■ Bộ xử lí Dual-Core Intel Xeon Processor, có khả đến 3.0 GHz, 1333 MHz với bus ngoài, hav xử lí Quad-Core Intel Xeon Processor, có khả 3.0 GHz, đến 1333 MHz bus nsoài (x3650, x3550)

■ Bộ xử lí Dual-core AMD Opteron, có khả năns đến 3.0 GHz (x3455) ■ Bộ xử lí Duaỉ-core AMD Opteron có khà năns đến 2.8 GHz AMD Opteron

(x3655)

■ Bộ xử lí Dual-core AMD Opteron có khả đen 3.0 GHz (x3755) * Bộ xử lí Duaỉ-Core Intel Xeon có khả năns đến 3.0 GHz, với bus có khả

đến 1333 MHz, xử lí Quad-Core Intel Xeon có kha năns đến 2.33 GHz, với bus có khả đến 1333 MHz (HS21 XM)

■ Bộ xử lí Dual-Core Intel Xeon có khả đến 3.0 GHz, với bus có khả đến 1333 MHz, xừ lí Quad-Core Intel Xeon có khả năne đến 3.0 GHz, với bus có khả năns đển 1333 MHz (HS21)

- Four 64-bit 4.0 GHz POWER6 (JS22)

■ Bộ xử lí Dual-core AMD Opteron có khả đến 3.0 GHz (LS21, LS41) ■ Đa xừ lí Multi-core 3.2 GHz Cell Broadband Engine™(QS21)

(14)

số máy chủ : lên đến 1,024 cluster nodes; 1- to 8-core nodes Liên kết mạng :

■ Gigabit Ethernet ■ Myrinet

In fin iB a n d

1.4 Một số thiết bị mạng

1.4.1 Chuyển mạch Cisco 3750

Interactive Model of the Cisco Catalyst 3750 Series Switches

Hình

1.4.2 Chuyển mạch Cisco 3550

Chuyển mạch Cisco Catalyst 3550 24 DC phần tử họ chuyển mạch thông minh sử dụng chuyển mạch Ethernet Catalyst 3550 Đây chuyển mạch nhiều tầng, chia ngăn, đảm bảo chất lượng an toàn, mức sẵn sàng cao, đáp ứng nhu cầu nối mạng

Với hạ tầng Ethernet nhanh, hay Ethernet Giga, chuyển mạch dùng làm chuyển mạch đường trục ứng dụng mức vừa phải

Người dùng thực chia đường IP chất lượng cao chuyển mạch Vậy dùng chuyển mạch LAN truyền thống hay mạng Intranet

(15)

1.5 Cơ chế truy cập máy tính hạ tầng mạng Trung tâm

Việc truy cập mạng chủ Trung tâm theo kiến trúc khách/ chủ Người dùna sừ dụna máy đơn

T rao đổi thông qua Putty

Hệ điều hành Windows 2000 hay Linux

máy chủ

máy người dùng

trong trung tâm tính tốn hiệu cao Hình Truv cập hệ thống máy cụm

Hệ thổng đàm bào truv cập Secure Shell, eiao thửc SSH cơns 22 Địa chi IP máy tính chủ 10.8.75.1

■ Máy chủ máy tính cụm, có nút

■ Trong nứt, có nút làm chức quản trị; nút lại sừ dụnc cho tính tốn hay íơ chức dừ liệu;

" Hệ thống điều hành Linux;

■ Bộ nhớ RAM 2G cho mồi nút

Để lập trình dùng hết năns lực cụm máy tínhT người ta có hai chế :

1 Lập trình theo Open MP : cho phép tự động chọn quản trị nhớ chuns tự động chia sẻ tải nguyên;

2 Lập trình theo MPI yêu cầu nsười dùng tự quản li tài nguyên, tự chia công việc ứng với toán nhiệm vụ nhỏ

Có hai máy tinh cụm, IBM 1600 IBM 1350 Thơn2 số k ĩ thuật hai máy tính nêu Địa chi IP thời máv IBM 1600 lã 172.72.20.0

■ Máy tính IBM 1600 cụm máy Mồi máv có CPU Hệ thống điều hành nhận CPU

■ Chuyển mạch Cisco Catalvst 3750 3550

A IX A dvanced Interactive executive

16C0

máy

(16)

Việc chuyển liệu, dạng file hệ thống tiến hành theo : ■ Sử dụng hệ thống điều hành Linux lệnh xử lí file;

■ Sử dụng chế giao diện Windows với Linux

Hình Hệ thống điều hành số máy

Từ máy trạm Trung tâm tính tốn hiệu cao, người ta truy cập mạng Internet qua máy chủ Đại học Quốc gia Hà Nội, hay qua máy chủ VDC, nhờ đường thuê bao ADSL Hệ quản trị mạng Trung tâm NIS (network information service), Windows NT sử dụng TCP/IP

AIX

(17)

2 Phần mềm xử lí tri thức GNU Prolog

2.1 GNU Prolog

GNƯ Prolog chương trình dịch Prolog với việc giải ràng buộc lĩnh vực vô hnạ Daniel Diaz phát triển

Ngôn ngữ chấp nhận Prolog chương trình với ràng buộc, sinh mã nhị phân, giống gcc sinh từ chương trình ngơn ngữ c

Chương trình trực khai thu sau dịch liên kết chương trình chạy độc lập Kích thước chương trình nhỏ GNU Prolog tránh việc liên kết đến vị từ khơng cần thiết q trình xử lí tri thức Vậy nên hiệu GNƯ Prolog cao

Ngoài việc dịch mã nguồn, GNU Prolog cho phép tìm lỗi chương trình theo chế dodọ có giải thích

Phần làm việc với chương trình Prolog hồn tồn tương thích với chuẩn ISO cho ngơn ngữ Prolog, biến đùng chung, giao diện với hệ thống điều hành,

GNƯ Prolog cho phép thành phần giải ràng buộc hiệu theo lĩnh vực vô hạn FD Điều tạo liệu cho việc đưa chương trình logic có ràng buộc vào chương trình logic theo mơ tả

2.2 Cài đặt GNU Prolog máy tính hiệu cao 2.2.1 Bước Kiểm tra cấu hình

[tuandt@portaI src]$ /configure — prefix=$HOME

checking for gcc gcc

checking for c compiler default output file name a out

checking whether the c compiler works yes

checking whether we are cross compiling no

checking for suffix of executables checking for suffix of object files o

checking whether we are using the GNU c compiler , yes

checking whether gcc accepts -g yes

checking for gcc option to accept ISO C89 none needed checking for ranlib ranlib

checking whether make sets $ (MAKE) yes

checking for a BSD-compatible install /usr/local/bin/install -c checking whether In -s works yes

checking build system type i686-pc-linux-gnu checking host system type i686-pc-linux-gnu

checking how to run the c preprocessor gcc -E

checking for grep that handles long lines and -e /bin/grep checking for egrep /bin/grep -E

checking for ANSI c header files yes

checking for sys/types h yes checking for sys/stat.h yes checking for stdlib.h yes

checking for string.h yes

checking for memory.h yes

(18)

checking for inttypes.h yes checking for stdint.h yes checking for unistd.h yes checking for long yes checking size of long

checking sys/ioctl_compat.h usability no checking sys/ioctl_compat.h presence no checking for sys/ioctl_compat.h no

checking termios.h usability yes checking termios.h presence yes checking for termios.h yes

checking malloc.h usability yes checking malloc.h presence yes checking for malloc.h yes

checking for stdlib.h (cached) yes checking for unistd.h (cached) yes checking for getpagesize yes

checking for working mmap yes checking for mprotect yes checking for mallopt yes checking for fgetc yes checking for socklen_t yes checking for inline inline checking for socket yes

checking for gethostbyname yes DIRECTORIES

> Installation: > Link to binaries : > Documentation:

> HTML documentation: > Examples:

/home/tuandt/gprolog-1.3.0 /home/tuandt/bin

/home/tuandt/gprolog-1.3.0/doc

/home/tuandt/gprolog-1.3 0/doc/html_node /home/tuandt/gprolog-1.3.0

configure: creating /config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status config.status

2 2 Blp&c 2

creating Makefile

creating TopComp/Makefile creating P12Wam/Makefile creating Wam2Ma/Makefile creating Ma2Asm/Makefile creating Fd2C/Makefile creating Linedit/Makefile creating W32GUICons/Makefile creating EnginePl/Makefile creating BipsPl/Makefile creating EngineFD/Makefile creating BipsFD/Makefile

creating Ma2Asm/FromC/Makefile creating Win32/Makefile

creating Win32/gp-setup.iss creating EnginePl/gp_config.h EnginePl/gp_config.h is unchanged

[tuandt@portal src]$ make

(cd EnginePl; make config)

(19)

make[l]: Leaving directory '/home/tuandt/src/EnginePl'

•/SETVARS;for i in TopComp EnginePl Wara2Ma Ma2Asm Linedit BipsPl Pl2Wam

Fd2C EngineFD BipsFD;do (cd $i; make) I I exit 1; done;\

(cd TopComp; make gprolog)

makefl]: Entering directory '/home/tuandt/src/TopComp' make[l]: Nothing to be done for 'first'

make[l]: Leaving directory '/home/tuandt/src/TopComp' make[l]: Entering directory '/home/tuandt/src/EnginePl' make[l]: Nothing to be done for 'all'

make[l]: Leaving directory '/home/tuandt/src/EnginePl' make[l]: Entering directory '/home/tuandt/src/Wam2Ma' make[l]: Nothing to be done for 'all'

make[l]: Leaving directory '/home/tuandt/src/Wam2Ma' make[l]: Entering directory '/home/tuandt/src/Ma2Asm' make[l]: Nothing to be done for 'all'

make[l]: Leaving directory '/home/tuandt/src/Ma2Asm' make[l]: Entering directory '/home/tuandt/src/Linedit'

make[l]: 'liblinedit.a ' is up to date

make[l]: Leaving directory '/home/tuandt/src/Linedit1 make[l]: Entering directory '/home/tuandt/src/BipsPl'

make[l]: 'libbips_pl.a ' is up to date

make[l]: Leaving directory '/home/tuandt/src/BipsPl' make[l]: Entering directory '/home/tuandt/src/P12Wam' make[l]: 'pl2wam' is up to date

make[l]: Leaving directory '/home/tuandt/src/P12Wam' make[l]: Entering directory '/home/tuandt/src/Fd2C' make[l]: 'fd2c' is up to date

make[l]: Leaving directory '/home/tuandt/src/Fd2C'

make[l]: Entering directory '/home/tuandt/src/EngineFD'

make[l]: 'libengine_fd a ' is up to date

make[l]: Leaving directory '/home/tuandt/src/EngineFD' make[l]: Entering directory '/home/tuandt/src/BipsFD'

make[l]: 'libbips_fd.a ' is up to date

make[l]: Leaving directory '/home/tuandt/src/BipsFD' make[l]: Entering directory '/home/tuandt/src/TopComp' make[l]: 'gprolog' is up to date

make[l]: Leaving directory '/home/tuandt/src/TopComp'

2.2.3 Tạo thư mục cho GNU Prolog

[tuandt@portal src]S make install

./mkinstalldirs /home/tuandt/gprolog-1.3.0 /home/tuandt/gprolog-1.3.o/bin \

/home/tuandt/gprolog-1.3 o/include /home/tuandt/gprolog-1.3.o/lib mkdir /home/tuandt/gprolog-1.3.0

mkdir /home/tuandt/gprolog-1.3.o/bin mkdir /home/tuandt/gprolog-1.3.0/include mkdir /home/tuandt/gprolog-1.3.o/lib

for i in COPYING VERSION NEWS ChangeLog; /usr/local/bin/install -c -m 644 /$i /home/tuandt/gprolog-1.3.0; done

for i in gplc hexgplc gprolog pl2wam wam2ma ma2asm fd2c;

/usr/local/bin/install -c */$i /home/tuandt/gprolog-1.3 o/bin; done for i in top_level.o all_pl_bips.o debugger.o all_fd_bips.o;

(20)

f°r Ị in libengine_pl.a libbips_pl.a liblinedit.a libengine_fd.a libbips_fd.a; /usr/local/bin/install -c -m 644 */$i

/home/tuandt/gprolog-1.3.o/lib; done

for i in gprolog.h fd_to_c.h; /usr/local/bin/install -c -m 644 */$i /home/tuandt/gprolog-1.3.o/include; done

f°r i in /home/tuandt/gprolog-1.3.o/lib/*.a; ranlib $i; done if test /home/tuandt/gprolog-1.3.0/doc != none; then \

./mkinstalldirs /home/tuandt/gprolog-1.3 0/doc; \

{F='cd /doc; echo ???*.dvi ???*.ps ???*.pdf ???*.chm ???*.eps ???*.html ???*.gif'; \

for i in $F; /usr/local/bin/install -c -m 644 /doc/$i /home/tuandt/gprolog-1.3.0/doc; done); \

fi

mkdir /home/tuandt/gprolog-1.3.0/doc

if test /home/tuandt/gprolog-1.3.0/doc/html_node != none; then \ /mkỉnstalldirs /hõme/tuãndt/gprolog-1.3.0/doc/html_node; \ (F='cd /doc/html_node; echo ???*.html ???*.gif ???*.css'; \

for i in $F; /usr/local/bin/install -c -m 644 /doc/html_node/$i /home/tuandt/gprolog-1.3 0/doc/html_node; done); \

fi

mkdir /home/tuandt/gprolog-1.3.0/doc/html_node if test /home/tuandt/gprolog-1.3.0 != none; then \

./mkinstalldirs /home/tuandt/gprolog-1.3.O/ExamplesPl; \ (F='cd /ExamplesPl; echo Makefile README PROGS ??*.pl*; \

for i in $F; /usr/local/bin/install -c -m 644 /ExamplesPl/$i /home/tuandt/gprolog-1.3 O/ExaraplesPl; done); \

./mkinstalldirs /home/tuandt/gprolog-1.3•O/ExamplesC; \

(F='cd /ExamplesC; echo Makefile README ??*.pl ??*_c.c'; \ for i in $F; /usr/local/bin/install -c -m 644 /ExamplesC/$i /home/tuandt/gprolog-1.3.O/ExamplesC; done); \

./mkinstalldirs /home/tuandt/gprolog-1.3.O/ExamplesFD; \ (F='cd /ExamplesFD; echo Makefile ??*.pl ??*.fd'; \

for i in $F; /usr/local/bin/install -c -m 644 ,/ExamplesFD/$i /home/tuandt/gprolog-1.3,O/ExamplesFD; done); \

fi

mkdir /home/tuandt/gprolog-1.3.O/ExamplesPl mkdir /home/tuandt/gprolog-1.3.O/ExamplesC rakdir /home/tuandt/gprolog-1.3.O/ExamplesFD if test /home/tuandt/bin != none; then \

{cd /home/tuandt/bin 2>/dev/null && rm -f gplc hexgplc gprolog pl2wam wam2ma ma2asm fd2c); \

rmdir /home/tuandt/bin 2>/dev/null; \ fi I I exit 0;

if test /home/tuandt/bin != none; then \ /mkinstalldirs /home/tuandt/bin; \

(cd /home/tuandt/bin ; In -s /home/tuandt/gprolog-1.3 o/bin/* ); \ f i

mkdir /home/tưandt/bin

2.2.4 Kiểm tra lại việc cài đặt

[tuandt@portal src]S make check

{cd EnginePl; make check) && \

(cd Ma2Asm; make check) && \

(21)

echo All tests succeeded

make[l]: Entering directory '/home/tuandt/src/EnginePl'

f°r i in 5; echo -e "#define OBJ_NO $i\\n#include \"test_oc_defs.h\"” >/tmp/test_oc_m$i.c; done

gcc -march=pentiumpro -03 -fomit-frame-pointer -o test_oc test_oc.c obj_chain.c -I /tmp/test_oc_m[1-5].c

rm -f /tmp/test_oc_m[l-5].c /test_oc

starting

object cobject #5> found &name:0x804cle0

object <object #4> found iname:0x804clc0

object <object #3> found &name:0x804cla0

object cobject #2> found &name:0x804cl80

object <object #1> found &name:0x804cl60

finished - OK !

make[l]: Leaving directory '/home/tuandt/src/EnginePl' make[l]: Entering directory '/home/tuandt/src/Ma2Asm' if [ "$FC" = "Y" ]; then FCFLAGS=1-DFAST'; fi; \

gplc — c-compiler "gcc -march=pentiumpro" -C "-03 -fomit-frame-pointer $FCFLAGS" -c chkma.c

if [ "$FC" != "Y" ]; then MAFLAGS='— ignore-fast'; fi; \ /ma2asm — comment 5MAFLAGS chkma_ma.ma

gplc -c chkma_ma.s

gcc -march=pentiumpro -03 -fomit-frame-pointer -o chkma chkma.o chkma_ma.o /EnginePl/enginel.o

./chkma

check running without FC (NO fast call}

reg_bank=&X(0):0x8052840 B:0x804b7c0 E:0x804c7c0 &Y (0) :0x804c7b0

stack:0x804b7c0

test 1: c code intializer

test OK

test 2: long local/global

test OK

test 3: pi jump/pl ret

test OK ”

test : pi call/pl ret/pl fail

test OK

test 5: prep cp/here_cp

test OK

test 6: jump/c ret

test OK

test 7: call c(void)

test OK

test : move X (i) to Y (j)

test OK

test 9: move Y(i) to X (j)

test OK

test 10: call_c(int) test 10 OK

test 11: call_c(double) test 11 OK

test 12: call_c(string) test 12 OK

test 13: call_c(mem,&label,mem( ),&mem( )) test 13 OK

(22)

test 14 OK

test 15: call c Y() )

test 15 OK

test 16: call c FL())

test 16 OK

test 17 : call c FD{))

test 17 OK

test 18: call _c lot of args)

test 18 OK

test 19: call _c )+jump ret • *

test 19 OK

test 20: call c )+fail ret.# #

test 20 OK

test 21: call c )+raove ret mem

test 21 OK

test 22: call _c )+move ret X(>

test 22 OK

test 23: call c )+move ret Y()

test 23 OK

test 24 : call c )+move ret FLO

test 24 OK

test 25: call c )+move ret FD()

test 25 OK

test 26: call c )+switch ret

test 26 OK

MA checks suceeded

make[l]: Leaving directory '/home/tuandt/src/Ma2Asm' make[l]: Entering directory '/home/tuandt/src/P12Wam' /check_boot -a && echo Bootstrap Prolog Compiler OK Bootstrap Prolog Compiler OK

make[l]: Leaving directory '/home/tuandt/src/P12Wam' make[l]: Entering directory '/home/tuandt/src/BipsPl'

/P12Wam/check_boot -a && echo Bootstrap Prolog Bips OK Bootstrap Prolog Bips OK

make[l]: Leaving directory '/home/tuandt/src/BipsPl1 All tests succeeded

2.2.5 Các thư mục liên quan đến truy cập NGU Prolog

[tuandt@portal tuandt]$ Is

bin COPYING ExamplesC ExamplesPl INSTALL PROBLEMS src

ChangeLog doc ExamplesFD gprolog-1.3.0 NEWS README VERSION

[tuandt@portal tuandt]$ cd [tuandt0portal home]$ ls

anhpk tungld

diennh haibh ibm models nhungpt tienbq

aquota.user tuongtm

dunglt haidd kienlt namndb sinhnt tientt

badt vuanh

dungvt hait V kiennt namnh sonlh trangtt

chungnm vuthai

ftp hakt lost+found nghinh tanpv trantv

chungnt yennt

griduser hangkt mimwebroot ngoandt thangdq trungtv

cnguyen hadt hangnm minhnth nguyenhs thuynb tuandt

[tuandt@portal home]$ cd

(23)

— -[tuandt@portal /]$ ls

bin dev gpfs initrd lost+found mnt proc root share tmp

boot etc home lib

3 Thử nghiệm chương trình

3.1 Thừ chương trình tốn gia phả

Name •- Size Type Date Modified Ịã l giapha 656 KB File 11/15/2007 10:56 AM N 'l giapha 7 KB MA File 11/15/2007 10:45 AM 0 giapha 1 KB PL File 11/15/2007 10:45 AM 1 ^ giapha,0 6 KB 0 File 11/15/2007 10:45 AM [ã ị giapha, s 16 KB 5 File 11/15/2007 10:45 AM

[âj giapha warn 2 KB WAM File 11/15/2007 10:45 AM giapha 24 KB Microsoft Word Doc 11/15/2007 10:59 AM

3.1.1 Nội dung File giapha.pl

cha(toto, mo) cha(toto, man)

cha(mo, am) cha(mo, chen) cha(man, bat) cha(man, dia) anhemR(X, Y):-

cha(Z,X), cha(Z,Y), x \ = Y

kq anhemR(X,Y),

write('anh em ruot '), write(X),

write(Y) % giao dien

kq

3.1.2 Chuyển sang mã assembly File giapha.ma

1

2

10

*** Predicate:

* + * Predicate: cha/2 ( pl_code global X636861_2

GNU Prolog 1.3.0 (Jan 2007) giapha.pi

11 15 2007

o • 10:45:28

file name('/home/tuandt/gprolog-1.3 0/bin/giapha.pi' predicate(cha/2,1,static,private,user,[

cha/2 (/home/tuandt/gprolog-1.3 0/bin/giapha.pi:1) % compiler

% file % date % time

(24)

; 11:

call_c jump_ret

; 13:

Lpredl_l:

; 14:

call_c j ump_ret

; 16:

Lpredl_2:

; 17:

call_c jump Lpredl_sub_0:

; 18:

call_c jump

; 20:

Lpredl_3:

; 21:

call_c j ump Lpredl_sub_l:

; 22:

call_c j ump

; 24:

Lpredl_4:

; 25:

call_c j ump Lpredl_sub_2:

7 26:

call_c jump

; 28

Lpredl_5:

; 29

call_c

; 31

Lpredl_6:

; 32

call_c fail_ret

; 33:

call_c fail_ret

' 34: pl_ret

36: Lpredl_7:

37: call_c

' 39:

switch_on_term(5,1,fail, fail, fail) ,

fast Switch_On_Term_Var_Atm(&Lpredl_5,&Lpredl_l) label(1),

switch_on_atom([(toto,2),(mo,3),(man,4)]), fast Switch_On_Atom(st(0) , 3)

label(2), try(6),

fast Create_Choice_Point2{&Lpredl_sub_0) Lpredl_6

trust(8),

fast Delete_Choice_Point2() Lpredl_8

label(3), try(10),

fast Create_Choice_Point2(&Lpredl_sub_l) Lpredl_10

trust(12),

fast Delete_Choice_Point2() Lpredl_12

label(4), try(14),

fast Create_Choice_Point2(&Lpredl_sub_2) Lpredl_14

trust (16),

fast Delete_Choice_Point2() Lpredl_l6

label(5),

try_me_else(7) ,

fast Create_Choice_Point2(&Lpredl_7) label(6),

get_atom(toto,0),

fast Get_Atom_Tagged(ta(0) , X (0)) get_atom(mo,1),

fast Get_Atom_Tagged(ta(1) , X (1) ) proceed,

label(7),

retry_me_else(9),

fast Update_Choice_Point2(&Lpredl_9) label (8),

Lpredl_8:

(25)

call c fast Get Atom Tagged(ta(0),X (0)) fail ret

; 41: get atom(man,1),

call c fast Get Atom_Tagged(ta(2),X(1))

fail ret

; 42: proceed,

pi ret

; 44 : label(9),

_ :

; 45: retry me else(ll),

call c fast Update Choice Point2(&Lpredl

; 47: label(10),

10:

; 48: get atom(mo,0),

call_c fast Get_Atom_Tagged(t a (1) , X {0) )

fail_ret

; 49: get_atom(am,1),

call_c fast Get_Atom_Tagged(ta(3),X (1))

fail_ret

; 50: proceed,

pl_ret

; 52: label(11),

Lpredl_ll:

; 53: retry_me_else(13),

call_c fast Update_Choice_Point2(&Lpredl_13)

; 55: label(12),

Lpredl_12:

; 56: get_atom(mo,0),

call_c fast Get_Atom_Tagged(ta (1) ,X(0) )

fail_ret

; 57: get_atom(chen, 1) ,

call_c fast Get_Atom_Tagged(t a (4) , X (1))

fail_ret

; 58: proceed,

pl_ret

; 60: label(13),

Lpredl_13:

; 61: retry_me_else (15),

call_c fast Update_Choice_Point2(&Lpredl_15)

; 63: label (14),

Lpredl_14:

; 64: get_atom(man,0),

call_c fast Get_Atom_Tagged(ta(2),X (0))

fail_ret

; 65: get_atom(bat,1),

call_c fast Get_Atom_Tagged(ta(5),X(l))

fail_ret

; 66: proceed,

pl_ret

; 68: label (15),

Lpredl_15:

; 69: trust_me_else_fail,

call_c fast Delete_Choice_Point2()

; 71: label(16),

Lpredl_16:

(26)

call_c fast Get_Atom_Tagged(ta (2) , X (0) ) fail_ret

; 73: get_atom(dia,1),

call_c fast Get_Atom_Tagged(ta(6),X(1))

fail_ret

; 74: proceed])

pl_ret

; 77: predicate(anhemR/2,8,static,private,user,[

; *** Predicate: anhemR/2 (/home/tuandt/gprolog-1.3.O/bin/giapha

pl_code global X616E68656D52_2

/ 78: allocate(3),

call c fast Allocate(3)

/ " 79: get variable(y( 0) ,0) ,

move o X ( ) , Y {0 ) '

00 get variable(y( 1) ,1) ,

move X (1),Y(l)

r 81: put variable(y(2),0),

call c fast Put Y Variable(&Y(2))

move ret X ( )

/ " 82: put value(y (0) ,1) ,

move Y (0) , X (1)

83: call{cha/2),

pi call X6368 61_2

r 84 : put value(y (2),0) ,

move Y (2) , X (0)

t 85 : put value(y(1),1) ,

move Y ( ) , X ( )

r 86: call(cha/2),

pi call X6368 61

/ 87: put value(y(0),0),

move Y ( ) , X ( )

r 00 00 put value(y(1), 1),

move Y (1),X(1)

/ 00 VD deallocate,

call c fast Deallocate()

/ ' 90: execute((\=)/2) ] )

pi j ump X5C5C3D_2

93: predicate(kq/0,12,static,private, user,[

; *** Predicate: kq/0 (/home/tuandt/gprolog-1.3 O/bin/giapha.pi: pi code global X6B71_0

; 94: try_me_else(1),

call c fast Create_Choice_Point(&Lpred3_l,0)

; 95: allocate(2),

call_c fast Allocate(2)

; 96: put_variable(y (0),0),

call_c fast Put_Y_Variable(&Y(0))

move_ret X(0)

; 97: put_variable(y (1},1),

call_c fast Put_Y_Variable(&Y(1))

move_ret X(l)

; 98: call(anhemR/2),

pl_call X616E68656D52_2

; 99: put_atom('anh em ruot ',0),

call_c fast Put_Atom_Tagged(t a (7))

* pi : 8)

(27)

Lpred3

move ret X(0)

; 100: call(write/1),

pi call X7772697465_l

; 101: put value(y(0),0),

move Y ( ) , X ( )

; 102: call(write/1),

pi call X7772697465_l

; 103: put_unsafe value(y(1),0),

call c fast Put Unsafe Value(Y(l)

move ret X(0)

I 104: deallocate,

call c fast Deallocate()

; 105: execute(write/1),

pi jump X77726974 65

; 107: label (1),

3 1:

; 108: trust me else fail,

call c fast Delete Choice Point(0

; 109: proceed])

pi ret local a t (7) local t a (8) local st(1}

c code initializer Object Initializer call c

New Object(&Prolog Object Initializer,&System Directives, c ret

c code local Prolog Object Initializer

call c fast Create Atom

("/home/tuandt/gprolog-1., 3.0/bin/giapha pi")

move ret at (0)

call c fast Create Atom ("anhemR")

move ret at (5)

call c fast Create Atom ("cha")

move ret at (1)

call c fast Create Atom ("kq")

move ret at (6)

call c fast Create Atom ("man")

move ret at (4)

call c fast Create Atom("mo")

move ret at (3)

call c fast Create Atom ("toto")

move ret at (2)

call c fast Create Atom Tagged("am")

move ret ta (3)

call c fast Create Atom Tagged("anh em ruot ")

move ret ta (7)

call c fast Create Atom Tagged("bat")

move ret ta (5) “

call c fast Create Atom Tagged("chen")

move ret ta (4 )

call c fast Create Atom Tagged("dia")

move ret ta (6)

(28)

move_ret ta{2)

call_c fast Create_Atom_Tagged("mo”)

move^ret ta(l)

call_c fast Create_Atom_Tagged{"toto")

move_ret ta(0)

call_c fast Create_Pred(at(1),2,at(0) , 1,1, &X636861_2)

call_c fast Create_Swt_Table(3)

move_ret st(0)

call_c fast Create_Swt_Atm_Element(st (0) , 3, at (2) , &Lpredl_2)

call_c fast Create_Swt_Atm_Element(st(0),3,a t (3),&Lpredl_3)

call_c fast Create_Swt_Atm_Element(st(0),3,a t (4),&Lpredl_4)

call_c fast Create_Pred(at(5),2,at(0),8, 1, &X616E68656D52_2)

call_c fast Create_Pred(a t (6),0,at(0),12,1, &X6B71_0)

c_ret

c_code local System_Directives c_ret

c_code local User_Directives c_ret

3 File giapah.wam % compiler

% file % date % time

GNU Prolog 1.3.0 (Jan 2007) giapha.pi

11 15 2007 10:45:28

file_name('/home/tuandt/gprolog-1.3.0/bin/giapha.pi') predicate(cha/2, 1,static,private,user, [

switch_on_term(5,1,fail,fail,fail), label (1),

switch_on_atom([(toto,2 ), (mo,3), (man,4)]), label (2),

try(6), trust(8), label (3),

try(10) , trust (12), label(4),

try(14), trust(16), label (5),

try_me_else (7),

label ( 6),

get_atom(toto,0), get_atom(mo,1), proceed,

label (7),

retry_me_else (9) , label (8),

(29)

proceed, label{9),

retry_me_else(11), label(10),

get_atom(mo,0), get_atom(am,1), proceed,

label (11),

retry_me_else(13) , label(12),

get_atom(mo,0), get_atom(chen,1), proceed,

label(13),

retry_me_else(15), label (14),

get_atom(man,0), get_atom(bat,1), proceed,

label(15),

trust_me_else_fail, label(16),

get_atom(man,0), get_atom(dia,1), proceed])

predicate(anhemR/2,8,static,private,user, [ allocate(3),

get_variable(y(0) , 0) , get_variable(y (1) , 1) , put_variable(y (2) , 0) , put_value(y(0),1), call (cha/2),

put_value(y (2) , 0) , put_value(y (1) , 1), call(cha/2) ,

put_value(y (0),0), put_value(y (1),1), deallocate,

execute((\=)/2)])

predicate(kq/0,12, static,private,user, [ try_me_else(1),

allocate (2),

put_variable(y (0) , 0) , put_variable(y (1),1), call(anhemR/2),

put_atom(1anh em ruot ',0), call(write/1),

put_value(y (0),0), call(write/1),

put_unsafe_value(y (1),0), deallocate,

execute(write/1), label(1),

(30)

3.1.4 File giapha.s

text fail:

movl jmp

reg_bank+1024,%eax *-4(%eax)

# ; % compiler:

# ; % file :

# ; % date :

# ; % time :

# ; file name{'

1.3.O/bin/giapha

# 6:

# 9:

GNU Prolog giapha.pi 11 15 2007 10:45:28

1.3.0 (Jan 2007'

p l ' )

1 0: predicate(cha/2,1,static,private,user,[

Predicate: cha/2 (/home/tuandt/gprolog- 1.3.0/bin/giapha.pl:1)

# 12: pl_code global X636861_2

.p2align 4, , 15

.type X636861_2,@function globl X636861_2

X6368 61_2:

# 13: ; 11: switch_on_term(5,1,fail,fail,fail),

# 14: call_c fast

Switch_On_Term_Var_Atm(&Lpredl_5,&Lpredl l) movl $Lpredl_5+0,%eax

$Lpredl_l+0,%edx

Switch_On_Term_Var_Atm 15: jump_ret

movl call # jmp # # Lpredl_l: # # movl movl call # jmp # # *%eax 16: ; 18 :

; 13:

Lpredl :

label(1) ,

19: ; 14

20: call_c st+0,%eax $3,%edx

Switch_On_Atom 21: jump_ret *%eax

22: ; 16: label(2),

24: Lpredl_2:

switch_on_atom([(toto,2), (mo,3), (man,4 fast Switch_On_Atom(st(0),3)

Lpredl_2:

# 25: ; 17: try(6),

# 26: call_c fast Create_Choice_Point2(&Lpredl_sub_0)

movl $Lpredl_sub_0+0,%eax call Create_Choice_Point2

# 27: jump Lpredl_6

jmp Lpredl_6

# 28: Lpredl_sub_0:

Lpredl_sub_0:

# 29: ; 18: trust(8),

# 30: call_c fast Delete_Choice_Point2()

call Delete_Choice_Point2

(31)

jmp Lpredl_8

# 32: ; 20: label(3),

# 34: Lpredl_3:

Lpredl_3:

# 35: ; 21: try(10),

# 36: call_c fast Create_Choice_Point2(&Lpredl_sub_l)

movl $Lpredl_sub_l+0,%eax call Create_Choice_Point2

# 37: jump Lpredl^lO

jmp Lpredl_10

# 38: Lpredl_sub_l:

Lpredl_sub_l:

# 39: ; 22: trust(12),

# 40: call_c fast Delete_Choice_Point2()

call Delete_Choice_Point2

# 41: jump Lpredl_12

jmp Lpredl_12

# 42: ; 24: label(4),

# 4: Lpredl_4:

Lpredl_4:

# : ; 25: try(14),

# 6: call_c fast Create_Choice_Point2(&Lpredl_sub_2}

movl $Lpredl_sub_2+0,%eax call Create_Choice_Point2

# 47: jump Lpredl_14

jmp Lpredl_14

# 48: Lpredl_sub_2:

Lpredl_sub_2:

# 49: ; 26: trust(16),

# 50: call_c fast Delete_Choice_Point2()

call Delete_Choice_Point2

# 51: jump Lpredl_16

jmp Lpredl_16

# 52: ; 28: label(5),

# 54: Lpredl_5:

Lpredl_5:

# 55: ; 29: try_me_else(7 ) ,

# 56: call_c fast Create_Choice_Point2(&Lpredl_7)

movl $Lpredl_7+0,%eax call Create_Choice_Point2

# 57: ; 31: label(6),

# 59: Lpredl_6:

Lpredl_6:

# 60: ; 32: get_atom(toto, 0) ,

# 61: call_c fast Get_Atom_Tagged(t a (0) , X (0) )

movl ta + 0,%eax

movl reg_bank+0,%edx call Get_Atom_Tagged

# 62: fail_ret

(32)

je fail

63: ' 33: get_atom(mo, 1) ,

# 64: call_c fast Get_Atom Tagged(ta(1),X (1))

moví ta+4,%eax

moví reg_bank+4,%edx cali Get_đtom Tagged

# 65: fail_ret

testl %eax,%eax

je fail

$ 66: ; 34: proceed,

# 67: pl_ret

jmp *reg_bank+1036

# 68: ; 36: label{7),

# 70: Lpredl_7:

Lpredl_7:

# 71: ; 37: retry_me_else(9) ,

# 72: call_c fast Update_Choice_Point2(&Lpredl_9)

moví $Lpredl_9+0,%eax cali Update_Choice_Point2

# 13: ; 39: label(8) ,

# 75: Lpredl_8:

Lpredl_8:

# 76: ; 40: get_atom(toto, 0) ,

# 77: call_c fast Get_Atom_Tagged(ta(0) , X (0) )

moví ta+0,%eax

moví reg_bank+0,%edx cali Get_Atom_Tagged

# 78: fail_ret

testl %eax,%eax

je fail

# 79: ; 41: get_atom(man,1) ,

# 80: call_c fast Get_Atom_Tagged(t a (2) , X (1))

moví ta+8,%eax

moví reg_bank+4,%edx cali Get_Atom_Tagged

# 81: fail_ret

testl %eax,%eax

je fail

# 82: ; 42: proceed,

# 83: pl_ret

jmp *reg_bank+1036

# 84: ; 44: label(9),

# 86: Lpredl_9:

Lpredl_9:

# 87: ; 45: retry_me_else(11) ,

# 88: call c fast Update_Choice_Point2 (&Lpredl_l 1)

moví $Lpredl_ll+0,%eax cali Update_Choice_Point2

# 89: ; 47: label(10),

# 91: Lpredl_10:

Lpredl_10:

(33)

# moví moví call # testl je # # moví moví cali # testl je # # jmp # #

93: call_c

ta+4, %eax

reg_bank+0,%edx Get_Atom_Tagged

94: fail_ret %eax,%eax fail

95: ;

96: call_c ta+12,%eax

reg_bank+4,%edx Get_Atom Tagged

97: fail_ret %eax,%eax fail

98: ; 50: proceed,

99: pl_ret *reg_bank+1036

100: ; 52: label(11),

102: Lpredl 11:

fast Get_Atom Tagged (ta (1) , X (0) )

get_atom (am, 1) ,

fast Get_Atom_Tagged(ta(3),X(1)

Lpredl_ll: # # moví cali # #

53: retry 103: ;

104: call_c

$Lpredl_13+0,%eax Update_Choice_Point2

105: ; 5; label(12),

107: Lpredl 12:

etry_me_else(13) ,

fast Update_Choice_Point2(&Lpredl 13)

Lpredl_12: # # moví moví cali #

108: ; 56:

109: call_c ta+4,%eax

reg_bank+0,%edx Get_Atom_Tagged 110: fail ret

g e t _ a t o m ( m o , 0) ,

fast G e t _ A t o m _ T a g g e d ( t a (1), X (0;

testl %eax,%eax

je fail

# 111: ;

# 112: call_c

moví ta+16,%eax

moví reg_bank+4,%edx cali Get_Atom_Tagged

# 113: fail_ret

testl %eax,%eax

57: get_atom(chen,1),

c fast Get_Atom_Tagged(ta(4),X(1))

je # # jmp # # fail 114 : 115: pl

58: proceed, ret

reg_bank+1036

116: ; 60: label(13),

118: Lpredl 13: Lpredl_13:

# #

moví

119: ; 61: retry_me_else(15) ,

120: call_c fast Update_Choice_Point2(&Lpredl_15)

(34)

call Update_Choice_Point2

# 121: ; 63: label(14),

# 123: Lpredl_14:

Lpredl_14:

# 124: ; 64: get_atom{man, 0) ,

# 125: call_c fast Get_Atom_Tagged(ta{2),X (0))

movl ta+8,%eax

movl reg_bank+0,%edx call Get_Atom_Tagged

# 126: fail_ret

testl %eax,%eax

je fail

# 127: ; 65: get_atom(bat, 1) ,

# 128: call_c fast Get_Atom_Tagged(t a (5) , X (1))

movl ta+20,%eax

movl reg_bank+4,%edx call Get_Atom_Tagged

# 129: fail_ret

testl %eax,%eax

je fail

# 130: ; 66: proceed,

# 131: pl_ret

jmp *reg_bank+1036

# 132: ; 68: label{15),

# 134: Lpredl_15:

Lpredl_15:

# 135: ; 69: trust_me_else_fail,

# 136: call_c fast Delete_Choice_Point2()

call Delete_Choice_Point2

# 137: ; 71: label(16),

# 139: Lpredl_16:

Lpredl_l6:

# 140: ; 72: get_atom(man,0) ,

# 141: call_c fast Get_Atom_Tagged(t a {2) , X (0))

movl ta+8,%eax

movl reg_bank+0,%edx call Get_Atom_Tagged

# 142: fail_ret

testl %eax,%eax

je fail

# 143: ; 73: get_atom(dia, 1) ,

# 14 4: call_c fast Get_Atom_Tagged(t a (6),X (1))

movl ta+24,%eax

movl reg_bank+4,%edx call Get_Atom_Tagged

# 145: fail_ret

testl %eax,%eax

je fail

# 146: ; 74: proceed])

# 147: pl_ret

jmp *reg_bank+1036

(35)

# 151: ; *** Predicate: anhemR/2 (/home/tuandt/gprolog- 1.3.0/bin/giapha.p i :8)

# 154: pl_code global X616E68656D52_2

.p2align 4,,15

.type X616E68656D52_2,@function globl X616E68656D52_2

X616E68656D52_2:

# 155: ; 78: allocate(3),

# 156: call_c fast Allocate(3)

movl $3,%eax call Allocate

# 157: ; 79: get_variable(y(0),0),

# 158: move X(0),Y(0)

movl reg_bank+0,%eax movl reg_bank+1040,%edi movl %eax,-16{%edi)

# 159: ; 80: get_variable(y (1) , 1) ,

# 160: move X(1),Y(1)

movl reg_bank+4,%eax movl %eax,-20(%edi)

# 161: ; 81: put_variable(y(2) , ) ,

# 162: call_c fast Put_Y_Variable(&Y(2) )

leal -24(%edi),%eax call Put_Y_Variable

# 163: move_ret X (0)

movl %eax,reg_bank+0

# 164: ; 82: put_value(y(0} , 1) ,

# 165: move Y(0),X(1)

movl -16(%edi),%eax movl %eax,reg_bank+4

# 166: ; 83: call(cha/2),

# 167: pl_call X636861_2

movl $.LcontO,reg_bank+1036

jmp X636861_2

.LcontO:

# 168: ; 84: put_value(y (2),0),

# 169: move Y(2),X(0)

movl reg_bank+1040,%edi movl -24(%edi),%eax

movl %eax,reg_bank+0

# 170: ; 85: put_value(y (1) , 1) ,

# 171: move Y{1),X(1)

movl -20(%edi),%eax movl %eax,reg_bank+4

# 172: ; 86: call(cha/2),

# 173: pl_call X636861_2

movl $.Leonti,reg_bank+1036

jmp X636861_2

.Leonti:

# 174: ; 87: put value (y (0 ) , 0) ,

# 17 5: move Y(0),X(0)

movl reg_bank+1040,%edi movl -16(%edi),%eax

movl %eax,reg_bank+0

(36)

# 177: move Y(1),X(1) movl - (%edi),%eax

movl %eax,reg_bank+4

# 178: ; 89: deallocate,

# 179: call_c fast Deallocate()

call Deallocate

# 180: ; 90: execute({\=)/2)])

# 181: pl_jump X5C5C3D_2

jmp X5C5C3D_2

# 182: ; 93: predicate{kq/0,12,static,private, user, [

# 185: ; *** Predicate: kq/0

(/home/tuandt/gprolog-1.3.0/bin/giapha.p i :12)

# 188: pl_code global X6B71_0

.p2align 4,,15

.type X6B71_0,Sfunction globl X6B71_0

X6B71_0:

# 189: ; 94: try_me_else(1) ,

# 190: call_c fast Create_Choice_Point(&Lpred3_l, 0}

movl $Lpred3_l+0,%eax movl $0,%edx

call Create_Choice_Point

# 191: ; 95: allocate(2),

# 192: call_c fast Allocate(2)

movl $2,%eax call Allocate

# 193: ; 96: put_variable(y (0) , ) ,

# 194: call_c fast Put_Y_Variable(&Y(0))

movl reg_bank+1040,%edi leal -16(%edi},%eax call Put_Y_Variable

# 195: move_ret X(0)

movl %eax,reg_bank+0

# 196: ; 97: put_variable(y (1) , 1) ,

# 197: call_c fast Put_Y_Variable(&Y(1))

leal -20(%edi),%eax call Put_Y_Variable

# 198: move_ret X(l}

movl %eax,reg_bank+4

# 199: ; 98: call(anhemR/2),

# 200: pi call X616E68656D52_2

movl $ Lcont2,reg_bank+1036 jmp X 6 E6 86 56D52_2

.Lcont2:

I 201: ; 99: put_atom('anh em ruot ',0),

# 202: call_c fast Put_Atom_Tagged(ta(7))

movl ta+28,%eax

call Put_Atom_Tagged

# 203: move_ret X(0}

movl %eax,reg_bank+0

# 204* ; 100: call(write/1) ,

# 205: pl_call X7772697465_1 movl $ L c o n t , r e g _ b a n k + 6

jmp X7772697465_l

(37)

# # moví moví moví # # moví jmp Lcont4: # # moví moví cali # moví # # cali # # jmp # # Lpred3_l: # # moví cali # # jmp # # # #

206: ; 101: put_value(y(0) , 0) ,

207: move Y(0),X(0)

reg_bank+104 0,%edi -16(%edi),%eax %eax,reg_bank+0

2^8: ; 102: call(write/1) ,

209: pl_call X7772697465_1

$.Lcont4,reg_bank+1036 X77726974 65_1

210: ; 103: put_unsafe_value(y(1) , 0) ,

211: call_c fast Put_Unsafe_Value(Y (1))

reg_bank+1040,%edi -20(%edi), %eax Put_Unsafe_Value 212: move ret X (0)212: move_ret

%eax,reg_bank+0

213: ; 104: d

213: ; 104

214: call_c Deallocate

215: ; 105:

216: pl_jump X77726974 65_1

217: ; 107:

219: Lpred3 1:

deallocate, fast Deallocate execute(write/1) ,

X77726974 65_1 label (1),

trust_me_else_fail,

fast Delete_Choice_Point(0;

220: ; 108:

221: call_c $0,%eax

Delete_Choice_Point

222: ; 109: proceed])

223: pl_ret *reg_bank+103

226: long local a t (7) 227: long local ta(8) 228: long local st(l)

231: c_code initializer Object_Initializer 4,, 15

.p2align

.type Object_Initializer,@function Obj ect_Initializer:

pushl %esi

subl $132,%esp

# 233: call

# zJJ: call_c

New_Object(&Prolog_Object_Initializer,&System_Directives,&User_Directives;

’ $Prolog_Object_Initializer+0,0 (%esp)

$System_Directives+0,4 (%esp) $User_Directives+0,8 (%esp) New_Obj ect movl movl movl call # addl popl ret #

234: c_ret $132,lesp %esi

237 p2align

code ”4, , 15

(38)

• type Prolog_Object_Initializer,0function Prolog_Object_Initializer:

pushl %esi subl $132,%esp

# 239: call_c fast

Create_Atom("/home/tuandt/gprolog-1.3.O/bin/giapha.pi")

moví $.LC0,%eax

cali Create Atom

# 240: move ret at (0)

moví %eax,at+0

# 241: call c fast Create Atom ("anhemR")

moví $ LC1,%eax

cali Create Atom

# 242: move ret at (5)

moví %eax,at+20

# 243: call c fast Create Atom ("cha")

moví $.LC2,%eax

cali Create Atom

# 24 4: move ret at (1)

moví %eax,at+4

# 245: call c fast Create Atom ("kq")

moví $ LC3,%eax

cali Create Atom

# 24 6: move ret at (6)

moví %eax,at+24

# 247: call c fast Create Atom {"man")

moví $ LC4,%eax

cali Create Atom

# 24 8: move ret at (4)

moví %eax,at+16

# 249: call c fast Create Atom ("mo")

moví $ LC5,%eax

cali Create Atom

# 250: move ret at (3)

moví %eax,at+12

# 251: call_c fast Create Atom ("toto")

moví $ LC6,%eax

cali Create Atom

# 252: move ret at {2)

moví %eax,at +

# 253: call_c fast Create_ Atom Tagged("am")

moví $.LC7,%eax

cali Create Atom_Tagged

# 254: move ret ta (3)

moví %eax,ta+12

# 255: call_c fast Create At om_ Tagged("anh em

moví $.LC8,%eax

cali Create Atom_Tagged

# 256: move ret ta (7)

moví %eax,ta+28

# 257: call_c fast Create Atom Tagged("bat")

moví $.LC9,%eax

cali Create Atom_Tagged

# 258: move ret ta (5)

(39)

# 259: call c fast

moví $.LC10,%eax

cali Create_Atom Tagged

# 260: move ret ta (4)

moví %eax,ta+16

# 261: call c fast

moví $.LC11,%eax

cali Create Atom Tagged

# 262: move ret ta (6)

moví %eax,ta+24

# 263: call c fast

moví $.LC4,%eax

cali Create Atom Tagged

# 64: move ret ta (2)

moví %eax,ta+8

# 265: call c fast

moví $.LC5,%eax

cali Create Atom Tagged

# 266: move ret ta (1)

moví %eax,ta+4

# 267: call c fast

moví $.LC6,%eax

cali Create Atom Tagged

# 68: move ret ta (0)

moví %eax,ta+0

# 270: call c fast

moví at+4,%eax

moví $2,%edx

moví at+0,%ecx

moví $1,0(%esp)

moví $1,4(%esp)

moví $X636861_2+0 ,8(%esp)

cali Create Pred

# 271: call_c fast

moví $3,%eax

cali Create Swt Table

# 272: move ret st (0)

moví %eax,st+0

# 273: call c fast

Create Swt_ Atm Element(st(0) , 3, c

moví st+0,%eax

moví $3,%edx

moví at+8,%ecx

moví $Lpredl 2+0, 0(%esp)

cali Create Swt Atm Eleme

fast Create_Atom_Tagged("chen")

fast Create_Pred(at(l),2,at(0),l,l,&X6368 61_2¡

# Create_Swt moví moví moví moví cali # Create_Swt moví moví

L / I c d L c o w l_uní jL c m c ii i

274: call_c fast

_Atm_Element(st {0),3,a t (3),&Lpredl_3) st+0,%eax

$3,%edx at+12,%ecx

$Lpredl_3+0,0 (%esp) Create_Swt_Atm_Element

275: call_c fast

Atm_Element(s t (0),3,a t (4),&Lpredl_4 ) st+0,%eax

(40)

moví at+16,%ecx

m ov í $ L p r e d l _ + , (%esp)

cali Create_Swt Atm Element

# 277: c a l l _ c fast

C r e a t e _ P r e d ( a t (5),2 , at (0) , , , &X616E68 656D52 2)

m o v í a t + , % e a x ~

m o v í $ , %edx moví at + ,%ecx moví $ , (%esp) m o v í $ , ( %esp)

m o v í $ X 6 E 6 D _ + , (%esp) cali C r e a t e _ P r e d

# 279: c a l l _ c fast C r e a t e _ P r e d ( a t {6),0,a t (0),12,] m o v í a t + , %eax

m o v í $ , %edx m o v í a t + , % e c x m o v í $ , (%esp) mo v í $ , ( %esp)

moví $X6B71_0+0,8 (%esp) cali C r e a t e _ P r e d

# 280: c ret

addl $ , %esp

popí %esi

ret

# 282: c _ c o d e local S y s t e m _D ir e c t i v e s .p a l i g n 4,, 15

.type S y s t e m _ D i r e c t i v e s , f u n c t i o n

S y s t e m _ D i r e c t i v e s : p u s h l %esi subí $ , %esp

# 284: c_ret

addl $ , % e s p

popí %esi

ret

# 286: c _ c o d e local U se r_ D i r e c t i v e s .p a l i g n 4 , , 15

.type U s e r _ D i r e c t i v e s ,@ f u n c t i o n

U s e r _ D i r e c t i v e s : p u s h l %esi subí $ ,%esp

# 288: c_ret

addl $ , %esp

LC0: , LC7 :

LC8 :

popí %esi ret

.section ctors,"aw",Sprogbits

.align

.long Object_Initializer

.section rodata.strl.1,"aMS",@progbits,

.string "/home/tuandt/gprolog-1.3.0/bin/giapha.pl"

.string "am"

.string "anh em ruot "

(41)

.L C l :

.string "anhemR

.L C :

.string "bat"

LC2 :

.string "cha"

LC10 :

.string "chen"

.L C 11 :

.string "dia"

.LC3 :

.string "kq"

.LC4 :

.string "man"

.LC5 :

.string "mo"

.LC :

string data

"toto"

.align 4

.local at

comm at,28,4

.local St

• c onun s t /4 , 4

.local ta

.comm ta,32,

.section note Gl

3.1.5 Khai thac giapha

[tuandt@portal bin]$ /giapha GNU Prolog 1.3.0

By Daniel Diaz

Copyright (C) 1999-2007 Daniel Diaz

Ị ?- kq “

I ?- cha(toto,mo)

true ?

yes

I ?- anhemR(mo,man) true ?

yes

I ?- anhemR(mo,X), write(X) man

X = man ? yes

I ? -

Prolog interruption (h for help) ? e [tuandt@portal bin]$

3.2 Một số nhận xét 3.2.1 cỏu hỏi Datalog

(42)

Liên quan đên xử lí tri thức, người ta sử dụng kiến thức biết xử lí liệu quan hệ Người ta có kết quả, sở liệu logic, trình bày tài liệu Ưliman :

Định lí : Moi hàm biểu diễn đại số quan hệ thi biểu diễn chương trình Datalog khơng đệ quy

Đê chửng minh, người ta thấy biểu thức xuất i lần tốn từ quan hệ, có chương trình Datalog không đệ qui sinh giá trị biểu thức, quan hệ ứng với vị từ chương trình

Khi i=0, có tốn hạng Nếu quan hệ (i) EDB, khơng cần luật nào, có quan hệ, vị từ xác định; (ii) tập bộ; người ta gán tên, p chẳng hạn, lấy a 1, an luật p ( a l an), tức luật có phần đàu, khơng có thân

Khi i >1, xét qui nạp với phép toán quan hệ (i) hợp, (ii) trừ; (iii) hạn chế; (iv) chiếu; (v) tích

1 Trường hợp phép hợp, biểu thức E = E l u E2 Dùng hai luật e (X I, Xn) el (X I, Xn) e (X I, Xn) e2 (X I, Xn);

2 Trường hợp trừ, E= E l - E2 Dùng luật e (X I, X n ) :- e l (X I, Xn), e2 (X I, Xn); Trường hợp chiếu, E = chiếu ii ik (E l) Ngôi quan hệ n, el vị từ có luật sinh

quan hệ cho E l Luật cho e, tức vị từ tương ứng với biểu thức E e (X il, Xik) el (X I, Xn);

4 Trường hợp tích E = E l X E2 Giả sử E l, E2 có n, m Luật e (X I, X n + m ) e l (X I, Xn), e2 (X n+1, Xn+m);

5 Trường hợp hạn chế : E - hạn chế F (E l) Do kết bổ đề, coi F phép chọn đơn giản, có dạng $i $j Khi có Luật có dạng e (X I, Xn) el (X I, Xn), Xi Xj

Định lí (định ỉí đảo) : Gọi R tập luật Datalog an tồn, khơng đệ quy, có đích phủ định Với mồi vị từ p cùa R, tồn biểu thức đại số quan hệ tính quan hệ cho p

3.2.2 Tối ưu cảu Prolog

về khả song song hóa câu Prolog, tốn xử lí tri thức : Tách câu có logic OR

(43)

Hợp kết trung gian

q(X) p1 (X); p2 (X)

Hỉnh Tách câu với logic OR q ( X ) : - p l ( X )

q(X) p2 (X)

ứng với hai vị từ EBD Việc tính theo hai vị từ thực song song, Ket quà câu hỏi ban đầu họp hai câu kết thành phần

Thí dụ C o n n h T O T O (X) cha (toto, X); mẹ (toto, X) Làm tinh giản câu có điều kiện hạn chế

Các câu q(X) p (X, Y, _), Y = c hiểu câu có thân với vế phải vị từ p2 (X) Vị từ p2 xác định theo p2 (X) p (X, Y, _), Y = c Vị từ p vị từ EDB

Để đơn giản, tính trước vị từ IDB p2, nhàm giảm bớt sổ lượng tham số cần xét vị từ p

Hình 10 Tinh giản câu hỏi

Liên quan đến công việc này, sử dụng vị từ IDB thay cho EDB Các câu có liên kết nối

Các câu có nhiều vị từ EDB, hay vị từ IDB thay cho EDB phép hạn chế q(X) p i (X), p2 (X), tách

Tính q (X) p2 (X)

p2 (X) p (X, Y c1), Y > c2 theo tham số Y,

theo tham số cuối c1

(44)

Hình ỉ Tách liên kết AND ql (X) p l (X)

q2 (X) p2 (X)

ứng với hai trình tính song song, thu kết ql q2 Việc tính tốn tổng cộng hai q trình có số lượng tính tốn lớn hom việc tính pl(X ), p2(X) Tuy nhiên có hai CPU độc lập, tính ql q2 lấy giao kết kết cuối Việc tính hai CPU nhanh hơn, cho phép thực song song hóa việc trả lời câu hỏi

4 Phân tích sơ ngữ nghĩa câu hỏi để loại bỏ tính tốn thừa Một số trường hợp loại bỏ :

• Điều kiện sai q ( X ) p (X, 4), p(X, 5), tham số thứ hai • Điều kiện rỗng q ( X ) X > 4, X <4

• u cầu tồn thể q (X) p() Khơng có u cầu thân mệnh đề Hom, vế trái

q ( X ) p (X) p2 (X)

Hình 12 Quá trình xử lí câu hỏi Tách điều kiện hạn chế

Các câu có nhiều điều kiện hạn chế q ( X ) p ( X , Y, Z), Y = c l, z = c2 tách thành ql ( X ) p (X, Y, _), Y =cl

(45)

q ( X ) p (X, Y, Z), Y > c1, z > c2

Hình 13 Tách điều kiện hạn chế

Kết cuối giao kết hai q trình tính q l, q2 hai CPU song song

6 Thứ tự thực phép tối ưu câu hỏi

• Chuyển vị từ EDB có điều kiện hạn chế vị từ IDB, khơng cịn điều kiện hạn chế;

• Chuyển vị từ có nhiều tham vị từ có tham số hơn, nhằm giảm nhớ trung gian;

(46)

Một số luận văn tốt nghiêp

Mọt so can bọ tham gia đê tài nghiên cứu khoa học cấp Đại học Quốc gia Hà Nội mã số QT 07 08 thực luận văn tốt nghiệp ngành công nghệ thông tin, bậc đại học cao học :

Một sô luận văn cao học công nghệ thông tin, liên quan đến đề tài ;

Tên học viên Đề tài Bảo vệ

Trần Thị Thúy Xây dựng mơ hình sở liệu suy diễn ứng dụng

5/2007

Đỗ Văn Bình Một số mơ hình dự báo áp dụng vào ngành điện

2/ 2007

Một số khóa luận tốt nghiệp đại học, chun ngành cơng nghệ thông tin liên quan đến đề t i :

Tên học viên Đề tài Bảo vệ

Đỗ Minh Tiến Quản lí tri thức đánh giá kết học tập sinh viên chương trình PROLOG

5/ 2007

(47)

Bài báo khoa học _•_

Tác giả Tên báo Tạp chi Hội thảo Nam

Tuan DoTrung Deductive Model for Active Database Svsiems ■»

Kỉ yếu Hội thảo Quốc gia Nghiên cứu bản, 2007

FAIR 07, Nha trans

2007

Do TrungTuan

End-user Interface for Active Databases

Proceedings of The 2nd Asia Pacific International Conference on Information Science and Technology, p 69-72

(48)

Tài liệu tham khảo

1 J D U llm an,

Nguyên lí hệ sở liệu sở tri thức, tập 1, Nxb Thống kê, 1999 Adrian Walker, et al

Knowledge Systems and Prolog, Ed Addison Wesley, 1990 Subrrata Kumar Das,

(49)(50)

TRI THỨC TRONG c SỞ DỪ LIỆU

Đo rung Tuân, Trường Đại học Khoa học tự nhiên, Đại học Quốc gia Hà nội 334 Nguyên Trãi, Hà nội Email tuandt'Svnu edu

Tóm tắt

Bài báo nêu khía cạnh động sờ liệu, nhẩm thiết kế mơ hình sỡ liệu suy diên Một sơ điêu liên quan đên khai phá tri thức, điều kiện toàn vẹn liệu, yếu tổ thời gian iữ liệu xét nghiên cứu ứng dụng sờ liệu Kiến trúc cùa hệ thốn2 xử lí tri thức sờ liệu với (i) giao diện người dùng; (ii) khai phá tri thức; (iii) tổ chức tri thức sở liệu, trình bày nhu kết nghiên cứu báo

Từ khoá : sở liệu động; liệu; tri thức; khai phá liệu

Abstract

The paper aims at active aspects in database systems for designing a model of a deductive database Some points concerning data mining techniques, integrity constraints, temporal aspects of data are examined in approaching to applications of database The svstem architecture for knowledge manipulation with (i) end-users interactive interface; (ii) data mining; and (iii) knowledge representation in database systems are presented in the paper as a research result

Keyword : active database; data; knowledge; data mining

I Giới thiệu

Mơ hình liệu quan hệ cho phép chuyển hệ quản trị sờ dừ liệu từ hệ sang hệ Tuy nhiên, sau năm 80 thể ki trước, mơ hình dừ liệu tiến tiến với mơ hình liệu phân tán, mơ hình liệu hướng đối tượng mơ hình dừ liệu suy diễn chưa tách khỏi mơ hình liệu quan hệ, chưa đủ đế có hệ quản trị sở liệu hệ khác

Nhu cầu xử lí tri thức sở liệu, khẳc phục hạn chế lập luận mô hình liệu quan hệ dẫn đến mơ hình dừ liệu suy diễn Tiếp cận lí thuyết chứng minh tiếp cận logic vị từ cho phép thiết kế hệ thống xử lí tri thức, có đù tiên đề phép xử lí tri thức Nhữne kết đạt năm 90 kỉ XX chưa đù để xây dựng hệ thống hoàn chinh, độc lập với hệ thống theo mơ hình liệu quan hệ Nghiên cứu tri thức xử lí tri thức xem xét nhiều hệ thống [12, 17, 18], sờ liệu logic Sự tương đương phép toán logic vị từ đại số quan hệ [6] đảm bảo hỏi liệu hệ thống tri thức

Cho dù chưa hoàn chinh, số hệ thống [1, 3, 9, 10, 11] cho phép xử lí tri thức với xử lí liệu Các hệ thống đề cập :

(51)

3 Ngôn ngữ cho phép người dùng đặt câu hịi, dạng đích cần kiểm tra.

Một mặt hệ thống tập trung vào chế lập luận tri thức, mật khác trons sở đữ liệu quan hệ, người ta tiến hành kĩ thuật phát tri thức, khai phá liệu Các kết khai phá góp thêm thơng tin cho người dùng nhìn nhận nsữ nshĩa liệu vốn có

Mục đích cùa báo hệ thống cho phép xử lí liệu theo mỏ hình liệu quan hệ, xử lí phần tri thức Tri thức thu từ nhiều nguồn; từ người dùng tro n s đặc tả đối tượng giới thực, từ trình khai phá liệu, từ q trình suv luận, với qui mơ khơng hồn thiện

Cơ sở liệu động [5, 14, 15] hệ thống tích hợp kĩ thuật sờ liệu, hệ chuyên gia trí tuệ nhân tạo Các kĩ thuật, cơng nghệ dùng trone sờ liệu động hô trợ kích hoạt qui tắc trẽn dừ liệu, đáp ứng địi hịi kiện Việc kích hoạt tụ động qui tắc dùng (i) đảm bảo điều kiện toàn vẹn liệu; (ii) cập nhật khung nhìn người đùng, tri thức

II Khía cạnh động CO’ sờ liệu

Khía cạnh động sờ liệu động thể qua :

• Tri thức người dùng yêu cầu khai thác liệu Những tri thức có kiện

người dùng yêu cầu, điều kiện họ cần liệu Người ta thể hiện tri thức qua dừ liệu thời gian [2];

• Điều kiện tồn vẹn liệu Điều kiện mô tả thiết kế sở liệu, biết trước liệu bổ sung vào sở liệu Các điều kiện có dạng qui luật mà liệu cần thoả măn, liên quan đến (i) giá trị thuộc tính đối tượng; (ii) tương quan giá trị cùa nhiều thuộc tính, phụ thuộc liệu, điều kiện ràng buộc trẽn nhiều thuộc tính; (iii) điều kiện phù họp với logic giới thực, môi trường xét Một số kết có [4, 5, 13, 16, 17];

• Các qui tắc áp dụng cho hành động hệ thống sở liệu, gồm (i) kiện, cho phép qui luật kích hoạt; (ii) điều kiện để qui luật xảy ra; (iii) hành động, xảy luật kích hoạt điều kiện thoả mãn;

• Tính linh động mà ngôn ngữ hỏi cho phép Trong [10] cho thấy nhận xét triển khai việc hòi liệu sở liệu suy diễn, mang nhiều yếu tố linh hoạt cho người dùng Các yếu tố trợ giúp người dùng, cung cấp thông tin tương tác người-máy, với ừi thức hệ thống cho phép người dùng linh động giao diện người-máy Một số kết [19, 20]

(52)

coi sở liệu tổng quát, gồm (i) miền liệu; (ii) kiện; (iii) điều kiện toàn vẹn: (iv) luật suy diễn

Một kiên trúc vê sở liệu động, tính đến khía cạnh nêu trên, đáp ửn2 việc xử lí liệu xử lí tri thức mức đơn giản đóng aóp báo

III Kiến trúc đề xuất

Dựa tren cac phan tích ve ưng dụng sờ dừ liệu, kiên trúc hệ thống sở liệu động mơ tả hình

A

ũ

c m «#!*■

Giao diện người-máy

Xử lí

thống kê dữ liệuHỏi

J] *

Thể

đổ hoa liệu, tri thứcMô tả

Hỏi tri thức

7 T “

Quản tri

Quản trị liệu Quàn trị kiện, luật, hành động

/ / / ' / 3E —

I -Kĩ thuật phân tích liệu Kĩ thuật khai phá liệu

ế 4.4

Toàn vẹn liệu

Cơ ché' lập luận

Tối ưu liệu, lọc liệu

- T Y

M y ^

75 » • t i i - ĩ—

Cơ sở liệu sở tri thức

chủ Cơ'

k

liệu Cơ s’

Hình Kiến trúc sờ liệu động

Liên quan đến khối chức mà kiến trúc đề xuất, có đường truvền thơne kí hiệu đường nét đúp đường nét chấm chấm Các đường truyền thông nét đúp thể đường truyền thống hệ quản trị liệu hay tri thức Qua thử nghiệm cài đặt chức kiến trúc sờ liệu động, có sổ lưu ý :

(53)

thứ nhât cho phép người dùng đặt câu hỏi theo giao diện hỏi liệu, theo khuôn dạna Visual Basic Hệ thống chuyển càu hỏi dừ liệu sang dạng vị từ, thực lập luận;

2 Xử lí tri thức theo đường chẩm chấm số 2, trực tiếp tới sờ tri thức Thực có thẻ kết hợp sờ với sở liệu; tổ chức sờ tri thức dạng liệu liệu meta sở liệu quan hệ Việc xử lí tri thức theo đường nàv thực nhờ ngơn ngừ Prolog Có thể xem phần chương trình Datalog, tạo nên sờ liệu suy diễn

3 Kĩ thuật phân tích liệu hay khai phá liệu, với thuật toán phân tích, thốns; kẻ, làm tinh, phát tri thức, nhăm tăng thông tin sở liệu Do đường chấm chấm số cho biết việc cập nhật liệu cách tự động nhờ việc tự kích hoạt kĩ thuật Các hành động thực kĩ thuật điều khiển nhờ chế kích hoạt qui luật điều kiện thoả mãn;

4 Các điêu kiện toàn vẹn thường xuvên hệ quản trị sờ liệu rà soát Khi vi phạm điều kiện toàn vẹn, người dùng hay hệ thống cần cập nhật đữ liệu để sờ dừ liệu bền vững cỏns việc thực theo đường truyền thông số 4;

5 Cơ sờ liệu cập nhật, người dùng, điều kiện toàn vẹn hav q trình khai phá liệu đơi khơng cần thiết Tuy kiến trúc chưa đề xuất giải pháp tối ưu liệu giải pháp [7, 8], số kĩ thuật lọc lấy liệu cần thiết hơn, hay lược bò liệu bổ sung mà không mang nhiều thông tin cần nhúng hệ quản trị sờ liệu

IV Kết luận

Dù có số sờ liệu suy diễn, dùng logic vị từ, cho phép xử lí tri thức, người ta nghiên cứu mô hình sờ liệu suy diễn với mong muốn thu mơ hình liệu hồn chinh, lập luận với tri thức Cơ sờ liệu động xây dựng sờ liệu quan hệ, với khía cạnh động điều kiện toàn vẹn liệu, số qui tắc, kiện lập ỉuận đon giản phương án tạm thời

Tài liệu tham khảo

[1], B Yang et al., Deductive synthesis of workflows for e-science, IEEE inter Symposium on cluster computing and the grid, p 168- 175, 2005

[2], c Lee., M Chen, Progressive partition miner : an efficient algorithm for mining general temporal association rules, EEEE tran on knowledge and data engineering, V 15, N 4,

1004-1017,2003

[3] c Zaniolo, H Wang, Logic-based user-defined aggregates for the next generation of database systems, in “The logic programming paradigm : a 25 year perspective”, Ed Springer, p 401-426

[4], c Zaniolo, Mining databases and data streams with query languages and rules, 14 p., 2005 [5] D Botzer, o Etzion, Self-tuning of relationships among rule’s components in active

databases systems, IEEE tran on knowledge and data engineering, V, 16, N 3, p 375­ 379,2004 '

[6] J D Ưllman, Nguyên lí hệ sở liệu sờ tri thức, T 1, 2, Ed Thông kê,

(54)

[7], Jiuyong Li, On Optimal rule discovery, IEEE tran on knowledge and data engineering Vol 18, N 4, 2006

[8] Jiuyong Li, Robust Rule-based pred:c*:ion, IEEE tran on knowledge and data engineering Vol 18, N 8,2006

[9] K Sagonas, T Swift, D S Warren, XSB as an efficient deductive database engine Proc of SIGMOD, p 442- 453, 1994

[10] M Liu, Deductive database languages : problems and solutions, ACM computing surveys V 31, N 1, p 27-59, 1999

[11], M Liu, Design and implementation of the ROL system, Journal of intelligent information systems, N 14, p 1-21, 2000

[12], Maja van der Velden, Knowledge facts, knowledge fiction, Journal of international Development, J Wiley & son, 15 p., 2002

[13] S Ceri, Effective scheduling of detached rules in active databases, IEEE tran on knowledge and data engineering, V 15, N 1, p 2- 13, 2003

[14] S Flesca, S Greco, Declarative semantics for active rules, 27 p., 2003

[15] Sudermier A., Dietrich Suzannne W\, Shah V., An active database approach to integrating black-box software components, Arizona state University, 1998

[16] Urban S D et al., An evaluation of distributed computing options for a rule-based approach to black-box software component integration, Proc of 3rd int workshop advanced issues of e-commerce and web-based information systems (WECWIS'01), 2001 [17] Urban S D et al., Delta Abstractions : a technique for managing database states in runtime

debugging of active database rules, IEEE tran on knowledge and data engineering V 15, N 3, p 597- 612, 2003

[18] www nwlink com/~donclark/knowledge/knowledge html, 2006

[19], Xindong Wu, Synthesizing High-frequency Rules from different data sources, IEEE tran on knowledge and data engineering, V 15, N 2, p 353- 367, 2003

(55)

End-user Interface for Active databases

Do TrungTuan

Abstract— E n d -u s e r fr ie n d s h ip in te r a c tiv e in te r fa c e fo r a deductive d ata b a s e p ro po ses fa c ilitie s to access to d a ta an d knowledge a c c u m u la te d in bases A lo t o f k in d s o f lan g u ag es jllow users to q u e r y d a ta in th e e n v ir o n m e n t o f d a ta b a s e , an d certain lan g u ag es a llo w users to q u e r y k n o w le d g e a f te r knowledge e n g in e e rin g A n a c tiv e d a ta b a s e is fo r c o m p le x ity o f data and k n o w le d g e , w it h m a n ip u la t in g o p e r a tio n T h e p a p e r aims at a fo rm o rie n te d in t e r f a c e f o r a c tiv e d a ta b a s e s , in o r d e r to query both d a ta a n d k n o w le d g e

Index T erm s— H C I ; A c t iv e D a ta b a s e ; F o r m ; Q u e r y

I INTRODUCTION

O n knowledge manipulation, there are different directions o f research; a lot o f problems were solved Techniques o f knowledge representation are satisfied researchers Kinds o f knowledge are (i) declarative; (ii) procedural; (iii) meta; (iv) heuristics; and (v) structured Some mown techniques for knowledge representation are (i) ittribute-object-value; (ii) rule: (iii) semantic net; (iv) frame;

y) dependency concept; (vi) logic A lot of applied artificial ¡ystems, expert systems were referenced.

Concerning database systems, there are some data models : he hierarchical model, 1960; the network model, 1968; and he relational model, 1970 These models allows to describe ind to manipulate data Database management systems have mictions permitting to design, to build database applications \fter the year o f 1990, advanced data models such as (i) listributed model; (ii) object oriented model; and (iii) leductive model, respond the need practical problems )eductive model is for knowledge manipulation in database ystems.

In the years o f 80’s, 90 ’s, it existed proposals for linking latabase systems to artificial systems A couple of expert ystems and relational databases is known [4, 5] Each strict ouple or loose couple allows to apply a mechanism focusing ) knowledge activities.

The results on logic programming permit to prove theories utomatically, to determine the relationship between facts and sasoning The proving theory and model theory are used for lowledge manipulation The proving theory uses the lecification o f reasoning process on premise; the model eory uses interpretability o f clauses on facts The Prolog nguage uses Horn clause and backward-chaining inference, ises on the semantic o f the proving theory and model theory.

Prolog may present facts, inference, recursive function, query, updating integrity' constraints by same way The XBS [4] is known as successful one with the language HiLog that is developed on Prolog.

Database researches show resemble among the relational database and logic programming Conversion predicate clauses to relational algebra clauses is not complicated However the are problems (i) the effect ness when a big amount of knowledge is used; (ii) query languages in relational model can not inference Besides the relational language is week for exhibiting all application data; it demands traditional programming language Some deductive model focused simultaneously on Prolog language and relational data manipulation functions Datalog is a restricted form of the Prolog language, accepting the negation, is used in deductive models in the years of 90's.

From the users part in deductive models, there are problems concerning the user interface [3] :

deductive database uses flat structure which does not be displayed, does not support complex value data in new database applications;

the integration of objects to database for modeling possibility increasing is net easy;

deductive model needs the unified way for presenting data schema and data higher levels; updating in logic database.

For solving these problems, there are some research directions [3] :

1 Deductive language with complex valued data.

The researches cited are data models with embedded, complex valued data on relationship It uses the first normal form relations; therefore Datalog can not present embedded n_tuple, sets Using functions is solution for that problem Datalog is developed; they achieved certain language, such as (i) LDL; (ii) COL: (iii) HiLog; and (iv) Relationalog;

2 Object oriented deductive language. The object oriented approach intends (i) objects; (ii) complex valued data; (iii) methods; (iv) classes; (v) heritage; (vi) encapsulation Languages in this approach are (i) O-logic; (ii) F-logic; (iii) ROL; and (iv) IQL;

(56)

End-user Interface for Active databases

D o T r u n g T u a n

Abstract— E n d -u s e r fr ie n d s h ip in t e r a c t iv e in te rfa c e fo r a deductive d atab as e p ro p o ses fa c ilitie s to access to d a ta and knowledge a c c u m u la te d in bases A lo t o f k in d s o f lan gu ag es allow users to q u e ry d a ta in th e e n v ir o n m e n t o f d a ta b a s e , an d «rtain lan gu ag es a llo w u sers to q u e r y k n o w le d g e a fte r knowledge e n g in e e rin g A n a c tiv e d a ta b a s e is fo r c o m p le x ity o f data and k n o w le d g e , w it h m a n ip u la t in g o p e tio n T h e p a p e r aims at a fo rm o rie n te d in t e r fa c e fo r a c tiv e d a ta b a s e s , in o r d e r to query both d a ta a n d k n o w le d g e

Index T erm s— H C I ; A c t iv e D a ta b a s e ; F o r m ; Q u e r y

I INTRODUCTION

O n knowledge manipulation, there are different directions o f research; a lot o f problems were solved Techniques o f knowledge representation are satisfied researchers Kinds o f knowledge are (i) declarative; (ii) procedural; (iii) meta; (iv) heuristics; and (v) structured Some known techniques for knowledge representation are (i) attribute-object-vaiue; (ii) rule; (iii) semantic net; (iv) frame; (v) dependency concept; (vi) logic A lot of applied artificial systems, expert systems were referenced.

Concerning database systems, there are some data models : the hierarchical model, 1960; the network model, 1968; and the relational model, 1970 These models allows to describe and to manipulate data Database management systems have functions permitting to design, to build database applications After the year o f 1990, advanced data models such as (i) distributed model; (ii) object oriented model; and (iii) deductive model, respond the need practical problems Deductive model is for knowledge manipulation in database systems.

In the years of 80’s, 90 ’s, it existed proposals for linking database systems to artificial systems A couple of expert systems and relational databases is known [4, 5], Each strict couple or loose couple allows to apply a mechanism focusing to knowledge activities.

The results on logic programming permit to prove theories automatically, to determine the relationship between facts and reasoning The proving theory and model theory are used for knowledge manipulation The proving theory uses the specification o f reasoning process on premise; the model theory uses interpretability o f clauses on facts The Prolog language uses Horn clause and backward-chaining inference, Jases on the semantic o f the proving theory and model theory.

Prolog may present facts, inference, recursive function, query, updating integrity' constraints by same way The XBS [4] is known as successful one with the language HiLog that is developed on Prolog.

Database researches show resemble among the relational database and logic programming Conversion predicate clauses to relational algebra clauses is not complicated However the are problems (i) the effect ness when a big amount of knowledge is used; (ii) query languages in relational model can not inference Besides the relational language is week for exhibiting all application data; it demands traditional programming language Some deductive model focused simultaneously on Prolog language and relational data manipulation functions Datalog is a restricted form of the Prolog language, accepting the negation, is used in deductive models in the years of 90‘s.

From the users part in deductive models, there are problems concerning the user interface [3] :

deductive database uses flat structure which does not be displayed, does not support complex value data in new database applications;

the integration of objects to database for modeling possibility increasing is net easy;

deductive model needs the unified way for presenting data schema and data higher levels; updating in logic database.

For solving these problems, there are some research directions [3] :

1 Deductive language with complex valued data

The researches cited are data models with embedded, complex valued data on relationship It uses the first normal form relations; therefore Datalog can not present embedded n_tuple, sets Using functions is solution for that problem Datalog is developed; they achieved certain language, such as (i) LDL; (ii) COL: (iii) HiLog; and (iv) Relationalog;

2 Object oriented deductive language. The object oriented approach intends (i) objects; (ii) complex valued data; (iii) methods; (iv) classes; (v) heritage; (vi) encapsulation Languages in this approach are (i) O-logic; (ii) F-logic; (iii) ROL; and (iv) IQL;

(57)

yet described data schema clearly For reasoning on data schema It is preferred to use schema variable, logic which is higher than the first order predicate logic Languages allowing to manipulate data schema are : (i) HiLog; (ii) L:; (iii) F-losic; and (iv) ROL;

4 Knowledge updating. The important aspects in database systems are (i) updating extension database and intention database; (ii) updating un­ defined data; (iii) updating sets; and (iv) updating according to conditions.

II ARCHITECTURE OF AN ACTIVE DATABASES Some database systems use integrity constraints for introducing knowledge Integrity constraint management leads to information management in database systems Using data dictionary that composed o f meta-data for database design is a kind of knowledge manipulation in database systems The systems in [1, 6, 8] suggest an idea for developing database systems on knowledge manipulation Besides when manipulating data, describing the relationship among data and datamining [2, 3, 7], users can Find new relationship in database The relationship keeps space-temporal information.

The proposed deductive model has not yet detached from the relational model and artificial systems However it is neces to build a model that separates the relational model with the second generation database management systems.

M

External level -i-knowledge m anagem ent level

In fe re nce engine P R O L O G

t

-p hy sical level ' $

Q know ledge base

Conceptual levels for the proposed deductive

Figure model [9]

Conceptual levels of the deductive model are as followings: External level;

Knowledge management level; Physical level.

In the architecture of deductive systems below, each module is correspond to system function The role o f these modules is explained, for meeting the needs of deductive systems:

Language in user interactive interface; Data management;

Database;

Datamining methods.

III PROPOSED ENDJJSER INTERFACE

In the architecture of a deductive database presented in the

previous version [9], the interface is composed of components corresponding to either data or knowledge In this paper, a form oriented interface is implemented It bases on graphic facilities, presents forms for filling in.

tiẳà

I to4 k i inta'jnty canK ra^t 09<Xct!Ort E S » ’ S

4

-Q 4Í da ta T ia n a g « m *n t (re la tio n a l m o d * l)

k ' v j ’Mtndqm m « n * g * r r « r t

(P ro tc g e n g in e ;

u i a aieoorvary ’

— € * —

data facts fcncwtaag* <Ri)

Figure End-user interface in a deductive systems

In order to meet user needs, the interface has to arranged with :

1 Graphic facilities in the information input/output forms This requirement is necessary, is easy with current technology:

2 In the actual version, data query focus on the selection query in according to restriction, jointure of relational model, such as “hanoi" is filled in the form City for a restriction;

Knowledge query allows users to fill in their goals to deductive process The goals are proposed under the kind of predicate clauses, such as learm(toto, X);

A lot of kinds of constraints are used in the interface : Integrity constraint for an object attribut, such as

“age> 20"; this example constraint needs three form (i) attribute “age”; (ii) comparing operation; and (iii) attribute value “20";

Deductive rules belong to If-then rules For the knowledge “if leam(X informatics) then Ieam(X, mathematics)”, the interface uses forms (i) IF form for “leam(X, informatics)”; and (ii) THEN form for leam(X, mathematics)” Theses predicates have to verified in syntax/semantic;

Alphabetic numeric data and knowledge under form of predicate clauses are imported via forms.

users

■t

3.

4.

5.

End_user interface

data query knowledge query

form for entere in restrict form for clauses coresspondmg to clauses deductive goal

constraints

form for data condition coressponaing to constraints

form for predicates coresspondmg to constraints

(58)

[on-informatics users; (ii) actual graphical equipments; (iii) united amount o f queries.

Behind the form oriented interface are modules allowins to ransfer form clauses into either select clauses in relational lata model, or Prolog clauses.

IV CONCLUSION

The proposed interface permits users to access to active latabase, after the needs o f data/ knowledge manipulation of ion-informatics users An interactive interface is necessary in aiowledge environment; is a subject o f form oriented nterface.

Thanks to the high performance computing center, Vietnam lational university, Hanoi for facilities concerning the work.

REFERENCES

1] C Zaniolo, H Wang, Logic-based user-defined aggregates for the next generation o f database system s, in “The logic programming paradigm : a 25 year perspective”, Ed Springer, p -4 , 2004

2) C Zaniolo, M ining databases and data streams with query languages and rules, 14 p., 2005

3| D Botzer, O Etzion, Self-tuning o f relationships among rule's components in active databases system s, IEEE tran On knowledge and data engineering, V 16, N 3, p 375- 379, 2004

)] K Sagonas, T Swift, D S Warren, X SB as an efficient deductive database engine, Proc O f SIGM OD, p 42- ,1 9

5] M Liu, Deductive database languages : problems and solutions, ACM

computing surveys, V 31, N 1, p 27-59, 1999

5| M Liu, Design and implementation o f the ROL system, Journal o f intelligent information system s, N 14, p 1-21, 2000

7| S Flesca, S Greco, Declarative sem antics for active rules, 27 p., 2003 i| Y Law, H Wang, C Zaniolo, Query languages and data models for

database sequences and data streams, Proc o f the th VLDB conference, 12 p., 2004

(59)(60)

M Ü S

-T ••v ,-™

i P S i l K l l M

S ä v M s

(61)

-T F -T ;

Ì S M ^ Ể Ẻ

M m f æ

M £h¿

Ị^Áýl-:

(62)(63)

TĨM TẮT CÁC CƠNG TRÌNH NCKH CỦA CÁ NHÂN

Ngành : Cơng nghệ thơng tin

Chun ngành : Xử lí liệu tri thức

Họ tên :

Đo Trung Tuấn Năm 2007

Tên báo : Giao diện người dùng cho sở liệu động Hội n g h ị:

Proc of The 2n Asia Pacific International Conference on Information Science and Technology, 2007, Hanoi, p 69-73

Abstract

End-user friendship interactive interface for a deductive database proposes facilities to access to data and knowledge accumulated in bases A lot of kinds of languages allow users to query data in the environment of database, and certain languages allow users to query knowledge after knowledge engineering An active database is for complexity of data and knowledge, with manipulating operation The paper aims at a form oriented interface for active databases, in order to query both data and knowledge

Họ tên :

Đổ Trung Tuấn, Năm 2006

Tên báo : Deductive Model for Active Database Systems Tên Hội thảo : FAIR 07, Nha trang

Tóm tắt

Bài báo nêu khía cạnh động sở liệu, nhàm thiết kế mơ hình sờ liệu suy diễn Một số điều liên quan đến khai phá tri thức, điều kiện toàn vẹn liệu, yếu tổ thời gian cũa dử liệu xét ừong nghiên cứu ứng đụng sở liệu Kiến trúc hệ thống xử lí tri thức sờ liệu với (i) giao diện người dùng; (ii) khai phá tri thức; (iii) tổ chức tri thức sở liệu, trình bày kết nghiên cứu cùa báo

Abstract

(64)

SCIENTIFIC PROJECT

BRANCH: INFORMATION TECHNOLOGY PROJECT CATEGORY: VNU

1 Title

Organizing knowledge simultaneously in clusters of High Performance Computer

2 Code

QT 0708

3 Managing Institution

University of Science

4 Implementing Institution

Faculty of Mathematic Mechanics and Informatics, University of Science

5 Collaborating Institutions 6 Coordinator

■ MA Thuy TranThi ■ MA Binh Do Van

■ Tien DoMinh

■ Ngan DoThiPhuong ■ Dr Tao NguyenVan

■ MA Duyen NguyenThiThanh ■ Nghia LeTrung

7 Key implementors

Tuan DoTrung

8 Duration:

From /2 0 to 4/ 2008

9 Budget

20.000.000 VNd

10 Main results

■ Studying about High Performance Computer systems, University of Science, Vietnam National University, Hanoi;

■ Installing and testing GNU Prolog programs on High Performance Computer;

■ Some test programs in GNU Prolog;

■ Thesis concerning the project content; * Some articles

(65)

PH IÊ U Đ Ă N G K Ý

K Ế T Q U Ả N G H IÊ N cứu K H -C N

Tên để tài

Tổ chức xử lí tri thức đồng thời cụm máy Máy tính hiệu nãng cao

Mã sơ : Q T 0708

Cơ quan chủ trì đề tài:

Khoa Toán Cơ Tin học

Địa chỉ: 332 Nguyễn Trãi, Hà Nội

Tel: (84) (04) 8581530

Cơ quan quản lý đé tài:

Trường Đại học Khoa học Tự nhién

Địa chỉ: 332 Nguyễn Trãi, Hà Nội

Tổng kinh phí thực chi:

Trong đó: - Từ ngân sách Nhà nước: - Kinh phí trường: - Yav tín dụng:

- Vốn tự có: - Thu hồi:

20.000.000 đ

Thời gian nghiên cứu: 12 tháng

Thời gian bắt đầu: 4/2007

Thời gian kết thúc: 4/ 2008 Tên cán phối hơp nghiên cứu:

1 Trần Thị Thúy Đỗ Văn Bình Đỗ Minh Tiến

4 Đỗ Thị Phương Ngân Nguyễn Văn Tảo

6 Nguyễn Thị Thanh Duyên Lê Trung Nghĩa

Số đãng ký đề tài Ngày:

Số chứng nhộn đăng ký kết nghiên cứu:

Bảo mật:

a Phổ biến rộng rãi: Phổ biến b Phổ biến hạn chế:

(66)

Tóm tát kết nghiên cứu:

" Tìm hiêu vê may tmh cụm Trung tâm Tính tốn hiẻu cao Trườnơ Đại học Khoa học Tự nhiên, Đại học Quốc gia Hà Nội;

■ Cai đạt chương tnnh cho phép xư lí tri thức GNTl Prolos trẽn máv tính hiêu nănơJ c cao;

■ Chương trình thừ nghiệm ngơn ngữ Prolog trẽn máv tính hiệu năns cao ; ■ Một số luận văn tốt nghiệp đại học, cao học liên quan đến đề tài;

■ Bài báo khoa học

Kiến nghị quy mô đỏi tượng áp dụng nghiên cứu:

Kêt để tài sử dụng cơng tác đào tạo cơng nghệ thịng tin, chun ngành khoa học máy tính

Họ tên

Học hàm học vị

Kí tên Đóng dấu

C hủ nhiệm đề tài Thù trường quan chủ trì đề tài

Chù tịch Hội đánh giá thức

Thù trường quan quản lý đé tài

ĐỖ Trung Tuấn ĨẦlAM k y Artỉ/

PGS TS G i M i í

t l g i Ắ m e c Y c

'<;• HiN KHíi* hị) [ _í;í;nc

l ’ n g q a ỉ

C A ‘2m a i.

giapha.pl

Ngày đăng: 03/02/2021, 17:05

Xem thêm:

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

w