simulator.py: Adding method for type checking operands