Skip to content

Uniqueness of symbol not enforced #3964

@tothtamas28

Description

@tothtamas28

kast.md defines #Top as

syntax {Sort} Sort ::= "#Top" [klabel(#Top), symbol, group(mlUnary)]

and #True as

| "#True" [klabel(#Top), symbol, group(mlUnary), unparseAvoid]

(Similarly for #Bottom and #False.)

Both productions have the same klabel and are symbol-s. However, according to the K User Manual,

The symbol provided must be unique to this definition. This is enforced by K.

In this case, it is not enforced. As a consequence, there are productions in compiled.json that have the same klabel (field, not the attribute), which makes processing productions more difficult.


Possible fixes:

  1. [If this is a bug] Add the missing check for symbol uniqueness. Drop #True and #False as they do not seem to be indispensable.
  2. [If this is a feature] Adjust the documentation. Add a new kompiler pass that eliminates the duplicate production from compiled.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions