Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Parser for PDDL in Prolog/ECLiPSe

208 views
Skip to first unread message

Ulrich Scholz

unread,
Jan 27, 2009, 11:33:58 AM1/27/09
to
Hi everybody,

I plan to write a parser for PDDL (Planning Domain Description
Language) in Prolog. As a description, I have a BNF and an ANTLR
input.

Currently, I know only little on how to write a parser in Prolog. I
had some
lectures back in university but we used C. Maybe of best help would
be an
existing parser that I can modify or a "cookbook". The Prolog dialect
I use is ECLiPSe.

Thanks,

Ulrich

BNF PDDL 3.0: http://www.cs.yale.edu/homes/dvm/papers/pddl-bnf.pdf
PDDL grammar for ANTLR v3: http://www.antlr.org/grammar/1172246598728/Pddl.g

fsaenzperez

unread,
Jan 28, 2009, 4:09:11 AM1/28/09
to
Dear Ulrich,
You can find a parser of SQL along with its BNF grammar in the file
dessql.pl at des.sourceforge.net. I think you can easily modify it to
meet your requirements. It tries to follow ISO Prolog whenever
possible.
Best regards,
Fernando Sáenz

moya....@gmail.com

unread,
Mar 9, 2009, 8:41:31 PM3/9/09
to
On 27 ene, 14:33, Ulrich Scholz <d...@thispla.net> wrote:
> Hi everybody,
>
> I plan to write a parser for PDDL (Planning Domain Description
> Language) in Prolog.  As a description, I have a BNF and an ANTLR
> input.

Hi Ulrich, I am trying the same like you. May be we could try to join
efforts in that task...

>
> Currently, I know only little on how to write a parser in Prolog.  I

I have writen a minimalist DCG [http://en.wikipedia.org/wiki/
Definite_clause_grammar] to parse a PDDL domain description file, but
this implies too many efforts, and too many time lost debuguing the
program.

Another option is to discard the first one :S , and try some antlr
approach. I think this could be more simpler than DCG aproach, but
implies to learn antlr (i'm currently studying this one).

> had some
> lectures back in university but we used C.  Maybe of best help would
> be an
> existing parser that I can modify or a "cookbook". The Prolog dialect
> I use is ECLiPSe.

I'm usind Ciao Prolog.

Ulrich Neumerkel

unread,
Mar 10, 2009, 12:35:21 PM3/10/09
to
moya....@gmail.com writes:
>I have writen a minimalist DCG [http://en.wikipedia.org/wiki/
>Definite_clause_grammar] to parse a PDDL domain description file, but
>this implies too many efforts, and too many time lost debuguing the
>program.

In case you stick to writing a DCG for parsing, you can use
the DCG directly for reading from a file.

In SWI-Prolog:

:- use_module(library(pio)).

... --> [] | [_], ... .

nt -->
( "a" | "b" ),
... .


?- phrase_from_file(nt, filex).


This succeeds if filex starts with an a or b.

fodor...@gmail.com

unread,
Mar 26, 2009, 6:56:46 PM3/26/09
to
I am curious if anyone (Ulrich) implemented yet a minimal parser. I
also have a planner in Prolog, but I never compared it with state of
the art planners. I am also trying to write a minimal PDDL parser, but
don't have a working version yet.

0 new messages