Static type inference method and system for Python external function
An external function, static type technology, applied in electrical digital data processing, instrument, platform integrity maintenance, etc., can solve problems such as requiring manual assistance, poor type inference accuracy, and inability to effectively handle external functions.
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0034] Such as figure 1 As shown, the static type inference method of a Python external function provided by the embodiment of the present invention includes the following steps:
[0035] Step S1: Perform language separation on the Python / C multilingual project; for the C language file obtained after separation, identify the external function declarations therein, and analyze the parameter type conversion and return type conversion realized by the external function corresponding to each external function declaration;
[0036] Step S2: Carry out type inference according to the external function declaration, parameter type conversion and return type conversion, and at the same time check the consistency of the no-argument function declaration for the external function declaration and the corresponding external function implementation.
[0037] Python's foreign function interface Python / C API is an intermediate layer bridging Python and C / C++. Such as Figure 2A The program hos...
Embodiment 2
[0119] Such as Figure 12 As shown, the embodiment of the present invention provides a static type inference system for Python external functions, including the following modules:
[0120] The recognition and analysis module 21 is used to separate the languages of Python / C multilingual projects; for the C language files obtained after separation, identify the external function declarations therein, and analyze the parameter type conversions implemented by the external functions corresponding to each external function declaration and return type conversion;
[0121] The type inference module 22 is configured to perform type inference according to the external function declaration, parameter type conversion and return type conversion, and at the same time check the consistency of the no-argument function declaration for the external function declaration and the corresponding external function implementation.
[0122] Such as Figure 13 As shown, a schematic diagram of the Py...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com