Programming styles play an important role to promote maintainability of programs. The authors aim at developing a system for assisting a task that programmers rewrite programs in order to improve their readability, understandability and maintainability. This system detects program fragments which infringe programming styles in a C program and makes diagnosis on the programming style. This system has the following features: 1) It can detect various patterns, for example, context dependent patterns and dispersed patterns extending two or more functions. It is difficult to detect these patterns by character based pattern matching; and 2) Each style guideline is defined as program patterns. This system uses them as search data, so it becomes ea...