|
| 1 | +# Implementation Plan: Submit Sub-PR 3.1 (Temporal Formula Type) |
| 2 | + |
| 3 | +- **Task**: 170 - Submit Sub-PR 3.1: Temporal formula type |
| 4 | +- **Status**: [COMPLETED] |
| 5 | +- **Effort**: 1.5 hours |
| 6 | +- **Dependencies**: Task 138 (Connectives.lean / PR #635 must be open as base) |
| 7 | +- **Research Inputs**: specs/170_submit_subpr_3_1_3_2_temporal_syntax/reports/01_pr-submission-research.md |
| 8 | +- **Artifacts**: plans/01_pr-submission-plan.md (this file) |
| 9 | +- **Standards**: plan-format.md, status-markers.md, artifact-management.md, tasks.md |
| 10 | +- **Type**: pr |
| 11 | +- **Lean Intent**: false |
| 12 | + |
| 13 | +## Overview |
| 14 | + |
| 15 | +Create a clean PR branch `pr3/temporal-syntax` based on `refactor/proposition-lukasiewicz` (PR #635's branch), containing only Formula.lean (~582 lines), the barrel import entry in Cslib.lean, and two new references.bib entries. The PR stacks on PR #635 because Formula.lean imports `Cslib.Foundations.Logic.Connectives` which only exists on that branch. Citation format in Formula.lean must be updated from informal text to BibKey format per CSLib standards. Context.lean, BigConj.lean, and Subformulas.lean are explicitly out of scope (deferred to task 160 / Sub-PR 3.2). |
| 16 | + |
| 17 | +### Research Integration |
| 18 | + |
| 19 | +Key findings from report 01_pr-submission-research.md: |
| 20 | +- PR #635 is open but not yet merged upstream; branch strategy must stack on it |
| 21 | +- Formula.lean imports `Cslib.Foundations.Logic.Connectives` for `TemporalConnectives` -- hard dependency |
| 22 | +- references.bib is missing `Kamp1968` and `GabbayPnueliShelahStavi1980` entries |
| 23 | +- CI checks: `lake build --wfail --iofail`, `lake test`, `mk_all --check --module`, `checkInitImports`, `lint-style-action` |
| 24 | +- The existing `pr3/temporal-formula` branch carries the full fork diff (80+ files) and cannot be reused |
| 25 | +- CONTRIBUTING.md requires AI usage disclosure in the PR description |
| 26 | + |
| 27 | +### Prior Plan Reference |
| 28 | + |
| 29 | +No prior plan. |
| 30 | + |
| 31 | +### Roadmap Alignment |
| 32 | + |
| 33 | +This plan advances the "Temporal syntax infrastructure" roadmap item listed under Completed: |
| 34 | +- `Temporal syntax infrastructure (Context, BigConj, Subformulas)` in `Logics/Temporal/Syntax/` |
| 35 | +- Formula.lean is the core type that underpins the entire Temporal module tree |
| 36 | + |
| 37 | +## Goals & Non-Goals |
| 38 | + |
| 39 | +**Goals**: |
| 40 | +- Create a clean branch `pr3/temporal-syntax` from `refactor/proposition-lukasiewicz` |
| 41 | +- Cherry-pick/extract only `Formula.lean` (582 lines) into the branch |
| 42 | +- Add barrel import `Cslib.Logics.Temporal.Syntax.Formula` to `Cslib.lean` |
| 43 | +- Add `Kamp1968` and `GabbayPnueliShelahStavi1980` BibTeX entries to `references.bib` |
| 44 | +- Update Formula.lean citation format from informal to BibKey |
| 45 | +- Pass all CI checks (lake build, lake test, mk_all, checkInitImports, lint-style) |
| 46 | +- Submit PR to `leanprover/cslib` with proper description and AI disclosure |
| 47 | + |
| 48 | +**Non-Goals**: |
| 49 | +- Including Context.lean, BigConj.lean, or Subformulas.lean (those are Sub-PR 3.2 / task 160) |
| 50 | +- Addressing eric-wieser's Bot/HImp comment on PR #635 (that is task 138's concern) |
| 51 | +- Waiting for PR #635 to merge before submitting (stacked PRs are accepted) |
| 52 | + |
| 53 | +## Risks & Mitigations |
| 54 | + |
| 55 | +| Risk | Impact | Likelihood | Mitigation | |
| 56 | +|------|--------|------------|------------| |
| 57 | +| PR #635 not yet merged, blocking reviewability | M | H | Clearly state dependency in PR description; stacked PRs are accepted practice in cslib | |
| 58 | +| Formula.lean produces warnings under --wfail | H | L | File compiles cleanly on fork main; verify on PR branch before submission | |
| 59 | +| mk_all --check fails due to missing barrel entry | H | L | Phase 2 adds the Cslib.lean entry; verify with mk_all before PR | |
| 60 | +| checkInitImports fails for transitive import | M | L | Formula.lean has `public import Cslib.Init` via Connectives; verify explicitly | |
| 61 | +| BibKey format incorrect or lint-style rejects it | M | L | Follow exact format from existing files (Modal/Basic.lean, Propositional/Defs.lean) | |
| 62 | +| PR #607 (fmontesi/connectives) merges first, breaking imports | H | L | Monitor #607 status; our PR depends on #635 not #607 | |
| 63 | + |
| 64 | +## Implementation Phases |
| 65 | + |
| 66 | +**Dependency Analysis**: |
| 67 | +| Wave | Phases | Blocked by | |
| 68 | +|------|--------|------------| |
| 69 | +| 1 | 1 | -- | |
| 70 | +| 2 | 2 | 1 | |
| 71 | +| 3 | 3 | 2 | |
| 72 | +| 4 | 4 | 3 | |
| 73 | + |
| 74 | +Phases are sequential because each depends on the branch state from the prior phase. |
| 75 | + |
| 76 | +--- |
| 77 | + |
| 78 | +### Phase 1: Create clean PR branch [COMPLETED] |
| 79 | + |
| 80 | +**Goal**: Create `pr3/temporal-syntax` branch from `refactor/proposition-lukasiewicz` with only Formula.lean added. |
| 81 | + |
| 82 | +**Tasks**: |
| 83 | +- [ ] Fetch latest upstream and origin remotes (`git fetch upstream && git fetch origin`) |
| 84 | +- [ ] Create branch `pr3/temporal-syntax` from `refactor/proposition-lukasiewicz` (`git checkout -b pr3/temporal-syntax refactor/proposition-lukasiewicz`) |
| 85 | +- [ ] Copy `Formula.lean` from fork main: `git checkout main -- Cslib/Logics/Temporal/Syntax/Formula.lean` |
| 86 | +- [ ] Create directory if needed: `mkdir -p Cslib/Logics/Temporal/Syntax/` |
| 87 | +- [ ] Verify the file is present and has expected content (~582 lines) |
| 88 | +- [ ] Stage and commit: `git add Cslib/Logics/Temporal/Syntax/Formula.lean` |
| 89 | + |
| 90 | +**Timing**: 15 minutes |
| 91 | + |
| 92 | +**Depends on**: none |
| 93 | + |
| 94 | +**Files to modify**: |
| 95 | +- `Cslib/Logics/Temporal/Syntax/Formula.lean` - add (cherry-pick from main) |
| 96 | + |
| 97 | +**Verification**: |
| 98 | +- Branch exists based on `refactor/proposition-lukasiewicz` |
| 99 | +- Only Formula.lean is added relative to the base branch |
| 100 | +- `git diff refactor/proposition-lukasiewicz --name-only` shows only the new file(s) |
| 101 | + |
| 102 | +--- |
| 103 | + |
| 104 | +### Phase 2: Update references and citations [COMPLETED] |
| 105 | + |
| 106 | +**Goal**: Add missing BibTeX entries to references.bib and convert Formula.lean citations to BibKey format. |
| 107 | + |
| 108 | +**Tasks**: |
| 109 | +- [ ] Add `Kamp1968` BibTeX entry to `references.bib` (in alphabetical position after `Jech2003` or similar K-entries) |
| 110 | +- [ ] Add `GabbayPnueliShelahStavi1980` BibTeX entry to `references.bib` (in alphabetical position after `FisherEtAl2019` or similar G-entries) |
| 111 | +- [ ] Update Formula.lean `## References` section from informal format to BibKey format: |
| 112 | + - Change to: `* [H. Kamp, *Tense Logic and the Theory of Linear Order*][Kamp1968]` |
| 113 | + - Change to: `* [D. Gabbay, A. Pnueli, S. Shelah, J. Stavi, *On the temporal analysis of fairness*][GabbayPnueliShelahStavi1980]` |
| 114 | +- [ ] Add barrel import to `Cslib.lean`: insert `public import Cslib.Logics.Temporal.Syntax.Formula` in alphabetical position (after `Logics.Propositional.NaturalDeduction.Basic`, before `MachineLearning.PACLearning.Defs`) |
| 115 | +- [ ] Stage and commit all changes |
| 116 | + |
| 117 | +**Timing**: 20 minutes |
| 118 | + |
| 119 | +**Depends on**: 1 |
| 120 | + |
| 121 | +**Files to modify**: |
| 122 | +- `references.bib` - add 2 BibTeX entries |
| 123 | +- `Cslib/Logics/Temporal/Syntax/Formula.lean` - update References section |
| 124 | +- `Cslib.lean` - add 1 barrel import entry |
| 125 | + |
| 126 | +**Verification**: |
| 127 | +- `grep -c "Kamp1968" references.bib` returns 1 |
| 128 | +- `grep -c "GabbayPnueliShelahStavi1980" references.bib` returns 1 |
| 129 | +- `grep "Cslib.Logics.Temporal.Syntax.Formula" Cslib.lean` finds the entry |
| 130 | +- Formula.lean References section uses `[BibKey]` bracket format |
| 131 | + |
| 132 | +--- |
| 133 | + |
| 134 | +### Phase 3: CI verification [COMPLETED] |
| 135 | + |
| 136 | +**Goal**: Run all CI checks locally and fix any issues before PR submission. |
| 137 | + |
| 138 | +**Tasks**: |
| 139 | +- [ ] Run `lake build Cslib.Logics.Temporal.Syntax.Formula` (or full `lake build --wfail --iofail`) to verify no build errors or warnings |
| 140 | +- [ ] Run `lake test` to ensure no test regressions |
| 141 | +- [ ] Run `lake exe mk_all --check --module` to verify barrel completeness |
| 142 | +- [ ] Run `lake exe checkInitImports` to verify Init import chain |
| 143 | +- [ ] Run `lake exe lint-style` (or equivalent lint check) to verify style compliance |
| 144 | +- [ ] Fix any issues found and re-run failed checks |
| 145 | +- [ ] Commit any fixes |
| 146 | + |
| 147 | +**Timing**: 30 minutes (includes build time) |
| 148 | + |
| 149 | +**Depends on**: 2 |
| 150 | + |
| 151 | +**Files to modify**: |
| 152 | +- Any files that need fixes from CI check failures (likely none) |
| 153 | + |
| 154 | +**Verification**: |
| 155 | +- All 5 CI checks pass with exit code 0 |
| 156 | +- No warnings in build output (--wfail is strict) |
| 157 | + |
| 158 | +--- |
| 159 | + |
| 160 | +### Phase 4: Submit PR [COMPLETED] |
| 161 | + |
| 162 | +**Goal**: Push branch and create PR on `leanprover/cslib` with proper description and dependency declaration. |
| 163 | + |
| 164 | +**Tasks**: |
| 165 | +- [ ] Push branch to origin: `git push origin pr3/temporal-syntax` |
| 166 | +- [ ] Create PR via `gh pr create` with: |
| 167 | + - Title: `feat(Logics/Temporal/Syntax): temporal formula type` |
| 168 | + - Base branch: `refactor/proposition-lukasiewicz` (PR #635's branch) to show minimal diff |
| 169 | + - Body including: summary, dependency on PR #635, file list, AI disclosure per CONTRIBUTING.md |
| 170 | +- [ ] Verify PR appears correctly on GitHub and diff shows only the temporal additions (not the full PR #635 diff) |
| 171 | +- [ ] Record PR URL in task artifacts |
| 172 | + |
| 173 | +**Timing**: 15 minutes |
| 174 | + |
| 175 | +**Depends on**: 3 |
| 176 | + |
| 177 | +**Files to modify**: |
| 178 | +- None (git operations only) |
| 179 | + |
| 180 | +**Verification**: |
| 181 | +- PR is created and visible on GitHub |
| 182 | +- PR description mentions dependency on PR #635 |
| 183 | +- PR diff shows only Formula.lean, Cslib.lean changes, and references.bib additions relative to the base branch |
| 184 | +- AI disclosure is present in the PR description |
| 185 | + |
| 186 | +## Testing & Validation |
| 187 | + |
| 188 | +- [ ] `lake build --wfail --iofail` passes with zero warnings |
| 189 | +- [ ] `lake test` passes |
| 190 | +- [ ] `lake exe mk_all --check --module` passes |
| 191 | +- [ ] `lake exe checkInitImports` passes |
| 192 | +- [ ] `lake exe lint-style` passes |
| 193 | +- [ ] `git diff refactor/proposition-lukasiewicz --stat` shows only Formula.lean, Cslib.lean, references.bib |
| 194 | +- [ ] PR diff on GitHub matches expected scope (no extra files from fork) |
| 195 | + |
| 196 | +## Artifacts & Outputs |
| 197 | + |
| 198 | +- `specs/170_submit_subpr_3_1_3_2_temporal_syntax/plans/01_pr-submission-plan.md` (this plan) |
| 199 | +- PR URL on `leanprover/cslib` (created in Phase 4) |
| 200 | +- Clean branch `pr3/temporal-syntax` pushed to origin |
| 201 | + |
| 202 | +## Rollback/Contingency |
| 203 | + |
| 204 | +- **Branch contamination**: If the branch picks up unintended files, delete and recreate: `git branch -D pr3/temporal-syntax` and start Phase 1 over |
| 205 | +- **CI failures**: Fix issues on the branch and force-push (acceptable for pre-review PRs) |
| 206 | +- **PR #635 changes**: If PR #635 is force-pushed or rebased, rebase `pr3/temporal-syntax` on the updated branch: `git rebase refactor/proposition-lukasiewicz` |
| 207 | +- **Scope creep**: If reviewer asks for Context/BigConj/Subformulas, those are task 160 (separate PR) -- respond directing to Sub-PR 3.2 |
0 commit comments