feat(Logics/LTL): LTL formula type and semantics over omega-words#649
feat(Logics/LTL): LTL formula type and semantics over omega-words#649benbrastmckie wants to merge 4 commits into
Conversation
Session: sess_1781487302_dddcf1
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
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
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
4da5d68 to
25c9d7c
Compare
ctchou
left a comment
There was a problem hiding this comment.
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.
0742815 to
40b325e
Compare
40b325e to
851ae31
Compare
|
Thanks for the comments. The latest push addresses these points: 1. Future-only temporal operators. 2. Omega-executions of LTS, not just state sequences. 3. Büchi automata and ω-regular languages. A natural follow-up is to prove the LTL-to-Büchi translation theorem, connecting 4. Encodable/Countable/Infinite/Denumerable. Removed. Deferred to a completeness PR where they are actually needed. |
851ae31 to
5785ebb
Compare
…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>
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
5bfb6b6 to
8f31fcf
Compare
Update intuitionisticCompletion docstring — the old wording "Attach a bottom element" was misleading since bot is already a constructor. Change "five-primitive propositional signature" to "five constructors" in Connectives.lean to avoid conflating generators with operations. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8f31fcf to
d2ad8c7
Compare
Session: sess_$(date +%s)_$(od -An -N3 -tx1 /dev/urandom | tr -d ' ') Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Since this PR depends on #648, can you rebase it on top of #648? Currently it is a single commit on top of main, which makes it hard to figure out what changes it makes relative to #648.
Also, many of the changed files don't seem to have anything to do with this PR, such as Data/HasFresh, LTS/Notation, CCS/Semantics, all the LambdaCalculus files, all the Logics/Modal files, etc. Can you remove those changes from this PR?
…ture Add temporal logic formula types for both full temporal logic (with until and since) and LTL (with until and next). Extend the connective typeclass hierarchy with HasUntil, HasSince, HasNext, FutureTemporalConnectives, LTLConnectives, and TemporalConnectives. New files: - Cslib/Logics/Temporal/Syntax/Formula.lean - Cslib/Logics/LTL/Syntax/Formula.lean Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d2ad8c7 to
3e11b1f
Compare
|
What exactly is the difference between |
|
ctchou
left a comment
There was a problem hiding this comment.
Can we separate LTL and Temporal into two different PRs? The former is far more important than the latter in computer science applications.
Regarding LTL, I'd like to see the following notational changes (where "..." is a unicode name in VScode's Lean mode):
"F" -> "\Diamond`
"G" -> "\Box"
"X" -> "\bigcirc"
"U" -> "\MCU"
These symbols are pretty standard. For example, see the first table of:
https://en.wikipedia.org/wiki/Linear_temporal_logic#Semantics
Another useful notation is "p \leadsto q", which is an abbreviation of "G (p -> F q)".
…d notation - Remove HasSince and TemporalConnectives from Connectives.lean - Remove Temporal/Syntax/Formula.lean from PR (deferred to follow-up) - Remove toTemporal embedding from LTL/Syntax/Formula.lean - Update notation: X->◯, U->𝓤, 𝐅->◇, 𝐆->□ (standard LTL unicode) - Add leadsto abbreviation (p ⇝ q := □(p → ◇q)) with ⇝ notation - Add Cslib/Logics/LTL/Semantics/Satisfies.lean (satisfaction over omega-words) - Add Mathlib.Order.Notation import to resolve Bot/Top instances - Remove GPSS1980 from references.bib (past-time, deferred to Temporal PR) - Update Cslib.lean: add LTL.Semantics.Satisfies, remove Temporal.Syntax.Formula Session: sess_1781823963_4f9f03
…only Session: sess_1781823963_4f9f03
Session: sess_1781823963_4f9f03
|
Thanks for the review. The latest push addresses all three points:
I also added |
This PR adds Linear Temporal Logic (LTL) to CSLib.
The original PR included both
LTLandTemporal(past+future). Per reviewer request, this PR contains LTL only. TheTemporalformula type (with since/past operators) is deferred to a follow-up PR.Files Changed
Cslib/Foundations/Logic/Connectives.lean(modified)Adds the LTL-relevant typeclass hierarchy on top of
PropositionalConnectives:New classes:
HasUntil,HasNext,FutureTemporalConnectives,LTLConnectives.FutureTemporalConnectivesis factored out becauseTemporalwill branch from it to addHasSince, from which the past+future operators are definable.HasSinceandTemporalConnectivesare not included here (deferred to the Temporal PR).Cslib/Logics/LTL/Syntax/Formula.lean(new file)Defines the LTL formula inductive type with primitives
{atom, bot, imp, next, untl}:Formula.someFuture(◇):⊤ U φ— φ holds at some future pointFormula.allFuture(□):¬◇¬φ— φ holds at all future pointsFormula.leadsto(⇝):□(p → ◇q)— every p-state is eventually followed by a q-stateNotation uses standard LTL unicode symbols per reviewer request:
◯\bigcirc𝓤\MCU◇\Diamond□\Box⇝\leadstoNote:
□is scoped toCslib.Logic.LTL; within that scope it means "globally". The modal□(box/necessity) is scoped to the modal logic namespace and does not conflict.LTLConnectivesinstance registered soFormulacan be used polymorphically in axiom schemas.Cslib/Logics/LTL/Semantics/Satisfies.lean(new file)Defines LTL satisfaction over omega-words:
φ U ψholds atiwhen ψ eventually holds at some futurej ≥ i(the event) and φ holds at all intermediate points (the guard).Also defines
Valid(holds at all time points) andSatisfiable(holds at some time point in some omega-word). Connection toOmegaExecutionfrom the LTS library is deferred to future work.references.bib(modified)Adds LTL-relevant references:
Kamp1968— historical foundation (tense logic)Pnueli1977— seminal LTL paperVardiWolper1986— automata-theoretic approachRemoves
GPSS1980(fairness and past-time operators; belongs in the Temporal PR).Cslib.lean(modified)Adds
Cslib.Logics.LTL.Syntax.FormulaandCslib.Logics.LTL.Semantics.Satisfies.AI Disclosure
This PR was revised with assistance from Claude (Anthropic). Specifically:
◯,𝓤,◇,□,⇝) were implemented by Claudeleadstoabbreviation and notation were added by ClaudeSatisfies.leanfile was adapted from main branch content with Claude assistance