AlloyTools / alloytools.github.io

Website for Alloytools
MIT License
13 stars 14 forks source link

Mistaken lexical grammar for 'greater than or equal to' token #50

Closed leavens closed 1 year ago

leavens commented 1 year ago

In the reference manual (http://alloytools.org/spec.html), under the heading "Precedence and Associativity" is a list of "comparison operators", which is written as: "in, =, <, >, =, =<, =>", but the last of these is wrong, as I believe that => is only used for implication in Alloy, and it should be written as >= instead in this list.

The same problem appears in the reference manual under the heading "Boolean Expressions", which has the production:

compareOp ::= in | = | < | > | =< | =>

again I believe that => should be >= in this case, as just below this the manual says:

The constraint i >= j is true when i is greater than or equal to j.

The “less than or equal to” operator is written unconventionally with the equals symbol first so that it does not have the appearance of an arrow, which might be confused with a logical implication. For all these operators, the sum function is applied implicitly to their arguments, so that if a non-scalar set of integers is presented, the comparison acts on the sum of its elements.

grayswandyr commented 1 year ago

Fixed in 38152d0440cdc78a426df8059695012b225c24fb. Thanks.