Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

13 results about "Type inference" patented technology

Type inference refers to the automatic detection of the data type of an expression in a programming language. It is a feature present in some strongly statically typed languages. It is often characteristic of functional programming languages in general. Some languages that include type inference include C++11, C# (starting with version 3.0), Chapel, Clean, Crystal, D, F#, FreeBASIC, Go, Haskell, Java (starting with version 10), Julia, Kotlin, ML, Nim, OCaml, Opa, RPython, Rust, Scala, Swift, Vala and Visual Basic (starting with version 9.0). The majority of them use a simple form of type inference; the Hindley-Milner type system can provide more complete type inference. The ability to infer types automatically makes many programming tasks easier, leaving the programmer free to omit type annotations while still permitting type checking.

Method and apparatus for type inference in programming language

The present application provides a method and apparatus for type inference in a programming language. The method comprises: acquiring an abstract syntax tree of source code, wherein the abstract syntax tree comprises a first node and a subtree of the first node, the first node indicates a first field in the source code, and the first field is one of the following: a variable, a class, a function or a parameter; constructing or updating a full type tree on the basis of the abstract syntax tree, wherein the full type tree indicates the types of a plurality of nodes in the abstract syntax tree and the relationship between the plurality of nodes, and the types of the plurality of nodes are determined on the basis of at least one of the following: the type of a second node in the plurality of nodes is indicated by the abstract syntax tree, and the type of a third node in the plurality of nodes is obtained from a type map, or the type of a fourth node in the plurality of nodes is based on the type of a fifth node, and the type of the fifth node is indicated by the abstract syntax tree or obtained from the type map, wherein the type map indicates the mapping relationship between at least one declaration and at least one type; and outputting an inference result on the basis of the full type tree, wherein the inference result comprises the type of the first node. The solution of the present application facilitates quick and accurate type inference.
Owner:HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Hierarchical fine-grained human trajectory activity type inference method and related device

The invention belongs to the field of urban calculation and intelligent transportation, and discloses a hierarchical fine-grained human trajectory activity type inference method and related devices.The method comprises the steps that firstly, rigid activity types are recognized through predefined anchor point rules, and efficient labeling of regular segments is ensured; subsequently, the remaining staying segments mark transactional or leisure motivations through a motivation classification model to differentiate internal heterogeneity of non-rigid activities; and finally, performing structured inference on the marked fragment by a specific large language model of the motivator, and outputting a fine-grained non-rigid activity type. By the adoption of the method, the overall accuracy and robustness of fine-grained activity inference are remarkably improved, the performance is optimized especially on identification of non-rigid activities, adaptability to complex multi-constraint scenes is enhanced, and reliable fine-grained classification requirements are supported.
Owner:SHENZHEN INST OF ADVANCED TECH CHINESE ACAD OF SCI

A method and apparatus for automatic inference of variable types in a low-code platform

The application discloses a low-code platform variable type automatic inference method and device. The method comprises the following steps: screening a variable with an automatic type identifier in a low-code platform to obtain a target variable; obtaining a default value inference result based on a type inference rule; traversing a structured model corresponding to a business logic and declaration information to obtain a node assignment inference result; obtaining a dependency relationship inference result through a multi-round iteration strategy recursive derivation; integrating the default value inference result, the node assignment inference result and the dependency relationship inference result to determine an initial type of the target variable; storing the initial type based on inference trace information and realizing change notification to finally obtain a target type. Through multi-stage inference, expression type calculation, chain dependency processing and other designs, the application does not need to manually specify the type, supports complex scene inference, maintains type safety, reduces use and maintenance costs, and improves the development efficiency and ease of use of the low-code platform.
Owner:XIAN GRAPE CITY SOFTWARE CO LTD

A training and inference method for python repository-level complex type inference

