Pattern recognition theory of mind