|
Lecture 12: Definite Clause Grammar
Context-Free Grammar (CFG) is introduced as a way of writing rules
about structured knowledge. Definite Clause Grammar (DCG) is
Prolog's in-built notation for writing CFGs.
- Writing DCGs is introduced showing:
- the basic framework;
- embedding calls to "ordinary" Prolog;
- building structures.
- DCGs suffer from problems with left-recursive rules
- DCGs are a general programming tool with applications
beyond natural language parsing, for instance in lexical
scanning and support tool writing for programming
languages.
|
|
How to prepare
|
|
|
Revise your knowledge of propositional calculus,
perhaps by using Dr Lee's notes:
|
|
|
|
|
Slides
|
|
|
If you really want the slides from the lecture ...
but don't forget printing the slides is not the same as understanding them.
|
|
|
|
|
Programs from the lecture
|
|
|
|
|
|
Individual study suggestions and further reading
|
|
|
Good introductions to DCG are:
|
|
|
|