Overloaded Operators for KeY lang #3032
This MR brings overloaded operators to KeY lang:
- On function and predicate definitions you can additional add prefix, infix, and postfix notations.
\functions { int add(int, int) \infix(+); }
These information are stored inside the Function
object.
-
These information also impacts the pretty printing.
-
Operators are now a sequence of symbols
[-+*/^<>=|]
. Their first character determines the precedence. Following are legal expressions:
a ++ b + c = ( a ++ b ) + c
a <|> b <= c
a +- b != a + -b
This trick avoids an "operator precedence parser", which would also be nice.
Artifacts
- 08. Feb 2023 12:16 (1353.95 kB large)
- 08. Feb 2023 12:10 (1354.38 kB large)