A knowledge-based software maintenance approach using logic and database techniques is presented. In the software maintenance phase, considerable flow information is used by software maintenance tools, such as the control flow analyzer, data flow analyzer, data flow anomaly detector, program slicer, and logical and performance ripple-effect analyzers. With the aid of a knowledge-based system, the generation and analysis of flow information could be treated in the same way. A unified, flow information retrieval and analyzing system could be developed faster, more economically, and would be more maintainable. Other applications, such as displaying the relations between two modules or listing the modules that share the same specific resources, can be set up quickly by adding new rules to the knowledge-based system.