Re: Parsing Context-sensitive languages with Prolog



Alessandro wrote:
I know that DCG rules aren't context-sensitive rules. I don't know a practical parser that allows you to specify a context-sensitive grammar.

Maybe you should have a look at the CHR grammars formalism of Henning Christiansen (available at http://akira.ruc.dk/~henning/chrg/). It is implemented for SICStus 3, but shouldn't be to difficult to port to other Prolog+CHR systems. From the abstract of the journal paper (published version available at http://arxiv.org/abs/cs/0408027v1):

"The formalism extends previous logic programming based grammars with a form of context-sensitive rules and the possibility to include extra-grammatical hypotheses in both head and body of grammar rules."

Cheers,
Peter
begin:vcard
fn:Peter Van Weert
n:Van Weert;Peter
org:K.U.Leuven;Computer Science
adr:room 01.08;;Celestijnenlaan 200A;Heverlee;;3001;Belgium
email;internet:Peter.VanWeert@xxxxxxxxxxxxxx
title:DTAI (Declarative Languages and Artificial Intelligence)
tel;work:+ 32 16 327064
x-mozilla-html:TRUE
url:http://www.cs.kuleuven.be/~petervw/
version:2.1
end:vcard