PendingCN122285012AComplex typeLinguistic model
This invention discloses a training and inference method for complex type inference at the Python repository level. It constructs a semantic graph of types; organizes type semantic contexts and constructs single-round type inference training samples, performing supervised fine-tuning on a large language model to obtain a single-round type inference base model; represents the predicted type and reference type as a type tree, constructing verifiable structured rewards; constructs multi-round refinement objectives according to the depth of the reference type, aggregating round-by-round refinement rewards, termination penalties, and final result rewards to obtain a hierarchical reinforcement learning model; constructs a repository-level scheduling order; for the multi-round refinement process, in each round, multiple candidate outputs are mapped to a depth-constrained abstract type space, and the stage decoding result is obtained through type space self-consistency aggregation, outputting the final predicted type. This invention can simultaneously enhance the cross-process semantic utilization capability, deep structure inference capability, and repository-level type consistency in complex type inference.
Owner:NANJING UNIV

Automatic inference method and device for variable types of low-code platform

The invention discloses an automatic inference method and device for low-code platform variable types. The method comprises the following steps: screening and matching variables with automatic type identifiers in a low-code platform to obtain target variables; obtaining a default value inference result based on the type inference rule; traversing the structured model and the declaration information corresponding to the service logic to obtain a node assignment inference result; recursive derivation is carried out through a multi-round iteration strategy to obtain a dependency relationship inference result; integrating the default inference result, the node assignment inference result and the dependency inference result, and determining the initial type of the target variable; and storing the initial type based on the deduced traceability information and realizing change notification, and finally obtaining a target type. Through multi-stage inference, expression type calculation, chain dependency processing and other designs, a user does not need to manually specify a type, complex scene inference is supported, type safety is kept, the use and maintenance cost is reduced, and the development efficiency and usability of a low-code platform are improved.
Owner:XIAN GRAPE CITY SOFTWARE CO LTD

A source code vulnerability detection method based on multi-source feature fusion and ensemble learning

PendingCN122433083AData streamFeature Dimension
The application discloses a source code vulnerability detection method based on multi-source feature fusion and ensemble learning, which adopts a three-stage pipeline architecture: firstly, four-way features of abstract syntax tree, control flow graph, data flow graph and sequential semantics are extracted from the source code in parallel and encoded respectively; secondly, the four-way features are dynamically assigned weights and weightedly fused through a multi-head attention mechanism, and a limited-depth inter-function dependency graph is constructed to complete the inter-process context of cross-function, and then the context-enhanced multi-source fusion vector of 512 dimensions is output through the transformation coding and principal component analysis dimension reduction; finally, the three vulnerability type exclusive sub-models of syntax, data flow and control flow are driven by the fusion vector for parallel integrated detection, the contribution of each sub-model is quantified by combining gradient importance analysis, and the integrated decision layer dynamically weights the output of the detection label, vulnerability confidence and the explainability report containing the main trigger sub-model, key feature dimension and CWE vulnerability type inference.
Owner:SOUTH CHINA UNIV OF TECH

Controlling data schema for data oriented architecture

Controlling data schema is provided for data object(s) in a data oriented architecture. Suggestions are provided for received data objects, including determining whether the received data object maps to one of multiple data types, and performing a conditional type inference to provide the one or more suggestions based on a result of the determining of whether the one of the data object maps to one of the multiple data types.
Owner:LEMON INC(GB)

Large model typed reasoning method based on hierarchical distillation and dynamic weight merging

The invention belongs to the technical field of typed reasoning, provides a large model typed reasoning method based on hierarchical distillation and dynamic weight merging, and realizes structured migration and cross-task fusion of SLMs typed reasoning knowledge through hierarchical thinking chain distillation and dynamic weight model fusion. The hierarchical distillation is used for extracting three types of key information including semantic representation, inference intermediate state and final thinking chain expression from the LLMs, and establishing semantic basis, logic arrangement and step generation capability required by typed inference in the SLMs in a structured mode. Meanwhile, a dynamic weight merging strategy with task types as guidance is adopted, adaptive fusion is carried out on parameter subspaces of the trained SLMs, the complementary advantages of different reasoning types are effectively reserved, and the cross-type reasoning capability is enhanced.
Owner:NORTHWEST UNIVERSITY FOR NATIONALITIES

