freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

[工學(xué)]第6章prolog語言-資料下載頁

2024-10-16 18:49本頁面
  

【正文】 (39。last clause39。). 第 6章 PROLOG語言 2021/11/10 58 ? cut_test_c(X,Y), write(XY), nl, fail. one one one two one three no cut抑制了其左邊的子目標(biāo) data(X)與 cut_test_c父目標(biāo)的回溯,而它右邊的目標(biāo)則不受影響。 第 6章 PROLOG語言 2021/11/10 59 PROLOG程序設(shè)計(jì) 這是一個(gè)文字的冒險(xiǎn)游戲 , 你所扮演的角色是一個(gè)三歲的小女孩 , 你想睡覺了 , 可是沒有毛毯 ( nani) 你就不能安心的睡覺 。 所以你必須在那個(gè)大房子中找到你的毛毯 , 這就是你的任務(wù) 。 下面我們正式開始 “ 尋找Nani”游戲的編寫 。 我們從定義基本的事實(shí)開始 , 這些事實(shí)是本游戲的基本的數(shù)據(jù)庫 。 它們包括: 房間和它們的聯(lián)系 物體和它們的位置 物體的屬性 玩家在游戲開始時(shí)的位置 第 6章 PROLOG語言 2021/11/10 60 “尋找 Nani”游戲的的房間格局 第 6章 PROLOG語言 2021/11/10 61 :dynamic here/1. :dynamic location/2. room(office). room(hall). room(39。dining room39。). room(cellar). door(office, hall). door(kitchen, office). door(hall, 39。dining room39。). door(kitchen, cellar). door(39。dining room39。, kitchen). 第 6章 PROLOG語言 2021/11/10 62 location(desk, office). location(apple, kitchen). location(flashlight, desk). location(39。washing machine39。, cellar). location(nani, 39。washing machine39。). location(broccoli, kitchen). location(crackers, kitchen). location(puter, office). location(envelope, desk). location(stamp, envelope). location(key, envelope). location_s(object(candle, red, small, 1), kitchen). location_s(object(apple, red, small, 1), kitchen). location_s(object(apple, green, small, 1), kitchen). location_s(object(table, blue, big, 50), kitchen). 第 6章 PROLOG語言 2021/11/10 63 loc_list([apple, broccoli, crackers], kitchen). loc_list([desk, puter], office). loc_list([flashlight, envelope], desk). loc_list([stamp, key], envelope). loc_list([39。washing machine39。], cellar). loc_list([nani], 39。washing machine39。). 第 6章 PROLOG語言 2021/11/10 64 edible(apple). edible(crackers). tastes_yucky(broccoli). here(kitchen). where_food(X,Y) : location(X,Y), edible(X). list_things(Place) : location(X, Place), tab(2), write(X), nl, fail. list_things(_). 第 6章 PROLOG語言 2021/11/10 65 list_things_s(Place) : location_s(object(Thing, Color, Size, Weight),Place), write(39。A 39。),write(Size),tab(1), write(Color),tab(1), write(Thing), write(39。, weighing 39。), write_weight(Weight), nl, fail. list_things_s(_). 第 6章 PROLOG語言 2021/11/10 66 write_weight(1) : write(39。1 pound39。). write_weight(W) : W 1, write(W), write(39。 pounds39。). connect(X,Y) : door(X,Y). connect(X,Y) : door(Y,X). list_connections(Place) : connect(Place, X), tab(2), write(X), nl, fail. list_connections(_). 第 6章 PROLOG語言 2021/11/10 67 look : here(Place), write(39。You are in the 39。), write(Place), nl, write(39。You can see:39。), nl, list_things(Place), write(39。You can go to:39。), nl, list_connections(Place). 第 6章 PROLOG語言 2021/11/10 68 can_go(Place): here(X), connect(X, Place). can_go(Place): write(39。You can39。39。t get there from here.39。), nl, fail. move(Place): retract(here(X)), asserta(here(Place)). goto(Place): can_go(Place), move(Place), look. 第 6章 PROLOG語言 2021/11/10 69 can_take(Thing) : here(Place), location(Thing, Place). can_take(Thing) : write(39。There is no 39。), write(Thing), write(39。 here.39。), nl, fail. can_take_s(Thing) : here(Room), location_s(object(Thing, _, small, _), Room). can_take_s(Thing) : here(Room), location_s(object(Thing, _, big, _), Room), write(39。The 39。), write(Thing), write(39。 is too big to carry.39。), nl, fail. 第 6章 PROLOG語言 2021/11/10 70 can_take_s(Thing) : here(Room), not(location_s(object(Thing, _, _, _), Room)), write(39。There is no 39。), write(Thing), write(39。 here.39。), nl, fail. take_object(X): retract(location(X,_)), asserta(have(X)), write(39。taken39。), nl. take(X): can_take(X), take_object(X). is_contained_in(T1,T2) : location(T1,T2). is_contained_in(T1,T2) : location(X,T2), is_contained_in(T1,X). 第 6章 PROLOG語言 2021/11/10 71 PROLOG語言與 C語言的連接 PROLOG語言是一種很適合與人工智能應(yīng)用的數(shù)據(jù)可管理的語言。但對與實(shí)際應(yīng)用相關(guān)的一些過程性工作卻很不適合。 可以將 PROLOG語言與其他語言連接起來使用。 如:用 PROLOG語言編寫自然語言的“前端”機(jī),而對過程性的工作處理仍使用 C語言來實(shí)現(xiàn)。 語言條件 外部 C語言子程序 外部謂詞說明 兩個(gè)限制 3參數(shù)傳遞
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1