Text this: Discrete-mathematical approach to formal description of measurement procedure