How lean-dojo/leandojo works
And Highlight Core Components
• Library Entry-Point: Represent the core package (lean_dojo) as the primary container.
• Data Extraction Module: Create a component for data_extraction that includes submodules such as ExtractData.lean, ast.py, cache.py, lean.py, trace.py, and traced_data.py. Show that this module is responsible for parsing Lean proof states, tactics, and premises.
• Interaction Module: Create a component for interaction that covers Lean4Repl.lean, dojo.py, and parse_goals.py. This module handles programmatic interactions with Lean (for example, sending commands and processing responses).
Relationships and Interactions
• That the Data Extraction module provides structured data about proofs and tactics, which then may be consumed by the Interaction module. For instance, results from ast and trace processing are used by functions in interactions.
Architectural Patterns
• Separation of Concerns: Note that the library cleanly separates functionalities—data extraction is isolated from interaction. This modular design helps in testing and maintenance.
• Integration Points: Identify points where the library might interface with external Lean installations (external dependency on Lean 4) or other tooling (like GitHub APIs via tokens).
• Reusability: Mention that submodules are designed to be plug-and-play components, hinting at extensibility.
Technologies
• Lean: Illustrate that the data and interaction methods are geared towards interfacing with Lean (noted by the Lean4Repl and Lean (.lean) files).