General
Lab Material
Lab 1
Lab 2
Lab 3
Lab 4
Lab 5
Lab 6

Play with a top down recognizer

It is easy to turn this recognizer into a parser --- and (unlike with bottomup_recognizer.pl ) it's actually worth doing this, because it is efficient on small grammars. As is so often the case in Prolog, moving from a recognizer to a parser is simply a matter of adding additional arguments to record the structure we find along the way.

Here's code. The ideas involved should be familiar by now. Read what is going on in the fourth argument position declaratively. Make sure you thoroughly understand how it works.

Test it with the ourEng.pl. You will find examples to cut-and-paste in here.

Back to lab 2.