level 1
predicates
nondeterm likes(symbol,symbol)
nondeterm fruit(symbol)
nondeterm color(symbol,symbol)
clauses
fruit(pears).
fruit(apples).
color(pears,yellow).
color(oranges,orange).
color(apples,yellow).
color(apples,red).
likes(bill,pears).
likes(bill,popcorn).
likes(bill,apples).
likes(tom,X):-likes(bill,X),fruit(X),color(X,red).
likes(tom,X):-likes(bill,X),X=popcorn.
goal
likes(tom,Who).
2011年08月11日 08点08分
1
nondeterm likes(symbol,symbol)
nondeterm fruit(symbol)
nondeterm color(symbol,symbol)
clauses
fruit(pears).
fruit(apples).
color(pears,yellow).
color(oranges,orange).
color(apples,yellow).
color(apples,red).
likes(bill,pears).
likes(bill,popcorn).
likes(bill,apples).
likes(tom,X):-likes(bill,X),fruit(X),color(X,red).
likes(tom,X):-likes(bill,X),X=popcorn.
goal
likes(tom,Who).