Skip to content

Unary minus binds more tightly than exponentiation #1322

@brianhuffman

Description

@brianhuffman

According to usual math conventions, - x ^^ y should parse as - (x ^^ y).

However, in Cryptol this is parsed instead as (- x) ^^ y, which surprising, inconsistent, and not useful, especially when used with an even exponent. It is inconsistent because the binary minus operator binds more loosely than exponentiation, so that e.g. w - x ^^ y parses as w - (x ^^ y).

Metadata

Metadata

Assignees

Labels

languageChanges or extensions to the languagelow-hanging fruitFor issues that should be easy to fixparserIssues with lexing or parsing.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions