Thank you for your interest in contributing to ProofChecker! This document provides guidelines for contributing to the project.
Current Focus: The primary development focus is on Bimodal, the complete and verified propositional modal-temporal logic. Bimodal has full soundness and completeness proofs and serves as the production-ready foundation. Contributions to enhance Bimodal's automation, documentation, and tooling are especially welcome.
Logos represents the research roadmap extending Bimodal to hyperintensional semantics. Research contributions to Logos are also welcome, with the understanding that this is experimental work.
- LEAN 4 v4.14.0 or later
- Lake (included with LEAN 4)
- Git
- VS Code with lean4 extension (recommended)
# Fork the repository on GitHub, then clone your fork
git clone https://github.com/YOUR-USERNAME/Logos.git
cd Logos
# Add upstream remote
git remote add upstream https://github.com/ORIGINAL-OWNER/Logos.git
# Install dependencies and build
lake update
lake build
# Run tests to verify setup
lake test# Build should complete without errors
lake build
# Tests should pass
lake test
# Linter should have no warnings
lake lintProofChecker requires TDD for all new features:
-- BimodalTest/ProofSystem/NewFeatureTest.lean
/-- Test new theorem is provable -/
example : ⊢ my_new_theorem := by
sorry -- Test fails because theorem doesn't exist-- Bimodal/Theorems/NewTheorem.lean
/-- New theorem: description -/
theorem my_new_theorem : ⊢ ... := by
-- Implementation to make test pass- Add documentation
- Optimize if needed
- Ensure style compliance
All code must follow the LEAN Style Guide:
-- Good: follows style guide
/-- Brief description of function -/
def my_function (x : Nat) : Nat :=
x + 1
-- Bad: missing docstring, wrong naming
def MyFunction(x:Nat):Nat := x+1Do not use emojis in code, comments, or documentation. Use text-based alternatives like [COMPLETE], **DO**, **DON'T**. Mathematical symbols (→, ∧, ∨, ¬, □, ◇) are NOT emojis and must be preserved. See LEAN Style Guide for details.
Every public definition needs:
- Declaration docstring (
/-- ... -/) - Module docstrings for new files (
/-! ... -/) - Examples where appropriate
/-- Compute the complexity of a formula.
Returns the number of operators plus atomic formulas.
## Example
```lean
#eval (Formula.atom "p").complexity -- 1
#eval (Formula.box (Formula.atom "p")).complexity -- 2-/ def complexity (φ : Formula) : Nat := ...
## 3. Directory Naming Convention
This project follows Lean 4 ecosystem conventions for directory naming:
### PascalCase (capitalized)
Directories containing Lean source code use PascalCase. These names must match Lean's import path requirements:
- `Logos/` - Main Lean source code
- `Theories/` - Theory implementations (Bimodal, Logos)
- `Tests/` - Test suites
**Rationale**: Lean imports like `import Theories.Bimodal.Syntax` require directory names to match exactly.
### lowercase
All other directories use lowercase:
- `docs/` - Project documentation
- `scripts/` - Utility scripts
- `benchmarks/` - Performance benchmarks
- `latex/` - LaTeX resources and templates
**Rationale**: Aligns with standard software project conventions and provides visual distinction between code and non-code directories.
### Why This Matters
1. **Lean compatibility**: Import paths must match directory structure exactly
2. **Ecosystem alignment**: Follows Mathlib and other Lean 4 project conventions
3. **GitHub Pages**: `docs/` is automatically served by GitHub Pages
4. **Clarity**: Developers can quickly identify code vs. non-code directories
## 4. Pull Request Process
### Branch Naming
feature/description -- New features fix/issue-number -- Bug fixes docs/description -- Documentation updates refactor/description -- Refactoring
Examples:
- `feature/temporal-duality-tactic`
- `fix/123-modus-ponens-edge-case`
- `docs/update-examples`
### Commit Message Format
:
Fixes #123
Types:
- `feat`: New feature
- `fix`: Bug fix
- `docs`: Documentation
- `test`: Adding tests
- `refactor`: Code refactoring
- `style`: Style/formatting changes
- `chore`: Maintenance tasks
Examples:
feat: Add temporal_k tactic for TK rule application
Implements a custom tactic that automatically applies the temporal K inference rule when the goal matches the pattern.
Fixes #45
### PR Description Template
```markdown
## Summary
Brief description of changes.
## Changes
- Change 1
- Change 2
- Change 3
## Testing
- [ ] Added unit tests
- [ ] All existing tests pass
- [ ] Manual testing performed
## Checklist
- [ ] Code follows style guide
- [ ] All public definitions have docstrings
- [ ] No `sorry` in committed code
- [ ] `lake lint` has no warnings
- [ ] Updated relevant documentation
- Create a feature branch from
main - Make your changes with tests
- Ensure
lake build,lake test,lake lintall pass - Push to your fork
- Open PR against upstream
main - Address review feedback
- Squash commits if requested
Reviewers will check:
- All tests pass
- No
sorryin committed code - Logic is correct
- Edge cases handled
- Follows LEAN Style Guide
- 100-char line limit
- 2-space indentation
- Proper naming conventions
- All public definitions have docstrings
- Module docstring if new file
- Examples where appropriate
- Updated README if needed
- New tests for new features
- Tests cover edge cases
- No decrease in coverage
- No unnecessary computation
- Reasonable proof complexity
- Build time not significantly increased
- Create issue describing the bug
- Reference issue in PR
- Add regression test
- Fix the bug
- Verify fix with tests
- Discuss in issue first (for large features)
- Follow TDD process
- Document thoroughly
- Add examples
- Fix typos and unclear explanations
- Add examples
- Improve tutorials
- Update outdated information
- Increase coverage
- Add edge case tests
- Add integration tests
- Improve test organization
- Discuss approach in issue first
- Ensure no behavior change
- All tests must pass
- Update documentation if APIs change
- GitHub Issues: Bug reports, feature requests
- GitHub Discussions: Questions, ideas
- Lean Zulip:
#lean4and#mathlib4channels
- Check existing documentation first
- Search closed issues
- Ask in GitHub Discussions
- Ask on Lean Zulip
Include:
- LEAN version (
lean --version) - Steps to reproduce
- Expected behavior
- Actual behavior
- Minimal reproducible example
## Bug Report
### Environment
- LEAN: v4.14.0
- OS: Ubuntu 22.04
### Steps to Reproduce
1. Step 1
2. Step 2
### Expected Behavior
Description of expected behavior
### Actual Behavior
Description of actual behavior
### Minimal Example
```lean
-- Code that reproduces the issue
### Feature Requests
Include:
1. Problem being solved
2. Proposed solution
3. Alternatives considered
4. Additional context
## 8. Recognition
Contributors are recognized in:
- CONTRIBUTORS.md file
- Release notes for significant contributions
- Commit history
## 9. Code of Conduct
- Be respectful and inclusive
- Focus on constructive feedback
- Help others learn
- Follow project guidelines
- Report issues appropriately
## 10. AI-Assisted Development
Logos includes an AI agent system that automates development workflows:
### Using AI Commands
```bash
# Research a topic
/research "LEAN 4 metaprogramming for tactics"
# Create implementation plan
/plan "Implement modal_search tactic"
# Implement the plan
/lean 045
# Refactor code
/refactor Logos/Automation/Tactics.lean
# Update documentation
/document "automation tactics"
- Automated Research: Multi-source research with LEAN library exploration
- Implementation Planning: Detailed step-by-step plans with complexity analysis
- Proof Development: LEAN 4 proof implementation with verification
- Code Refactoring: Style guide adherence and readability improvements
- Documentation Management: Automated documentation updates
Use /meta to create or modify agents and commands:
/meta "Create a new agent for proof optimization"The meta system provides templates and patterns for extending the AI agent system.
- AI System Overview - Complete system documentation
- Architecture - Detailed system architecture
- Quick Start - Step-by-step usage guide
- Agent Catalog - Primary agents and routing
- Command Reference - Command usage and examples
- Meta System - Extending the AI system
- LEAN Style Guide
- Testing Standards
- Module Organization
- Quality Metrics
- Tactic Development
- AI System Overview - Automated development workflows