The module overloading mechanism is explained in the Tower of Hanoi sample here. It enables you to implement TLA+ operators in Java, for improved model-checking performance.

I've struggled for a while to define a useful hash function in TLA+ (no, the identity function does not work for my purposes) and am thinking module overloading might be the way to do it. The hash function would accept a TLA+ object (a record, for example) and use Java's hashCode() method on the object's string representation to deterministically derive its hash value. This value would be returned to the TLA+ spec.

Is this possible? What would the Java override code look like? Do any other module override code samples exist?