Supercharge Your Innovation With Domain-Expert AI Agents!

Python language feature automatic identification system and method

A technology for automatically identifying system and language features, applied in reasoning methods, creating/generating source code, software testing/debugging, etc., can solve problems such as difficult type inference

Active Publication Date: 2020-10-30
UNIV OF SCI & TECH OF CHINA
View PDF14 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

However, type inference is required when converting Python source code to LLVM IR, and language features such as Heterogenous List will bring great difficulties to type inference, so Numba compilation only supports a subset of Python

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Python language feature automatic identification system and method
  • Python language feature automatic identification system and method
  • Python language feature automatic identification system and method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment approach 1

[0107] The present invention takes the scanning of the language feature of the first-class function as an example to illustrate the specific implementation method. The system scans for language features in three phases:

[0108] 1) Phase 1: type inference and type result analysis

[0109] The system accepts Python source files as input. When it is given a Python source file, it first generates type inference results for that file using a type inference tool such as PySonar2, since we will need such results to help scan certain language features related to variable types. The results of PySonar2 are HTML files, and its original goal is to visualize the results in the web browsing module, so that developers can easily inspect the inference results. And the system first analyzes these HTML files and extracts the data to form the information (lineno, name, type) required in the scanning process. The tuple includes three elements: the identifier's line number in the source code,...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a Python language feature automatic identification system and method. The system comprises: an AST generation module; an AST access module; a language feature recognition module, wherein the language feature recognition module is used for calculating the information collected by the AST access module, comparing the information with a language feature recognition mode, recognizing each language feature and counting the occurrence frequency of the language features; a standard library scanning module, wherein the standard library scanning module is used for scanning language features generated by using a standard library function; a type inference tool interface module; and a report generation module, wherein the report generation module is used for outputting a use report of the language features after the whole scanning and recognition are finished. Python language specifications are analyzed, and 22 language features with wide influence in total of six categories are summarized and classified; then, a method for automatically identifying the characteristics is provided; the Python language feature use difference and the overall Python language feature use condition of each field are further analyzed, and language feature reference is provided for construction of a Python compiling module or field special language based on a Python subset and analysis andoptimization.

Description

technical field [0001] The invention relates to the fields of programming language and static analysis, in particular to an automatic recognition method of language features in Python software. Background technique [0002] Python is currently a very popular dynamic programming language, and its flexible and diverse language features make it widely used in various computer fields. At present, there have been some studies on the language features of different programming languages. Researchers hope to find out the usage and defects of language features in existing software, and lay the foundation for the further development of methods and tools to improve the performance and security of programming languages. Base. In 2013, Dyer et al. studied the use of Java language features from a large number of Java open source projects. In 2018, Rodrigues et al. analyzed the way developers use Ruby language features from 28 Ruby projects. In 2019, Malloy et al. studied In 2016, Lin et...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F11/36G06F8/75G06F8/30G06N5/04
CPCG06F11/3608G06F8/75G06F8/315G06N5/041
Inventor 张昱彭昀胡明哲
Owner UNIV OF SCI & TECH OF CHINA
Features
  • R&D
  • Intellectual Property
  • Life Sciences
  • Materials
  • Tech Scout
Why Patsnap Eureka
  • Unparalleled Data Quality
  • Higher Quality Content
  • 60% Fewer Hallucinations
Social media
Patsnap Eureka Blog
Learn More