Skip to content

Inlining#348

Merged
lucaneg merged 3 commits intomasterfrom
inlining
Dec 10, 2025
Merged

Inlining#348
lucaneg merged 3 commits intomasterfrom
inlining

Conversation

@lucaneg
Copy link
Member

@lucaneg lucaneg commented Dec 9, 2025

Implemented features
Closes #347

@lucaneg lucaneg added this to the 0.2 milestone Dec 9, 2025
@lucaneg lucaneg self-assigned this Dec 9, 2025
Copilot AI review requested due to automatic review settings December 9, 2025 16:58
@lucaneg lucaneg added this to LiSA Dec 9, 2025
@lucaneg lucaneg added 🎆 type:feature New feature or request ⁉ priority:p2 Priority planning - level 2 🌍 scope:interproc Work regarding interprocedural analyses or call graphs labels Dec 9, 2025
@lucaneg lucaneg moved this to PR WIP in LiSA Dec 9, 2025
@lucaneg lucaneg added the 🏗 resolution:wip Incomplete work - do not review yet label Dec 9, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements inlining functionality (closes #347) by refactoring the context sensitivity mechanism. The key changes consolidate multiple token types into a single parameterized KDepthToken<A> class and add generic type parameters throughout the scope tracking system.

  • Unified context sensitivity: Replaces ContextSensitivityToken, FullStackToken, LastCallToken, and ContextInsensitiveToken with a single KDepthToken<A> that handles all sensitivity levels via a k parameter
  • Generic scope tracking: Added type parameter <A extends AbstractLattice<A>> to ScopeId interface and implementations
  • Enhanced API: Updated ScopeId.push() to accept an AnalysisState<A> parameter for potential state-based inlining decisions

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
lisa/lisa-sdk/src/main/java/it/unive/lisa/interprocedural/ScopeId.java Added generic type parameter and new state parameter to push method
lisa/lisa-sdk/src/main/java/it/unive/lisa/interprocedural/UniqueScope.java Made generic to match updated ScopeId interface
lisa/lisa-sdk/src/main/java/it/unive/lisa/interprocedural/FixpointResults.java Updated to use generic ScopeId
lisa/lisa-sdk/src/main/java/it/unive/lisa/interprocedural/CFGResults.java Updated to use generic ScopeId throughout
lisa/lisa-sdk/src/main/java/it/unive/lisa/analysis/AnalyzedCFG.java Updated id field and constructor parameters to use ScopeId
lisa/lisa-sdk/src/main/java/it/unive/lisa/analysis/BackwardAnalyzedCFG.java Updated id field and constructor parameters to use ScopeId
lisa/lisa-sdk/src/main/java/it/unive/lisa/analysis/OptimizedAnalyzedCFG.java Updated ScopeId usage and modified push call to include state parameter
lisa/lisa-sdk/src/main/java/it/unive/lisa/analysis/BackwardOptimizedAnalyzedCFG.java Updated ScopeId usage, renamed parameter from exitState to entryState for consistency, modified push call
lisa/lisa-sdk/src/main/java/it/unive/lisa/program/cfg/CFG.java Updated all fixpoint method signatures to use ScopeId
lisa/lisa-sdk/src/main/java/it/unive/lisa/util/numeric/IntInterval.java Fixed spelling: corrected "then" to "than" in three documentation comments
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/context/KDepthToken.java Refactored to implement ScopeId, added logic for k-depth sensitivity (k=0: insensitive, k<0: full stack, k>0: bounded)
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/context/ContextSensitivityToken.java Removed - functionality consolidated into KDepthToken
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/context/FullStackToken.java Removed - replaced by KDepthToken with k=-1
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/context/LastCallToken.java Removed - replaced by KDepthToken with k=1
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/context/ContextInsensitiveToken.java Removed - replaced by KDepthToken with k=0
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/context/ContextBasedAnalysis.java Replaced ContextSensitivityToken with KDepthToken, updated constructor to accept int k parameter
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/context/recursion/Recursion.java Updated to use KDepthToken instead of ContextSensitivityToken
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/context/recursion/RecursionSolver.java Updated to use KDepthToken instead of ContextSensitivityToken
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/ModularWorstCaseAnalysis.java Changed id from static final to instance field to accommodate generic type parameter
lisa/lisa-analyses/src/main/java/it/unive/lisa/interprocedural/BackwardModularWorstCaseAnalysis.java Changed id from static final to instance field to accommodate generic type parameter
lisa/lisa-sdk/src/test/java/it/unive/lisa/checks/semantic/CheckToolWithAnalysisResultsTest.java Added diamond operator to UniqueScope instantiations
lisa/lisa-sdk/src/test/java/it/unive/lisa/analysis/AnalyzedCFGTest.java Added diamond operator to UniqueScope instantiations
lisa/lisa-analyses/src/test/java/it/unive/lisa/program/cfg/CFGFixpointTest.java Added diamond operator to UniqueScope instantiations
lisa/lisa-analyses/src/test/java/it/unive/lisa/TestParameterProvider.java Added diamond operator to UniqueScope instantiations
lisa/lisa-analyses/src/test/java/it/unive/lisa/cron/*.java Replaced FullStackToken.getSingleton() with new ContextBasedAnalysis<>(-1)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lucaneg lucaneg merged commit d0a8e12 into master Dec 10, 2025
2 checks passed
@lucaneg lucaneg deleted the inlining branch December 10, 2025 09:23
@github-project-automation github-project-automation bot moved this from PR WIP to PR Merged in LiSA Dec 10, 2025
@lucaneg lucaneg removed the 🏗 resolution:wip Incomplete work - do not review yet label Dec 10, 2025
@lucaneg lucaneg moved this from PR Merged to PR Ready in LiSA Dec 10, 2025
@lucaneg lucaneg moved this from PR Ready to PR Merged in LiSA Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⁉ priority:p2 Priority planning - level 2 🌍 scope:interproc Work regarding interprocedural analyses or call graphs 🎆 type:feature New feature or request

Projects

Status: PR Merged

Development

Successfully merging this pull request may close these issues.

[FEATURE REQUEST] Add an inlining-based interprocedural analysis

2 participants