# US 2021/0173639 A1 · System and method for interprocedural analysis

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0173639 A1
- Document ID: US20210173639A1
- Status: Published application
- Kind: A1
- Application number: 16/702,834
- Filed: 2019-12-04
- Published: 2021-06-10
- Earliest claimed: 2019-12-04
- Assignees: Whitesource Ltd.
- Applicants: Whitesource Ltd.
- Inventors: Aharon ABADI; Bar MAKOVITZKI; Ron SHEMER; Eugen HOROVITZ
- Web page: https://patentgrep.com/patent/US20210173639A1

## CPC

- G06F 8/75: Structural analysis for program understanding
- G06F 16/9024: {Graphs; Linked lists (G06F16/9027 takes precedence)}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A computer-implemented method, system and computer program product, the method comprising: obtaining computer code; abstracting the computer code to obtain abstracted computer code comprising a plurality of instructions; generating a constraint system, comprising one or more constraints on one or more entities of the abstracted computer code; obtaining a solution to the constraint system, the solution comprising one or more possible types for each entity; and creating a call graph based on the types of the entities.

## Claims

### Claim 1

A computer-implemented method comprising:
obtaining computer code;
abstracting the computer code to obtain abstracted computer code comprising a plurality of instructions;
generating a constraint system, comprising at least one constraint on an at least one entity of the abstracted computer code;
obtaining a solution to the constraint system, the solution comprising at least one possible type for the at least one entity; and
creating a call graph based on the at least one type of the at least one entity.

### Claim 2 (depends on 1)

The method of claim 1, wherein the constraint system is generated upon at least one instruction from the plurality of instructions, each of the at least one instruction selected from the group consisting of: an assignment and a method invocation.

### Claim 3 (depends on 1)

The method of claim 1, wherein said abstracting comprising eliminating from the computer code at least one flow-related instruction.

### Claim 4 (depends on 3)

The method of claim 3, wherein said abstracting the computer code comprises entering at least one second instruction replacing the at least one flow-related instruction.

### Claim 5 (depends on 3)

The method of claim 3, wherein the flow-related instruction is selected in accordance with a programming language of the computer code.

### Claim 6 (depends on 1)

The method of claim 1, wherein obtaining the solution comprises using a technique selected from the group consisting of: abstract interpretation and chaotic iteration.

### Claim 7 (depends on 1)

The method of claim 1, wherein the entity is a variable or a parameter.

### Claim 8 (depends on 1)

The method of claim 1, wherein the at least one possible type of the at least one entity comprises at least two possible types for the at least one entity.

### Claim 9 (depends on 1)

The method of claim 1, wherein said generating the constraint system and said obtaining the solution to the constraint system are repeated until no changes are detected.

### Claim 10

A computerized apparatus having a processor, the processor being configured to perform the steps of:
obtaining computer code;
abstracting the computer code to obtain abstracted computer code comprising a plurality of instructions;
generating a constraint system, comprising at least one constraint on an at least one entity of the abstracted computer code;
obtaining a solution to the constraint system, the solution comprising at least one possible type for the at least one entity; and
creating a call graph based on the at least one type of the at least one entity.

### Claim 11 (depends on 10)

The apparatus of claim 10, wherein the constraint system is generated upon at least one instruction from the plurality of instructions, each of the at least one instruction selected from the group consisting of: an assignment and a method invocation.

### Claim 12 (depends on 10)

The apparatus of claim 10, wherein said abstracting comprising eliminating from the computer code at least one flow-related instruction.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein said abstracting the computer code comprises entering at least one second instruction replacing the at least one flow-related instruction.

### Claim 14 (depends on 12)

The apparatus of claim 12, wherein the flow-related instruction is selected in accordance with a programming language of the computer code.

### Claim 15 (depends on 10)

The apparatus of claim 10, wherein obtaining the solution comprises using a technique selected from the group consisting of: abstract interpretation and chaotic iteration.

### Claim 16 (depends on 10)

The apparatus of claim 10, wherein the entity is a variable or a parameter.

### Claim 17 (depends on 10)

The apparatus of claim 10, wherein the at least one possible type of the at least one entity comprises at least two possible types for the at least one entity.

### Claim 18 (depends on 10)

The apparatus of claim 10, wherein said generating the constraint system and said obtaining the solution to the constraint system are repeated until no changes are detected.

### Claim 19

A computer program product comprising a computer readable storage medium retaining program instructions, which program instructions when read by a processor, cause the processor to perform a method comprising:
obtaining computer code;
abstracting the computer code to obtain abstracted computer code comprising a plurality of instructions;
generating a constraint system, comprising at least one constraint on an at least one entity of the abstracted computer code;
obtaining a solution to the constraint system, the solution comprising at least one possible type for the at least one entity; and
creating a call graph based on the at least one type of the at least one entity.
