Knowledgebases
The food/color/like facts are here;
the thing facts are here.
Exercises
- Hiding the on-slide answers from yourself, do the queries on slides 38-39, 42-43
- Using the food/color/like facts, do these queries:
- Who likes carrots?
- Who likes baseball and a food?
- Who likes baseball and a red food?
- Who likes somebody who likes baseball?
- Create and solve two more queries.
- Using the thing facts, do these queries:
- What are the colors of non-foods?
- What are colors that are a color of both a food and a non-food?
- Create and solve one more query.
- Add a collection of two-term facts to your eca1 facts and then create and solve five multiple-goal queries.
(If you missed Monday's lecture, see slide 13 for eca1.)
- Using only the little bit of unification we've seen, predict the results of the following queries:
- ?- A = B, C = 10, C = B, write(A).
- ?- write(A), A=999, write(A).
- ?- A=1, B=2, C=A, write(C), write(C=B).
- ?- Z=A+B, X=Y, Y=x(A,B), X=x(10,20).
- Devise and try two unification experiments.
- These are getting ahead of ourselves a little bit but see what you make of these:
- Try the query ?- write("testing").
- Try the query ?- display([one,two,three]).