9.8 Quiz: A simple Prolog program

Question:

What is a fact?

Choose an answer:
A term followed by a period.
A term.
A structure followed by a period.

Hints at: 9.1 Facts and the program database.

Question:

Can the term in a fact be a variable?

Choose an answer:
Yes.
No.

Hints at: 9.1 Facts and the program database.

Question:

Which of the following is not a query? (I.e., which of the following does not conform to the syntax of queries?)

Choose an answer:
?- student(Lisa, 5).
?- student(Lisa, X), student(Abraham, X).
?- student(Abraham, X)

Hints at: 9.2 Queries, 9.5 Variables.

Question:

Can a query be made up of more than one subgoal?

Choose an answer:
Yes.
No.

Hints at: 9.3 Goals and subgoals.

Question:

Which of the following is not a variable? (I.e., does not conform to the syntax of variables?)

Choose an answer:
glyph
_glyph
g_lobal
c_3
c3

Hints at: 9.5 Variables.

Question:

What is a free variable?

Choose an answer:
A variable which has not been given a value.
A variable which has been given a value.

Hints at: 9.5 Variables.

Question:

What is a bound variable?

Choose an answer:
A variable which has not been given a value.
A variable which has been given a value.

Hints at: 9.5 Variables.

Question:

Can you have structures within structures?

Choose an answer:
Yes.
No.

Hints at: 9.6 Structures within structures (Ad).


PrevLite: 9.7 Summary
NextLite: 10 Matching

Prev: 9.7 Summary
Up: 9 A simple Prolog program
Next: 10 Matching