Compiler Inferring Argument Attributes from Call Site

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional compilers rely on source code declarations and assertions to determine function argument attributes, limiting code portability and efficiency, as they cannot infer attributes from external information passed during compilation.

Innovation Solution

Compilers are designed to infer function argument attributes from information passed during compilation, such as examples, objects, and assertions, allowing for the removal of attribute declarations from the source code, enabling the compilation of polymorphic functions into reduced polymorphic forms with static and dynamic attributes.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If source code includes declarations and assertions to provide compiler with attribute information, then the compiler can accurately determine function argument attributes, but the source code becomes less portable and more complex

Engineering Contradiction:
Improveattribute determination accuracyVSAvoidcode portability
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent extracts attribute information (declarations and assertions) from the source code and moves it to external configuration files or metadata. This allows the compiler to obtain attribute information without it being embedded in the source code, thereby improving portability while maintaining accurate attribute determination.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The patent introduces an intermediary layer (external configuration files, metadata, or attribute databases) that mediates between the source code and the compiler. This intermediary contains the attribute information, allowing the compiler to query it without the source code needing to include declarations and assertions, thus resolving the contradiction between accuracy and portability.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Reliability

If source code includes declarations and assertions for attribute information, then the compiler can compile the code, but the compilation process becomes less efficient and more time-consuming

Engineering Contradiction:
Improvecompilation correctnessVSAvoidcompilation efficiency
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent performs preliminary extraction and organization of attribute information into external configuration files or metadata before the compilation process. This preliminary action allows the compiler to quickly access pre-processed attribute information rather than parsing declarations and assertions from source code during compilation, thereby improving compilation efficiency while maintaining correctness.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The intermediary layer (external configuration files or metadata) serves as a pre-prepared repository of attribute information. The compiler queries this intermediary during compilation rather than analyzing source code declarations, which speeds up the compilation process while ensuring accurate attribute determination for correct compilation.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Measurement precision

If attribute information is embedded in source code, then the compiler can determine function argument attributes, but the compiler cannot infer attributes from external information passed during compilation

Engineering Contradiction:
Improveattribute information availabilityVSAvoidautomatic attribute inference
Core Design Contradiction:
Measurement precisionVSExtent of automation

Solution Approach 1:

The patent introduces an intermediary system that connects the compiler with external information sources (configuration files, metadata, attribute databases). This intermediary enables the compiler to automatically infer attribute information from external sources passed during compilation, eliminating the need for attribute information to be embedded in the source code while maintaining precise attribute determination.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The patent implements a feedback mechanism where the compiler can query external information sources during the compilation process. The external sources provide attribute information in response to compiler queries, enabling automatic attribute inference without requiring declarations in the source code, thus improving both automation and attribute information availability.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS8843906B1Inferring data types from compiler call site
Publication Date: 2014.09.23 MATHWORKS INC
  • US8843906B1 patent drawing
  • US8843906B1 patent drawing
  • US8843906B1 patent drawing

AI summary

Disclosed herein are methods and compilers for compiling code. The methods and compilers disclosed can compile a callable compilable unit of code free of declarations and assertions that identify attributes of arguments expressed therein. The attributes of the arguments in the callable compilable unit of code are inferred by the compilers and methods disclosed herein from information provided by a call site that calls a compiler to compile the callable compilable unit of code.