8.7 Exercises

  1. Using the ourEng.pl grammar, give a detailed top-down depth-first analysis of Marsellus knew Vincent loved Mia. That is, start with:

    and then show all the steps of your work, including the backtracking.

  2. Using the ourEng.pl grammar, give a detailed top-down breadth-first analysis of Marsellus knew Vincent loved Mia. That is, start with:

    and then show all the steps of your work.

  3. Can topdown_recognizer.pl and topdown_parser.pl handle the following grammar?

    s ---> [left,right].
    left ---> [left,x].
    left ---> [x].
    right ---> [right,y].
    right ---> [y].
     
    lex(a,x).
    lex(b,y).

    If you are not sure try it. Why does it not work? How can it be fixed?

  4. In terms of bottom us vs. top down and depth-first vs. breadth-first, what parsing strategy is used by Prolog's built in DCG mechanisms? If you are not sure, write a DCG corresponding to ourEng.pl and trace through an example comparing what happens to the different strategies that you have seen in the last two chapters.


Patrick Blackburn and Kristina Striegnitz
Version 1.2.4 (20020829)