The Art of Computer Un-Programming: Reverse Engineering in Prolog Peter T. Breuer 1 Oxford University Computing Laboratory, 11 Keble Road, Oxford OX1 3QD, UK. Email: Peter.Breuer@comlab.oxford.ac.uk Abstract. A suite of Prolog tools for reverse-engineering and validating COBOL programs has been developed as part of the ESPRIT REDO project [?]. These tools produce functional abstractions, object-oriented designs and documentation from raw source code, with the aim of im- proving comprehensibility and maintainability, and this article discusses the tools and aspects of their programming. 1 Reverse-Engineering and Validating COBOL The COBOL language [?] hinders program comprehension in several ways: 1. by its use of formats instead of types (which means that each assignment between variables usually involves an implicit conversion of data from one format to another); 2. by the mixed use of PERFORM statements and the ordinary fall-through exe- cution of paragraphs; 3. by the inclusion of unstructured constructs such as GO TO’s and ALTER GO TO’s (which establish computed aliases for labels in the code); and 4. by excessive proliferation of specialised verbs and variants of verbs, the exact semantics of which in turn requires very specialised knowledge on the part of the programmer. These features of COBOL make recognising reusable program components difficult, and therefore mean that most extant COBOL code is difficult to main- tain and difficult to integrate into an evolutionary business strategy. Many soft- ware houses today find themselves with products inherited from an earlier era that are comprehensible only to the original development team, who may well have left the company. When a modification or an improvement to the function- ality is required, the code has to be either jetisoned or laboriously researched, and it is in response to this problem that the ESPRIT II project REDO 1 [?] was launched in 1989. This project has sought to develop methods of maintaining and improving old Fortran and COBOL applications, and has met with some success. The 1 “REengineering, DOcumentation and validation of systems”, ESPRIT project no. 2487.