Easy Knowledge Base:
Studies[Sally, Math]
Likes[x, ComputerScience] IF Knows[x, Programming] 
Knows[Mary, Programming]
Queries/Answers
a) Studies[Sally, Math] 
Yes  Because Studies[Sally, Math]

b) Studies[z, Math] 
{z/Sally)  Because Studies[Sally, Math]
 
c) Studies[Sally, y] Because Studies[Sally, Math]

d) Likes[w, ComputerScience]
{w/ Mary} 
Because Likes[x, ComputerScience] IF Knows[x, Programming]
and Knows[Mary, Programming]
________________________________________________________________________________
Average Knowledge Base:
HighSchooler[p] IF Student[p] AND Teenager[p] 
Teenager[p] IF Younger[p, Twenty] AND Older[p, Twelve] 
Younger[p, Twenty] IF Age[p, Fifteen] 
Older[p, Twelve] IF Age[p, Fifteen] 
Age[Susan, Fifteen] 
Student[Susan] 
Age[Tom, Thirteen]

Queries/Answers
a) Age[Tom,Fifteen] No 

b) Younger[Tom,Twenty] No 
 
c) Teenager[Tom] No 
 
d) Teenager[Susan] Yes 
Because Teenager[p] IF Younger[p, Twenty] AND Older[p, Twelve] 
and Younger[p, Twenty] IF Age[p, Fifteen] 
and Older[p, Twelve] IF Age[p, Fifteen] 
and Age[Susan, Fifteen] 

e) High Schooler[z] 
{z/Susan} 
Because HighSchooler[z] IF Student[z] AND Teenager[z] 
and Student[Susan] 
and Teenager[Susan] 
_________________________________________________________________________________
Hard Knowledge Base:
Studies[x, SocialScience] IF Isa[y, SocialScience] AND Subject[Major[x], y]
Likes[x, ComputerScience] IF Likes[x, Programming] AND Likes[x, Math]
Likes[x, ComputerScience] IF Likes[x, Programming] AND Plays[x, ComputerGames]
Likes[Sally, Math]
Likes[Steve, Math]
Likes[Mary, Programming]
Likes[Steve, Programming]
Likes[Lisa, Programming]
Plays[Lisa, ComputerGames]
Subject[Major[Tom], History]
Subject[Major[Karen], Polisci]
Isa[History, SocialScience]
Isa[Polisci, SocialScience]

Queries/Answers
a) Likes[p, Programming] 
{{p/Steve}
 {p/Lisa} 
 {p/Mary} }

b) Likes[p, Computer Science] 
{{p/ Steve} 
because Likes[Steve, Programming] and Likes[Steve, Math]
 {p/ Lisa} 
because Likes(Lisa, Programming] and Plays[Lisa, ComputerGames]}

c) Studies[s, Social Science]
{{s/ Tom} 
because Isa[History, SocialScience] and Subject[Major[Tom], History]
 {s/ Karen} 
because Isa[Polisci, SocialScience] and Subject[Major[Tom], Polisci]}
________________________________________________________________________________
Very Hard Knowledge Base:
Instance[B1, Cube]
Color[B1, Red]
Instance[B2, Brick]
Color[B2, Blue]
Instance[B3, Sphere]
Color[B3, Green]
Isa[Cube, Brick]
Isa[Brick, Block]
Isa[Sphere, Block]
On[B2, Table]
On[B1, B2]
On[B3, B1]
Instance[a, Block] IF Isa[z, Block] AND Instance[a, z]
Above[x, y] IF On[x, y]
Above[x, y] IF On[x, z] AND Above[z, y]

Queries/Answers:
a) Color[b, c] 
{{b/B1, c/Red} 
 {b/B2, c/Blue} 
 {b/B3, c/Green}}
 
b) Instance[B3, Block] 
Yes. 
Because Instance[a, Block] IF Isa[z, Block] AND Instance[a, z]
and Isa[Sphere, Block] 
and Instance[B3, Sphere] 
c) Instance[B1,Block] No 

d) On[z, Table] {z/B2}}

e) Above[z, Table] 
{z/B2} {z/B1} {z/B3}}

f) Above[x, y]
{{x/B2, y/Table}
 {x/B1, y/B2} 
 {x/B3, y/B1} 
 {x/B1, y/Table} 
 {x/B3, y/B2}
 {x/B3, y,Table}
}