Source Code Search via Functionality Representation Index

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current technologies fail to effectively organize, index, and make source code searchable using natural language specifications and code graph representation, leading to inefficiencies in aggregating, synthesizing, and analyzing code for easy accessibility and reusability.

Innovation Solution

A computer-implemented method and system that crawls and parses source code units into abstract syntax trees, models them into code graphs, establishes type ontologies, generates semantic IDs through linguistic, structural, and contextual analyses, and organizes data in a functionality representation index for efficient searching and retrieval.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If keyword-driven search is used for source code, then search simplicity is maintained, but search accuracy and relevance deteriorate

Engineering Contradiction:
Improvesearch accuracyVSAvoidsearch system complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent introduces an intermediary layer (functionality representation index and code graph) between the user's natural language query and the source code repository. This intermediary translates semantic queries into structured code representations, enabling accurate search results without requiring complex query parsing or keyword matching algorithms.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs preliminary actions by pre-processing source code into abstract syntax trees, generating functionality representations, and building the code graph structure before search is needed. This pre-computation enables fast and accurate searching at query time without requiring complex real-time analysis.

Inventive Principle:
Principle #10Preliminary action

2Ease of operation

If natural language query processing is implemented, then ease of use improves, but processing complexity increases

Engineering Contradiction:
Improvequery simplicityVSAvoidprocessing complexity
Core Design Contradiction:
Ease of operationVSDevice complexity

Solution Approach 1:

The patent uses the functionality representation index as an intermediary that bridges natural language queries and code structures. The system translates natural language semantics into code graph queries through this intermediary, allowing users to search using simple language while the complex translation process is handled automatically in the background.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The system performs self-service by automatically analyzing the semantic meaning of natural language queries and translating them into appropriate code graph search operations without requiring manual intervention or complex configuration. The query processing system adapts to different natural language formulations automatically.

Inventive Principle:
Principle #25Self-service

3Measurement precision

If comprehensive code analysis is performed, then search relevance improves, but processing time increases

Engineering Contradiction:
Improvesearch relevanceVSAvoidprocessing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent performs comprehensive code analysis in advance by parsing source code into abstract syntax trees, extracting functionality representations, and building the code graph structure before search operations. This pre-computation stores detailed code semantics in an optimized format, enabling fast and relevant search results without requiring time-consuming real-time analysis.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The system dynamically adapts the level of analysis performed based on query requirements. The code graph structure allows the system to traverse only the relevant portions of the codebase needed to answer each query, rather than performing exhaustive analysis on the entire codebase for every search operation.

Inventive Principle:
Principle #15Dynamics

4Adaptability or versatility

If code is organized by functionality, then reusability improves, but organization complexity increases

Engineering Contradiction:
Improvecode reusabilityVSAvoidorganization complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent segments source code into functional units by parsing into abstract syntax trees and extracting functionality representations. Each code component is analyzed and organized according to its semantic meaning and purpose, creating a structured breakdown that improves reusability while managing complexity through systematic segmentation.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The functionality representation index serves as a universal organizing structure that can represent multiple types of code elements (functions, classes, methods, etc.) using a common semantic framework. This universal organization enables different code components to be discovered and reused based on their functionality regardless of their specific type or location in the codebase.

Inventive Principle:
Principle #6Universality (Multi-functionality)

Data Source

PatentUS10809984B2System for generating functionality representation, indexing, searching, componentizing, and analyzing of source code in codebases and method thereof
Publication Date: 2020.10.20 COCYCLES
  • US10809984B2 patent drawing
  • US10809984B2 patent drawing
  • US10809984B2 patent drawing

AI summary

Systems and methods are disclosed for generating functionality representation, indexing, searching, componentizing, an analyzing source code source code unit in a one or more of code repositories. The systems and method include one or more of crawling a set of data entities in a repository system; parsing said set of data entities into abstract syntax trees (ASTs) architecture; modeling said set of data entities into a code graph (CG) architecture; establishing type ontology (TO) architecture of said set of data entities; organizing and storing said set of data entities in functionality representation index (FRI) architecture; componentizing one or more projects in the repositories into code components; and making the components discoverable by functionality and analyzable for performance, usage volume, etc.