Calculation Specification Code Synthesis for Enterprise Query Automation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Implementing mathematical and logical calculations in large enterprise software from Calculation Specification (CS) sheets is tedious and requires manual effort, involving database queries and code translation, especially when dealing with complex formulae and enterprise-size databases.

Innovation Solution

A processor-implemented method and system for automated code generation using Natural Language Processing (NLP) to synthesize queries from CS sheets, formulating Query Synthesis Specifications (QSS), and converting them into a target programming language, with database execution and ranking of queries based on heuristics.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Productivity

If manual code generation from CS sheets is performed, then code can be implemented, but the process is tedious and effort-intensive

Engineering Contradiction:
Improvecode generation speedVSAvoidtime for writing database queries and converting formulae
Core Design Contradiction:
ProductivityVSLoss of time

Solution Approach 1:

The system performs self-service by automatically generating code from CS sheets without requiring manual intervention. The automated code generation system extracts information from CS sheets, generates database queries, and produces executable code independently, eliminating the need for manual code writing and conversion processes

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent introduces an intermediary automated code generation system that acts as a mediator between the CS sheets and the final executable code. This intermediary system processes the CS sheet information, generates appropriate database queries, and produces the target code, thereby eliminating the need for manual translation and significantly improving productivity

Inventive Principle:
Principle #24Intermediary (Mediator)

2Ease of manufacture

If manual conversion of complex mathematical formulae to code is performed, then calculations can be implemented, but the process requires significant effort

Engineering Contradiction:
Improveease of implementing calculationsVSAvoidcomplexity of converting formulae to code
Core Design Contradiction:
Ease of manufactureVSDevice complexity

Solution Approach 1:

The patent replaces the mechanical process of manual formulae conversion with an automated computational system. The automated code generation system uses algorithms and programming to convert mathematical formulae from CS sheets into executable code, eliminating the need for manual translation and reducing both effort and complexity

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

Solution Approach 2:

The system performs self-service by automatically handling the conversion of complex mathematical formulae into executable code. The automated generation process extracts formulae from CS sheets and transforms them into target language code without requiring manual intervention, thereby improving ease of implementation

Inventive Principle:
Principle #25Self-service

3Productivity

If automated code generation is implemented, then productivity is improved, but system complexity increases

Engineering Contradiction:
Improveautomation of code generationVSAvoidcomplexity of automated generation system
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The automated code generation system is divided into distinct functional modules: a CS sheet parser that extracts information, a query generator that creates database queries, and a code synthesizer that produces executable code. This segmentation allows each component to be independently developed and maintained, managing overall system complexity while maintaining high productivity

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS12596708B2Systems and methods for automated code generation for calculation based on associated formal specifications
Publication Date: 2026.04.07 TATA CONSULTANCY SERVICES LTD
  • US12596708B2 patent drawing
  • US12596708B2 patent drawing
  • US12596708B2 patent drawing

AI summary

Enterprise software relies on numerous types and instances of mathematical and logical calculations for proper functioning, which are formally specified in spreadsheets, known as Calculation Specification (CS) sheets, that provide illustrations of the inputs and outputs of the calculation, and are expressed in inputs and formulae applied on them to get values for outputs. The values for such inputs are retrieved by executing ad hoc queries on respective application's database. Present disclosure provides systems/methods to synthesize code using CS sheets by formulating a Programming By Example (PBE) problem for each input involved in the calculation. A query synthesis technique is then implemented that uses natural language processing and enumerative program synthesis techniques to infer queries corresponding to the PBE problem. These queries are filtered based on whether their output is consistent with expected output in PBE. Finally, the synthesized queries and calculation formulae are translated into a desired target programming language.