Post-Compilation Language Restriction Enforcement
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
As computer programs become more complex, there is a need to restrict certain code portions to prevent issues arising from parallel threads accessing and modifying shared global variables, and to enforce language restrictions on sub-classes of library classes, where the library author lacks control over the sub-class code, and is often blamed for failures.
Innovation Solution
A method for operating a data processing system to decompile a compiled program, examine it for violations of a restricted rule set using an abstract syntax tree representation, and generate a certificate indicating compliance or non-compliance, which can be checked by the runtime system to prevent execution if rules are not met.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If the compiler enforces language restrictions during compilation, then code reliability is improved, but the compiler complexity increases and requires cooperation from compiler suppliers
Solution Approach 1:
The invention separates the rule enforcement mechanism from the compiler into a distinct post-processing phase. The compiler generates standard compiled code without special restrictions, while a separate enforcement mechanism applied after compilation checks and enforces language restrictions. This segmentation avoids increasing compiler complexity while maintaining code reliability through post-compilation verification.
Solution Approach 2:
The invention introduces an intermediary decompilation step between compilation and execution. The compiled code is decompiled into an intermediate representation, where language restrictions can be examined and enforced without modifying the compiler itself. This intermediary layer acts as a mediator that enables rule enforcement independently of the compilation process.
2Reliability
If the entire compiled program is decompiled for rule examination, then complete code control is achieved, but computational workload increases significantly
Solution Approach 1:
The invention applies different processing quality to different parts of the program. Instead of uniformly decompiling and examining the entire program, it focuses examination only on specific portions where language restrictions are relevant (such as sub-classes of library classes). This localized approach maintains effective code control while significantly reducing computational overhead compared to full-program analysis.
Solution Approach 2:
The invention extracts only the necessary portions of the compiled program for decompilation and examination. Rather than processing the complete program, it identifies and extracts specific code segments (particularly sub-classes) that need to be checked against language restrictions. This extraction approach achieves adequate code control with minimal computational expense.
3Reliability
If library authors can control sub-class code restrictions, then program safety is improved, but the ease of use of library classes decreases
Solution Approach 1:
The invention enables library authors to self-define language restrictions for their library classes without requiring external enforcement mechanisms. By allowing authors to specify which sub-classes should be restricted and what restrictions apply, the system empowers them to control program safety within their own code. This self-service approach maintains ease of use by not imposing additional operational complexity on programmers while still achieving program safety through author-defined constraints.
Data Source
AI summary
A method of operating a data processing system to examine a compiled program for violations of a set of rules that do not constitute violations detected by the compiler that generated the program. The method includes obtaining a restricted rule set defined in terms of rules in a decompiled representation of the program. The method also includes decompiling the compiled program to the decompiled representation of the compiled program in which the restricted rule set is defined, examining the decompiled representation of the compiled program for a violation of the restricted rule set to determine if any of the rules are violated, and providing an output indicating that one of the rules was violated.

