請問Lern Proglog Now!網站中的Exercise 2.2 (我還沒辦法貼網址)
Exercise 2.2 We are working with the following knowledge base:
house_elf(dobby).
witch(hermione).
witch(’McGonagall’).
witch(rita_skeeter).
magic(X):- house_elf(X).
magic(X):- wizard(X).
magic(X):- witch(X).
Which of the following queries are satisfied? Where relevant, give all the variable instantiations that lead to success.
?- magic(house_elf).
?- wizard(harry).
?- magic(wizard).
?- magic(’McGonagall’).
?- magic(Hermione).
Draw the search tree for the query magic(Hermione) .
請問第五題magic(Hermione)答案是只有dobby嗎?(用SWI-Prolog跑出來是這樣)
可是我按照他畫的樹狀圖不是應該還有hermione, 'McGonagall',和rita_skeeter嗎??
Exercise 2.2 We are working with the following knowledge base:
house_elf(dobby).
witch(hermione).
witch(’McGonagall’).
witch(rita_skeeter).
magic(X):- house_elf(X).
magic(X):- wizard(X).
magic(X):- witch(X).
Which of the following queries are satisfied? Where relevant, give all the variable instantiations that lead to success.
?- magic(house_elf).
?- wizard(harry).
?- magic(wizard).
?- magic(’McGonagall’).
?- magic(Hermione).
Draw the search tree for the query magic(Hermione) .
請問第五題magic(Hermione)答案是只有dobby嗎?(用SWI-Prolog跑出來是這樣)
可是我按照他畫的樹狀圖不是應該還有hermione, 'McGonagall',和rita_skeeter嗎??