Tessian policy evaluation can represent arithmetic conditions in postfix notation so they can be processed efficiently. Given expression tokens and a mapping of variable names to integer values, evaluate the expression using the current bindings.
Tokens may be integer literals, variable names, or binary operators +, -, *, and /. Operators consume the two most recent values from the stack. For a / b, division must truncate toward zero. Every expression is valid, every referenced variable has a binding, and division by zero does not occur.
Implement eval_postfix(tokens, bindings).
tokens is a list of strings in postfix order.bindings is a dictionary mapping variable-name strings to integers.def eval_postfix(tokens, bindings):