Self-Validating Code Generator for Compiler Validation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Compilers face challenges in validating their operation, especially after significant revisions or changes in execution architecture, due to the complexity of translating high-level languages into machine language, which can result in subtle differences in output that are difficult to detect and validate manually.

Innovation Solution

An automated source code generator creates self-validating code that is syntactically correct, allowing for the comparison of expected and actual outcomes during compilation, thereby validating the correct parsing and execution of language syntax by the compiler.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual validation of compiler procedures is performed, then validation thoroughness can be achieved, but validation time and complexity increase significantly

Engineering Contradiction:
Improvevalidation thoroughnessVSAvoidvalidation time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system generates self-validating test code that automatically validates compiler procedures. The generated code includes expected outcomes built-in, allowing the compiler to validate itself without requiring manual test case creation for each procedure.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The validation code is generated in advance before actual compilation testing. The expected outcomes are pre-computed and embedded in the generated test code, so that when the compiler runs, it can immediately compare actual vs expected results without manual intervention.

Inventive Principle:
Principle #10Preliminary action

2Measurement precision

If comprehensive testing of all compiler procedures is implemented, then validation accuracy improves, but the complexity of test code increases

Engineering Contradiction:
Improvevalidation accuracyVSAvoidtest code complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The automated code generator creates validation tests that self-contained and self-explanatory. Each test case automatically includes its own expected outcomes based on the input syntax definition, eliminating the need for complex external test harnesses or manual test case management.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The generated validation code serves multiple functions simultaneously: it tests syntax parsing, validates code generation, verifies execution correctness, and provides expected outcomes all within a single unified test structure, reducing overall complexity.

Inventive Principle:
Principle #6Universality (Multi-functionality)

3Adaptability or versatility

If compiler code is heavily revised, then compiler functionality improves, but validation difficulty increases

Engineering Contradiction:
Improvecompiler functionalityVSAvoidvalidation difficulty
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The system generates validation test code based on the updated compiler's syntax definition before actual validation occurs. This preliminary generation of expected outcomes ensures that even heavily revised compilers can be validated systematically by comparing actual output against pre-computed expectations.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The generated validation code automatically compares actual compiler output against expected outcomes and provides immediate feedback on correctness. This feedback mechanism works effectively even when compilers are heavily revised, as the expected outcomes are regenerated to match the new syntax definition.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS9465591B2Syntax language generator for compiler validation
Publication Date: 2016.10.11 UNISYS CORP
  • US9465591B2 patent drawing
  • US9465591B2 patent drawing
  • US9465591B2 patent drawing

AI summary

Systems and methods for validating operation of a compiler are disclosed. One method includes receiving a definition of language syntax at an automated source code generator, and generating program code at the automated source code generator, the program code represented in source code including constructed self-validating code and syntactically-correct automatically generated code. The method also includes providing the source code to the compiler to be compiled into object code. Based on execution of the self-validating code as object code in a computing system, a computing system executing the object code outputs an indication of the correctness of compilation of the program code.