dodaro / cnl2asp

A tool for converting CNL sentences to ASP rules.
https://dodaro.github.io/cnl2asp/
Apache License 2.0
1 stars 0 forks source link

Possible bug with set membership and complex entities? #21

Open GregGelfond opened 1 month ago

GregGelfond commented 1 month ago

Consider the following declarations:

row goes from 1 to 9.
column goes from 1 to 9.
grid_square goes from 1 to 9.

A cell is identified by a row, and by a column.

There is a cell with row equal to 1, and with column equal to 1.

Grid_Square 1 is a set.

If I add the following:

Grid_Square 1 contains the cell with row equal to 1, and with column equal to 1.

I get the following compile error:

Error trying to process rule "simple_entity":

Compilation error at line 11:
    Entity "the" not declared before its usage.

I can kind of understand why this would be the case, since the cell is defined as predicate symbol of ASP cell(1,1), but my intuition suggests that the new line ought to compile to:

contains(1, cell(1,1)) :- grid_square(1), cell(1,1).

or something similar.

GregGelfond commented 1 month ago

Part of the intuition is that while the cell is not explicitly named in the CNL by a unique identifier, it is referenced using a definite article and all of its respective attributes are full specified. So the phrase the cell with row equal to 1, and with column equal to 1, naturally translates to cell(1,1) which ought to also be the function symbol/term that uniquely references the cell.

I hope that's clear.

simocaruso commented 4 weeks ago

Currently, "sets contains" only supports strings (refer to #19)