| Algorithm 3: Modified chromosome evaluation procedure. |
| for Each gene in chromosome do |
| if The gene is an operator then |
| Pop 2 operands from stack |
| if Arity of the operator then |
| Discard the 2nd operand |
| end if |
| Execute the operation |
| Push the result back on stack |
| else //Comment: the gene is an operand |
| Push the operand on stack |
| end if |
| end for |
| The element left on the stack is the value of the evaluated expression. |