Skip to content

feat(Logics/Temporal): temporal formula type with propositional structure#649

Open
benbrastmckie wants to merge 3 commits into
leanprover:mainfrom
benbrastmckie:feat/temporal-formula-propositional
Open

feat(Logics/Temporal): temporal formula type with propositional structure#649
benbrastmckie wants to merge 3 commits into
leanprover:mainfrom
benbrastmckie:feat/temporal-formula-propositional

Conversation

@benbrastmckie

@benbrastmckie benbrastmckie commented Jun 15, 2026

Copy link
Copy Markdown

Summary

Extends Connectives.lean from PR #648 with temporal operator typeclasses, then defines two formula types that instantiate them:

        PropositionalConnectives
           (HasBot + HasImp)
                    |
         FutureTemporalConnectives
               (+ HasUntil)
              /              \
   LTLConnectives      TemporalConnectives
    (+ HasNext)            (+ HasSince)

FutureTemporalConnectives factors out the shared future fragment so code generic over future-only logics need not commit to past or next-step operators. Temporal.Formula instantiates TemporalConnectives (future + past); LTL.Formula instantiates LTLConnectives (future + next).

Dependency

Stacked on PR #648 (feat(Foundations): propositional connectives typeclass hierarchy). Please review/merge #648 first.

New files

  • `Cslib/Logics/Temporal/Syntax/Formula.lean` -- `Temporal.Formula` inductive type with `TemporalConnectives` instance
  • `Cslib/Logics/LTL/Syntax/Formula.lean` -- `LTL.Formula` inductive type with `LTLConnectives` instance and `toTemporal` embedding

Modified files

  • `Cslib/Foundations/Logic/Connectives.lean` -- added `HasUntil`, `HasSince`, `HasNext`, `FutureTemporalConnectives`, `LTLConnectives`, `TemporalConnectives`
  • `Cslib.lean` -- added temporal and LTL imports
  • `references.bib` -- added Kamp1968, Pnueli1977, Burgess1984, VardiWolper1986, GPSS1980

Design rationale

`next` is a primitive in `LTL.Formula` rather than derived from `untl`. The encoding `next φ = φ U ⊥` holds on discrete non-ending sequences but fails in general temporal models; keeping `next` primitive supports broader model classes. The `toTemporal` embedding translates `next φ` as strict `untl φ ⊥` and `untl` as reflexive until.

Argument convention follows Burgess (1984): `untl event guard` where the first argument is the event (holds at the witness point) and the second is the guard (holds at all intermediate points).

Deferred

  • LTL satisfaction semantics over omega-words (follow-up PR)
  • LTS-based semantics redesign
  • `Encodable`/`Countable`/`Infinite`/`Denumerable` instances

References

  • [Kamp1968] H. Kamp, Tense Logic and the Theory of Linear Order, PhD thesis, UCLA, 1968.
  • [Pnueli1977] A. Pnueli, "The Temporal Logic of Programs," 18th FOCS, 1977.
  • [Burgess1984] J. P. Burgess, "Basic Tense Logic," Handbook of Philosophical Logic, vol. II, 1984.
  • [VardiWolper1986] M. Y. Vardi and P. Wolper, "An Automata-Theoretic Approach to Automatic Program Verification," 1st LICS, 1986.

AI Tools Used

Claude Code was used to rebase onto PR #648, resolve merge conflicts, adjust temporal operators, fix import minimization, and verify CI. All mathematical decisions reviewed by the human author.

benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 15, 2026
Session: sess_1781487302_dddcf1
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 15, 2026
Stack Modal PR on feat/propositional-v2 (PR leanprover#648) like PR leanprover#649 does,
keeping it independent of temporal additions. Two-PR chain, not three.

Session: sess_1781531573_4cdbb4
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 15, 2026
Stack on PR leanprover#648 (not leanprover#649), diplomatic PR description as first-class
deliverable, integrate PR landscape audit (report 06).

Session: sess_1781532709_eb0889
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 15, 2026
Diplomatic PR description for Modal/ formula primitives refactoring,
stacking on PR leanprover#648. Coordinates with PRs leanprover#607, leanprover#528, leanprover#535, leanprover#649.

Session: sess_1781535860_c7d8e9
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 15, 2026
@benbrastmckie benbrastmckie force-pushed the feat/temporal-formula-propositional branch from 4da5d68 to 25c9d7c Compare June 16, 2026 00:04

@ctchou ctchou left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

General comments:

  • We should start with a temporal logic with only future-time temporal operators. Past-time temporal operators are not very useful in deductive program verification and complicate the semantics.
  • I would like to have a temporal logic that can talk about the (omega-)executions of LTS, not just a sequence of states.
  • Also, we should be able to talk about LTS transitions.
  • I don't understand what Encodable/Countable/Infinite/Denumerable instances are doing there. They seem to be completely irrelevant.

@benbrastmckie benbrastmckie force-pushed the feat/temporal-formula-propositional branch from 0742815 to 40b325e Compare June 16, 2026 04:09
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 16, 2026
@benbrastmckie benbrastmckie force-pushed the feat/temporal-formula-propositional branch from 40b325e to 851ae31 Compare June 16, 2026 05:28
@benbrastmckie

benbrastmckie commented Jun 16, 2026

Copy link
Copy Markdown
Author

Thanks for the comments. The latest push addresses these points:

1. Future-only temporal operators. FutureTemporalConnectives (propositional + until) is now a shared base class. LTL.Formula instantiates LTLConnectives (future + next) with only future-time primitives. Temporal.Formula instantiates TemporalConnectives (future + past) for tense logic.

2. Omega-executions of LTS, not just state sequences. LTL.Satisfies is removed from this PR. Connection to LTS.OmegaExecution — which already carries both ss : ωSequence State and μs : ωSequence Label — is the right approach. A follow-up PR can define satisfaction directly over OmegaExecution pairs rather than bare state sequences.

3. Büchi automata and ω-regular languages. A natural follow-up is to prove the LTL-to-Büchi translation theorem, connecting LTL.Satisfies to ωLanguage.IsRegular via the existing boolean closure results.

4. Encodable/Countable/Infinite/Denumerable. Removed. Deferred to a completeness PR where they are actually needed.

@benbrastmckie benbrastmckie force-pushed the feat/temporal-formula-propositional branch from 851ae31 to 5785ebb Compare June 16, 2026 16:38
…e bot

Add `bot` as a primitive constructor of `Proposition Atom`, eliminating all
`[Bot Atom]` constraints from propositional logic signatures.

- New `Connectives.lean`: typeclass hierarchy (HasBot, HasImp, HasAnd, HasOr)
- `Defs.lean`: five-primitive Proposition type with derived neg, top, iff
- `Basic.lean`: natural deduction with impI/impE, andI/andE1/andE2, orI1/orI2
- `Theory.lean`: remove [Bot Atom], add instIsIntuitionisticIntuitionisticCompletion
- Replace German-language references with Avigad 2022, Prawitz 1965
- Semantics files deferred to follow-up PR per reviewer request

Reconciles with merged PR leanprover#536 (InferenceSystem-parameterized typeclasses).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 16, 2026
benbrastmckie added a commit to benbrastmckie/cslib that referenced this pull request Jun 16, 2026
Refocused from PR leanprover#649 to PR leanprover#648 (feat/propositional-v2).
Updated task description and created 6-phase plan for bot refactor.

Session: sess_1781632241_ba8d68
@benbrastmckie benbrastmckie force-pushed the feat/temporal-formula-propositional branch 2 times, most recently from 76d4552 to 5bfb6b6 Compare June 17, 2026 01:45
@benbrastmckie benbrastmckie force-pushed the feat/temporal-formula-propositional branch from 5bfb6b6 to 8f31fcf Compare June 17, 2026 01:55
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