CSCI 587 - Lecture 8 Grammars and Parsing
- Prolog Introduction
- Programming using predicate logic clauses
- Adding facts to the DataBase (assert)
- Goals:
- Rules: john likes anyone that likes sports and pizza
- Family example
- Recursive rules: ancestor
- Lists in prolog: Notation [ F | R ]
- Trees in list notation
- Lisp (a ((b c) (d e) f))
- Prolog [a ,[[b, c], [d, e], f]
- Grammars
- Context Free Grammars(CFGs)
- Formal definition
- G = (N, T, P, S)
- Derivations
- L(G) - the language generated by G
- Parse Trees
- Lexical symbols
- The Sentence Generation problem
- Parsing
- Good Grammars
- generality - the range of sentences analyzed correctly
- selectivity - the range of sentences analyzed as wrong
- understandability
- Parsing
- Top Down Parsing
- Bottom up Parsing
- Top Down Parsing Algorithm
- Initialize the Possible State List to contain ((S) 1)
- Then Repeat the following steps
- Set C = first state on the List
- If C = (() end of sentence) then the algorithm succeeds
- Else generate next states by
- Matching a lexical symbol with the next word of the sentence
- Applying each applicable rule and add to the possibilities list
- The Algorithm Fails by ...
- Tracing Top Down Parses
- The Chomsky Hierarchy Box 3.1
- regular grammars
- context sensitive
- unrestricted
- Readings
- Sections 3.1 - 3.3
- Prolog examples in /class/csci587/Prolog : family, nlp, nlp2
URL = http://sourgum.cs.sc.edu/~matthews/Courses/587/Lectures/lecture8.html