11.5 Quiz: Rules

Question:

Is the following clause well-formed?

student(name(Lisa)).

Choose an answer:
Yes.
No.

Hints at: 11.2 Terminology.

Question:

Is the following clause well-formed?

same_name(S, A, B) :- student(A, S), student(B, S).

Choose an answer:
Yes.
No.

Hints at: 11.2 Terminology.

Question:

Is the following clause well-formed:

same_semester(A, B, S) :- student(A, S), student(B, S)

Choose an answer:
Yes.
No.

Hints at: 11.2 Terminology.

Question:

Is the following clause well-formed:

students_in_semester(S, N) -: student(N, S).

Choose an answer:
Yes.
No.

Hints at: 11.2 Terminology.

Question:

Is the following clause well-formed:

student(name(Lisa), semester(5))

Choose an answer:
Yes.
No.

Hints at: 11.2 Terminology.


PrevLite: 11.3 Variable scoping rule
NextLite: Part II: CGs

Prev: 11.4 Returning values from rules (Ad)
Up: 11 Rules
Next: 12 Prolog's solution strategy (Ad)