Implementation of pattern recognition algorithms and theorems in C