A knowledge-based system that uses one pass only for thinning is described. The study of existing thinning algorithms reveals that appropriate thinning techniques are application dependent. Thinning algorithms suitable for applications such as Chinese characters unfortunately leave extraneous pixels (branches) in other applications such as Arabic characters. Alternatively, existing algorithms that delete extraneous pixels in certain applications may delete important pixels in other applications. We present a general
system where the user can select the degree of freedom of having branches in the output pattern according to his or her application. While the user selects one of three possible options, the system default is suitable for most usual applications, such as English characters. Our system is a knowledge-based system whose rules guarantee connectivity and preserve the symbol shape to a great extent. The implemented system can be used as a general thinning method for various applications. By having some knowledge about the input symbols, the user determines the best thinned output pattern or the degree of branches allowed. The implemented system helps to test the effect of each rule separately. Prolog built-in features for backtracking, strong logic handling, and rule manipulation prove to be very helpful in implementing this system.