This paper describes a software maintenance (SM) knowledge based system ealled SOFTM, serving the three following purposes: (1) assisting a software programmer or analyst in his application code maintenFce tasks, (2) generating and updating automatically sonware correction documentation, (3) helping the end user register, and possibly interpret, observed errors on the successive application code versions. The knowledge based system SOFTM is written in PROLOG 11, and is largely applicable to application codes written in different programming languages, provided code descriptors can be retrieved. SOFTM does not address any of the syntactic, input-output, or procedural errors normally detected by the syntactic analyzer, compiler, or by the operating system environment. SOFTM is relying on a unique ATN network based code description, on diagnostic inference procedure based on context based pattern classification, on maintenance log report generators, and on interfacing capabilities of PROLOG I1 to a variety of other languages.