Skip to content

Add Interactive Proof Debugger FeatureComplete proof debugging system…#133

Open
yaswanth169 wants to merge 1 commit intoboyland:masterfrom
yaswanth169:feature/interactive-proof-debugger
Open

Add Interactive Proof Debugger FeatureComplete proof debugging system…#133
yaswanth169 wants to merge 1 commit intoboyland:masterfrom
yaswanth169:feature/interactive-proof-debugger

Conversation

@yaswanth169
Copy link

Summary

This PR adds a proof debugging feature that captures the complete execution state of SASyLF proofs and exports them to JSON format for visualization and analysis.

Features

  • Complete proof tree capture with all derivation steps
  • JSON export for external visualization tools
  • Command-line flag: --proof-debug
  • Zero performance impact when disabled
  • Fully backward compatible

Implementation

New Package: edu.cmu.cs.sasylf.debugger (6 classes, 868 lines)

  • ProofDebugger: Main API with thread-local state
  • ProofState: Per-theorem state tracker
  • DerivationStep: Individual proof step
  • ProofTree: Hierarchical structure
  • ContextSnapshot: Immutable context capture
  • ProofStateExporter: JSON export

Modified Files (46 lines total):

  • Main.java: --proof-debug flag and JSON output
  • Theorem.java: ProofState initialization hook
  • Derivation.java: Push/pop derivation tracking

Testing

✓ All existing regression tests pass
✓ Feature tested on: sum.slf, lambda.slf, featherweight-java.slf
✓ JSON output validated
✓ Backward compatibility confirmed (no flag = no export)

Example Usage

java -jar SASyLF.jar --proof-debug examples/sum.slf

Copy link
Owner

@boyland boyland left a comment

Choose a reason for hiding this comment

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

Thanks for your work! It seems very interesting.
I'm open to including your changes, but you have lots of changes of existing files that merely update the formatting. Some of the formatting changes are fine, but others harmful. But in any case, formatting changes should not be mixed with semantic changes. Please update your pull request to change existing files only as needed for your extension, not because your version of VSC wants "if (condition) action" converted to add a newline.

@yaswanth169 yaswanth169 force-pushed the feature/interactive-proof-debugger branch from 602bcdf to 15bc66c Compare January 13, 2026 19:45
Complete proof debugging system with JSON export.

Modified Files (minimal semantic changes only):
- Main.java: Added --proof-debug flag parsing and JSON export (21 lines)
- Theorem.java: Added beginTheorem/endTheorem hooks (8 lines)
- Derivation.java: Added pushDerivation/popDerivation hooks (5 lines)
- ProofDebugger.java: Added stub methods for minimal tracking

New Files:
- 6 debugger package classes (ProofState, DerivationStep, etc.)
- PROOF_DEBUGGER_README.md documentation

Testing:
- All files compile successfully
- Feature test: JSON export working correctly
- Backward compatible (no impact when flag not used)

Total changes: ~34 lines across 3 existing files
Zero formatting changes to existing code
Zero Javadoc comment changes
@yaswanth169 yaswanth169 force-pushed the feature/interactive-proof-debugger branch from 15bc66c to 4f3d693 Compare January 13, 2026 20:14
@yaswanth169
Copy link
Author

Thanks for the detailed review on PR #133. I’ve fully revised the PR to address the formatting concerns.

What changed

  • Removed all non-semantic changes (VSCode auto-formatting, Javadoc reflow, whitespace-only diffs).
  • The PR now contains only functional additions required for the Interactive Proof Debugger.

Current scope

  • Minimal integration into existing files (34 total new lines):
    • Main.java: flag parsing, help text, JSON export hook
    • Theorem.java: begin/end theorem hooks
    • Derivation.java: push/pop derivation hooks
  • New debugger package (~1.4k LOC) is fully self-contained.

Verification

  • Compiles cleanly with no warnings.
  • Tested with --proof-debug; JSON output generated correctly.
  • No behavior or performance changes when the flag is not used.

This version is strictly limited to enabling JSON-based proof debugging. A separate PR will introduce the interactive visualization tool that consumes this output.

@yaswanth169
Copy link
Author

Hi @boyland ,
When you have some time, could you please review this feature? I’d also be excited to collaborate on more strong features that have potential for impactful papers.
Let me know your availability whenever it works for you.

@boyland
Copy link
Owner

boyland commented Feb 14, 2026

Thanks for your offer. I'm going to take a look when I get a chance. I am most interested in getting the earlier PR figured out, but it seems you've have pulled back to the scope of your changes, so I want to honor that by another review. But not yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants