CSC 8310, First Quiz
David Matuszek, Spring 2001
  Name ____________________________________

 

  1. True or False (Prolog):

    1. _____ There is no syntactic difference between a fact and a query.

    2. _____ A cut is used to prevent backtracking.

    3. _____ Prolog uses monotonic logic.

    4. The following unifications will succeed:

      1. _____ weather(Today) = weather(Yesterday)

      2. _____ [a, b, c] = [A, B | C]

      3. _____ mother(mary, father(john)) = mother(X, father(X))

      4. _____ loves(john, mary) = loves(_, _)

      5. _____ 2 + 2 = 4

  2. Short answer (Prolog):

    1. Each Prolog structure has four ports. Their names are _____call______, _______________, _______________,  and _______________.

    2. The symbol :- is called a(n) _______________.

    3. To force an entire predicate (not just one clause) to fail, use _______________.

    4. __________ is one example of an operation that is not undone by backtracking.

    5. Prolog programs should usually have the extension ._______.

  3. General

    1. Syntax can be precisely defined with a language called _______________.

    2. The most important second-generation language was _______________.

    3. Fortran was successful primarily because it was very _______________.

    4. The most efficient way to pass parameters is by _______________.

    5. When you talk about whether a programming language is suitable for a particular problem, you are talking about its _______________.