Skip to content

unnecessary qualification of operators when used without arguments #854

@alleystoughton

Description

@alleystoughton

Consider the following example:

require import AllCore List.

theory T.

op [-] (x : int) = 2 * x.

print [-].
(*
* In [operators or predicates]:

op [-] (x : int) : int = 2 * x.
abbrev [-]  : xint -> xint = xopp.
abbrev [-]  : real -> real = opp.
abbrev [-]  : int -> int = CoreInt.opp.
*)

op u = [-] 4.

print u.
(*
* In [operators or predicates]:

op u : int = -4.
*)

op z = [-].

print z.
(*
* In [operators or predicates]:

op z : int -> int = T.[-].
*)

It seems that the redefined operator [-] is needlessly qualified when used with no argument. Because one can use [-] without qualification inside T, and because when it's used with an argument qualification is not used, it seems it should not be needed when used with no arguments.

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