Memories are not held in their entirety in the brain like old movie clips, but are maintained as a kind of chemical residue of the original perception, which could be thought of as a hash value or remainder, but not a one-way algorithm at all.
When a stone is identified as a borderline case between two grades, the system uses an optimisation technique, called a genetic algorithm, to explore the different ways in which the stone could be cut to maximise its value.