Definition:Polish Notation

Definition
Polish notation is a method of writing expressions without the need for parentheses.

The main method in writing an expression in Polish notation is to output an operator $\Box$, directly followed by the output of all its arguments $p, q, \ldots$, yielding:


 * $\Box p q \ldots$

If we had another, operator $\diamond$ taking only one argument, then also:


 * $\Box {\diamond} p {\diamond} q \ldots$

is in Polish notation.

Note that for the applicability of Polish notation, it is vital to be able to efficiently distinguish an argument from an operator, or a sequence of arguments.

Reverse Polish Notation
For stack-based programming languages, reverse Polish language is very useful, because it naturally coincides with how the input is to be structured for the language.

As the name suggests, a string $\mathsf P$ is in reverse Polish language iff reversing it gives a string $\tilde{\mathsf P}$ in Polish notation.

Thus the reverse Polish language equivalents of the above examples are:


 * $\ldots q p \Box$
 * $\ldots q {\diamond} p {\diamond} \Box$

Also see

 * Unique Readability for Polish Notation
 * Unique Readability for Reverse Polish Notation