IP Library › Granted Patent US 12,423,220
Granted Patent B2
US 12,423,220 · App. 18/512,974 · Granted Sep 23, 2025

What-if analysis for notebooks

Inventors: Pavle Subotić (Belgrade, RS); Lazar Milikić (Palaiseau, FR); Milan Stojić (Belgrade, RS)
Assignee: MICROSOFT TECHNOLOGY LICENSING, LLC
G06F11/3698G06F8/436G06F11/3624G06F40/18G06F40/30G06N20/00
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,423,220
App. No.
18/512,974
Granted
Sep 23, 2025
Kind
B2
Abstract

Methods and systems provide for a notebook interactive programming environment, having out-of-order code-cell execution, which communicates potential cell execution outcomes. If an event handler receives an event (e.g., open notebook, code change, code execution, etc.) for a cell, without a request for a specific type of analysis (e.g., data-leakage, stale-state), intra-cell analysis is executed based-on the cell's abstract semantics, and an abstract state and pre-summaries are output that indicate the cell's propagation dependency (unbounded variables). If an analysis is associated with the event, starting with the stored abstract state, inter-cell analysis is recursively executed on successor cells having propagation dependencies, until a terminating criteria is reached. Outcomes (e.g., affected cell, line number, bug type, metrics, etc.) are sent via the notebook user-interface to warn users, ahead of concrete code execution, of hypothetical unsafe or safe actions in executing the notebook's code cells.

Claims (59)

1. A system for communicating potential cell execution outcomes in an interactive programming environment, the system comprising:

a processor;

a memory device, the memory device storing program code to be executed by the processor, the program code comprising:

an analysis engine that:

receives an event related to a first cell;

executes, in an abstract domain, first intra-cell static analysis for the first cell based on a current global abstract state and abstract semantics of the first cell to generate an updated global abstract state, the first intra-cell static analysis comprising generation of a pre-summary specifying a pre-condition of the first cell;

subsequent to executing the first intra-cell analysis, determines code of the first cell has changed; and

responsive to the determination that the code of the first cell has changed:

re-builds the pre-summary, and

executes, in the abstract domain, second intra-cell static analysis for the first cell based on the updated global abstract state and the abstract semantics of the first cell to generate a new updated global abstract state.

2. The system of claim 1 , wherein the analysis engine further:

parses code of the first cell to generate an abstract syntax tree (AST); and

converts the AST into a directed graph that encodes a control flow of statements in the first cell.

3. The system of claim 2 , wherein to execute the first intra-cell static analysis for the first cell, the analysis engine further:

utilizes the directed graph to generate the updated global abstract state.

4. The system of claim 1 , wherein the pre-condition of the first cell is used in determining if the first cell has a propagation dependency for receiving a global abstract state propagated from a second cell.

5. The system of claim 4 , wherein to generate the pre-summary, the analysis engine further:

utilizes a use-def structure to compute an unbound variable of the first cell, the use-def structure comprising a mapping between a usage of variables and respective definitions of variables.

6. The system of claim 1 , wherein to execute the first intra-cell static analysis for the first cell, the analysis engine further:

executes multiple approximate global states based on the abstract semantics.

7. The system of claim 1 , wherein to generate the pre-summary for the first cell, the analysis engine further:

determines there is no access pattern with respect to the first cell; and

generates the pre-summary by ignoring a variable in the first cell based on the determination that there is no access pattern with respect to the first cell.

8. The system of claim 1 , wherein the analysis engine further:

stores in memory the updated global abstract state generated based on the first intra-cell static analysis of the first cell.

9. A method for communicating potential cell execution outcomes in an interactive programming environment, the method comprising:

receiving an event related to a first cell;

starting with a stored global abstract state, recursively executing, until a terminating criteria is reached, inter-cell analysis on each successor cell of a plurality of cells including the first cell for which the successor cell has a propagation dependency relative to a global abstract state generated by a respective predecessor cell of the successor cell, said recursively executing inter-cell analysis comprising:

propagating the global abstract state generated by execution of abstract semantics of a predecessor cell to a respective successor cell, and

applying the generated global abstract state to an execution of abstract semantics of the respective successor cell; and

communicating information related to outcomes of the inter-cell analysis.

10. The method of claim 9 , wherein said recursively executing inter-cell analysis comprises:

determining a variable of the first cell causes the global abstract state to increase; and

adding the variable as a top element.

11. The method of claim 9 , wherein said recursively executing inter-cell analysis comprises:

identifying a second cell that has a direct dependency on the first cell.