Method and apparatus for type inference of programming languages

The application provides a type inference method and device of a programming language, the method comprising: in the development process of program code, obtaining a node to be inferred in an abstract syntax tree, the node to be inferred indicating a field to be inferred in the program code, the field to be inferred comprising one of the following: a variable, a class, a function or a parameter; obtaining a constraint related to the node to be inferred, the constraint being used to indicate a relationship involved by the node to be inferred in the abstract syntax tree; determining a type of the node to be inferred according to the constraint, the type of the node to be inferred being one of the following: a numeric type, a sequence type, a mapping type, a set type, an iterator type, a context manager type, a module type, a metatype, a null type or a callable type. The scheme of the application is beneficial to reducing the memory occupation of type inference.
Owner:HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Target element positioning method and device based on interface structure perception

This application discloses a target element localization method and apparatus based on interface structure perception, relating to the fields of artificial intelligence and human-computer interaction. By fusing multiple inference results, it achieves collaborative optimization based on explicit structural inference and multi-source information, which not only significantly improves the localization accuracy under complex interface layouts and complex natural language commands, but also enhances the interpretability and generalization ability of the method, providing more accurate target element localization capabilities for graphical user interface agents. The method includes: in response to a target element localization request, acquiring interface input data and natural language commands; constructing an interface relationship graph based on the interface input data; performing multi-type inference on element objects in the interface relationship graph to obtain multi-type inference results for the element objects; selecting at least two inference results from the multi-type inference results for fusion, and determining the localization result of the target element based on the fusion result.
Owner:HANGZHOU INST FOR ADVANCED STUDY UCAS

A verification-based Python function argument type inference method

This invention discloses a verification-based method for inferring Python function parameter types. The method involves parsing the input Python source file to extract function and parameter information; constructing an initial set of candidate parameter types; identifying the behavioral characteristics of function parameters within the function body based on static analysis and filtering the candidate type set accordingly; adding type annotations to the function parameters and introducing a static type checker to verify the candidate types; and integrating the verified types to obtain the final parameter type inference result. By introducing a Python static type checker into the type inference process, this invention effectively improves the accuracy and comprehensiveness of function parameter type inference results. It can reliably infer Python function parameter types even in the absence of call point context or explicit type annotations, overcoming the inaccurate and incomplete inference results of existing methods, and has high engineering practical value.
Owner:NANJING UNIV

WebAssessment type inference method and device based on enhanced semantic map and storage medium

The invention discloses a WebAssessment type inference method and device based on an enhanced semantic map, and a storage medium. Firstly, deep memory access semantics are extracted from WebAssembly binary codes, then an enhanced semantic graph containing access mode clustering, dependency chain analysis and type propagation paths is constructed, finally, the semantic graph is converted into high-precision type definition and data structure layout, and accurate inference of a complex data structure is achieved. Specifically, deep semantic association can be found from a seemingly irrelevant memory access sequence, and a logic structure of an original program is reconstructed. According to the method, through the construction of the enhanced semantic map, a complete definition including a nested structure, a complex, an array and other complex data types can be accurately identified and reconstructed, and the reverse analysis precision of WebAssembly codes is remarkably improved.
Owner:HUAZHONG UNIV OF SCI & TECH

Inferring type definitions of user-defined types of variables in application program code

Type definitions of user-defined types in application program code for which definitions are absent (“unknown types”) are inferred. A static analyzer implements two passes of a fixed-point type inference algorithm. Each pass encompasses a plurality of traversals of the application's control flow to build inferred definitions of unknown types until the inferred definitions are maximally built. To build an inferred definition, based on inferring a variable is an unknown type, the static analyzer infers member variables / functions of the unknown type based on contextual information associated with the variable. Type information of unknown types is propagated along control flow paths. After the first pass terminates, unknown types can be assigned known types based on matching of inferred definitions. Inferred definitions of remaining unknown types are incorporated into the application program code. A second pass of type inferencing and data flow analysis are then performed with the inferred definitions incorporated therein.
Owner:VERACODE INC