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

Tuple Support? #16

Closed GregGelfond closed 1 month ago

GregGelfond commented 1 month ago

In ASP I can declare tuples like the following:

row(1..9).
column(1..9).

cell( (R,C) ) :- row(R), column(C).

This then allows me to treat cells as first class objects when declaring subsequent predicates:

value(1..9).

% Exactly 1 value is assigned to every cell.
1{ assigned(C,V) : value(V) }1 :- cell(C).

Is there a way to do something similar in CNL? Or is the approach to use entities with id like this:

A cell is identified by an id and has a row and a column.
simocaruso commented 1 month ago

No, tuples are currently not supported but it might be an idea for future updates.

This is a possible encoding:

A row is identified by an id.
A column is identified by an id.

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

Every cell can be assigned to exactly 1 value.