You are on page 1of 2

Justin Jee

11/19/13
Logic Project 1 Trace
?- assert(eat(cow(X),grass)).
true.
?- assert(cow(hubert)).
true.
?- eat(hubert,grass).
false.
?- eat(cow(hubert),grass).
true.
?- assert(cloudy(X):-rainyday(X)).
true.
?- assert(cloudy(tuesday)).
true.
?- assert(rainyday(wednesday)).
true.
?- rainyday(wednesday).
true.
?- cloudy(wednesday).
true.
?- assert(delicious(X):-salty(x);spicy(x)).
true.
?- assert(salty(peanuts)).
true.
?- salty(peanuts).
true.
?- delicious(peanuts).
ERROR: delicious/1: Undefined procedure: spicy/1
Exception: (7) spicy(x) ? creep
Exception: (6) delicious(peanuts) ? creep
?- assert(spicy(\+ peanuts)).
true.
?- spicy(peanuts).
false.
?- delicious(peanuts).
true .
?- assert(isduck(X):-(walkslikeduck(X),talkslikeduck(X))).
true.
?- assert(walkslikeduck(bob)).
true.
?- assert(talkslikeduck(bob)).
true.
?- assert(talkslikeduck(\+ jane)).
true.
?- assert(walkslikeduck(\+ jane)).
true.
?- isduck(jane).
false.
?- isduck(bob).
true.
?- assert(mammal(X):-cat(X)).
true.
?- assert(cat(kara)).
true.
?- mammal(kara).
true.
?- mammal(X).
X = kara.
?- assert(isprogramminglanguage(lisp)).
true.
?- assert(isprogramminglanguage(prolog)).
true.
?- isprogramminglanguage(lisp).
true.
?- isprogramminglanguage(python).
false.
?- assert(istall(nbaplayer(X))).
true.
?- istall(nbaplayer(shaq)).
true.
?- assert(isbat(X):-(canfly(X),ismammal(X))).
true.

You might also like