aig-upf / fs-private

This is the private version of the FS planner repository
GNU General Public License v3.0
5 stars 1 forks source link

ANTLR Grammar #119

Closed gfrances closed 6 years ago

gfrances commented 6 years ago

Quick question, @miquelramirez : how does the FS+ parser deal with case-insensivity? i.e. does it accept a PDDL instance where the initial state is specified with :INIT instead of :init? (relevant part of the grammar here). Just ran into this while porting the grammar to Tarski... I have found ways of doing this, none too enticing, but just though that if it was already working in FS+... then I must have ported something wrong...

miquelramirez commented 6 years ago

The grammar I used to implement the parser is that of Kovac's

https://helios.hud.ac.uk/scommv/IPC-14/repository/kovacs-pddl-3.1-2011.pdf

who clearly states that built-ins like :init are lowercase terminals - and not re like [Ii][Nn][Ii][Tt]. That is in line with every formal specification of PDDL since 1998. Note that identifiers can use any kind of lower and upper case combination.

Another entirely different matter is that there's a huge number of benchmarks out there that just shove this detail somewhere the sun doesn't shine...

miquelramirez commented 6 years ago

On the other hand, I just realised that the code of the AST constructor is converting terminals to lower case programmatically... this is very odd, and I can't recall why I did that way. So my guess is that I was copying & pasting someone's else code in the first place... I have ammended fs_task_loader.py in aig-upf/fs-private accordingly.

gfrances commented 6 years ago

Oh you're completely right - I was trying to address that because some blocksworld encoding was failing because of an INIT, but we should try to adhere to the "official" spec. The "official" spec however... it is completely beyond me why you would want to label a formula with pre-GD... instead of formula :-) Not sure if it might be worth realigning the grammar "nomenclature" with that of FSTRIPS, though...

miquelramirez commented 6 years ago

The "official" spec however... it is completely beyond me why you would want to label a formula with pre-GD... instead of formula :-) Not sure if it might be worth realigning the grammar "nomenclature" with that of FSTRIPS, though...

That's because of "historical" reasons... McDermott referred to preconditions formulas as "precondition / goal descriptions", which became "pre-GD". I didn't want to deviate too much from the "tradition" but we could totally rename the symbols to something nicer.

Note that the callbacks for the parsing events are not coupled to the name of the non terminal in general... that was a massive pain in the ass using Bison et al.