Re: CYK & Context-Free Expressions
- From: Rock Brentwood <markwh04@xxxxxxxxx>
- Date: Thu, 1 May 2008 16:48:18 -0700 (PDT)
On Apr 28, 12:58 pm, Tegiri Nenashi <TegiriNena...@xxxxxxxxx> wrote:
I fail to inderstand the significance of Earley algorithm. Before
going to Earley, however, let's stop at the CYK method for a moment.
Consider Fernando Pereira perspecive "Parsing as Deduction". Every
nonterminal S becomes a binary predicate S(x,y) written informally as
a statement: "The nonterminal S is valid at semiopen interval starting
at x and ended at y". Then, there is predicate join: S(x,y) & Q(y,z) -
For each grammar a kind of universal CYK grammar formed along these
lines. If you think in terms of matrices then for each rule
q -> z1 z2 ... zn
and each i0 <= i1 <= ... <= in, one has a set of rules
q(i0,in) -> z1(i0,i1) z2(i1,i2) ... zn(i_{n-1} in).
For each terminal x, and each i, one has
x(i,i+1) -> x.
When including an output alphabet Y then for each y in Y, one also has
the rule
y(i,i) -> y.
The CYK algorithm, itself, is then a method of winnowing down the
minimal subset of these rules that processes a given input. One finds
all the A(i,i+D) for D = 0 and for all terminals and non-terminals A;
then the same for D = 1, then for D = 2.
The result is, itself, a grammar. Its complexity is O(n^{k+1}).
Now, what is the Earley method?
I'll post a description of this. There is one on the Wikipedia
already, but not as good or clear as I think ought to be.
These constructs (forests,"node packing", etc) are too awkward to
genuinely believe for them to be the answer...
That's also why I long ago moved away from all the tree-based methods
toward something more algebraic. Context-free expressions are much
easier to work with and less awkward. One sees already the algebraic
imprint in the REX utility and related regular expression software (in
the comp.compilers archive) ... which has (by the way) found
application or translation in various settings like Perl, Prolog, XML,
etc.
BTW, speaking of trees, what is algebraic definition of tree
structure?
A tree is an element of a free magma.
A magma is an algebra consising of a signature subject to no axioms.
It's the same thing as a pure signature. The archetypical example is
the magma whose only operation is binary. Its elements are then, in
effect, binary trees.
A more interesting case arises when one starts to consider magmas that
are not free, e.g. commutative magmas, or magmas that possess
solutions to fixed point systems.
.
- Follow-Ups:
- Re: CYK & Context-Free Expressions
- From: Tegiri Nenashi
- Re: CYK & Context-Free Expressions
- Prev by Date: Re: CYK & Context-Free Expressions
- Next by Date: Re: CYK & Context-Free Expressions
- Previous by thread: Re: CYK & Context-Free Expressions
- Next by thread: Re: CYK & Context-Free Expressions
- Index(es):
Relevant Pages
|