Compiler Error Correction via Automatic Source Modification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current compilers halt the compilation process upon detecting errors, requiring users to manually identify and fix issues, which is time-consuming and frustrating, especially since minor errors can cause significant delays.

Innovation Solution

Incorporating an error corrector module and an optimization adjustment module into the compiler driver to automatically correct user errors and internal compiler errors by modifying the source file and adjusting optimization levels, allowing for iterative correction processes without user intervention.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If the compiler halts the compilation process upon detecting errors, then the reliability of error detection is improved, but the productivity and user time are worsened due to manual intervention requirements

Engineering Contradiction:
Improveerror detection reliabilityVSAvoidcompilation productivity
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The compiler system performs self-service by automatically detecting errors and generating correction suggestions without requiring user intervention. The error corrector module autonomously analyzes error messages, queries the correction database, and modifies source code, enabling the system to service itself rather than relying on external user action.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The system performs preliminary action by pre-populating a database with known error patterns and their corrections before compilation occurs. When errors are detected during compilation, the system can immediately query this pre-prepared database for corrections, eliminating the need for users to manually research and fix errors.

Inventive Principle:
Principle #10Preliminary action

2Ease of operation

If the compiler automatically corrects errors by modifying source files, then the ease of operation is improved, but the manufacturing precision of the original source code is worsened due to automatic modifications

Engineering Contradiction:
Improvecompilation ease of operationVSAvoidsource code precision
Core Design Contradiction:
Ease of operationVSManufacturing precision

Solution Approach 1:

The system implements feedback by presenting multiple correction suggestions to the user and allowing selection of the appropriate correction. The error corrector module queries the database for possible corrections, presents them to the user, and only applies the selected correction, ensuring user oversight maintains source code precision while still improving ease of operation.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The error correction database serves as an intermediary between the error detection process and source code modification. Rather than directly modifying source code based on automated detection, the system uses the database as a mediator to provide verified correction suggestions that can be reviewed and selected by the user.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Productivity

If the compiler uses aggressive optimization processes, then the productivity of code generation is improved, but the reliability of compilation is worsened due to internal compiler errors

Engineering Contradiction:
Improvecode generation productivityVSAvoidcompilation reliability
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The system applies dynamics by making optimization levels adjustable and adaptable. Instead of using fixed aggressive optimization, the compiler can dynamically adjust optimization intensity based on the specific source code being compiled and errors encountered, allowing the system to maintain high productivity while avoiding the reliability issues caused by overly aggressive optimization.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The system uses parameter changes by modifying optimization level parameters when internal errors occur. The error corrector module can adjust optimization parameters downward to resolve compilation failures while maintaining the overall compilation process, thereby preserving productivity while improving reliability through parameter adaptation.

Inventive Principle:
Principle #35Parameter changes

Data Source

PatentUS9274770B2Fault tolerant compilation with automatic error correction
Publication Date: 2016.03.01 SUN MICROSYSTEMS INC
  • US9274770B2 patent drawing
  • US9274770B2 patent drawing
  • US9274770B2 patent drawing

AI summary

A compilation method is provided for automated user error correction. The method includes using a compiler driver run by a processor to receive a source file for compilation. With a compiler component invoked by the compiler driver, the method includes identifying an error in the source file such as a linking problem or syntax error in the user's program. The method includes receiving with the compiler driver an error message corresponding to the identified error. With an error corrector module run by the processor, the method includes processing the error message to determine an error correction for the identified error in the source file. The compiler driver modifies the source file based on the error correction and compiles the modified source file with the compiler component.