Skip to content

Feature Request: Add support for #show directives. #14

@GregGelfond

Description

@GregGelfond

Consider the following solution to N-Queens written in CNL:

number_of_queens is a constant equal to 8.

Row goes from 1 to number_of_queens.
Column goes from 1 to number_of_queens.

Every row can have a queen_at exactly 1 column.
Every column can have a queen_at exactly 1 row.

It is prohibited that
    row R1 has a queen_at column C1 and also
    row R2 has a queen_at column C2 where
    R1 is less than R2 and
    R1 - C1 is equal to R2 - C2.

It is prohibited that
    row R1 has a queen_at column C1 and also
    row R2 has a queen_at column C2 where
    R1 is less than R2 and
    R1 + C1 is equal to R2 + C2.

The only predicate whose output I am interested in seeing is queen_at/2. It would be very useful if I could add the corresponding #show directive directly in the CNL as some sort of inline asp/assembly or directive/pragma. This could be done potentially through a special comment that adorns the rule, for example:

// #show predicate
It is prohibited that
    row R1 has a queen_at column C1 and also
    row R2 has a queen_at column C2 where
    R1 is less than R2 and
    R1 + C1 is equal to R2 + C2.

The semantics of which is to include a #show directive for the predicate defined by the following rule. This would free a person from having to have knowledge of the how specifically the predicate is compiled into ASP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions