Compile-time data dependency verification

Data processing: software development – installation – and managem – Software program development tool – Translation of code

Reexamination Certificate

Rate now

  [ 0.00 ] – not rated yet Voters 0   Comments 0

Details

C717S152000, C717S152000, C714S038110

Reexamination Certificate

active

06275986

ABSTRACT:

BACKGROUND OF THE INVENTION
1. Technical Field
The present invention is directed to an improvement in compilers and related software development tools and in particular to the verification of data dependencies in computer programs at compile-time.
2. Prior Art
It is common to utilize data dependencies in computer programs. Data dependencies are used in computer programming because they can provide the advantages of memory efficiencies and run-time execution efficiencies.
Where data dependencies are created, program code can be written which will take advantage of characteristics or rules relating to the data structures which are not expressly defined in the programming language, or the data type definition, themselves. Examples of such data dependencies include requirements that two different data structures have identical lengths or that two data elements be adjacent to one another in memory. The programmer can take advantage of these known relationships between data structures to create programs which execute more quickly or with the need for less memory than would otherwise be the case.
Good programming practice requires that such assumptions or rules relating to how the data may be manipulated (the data dependencies) are indicated in the documentation accompanying the computer code. However, the error-free use of data which is subject to the data dependencies relies on the understanding of programmers, rather than on any restriction imposed by the compiler. Problems may arise when modifications are made to the computer program at which time the documentation is not referenced or available, or where the documentation is poorly prepared or inadequately laid out.
Furthermore, in writing complex computer systems, it is often preferable to define data or data types at a particular point in a computer program and to make use of the data or data type at different points in the computer systems or programs which may be remote from the data definition point. The data dependencies relied upon at the remote point may not be referenced in documentation at the data definition point. When modifications are later made to the computer program, the data dependencies may not be apparent to the programmer making the modifications, with the result that errors may arise in the program.
Typically, computer programmers use programming language features which can be utilized to verify such data dependencies at run-time. An example of such a computing language function is the assert macro included in libraries supplied with many compilers for the C programming language. Such macros or programming language features will evaluate specified characteristics of data structures at the point in the execution of the program where the statement or macro is found.
The difficulty with such an approach is that additional code is introduced into the computer program (which in some cases may be minimized or eliminated by compiler optimization). To eliminate this additional code, it is necessary to go through the step of removing the verifying macros or statements in the program entirely after the testing phase of the program development.
The further difficulty with this prior art approach is that because the verification occurs at run-time, if data subject to a data dependency is incorrectly used in a particular piece of programming code which is not executed during testing of the program the error may not be uncovered until some time after the program is put into use. Furthermore, the identification of errors during program testing does not occur at a single time; the program must be put through successive tests to uncover each such error. Finally, such error identification using, for example, the assert macro does not occur until run-time.
It is therefore desirable to have an improved compiler, assembler, or related tools, capable of verifying the correct use of data subject to data dependencies, without introducing additional run-time costs or increased run-time code, which will identify data dependency errors at a single time, and which compiler will not rely on run-time testing of the code to uncover such errors.
SUMMARY OF THE INVENTION
According to one aspect of the present invention, there is provided an improved compiler.
According to a further aspect of the present invention, there is provided an improved compiler capable of performing compile-time verification of data dependencies.
According to a further aspect of the present invention, there is provided a compiler extension comprising a data verification component for compiling a data-dependency expression contained in a computer program, the data-dependency expression reflecting a programmer-defined relationship between data in the computer program, the data-dependency expression having a one of a first set of predefined values when the program conforms to the programmer-defined relationship between data, and the data-dependency expression having a one of a second set of predefined values different from the first set of predefined values, when the computer program does not conform to the user-defined relationship between data, wherein upon compiling the data-dependency expression, the data verification component generates no run-time code or run-time data storage allocation, and upon compiling the data-dependency expression, the data verification component generates a compile-time error message when the value of the data-dependency expression is in the second set of predefined values, and the data verification component generates no compile-time error message when the value of the data-dependency expression is in the first set of predefined values.
According to a further aspect of the invention, the compiler extension includes a data verification component which further comprises a component for including in the compile-time error message reference to the data-dependency expression.
According to a further aspect of the present invention, there is provided a compiler extension for a programming language compiler, the compiler extension comprising a data verification construct for accepting as an argument a data-dependency expression in a computer program, the data-dependency expression reflecting a programmer-defined relationship between data in the computer program, the data-dependency expression having a one of a first set of predefined values when the computer program conforms to the programmer-defined relationship between data, and the data-dependency expression having a one of a second set of predefined values different from the first set of predefined values, when the program does not conform to the user-defined relationship between data, wherein upon compilation of the computer program, the programming language compiler generates a compile-time error message for the compilation of the data verification construct when the value of the data-dependency expression is in the second set of predefined values, and no compile-time error message for compilation of the data verification construct when the value of the data-dependency expression is in the first set of predefined values.
According to a further aspect of the present invention, the compiler extension described above is such that the compilation of the data verification construct generates no run-time code.
According to a further aspect of the present invention, the compiler extension described above is such that the compilation of the data verification construct results in no allocation of run-time data storage.
According to one aspect of the present invention, there is provided an improved method for verifying programmer-defined data dependencies at compile-time, comprising the steps of
a) defining a check statement in a computer program, the check statement having an argument,
b) inserting the check statement in the computer program at points where a data structure having a programmer-defined data dependency is accessed by the computer program,
c) passing as an argument to check statement, a data-dependency expression having a one of a first set of predefined values when the data structu

LandOfFree

Say what you really think

Search LandOfFree.com for the USA inventors and patents. Rate them and share your experience with other people.

Rating

Compile-time data dependency verification does not yet have a rating. At this time, there are no reviews or comments for this patent.

If you have personal experience with Compile-time data dependency verification, we encourage you to share that experience with our LandOfFree.com community. Your opinion is very important and Compile-time data dependency verification will most certainly appreciate the feedback.

Rate now

     

Profile ID: LFUS-PAI-O-2476044

  Search
All data on this website is collected from public sources. Our data reflects the most accurate information available at the time of publication.