Controller Model Generation from Binary Code Using ASTs
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing methods for generating controller models from binary code lack interpretability for subject matter experts, are not scalable for larger or more complex binaries, and are sensitive to noisy data, failing to provide SME-interpretable formats.
Innovation Solution
The approach involves decompiling binary code to isolate mathematical primitives, generating abstract syntax trees (ASTs), and constructing interpretable models using Modelica language, which are then tested and validated through the Functional Mockup Interface (FMI) standard to produce working C or C++ code.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of information
If existing methods are used to generate controller models from binary code, then model generation is possible, but the models lack interpretability for subject matter experts
Solution Approach 1:
The patent segments the binary code analysis into distinct components: mathematical primitives extraction, AST generation, and Modelica model construction. This segmentation allows each component to be optimized independently, preserving interpretability while maintaining accuracy through systematic processing of control flow graphs and mathematical operations.
Solution Approach 2:
The patent introduces abstract syntax trees (ASTs) as an intermediary representation between binary code and final models. This intermediary layer preserves the mathematical structure and control logic in a human-readable format, enabling subject matter experts to interpret the models while maintaining fidelity to the original binary code behavior.
2Productivity
If existing methods are used to generate controller models, then models can be produced, but they are not scalable for larger or more complex binaries
Solution Approach 1:
The patent implements dynamic adaptation of the analysis process based on binary complexity. The system automatically adjusts the level of abstraction and detail in AST generation and model construction, allowing efficient processing of both simple and complex binaries by dynamically selecting appropriate analysis depths and optimization strategies.
Solution Approach 2:
The patent changes key parameters in the model generation process, including the granularity of mathematical primitive extraction, the depth of control flow analysis, and the level of Modelica model detail. These parameter adjustments enable scalable processing across different binary complexities while maintaining generation speed through optimized compilation and caching mechanisms.
3Measurement precision
If existing methods are used to generate controller models, then models can be created, but they are sensitive to noisy data
Solution Approach 1:
The patent implements feedback mechanisms where the generated models are validated against the original binary code behavior through automated testing and verification. This feedback loop identifies and corrects deviations caused by noisy or ambiguous binary data, ensuring high precision by iteratively refining the Modelica models to match the actual control logic.
Solution Approach 2:
The patent applies preprocessing filters and validation rules before model generation to cushion against noisy data. By detecting and handling ambiguous instructions, invalid operations, or corrupted binary segments beforehand, the system prevents noise propagation into the final models, maintaining measurement precision through proactive data cleaning and error handling.
Data Source
AI summary
A method includes obtaining a binary code of a controller. The method also includes decompiling the binary code of the controller to generate a source code. The method further includes generating one or more abstract syntax trees based on the source code. The method further includes generating an interpretable model based on the one or more abstract syntax trees. The interpretable model is interpretable by subject matter experts.


