Browse Prior Art Database

Method for Extracting Program Design Based on Restructuring and Reduction of Algebraic Expressions

IP.com Disclosure Number: IPCOM000110046D
Original Publication Date: 1992-Oct-01
Included in the Prior Art Database: 2005-Mar-25
Document File: 6 page(s) / 205K

Publishing Venue

IBM

Related People

Makino, S: AUTHOR [+2]

Abstract

Disclosed is a method for extracting program design information from any programs written in third-generation languages (such as FORTRAN, COBOL, PASCAL, PL/I, and C). It is an enhancement of the existing reverse engineering method based on reduction of algebraic expressions in that: (a) it handles unstructured (GOTO-ridden) programs and (b) it represents exception handling and I/O references in the extracted design information (structure chart).

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 39% of the total text.

Method for Extracting Program Design Based on Restructuring and Reduction of Algebraic Expressions

       Disclosed is a method for extracting program design
information from any programs written in third-generation languages
(such as FORTRAN, COBOL, PASCAL, PL/I, and C).  It is an enhancement
of the existing reverse engineering method based on reduction of
algebraic expressions in that: (a) it handles unstructured
(GOTO-ridden) programs and (b) it represents exception handling and
I/O references in the extracted design information (structure chart).

      The enhancement comprises the following four points: (a)
extensions to algebraic expressions enabling them to represent
labels, unconditional branches, exception handling routines, and I/O
statements, (b) control flow restructuring that allows handling of
unstructured programs (c) extensions to the rules for reducing
algebraic expressions, to allow handling of exceptional exits from
routines, I/O statements, and exception handling routines, (d)
extensions to structure charts enabling them to represent exception
handling routines, statements of exceptional exits from routines, and
I/O references.

      Fig. 2 shows a PL/I program, which includes labels (such as
'LOOP'), unconditional branches (such as 'GOTO LOOP'), I/O statements
(such as 'READ', 'WRITE', 'DISPLAY'), and exception handling routines
(such as 'ON ERROR ... END').  However, these constructs were not
dealt with thoroughly in the existing method based on algebraic
expressions.  The proposed method offers a solution to this problem.

      Our method consists of four steps (see Fig. 1): (1) parse the
source program and extract algebraic expressions that represent its
structure, (2) restructure the extracted algebraic expressions, (3)
apply reduction rules to the restructured algebraic expressions, and
(4) construct a structure chart from the reduced algebraic
expressions.

      Fig. 3 shows an algebraic expression extracted from a PL/I
program in Fig. 2 in step 1.  Algebraic expressions consist of
operators and operands.  In Fig. 2, '/', '+' and '.' are operators
that represent a relation between statements in a program.  Other
expressions, such as 'b1', 'if1', and 'c1', are operands that
represent statements.  A '/' represents a sequential relation, and
'+' represents an alternative relation.  A '.' represents an
inclusion.  The prefix of each operand (such as, 'b', 'if', 'c', and
'lambda') is an operand type that represents a statement type (such
as 'b' for assignment statements, 'if' for selection statements, 'c'
for calling statements, or 'lambda' for no operation).  The suffix
(numeric number) of each operand is an index that distinguishes
between operands of the same type.

      Symbols with prefixes 'l', 'B', 'on', 'g', 'io', and 's' in
Fig.  3 are newly introduced operands.  'l' represents a label and
'g' represents an unconditional branch statement.  Each 'g' (or 'c')
operand has...