8.6 Quiz: Terms

It is time for our first quiz. The quiz is multiple-choice. Select the answers you think are right, and click "Check answers" below.

Question:

Is a structure a kind of term?

Choose an answer:
Yes.
No.

Hints at: 8 Terms.

Question:

Which of the following is a string:

Choose an answer:
47
string
"string"
(string)

Hints at: 8.3 String constants.

Question:

Can double quotes be included in a string?

Choose an answer:
Yes.
No.

Hints at: 8.3 String constants.

Question:

Which of the following is not a structure (i.e., does not conform to the syntax of structures).

Choose an answer:
Albert
birthdate(Albert, 14, March, 1879
birthdate(Alfred, 15, February, 1861)
foo(bar)

Hints at: 1.1 Downloading and installing the Prolog+CG environment.

Question:

Which of the following is not a numeric constant (i.e., does not conform to the syntax of numeric constants)?

Choose an answer:
47
87
3,14
3.14

Hints at: 8.5 Numeric constants (Ad).

Question:

What is the correct definition of an identifier?

Choose an answer:
A sequence of letters, digits, and underscores (_), where the first two are letters.
A sequence of letters and digits, where the first two are letters.
A sequence of letters, digits, and underscores (_).

Hints at: 8.4 Atomic constants.

Question:

What is a functor?

Choose an answer:
A sequence of letters and digits.
An identifier which is the name of a structure.

Hints at: 8.2 Structures, 8.4 Atomic constants.

Question:

What is the arity of a structure?

Choose an answer:
The number of letters, digits, and underscores in the functor.
The number of arguments it takes.

Hints at: 8.2 Structures.


PrevLite: 8.4 Atomic constants
NextLite: 9 A simple Prolog program

Prev: 8.5 Numeric constants (Ad)
Up: 8 Terms
Next: 9 A simple Prolog program