Prefix notation

From Esolang
(Redirected from Polish notation)
Jump to navigation Jump to search

Prefix notation, also called Polish notation or Łukasiewicz notation after Jan Łukasiewicz, is one of the four standard operator notation styles. In prefix notation, an operator is written in front of all of its operands. When an operator has a fixed number of parameters, it does not require parentheses or other grouping syntax for disambiguation. Prefix notation was originally developed to represent formal logic.

Examples

Consider the following arithmetic expression in infix notation:

(2 + 3) * 4

The same expression in prefix notation, assuming that all operators are binary:

* + 2 3 4

See also

External Links