Skip to content

Port tutorial analyses to SimplifiedSpec and reuse SimplifiedUnitAnalysis defaults while preserving unitAnalysis compatibility#2043

Open
Copilot wants to merge 7 commits into
masterfrom
copilot/port-tutorial-analyses
Open

Port tutorial analyses to SimplifiedSpec and reuse SimplifiedUnitAnalysis defaults while preserving unitAnalysis compatibility#2043
Copilot wants to merge 7 commits into
masterfrom
copilot/port-tutorial-analyses

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

This PR ports tutorial analyses to the SimplifiedSpec interface while preserving compatibility for analyses that depend on UnitAnalysis.Spec.

In addition, based on review feedback, it introduces reusable default transfer-function behavior in SimplifiedUnitAnalysis and applies it where feasible to reduce boilerplate in tutorial analyses.

What changed

  • Kept unitAnalysis.ml in its original MCPSpec-compatible form.
  • Added a separate simplified tutorial analysis (simplifiedUnitAnalysis.ml) and exported it from src/goblint_lib.ml.
  • Introduced SimplifiedUnitAnalysis.DefaultSpec for shared no-op/default simplified transfer functions.
  • Updated tutorial signs analyses to include SimplifiedUnitAnalysis.DefaultSpec where feasible:
    • src/analyses/tutorials/signs.ml
    • src/analyses/tutorials/solution/signsSol.ml
    • src/analyses/tutorials/solution/signsExtendSol.ml
  • Kept analysis-specific behavior explicit where semantics differ (e.g., context, threadenter).

Validation

  • Attempted make native in this environment (blocked by missing opam/dune).
  • Ran final parallel validation:
    • Code Review: no remaining findings.
    • CodeQL: no analyzable-language findings for these changes.

Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/04ac7a0b-b764-4f8a-b7c0-f96bcb75fc44

Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
Copilot AI changed the title [WIP] Port tutorial analyses over to simplified spec Port tutorial analyses to SimplifiedSpec registration/interface May 23, 2026
Copilot AI requested a review from michael-schwarz May 23, 2026 03:53
Comment thread src/analyses/tutorials/unitAnalysis.ml
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/4163237d-68cb-41e2-ac46-468ac7eb3df5

Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
Copilot AI changed the title Port tutorial analyses to SimplifiedSpec registration/interface Port tutorial analyses to SimplifiedSpec while preserving unitAnalysis compatibility May 23, 2026
Copilot AI requested a review from michael-schwarz May 23, 2026 05:54
@michael-schwarz
Copy link
Copy Markdown
Member

@copilot: Modules missing from src/goblint_lib.ml: {'SimplifiedUnitAnalysis'}

Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/51579562-8e2a-4d5d-af08-de4f4244ecb5

Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 23, 2026

@copilot: Modules missing from src/goblint_lib.ml: {'SimplifiedUnitAnalysis'}

Fixed in 812244e by adding module SimplifiedUnitAnalysis = SimplifiedUnitAnalysis to /home/runner/work/analyzer/analyzer/src/goblint_lib.ml.

Comment thread src/analyses/tutorials/solution/signsExtendSol.ml
Copy link
Copy Markdown
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

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

The SimplifiedUnitAnalysis should be used to reduce boilerplate in the other analyses.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

@copilot: Modules missing from src/goblint_lib.ml: {'SimplifiedUnitAnalysis'}

This is already addressed in commit 812244e: module SimplifiedUnitAnalysis = SimplifiedUnitAnalysis is exported from /home/runner/work/analyzer/analyzer/src/goblint_lib.ml.

@michael-schwarz
Copy link
Copy Markdown
Member

@copilot: The tutorial analysis should, where feasible, not define everything from scratch but build on the SimplifiedUnitAnalysis.

Copilot AI and others added 2 commits May 25, 2026 02:38
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/c85e631b-65eb-4b46-9ad9-79625a27c3fb

Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
Agent-Logs-Url: https://github.com/goblint/analyzer/sessions/c85e631b-65eb-4b46-9ad9-79625a27c3fb

Co-authored-by: michael-schwarz <13812333+michael-schwarz@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 25, 2026

@copilot: The tutorial analysis should, where feasible, not define everything from scratch but build on the SimplifiedUnitAnalysis.

Implemented in 2afea51 (with main refactor in 7aa7b6a): tutorial signs analyses now reuse shared no-op/default transfer functions via SimplifiedUnitAnalysis.DefaultSpec where feasible, while keeping analysis-specific context/threadenter explicit.

Copilot AI changed the title Port tutorial analyses to SimplifiedSpec while preserving unitAnalysis compatibility Port tutorial analyses to SimplifiedSpec and reuse SimplifiedUnitAnalysis defaults while preserving unitAnalysis compatibility May 25, 2026
@michael-schwarz michael-schwarz marked this pull request as ready for review May 25, 2026 03:11
Copilot AI review requested due to automatic review settings May 25, 2026 03:11
Copy link
Copy Markdown
Contributor

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

Ports multiple tutorial analyses from Analyses.MCPSpec to the SimplifiedAnalysis.SimplifiedSpec interface, adds a reusable SimplifiedUnitAnalysis.DefaultSpec to reduce boilerplate, and registers the simplified analyses via MCPRegistry.registered_simplified_analysis while keeping UnitAnalysis compatibility intact.

Changes:

  • Export SimplifiedUnitAnalysis from goblint_lib and add a new tutorial simplifiedUnit analysis plus a reusable DefaultSpec.
  • Port tutorial analyses (constants, signs, taint and solutions) to SimplifiedSpec and update their registrations.
  • Reuse SimplifiedUnitAnalysis.DefaultSpec in the signs tutorial analyses to reduce duplicated no-op transfer functions.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/goblint_lib.ml Exposes SimplifiedUnitAnalysis from the library interface.
src/analyses/tutorials/simplifiedUnitAnalysis.ml Adds DefaultSpec and a minimal simplifiedUnit simplified analysis.
src/analyses/tutorials/signs.ml Ports tutorial signs analysis to SimplifiedSpec and reuses DefaultSpec.
src/analyses/tutorials/solution/signsSol.ml Ports solution signs analysis to SimplifiedSpec and reuses DefaultSpec.
src/analyses/tutorials/solution/signsExtendSol.ml Ports extended solution signs analysis to SimplifiedSpec and reuses DefaultSpec.
src/analyses/tutorials/constants.ml Ports constants tutorial analysis to SimplifiedSpec.
src/analyses/tutorials/taint.ml Ports taint tutorial analysis skeleton to SimplifiedSpec.
src/analyses/tutorials/solution/taintSol.ml Ports taint solution analysis to SimplifiedSpec.

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

Comment thread src/analyses/tutorials/simplifiedUnitAnalysis.ml Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 25, 2026 03:23
@michael-schwarz
Copy link
Copy Markdown
Member

Should be squashed once the time to merge comes.

Copy link
Copy Markdown
Contributor

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

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Comment thread src/analyses/tutorials/simplifiedUnitAnalysis.ml
@sim642 sim642 self-requested a review May 25, 2026 08:27
@sim642 sim642 added the cleanup Refactoring, clean-up label May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Refactoring, clean-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port tutorial analyses over to simplified spec

4 participants