Skip to content

Declared operators can indirectly leak into modules #749

@oskgo

Description

@oskgo

The section mechanism allows defining abstract operators, types and modules (maybe more?) that act as though they were defined inside the section but become parameters of their dependees inside the section when concluding the section. This only works properly when EasyCrypt supports making the dependees parametric, but some things like modules cannot currently be parameterized by operators and types.

Because of these issues with modules in sections EasyCrypt tries to prevent usage of declared operators and types in modules. The current checks do not take into account transitive usages.

Example:

theory Thy.
section.

declare type _T.
type T = _T.
declare op _f: T.
op f: T = _f.

module M = {proc main() = {return f;}}.

end section.
end Thy.
print Thy.

On a side note, it seems to me like sections are a leaky abstraction in a language like EasyCrypt where not everything can be made parametric in terms of everything else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions