Skip to content

[gen] Clarify "plain" atomic annotations #1683

Description

@fsestini

atom option in gen/common/edge.ml is currently used to represent the "plain annotation" P. I personally find there's room for improvement, for a couple of reasons:

  1. One would expect the value None : atom option to represent "absence of annotation", or a failure state, but it doesn't. This is particularly counter-intuitive (IMO) when looking at the signature of functions like parse_atom : string -> atom option and incorrectly expecting atom option to represent "failure to parse".
  2. The semantics of P itself makes it more similar to a wildcard. P makes the annotated access plain by default, but does not enforce this property. Indeed, merging P with any non-P atom a equals a, so P really stands for "plain unless specified otherwise". I think it would be useful to also be able to express scenarios where a diy edge endpoint must be plain, and not just "plain unless specified otherwise".

To address both issues, I propose we:

  • extend atom with a constructor to represent the P annotation, removing the need for atom option. P's behaviour as a "wildcard"/"default annotation" can be preserved by modifying the edge/atom merging functions accordingly. This will also make atom more in like with sd, ie, etc., all of which also define their own wildcard constructors.
  • further extend atom with a completely new constructor to represent accesses that must be plain.

The can (and probably, should) address these two points in two separate PRs.

See original discussion here. CC @ShaleXIONG

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions