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

正文內(nèi)容

[工學(xué)]第6章prolog語(yǔ)言-閱讀頁(yè)

2024-10-31 18:49本頁(yè)面
  

【正文】 rry,marry), 該目標(biāo)失敗 , 引起回溯 , 系統(tǒng)重新試圖滿足前一個(gè)子目標(biāo) play(Y,swim),此時(shí) Y被解脫 , (因?yàn)?Y在搜索第三個(gè)目標(biāo)時(shí)失敗的 ) 第 6章 PROLOG語(yǔ)言 2021/11/10 53 (5)這次從知識(shí)庫(kù)標(biāo)記處開(kāi)始搜索 , 在知識(shí)庫(kù)中找不到與之匹配的事實(shí) , 所以 play(Y,swim)失敗 , 試圖重新滿足第一個(gè)子目標(biāo) play(marry,Z), Z被解脫 (6)從知識(shí)庫(kù)中開(kāi)始搜索 , 該子目標(biāo)與第二個(gè)事實(shí)匹配 , Z被例化為 tennis。 (9) 規(guī)則體中所有子目標(biāo)都成功 , 所以本規(guī)則成功 , 因?yàn)閱?wèn)題中的 X和規(guī)則中的 Y共享 , 所以 X也被例化為 john, 所以系統(tǒng)給出答案 X=john 第 6章 PROLOG語(yǔ)言 2021/11/10 54 謂詞!的討論 截?cái)嘀^詞的語(yǔ)法格式很簡(jiǎn)單 , 就是一個(gè)感嘆號(hào) “ !”。 例 :下面我們將舉個(gè)簡(jiǎn)單的例子來(lái)說(shuō)明 cut的作用 。last clause39。 ? cut_test_a(X), write(X), nl, fail. one two three last clause no 第 6章 PROLOG語(yǔ)言 2021/11/10 57 2)我們?cè)賮?lái)看看使用了 cut之后的情況。last clause39。 3)下面我們看看把 cut放到兩個(gè)子目標(biāo)中的情況。last clause39。 第 6章 PROLOG語(yǔ)言 2021/11/10 59 PROLOG程序設(shè)計(jì) 這是一個(gè)文字的冒險(xiǎn)游戲 , 你所扮演的角色是一個(gè)三歲的小女孩 , 你想睡覺(jué)了 , 可是沒(méi)有毛毯 ( nani) 你就不能安心的睡覺(jué) 。 下面我們正式開(kāi)始 “ 尋找Nani”游戲的編寫 。 它們包括: 房間和它們的聯(lián)系 物體和它們的位置 物體的屬性 玩家在游戲開(kāi)始時(shí)的位置 第 6章 PROLOG語(yǔ)言 2021/11/10 60 “尋找 Nani”游戲的的房間格局 第 6章 PROLOG語(yǔ)言 2021/11/10 61 :dynamic here/1. :dynamic location/2. room(office). room(hall). room(39。). room(cellar). door(office, hall). door(kitchen, office). door(hall, 39。). door(kitchen, cellar). door(39。, kitchen). 第 6章 PROLOG語(yǔ)言 2021/11/10 62 location(desk, office). location(apple, kitchen). location(flashlight, desk). location(39。, cellar). location(nani, 39。). 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語(yǔ)言 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。], cellar). loc_list([nani], 39。). 第 6章 PROLOG語(yǔ)言 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語(yǔ)言 2021/11/10 65 list_things_s(Place) : location_s(object(Thing, Color, Size, Weight),Place), write(39。),write(Size),tab(1), write(Color),tab(1), write(Thing), write(39。), write_weight(Weight), nl, fail. list_things_s(_). 第 6章 PROLOG語(yǔ)言 2021/11/10 66 write_weight(1) : write(39。). write_weight(W) : W 1, write(W), write(39。). 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語(yǔ)言 2021/11/10 67 look : here(Place), write(39。), write(Place), nl, write(39。), nl, list_things(Place), write(39。), nl, list_connections(Place). 第 6章 PROLOG語(yǔ)言 2021/11/10 68 can_go(Place): here(X), connect(X, Place). can_go(Place): write(39。39。), nl, fail. move(Place): retract(here(X)), asserta(here(Place)). goto(Place): can_go(Place), move(Place), look. 第 6章 PROLOG語(yǔ)言 2021/11/10 69 can_take(Thing) : here(Place), location(Thing, Place). can_take(Thing) : write(39。), write(Thing), write(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。), write(Thing), write(39。), nl, fail. 第 6章 PROLOG語(yǔ)言 2021/11/10 70 can_take_s(Thing) : here(Room), not(location_s(object(Thing, _, _, _), Room)), write(39。), write(Thing), write(39。), nl, fail. take_object(X): retract(location(X,_)), asserta(have(X)), write(39。), 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語(yǔ)言 2021/11/10 71 PROLOG語(yǔ)言與 C語(yǔ)言的連接 PROLOG語(yǔ)言是一種很適合與人工智能應(yīng)用的數(shù)據(jù)可管理的語(yǔ)言。 可以將 PROLOG語(yǔ)言與其他語(yǔ)言連接起來(lái)使用。 語(yǔ)言條件 外部 C語(yǔ)言子程序 外部謂詞說(shuō)明 兩個(gè)限制 3參數(shù)傳遞
點(diǎn)擊復(fù)制文檔內(nèi)容
教學(xué)課件相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1