12. The method of claim 9 , wherein said recursively executing inter-cell analysis comprises:

determining a second cell is an idle cell; and

pruning the idle cell from the plurality of cells.

13. The method of claim 12 , wherein said communicating information related to outcomes of the inter-cell analysis comprises:

generating a report that indicates a potential outcome in execution of the plurality of cells having the idle cell pruned therefrom.

14. The method of claim 9 , wherein a successor cell in the inter-cell analysis has a propagation dependency on a respective predecessor cell if an abstract state generated by execution of abstract semantics of the respective predecessor cell is propagatable to the successor cell based on unbounded variables in the successor cell.

15. The method of claim 9 , further comprising:

determining that a user initiated what-if analysis is associated with the event, wherein said recursively executing the inter-cell analysis is responsive to the determination that the user initiated the what-if analysis.

16. A computer-readable medium having program code recorded thereon that when executed by at least one processor causes the at least one processor to perform a method for communicating potential cell execution outcomes in an interactive programming environment, the method comprising:

receiving an event related to a first cell;

executing, in an abstract domain, first intra-cell static analysis for the first cell based on a current global abstract state and abstract semantics of the first cell to generate an updated global abstract state, the first intra-cell static analysis comprising generation of a pre-summary specifying a pre-condition of the first cell; and

subsequent to said executing the first intra-cell analysis, determining code of the first cell has changed; and

responsive to the determination that the code of the first cell has changed:

re-building the pre-summary, and

executing, in the abstract domain, second intra-cell static analysis for the first cell based on the updated global abstract state and the abstract semantics of the first cell to generate a new updated global abstract state.

17. The computer-readable medium of claim 16 , wherein the method further comprises:

parsing code of the first cell to generate an abstract syntax tree (AST); and

converting the AST into a directed graph that encodes a control flow of statements in the first cell.

18. The computer-readable medium of claim 17 , wherein said executing the first intra-cell static analysis for the first cell comprises:

utilizing the directed graph to generate the updated global abstract state.

19. The computer-readable medium of claim 16 , wherein the pre-condition of the first cell for use in determining if the first cell has a propagation dependency for receiving a global abstract state propagated from a second cell.

20. The computer-readable medium of claim 19 , wherein said generating the pre-summary comprises:

utilizing a use-def structure to compute an unbound variable of the first cell, the use-def structure comprising a mapping between a usage of variables and respective definitions of variables.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 30, 2023
From: SUBOTIC, PAVLE; MILIKIC, LAZAR; STOJIC, MILAN
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 065718/0361 →
Continuity (2)
Continuation 17497726 · Oct 8, 2021
Related Publication 20240086310A1 · Mar 14, 2024
References Cited (14)
US 10768904B2 · Wenskovitch, Jr. · 2020 [cited by examiner]
US 11880381B1 · Al-Alusi · 2024 [cited by examiner]
US 11954429B2 · Clement · 2024 [cited by examiner]
US 12147445B1 · Al-Alusi · 2024 [cited by examiner]
US 12265800B2 · Lyu · 2025 [cited by examiner]
US 20050273777A1 · Grover · 2005 [cited by examiner]
US 20180052891A1 · Shuster · 2018 [cited by examiner]
US 20200065219A1 · Bavishi · 2020 [cited by examiner]
US 20200310791A1 · Gilbertson · 2020 [cited by examiner]
Rule, Adam, Aurélien Tabard, and James D. Hollan. “Exploration and explanation in computational notebooks.” Proceedings of the 2018 CHI Conference on Human Factors in Computing Systems. 2018. pp. 1-12 (Year: 2018). [cited by examiner]
Head, Andrew, et al. “Managing messes in computational notebooks.” Proceedings of the 2019 CHI Conference on Human Factors in Computing Systems. 2019. pp. 1-12 (Year: 2019). [cited by examiner]
Tillmann, Nikolai, et al. “Touchdevelop: Programming cloud-connected mobile devices via touchscreen.” Proceedings of the 10th SIGPLAN symposium on New ideas, new paradigms, and reflections on programming and software. 2… [cited by examiner]
Chattopadhyay, Souti, et al. “What's wrong with computational notebooks? Pain points, needs, and design opportunities.” Proceedings of the 2020 CHI conference on human factors in computing systems. 2020.pp. 1-12 (Year: … [cited by examiner]
Johnson, Jeremiah W. “Benefits and pitfalls of jupyter notebooks in the classroom.” Proceedings of the 21st annual conference on information technology education. 2020. pp. 32-37 (Year: 2020). [cited by examiner]