Text this: Invariants in problems of pattern recognition and control of states of complex objects