Lists for parse trees


next up previous contents
Next: Lists for graphs
Up: Introduction to Prolog for Mathematicians
Previous: Uses of lists

Lists for parse trees

In linguistics, lists can represent parse trees:

[ sentence,
    [ noun_phrase,
      [ determiner,
        [the]
      ],
      [ noun,
        [dog]
      ]
    ],
    [ verb_phrase,
      [ verb,
        [hates]
      ]
    ],
    [ noun_phrase,
      [ noun,
        [cats]
      ]
    ]
]
We can use the same representation when parsing formal languages, such as programming languages.



Jocelyn Ireson-Ireson-Paine
Mon Jul 17 22:27:41 BST 1995