88
99import Cslib.Init
1010
11- /-! # Connective Typeclasses for Propositional Logic
11+ /-! # Connective Typeclasses for Propositional and Temporal Logic
1212
13- This module defines a typeclass hierarchy for propositional logical connectives. Each formula
13+ This module defines a typeclass hierarchy for logical connectives. Each formula
1414type registers itself as an instance of the appropriate connective class, enabling polymorphic
1515axiom definitions and notation that work uniformly across different formula types.
1616
1717## Design
1818
1919The hierarchy adopts a hybrid five-primitive propositional signature `{atom, bot, imp, and, or}`,
2020following the operator-typeclass direction of fmontesi's PR #607 (one class per operator):
21- - **Atomic classes** : `HasBot`, `HasImp`, `HasAnd`, `HasOr`
22- - **Bundled class** : `PropositionalConnectives` (extends `HasBot` and `HasImp`)
21+ - **Atomic classes** : `HasBot`, `HasImp`, `HasAnd`, `HasOr`, `HasUntil`, `HasSince`, `HasNext`
22+ - **Bundled classes** : `PropositionalConnectives` (extends `HasBot` and `HasImp`),
23+ `FutureTemporalConnectives` (extends `PropositionalConnectives` and `HasUntil`),
24+ `LTLConnectives` (extends `FutureTemporalConnectives` and `HasNext`),
25+ `TemporalConnectives` (extends `FutureTemporalConnectives` and `HasSince`)
2326
2427 Conjunction (`HasAnd`) and disjunction (`HasOr`) are treated as independent primitives rather
2528than Łukasiewicz-derived connectives. The classical encodings `φ ∧ ψ := ¬(φ → ¬ψ)` and
2629`φ ∨ ψ := ¬φ → ψ` are only propositionally equivalent to `∧` and `∨` in classical logic
27- ([ Avigad2022 ] ); they fail in intuitionistic and minimal logic. Making `and`
30+ ([ Wajsberg1938 ] , [ McKinsey1939 ] ); they fail in intuitionistic and minimal logic. Making `and`
2831and `or` primitive via `HasAnd`/`HasOr` supports all three logic strengths with a single
2932typeclass hierarchy.
3033
@@ -35,6 +38,15 @@ alike, so no typeclass machinery is needed for them.
3538## References
3639
3740* [ J. Avigad, *Mathematical Logic and Computation* ] [Avigad2022 ]
41+ * [ I. Johansson, *Der Minimalkalkül, ein reduzierter intuitionistischer Formalismus* ] [Johansson1937 ]
42+ * [ M. Wajsberg, *Untersuchungen über den Aussagenkalkül von A. Heyting* ] [Wajsberg1938 ]
43+ * [J. C. C. McKinsey,
44+ *Proof of the Independence of the Primitive Symbols of Heyting's Calculus* ][ McKinsey1939 ]
45+ * [ D. Prawitz, *Natural Deduction: A Proof-Theoretical Study* ] [Prawitz1965 ]
46+ * [A. S. Troelstra, D. van Dalen,
47+ *Constructivism in Mathematics: An Introduction* ][ TroelstraVanDalen1988 ]
48+ * [ A. Church, *Introduction to Mathematical Logic* ] [Church1956 ]
49+ * [ G. Gentzen, *Untersuchungen über das logische Schließen* ] [Gentzen1935 ]
3850 -/
3951
4052@[expose] public section
@@ -51,6 +63,21 @@ class HasImp (F : Type*) where
5163 /-- The implication connective. -/
5264 imp : F → F → F
5365
66+ /-- A type has an until temporal operator. -/
67+ class HasUntil (F : Type *) where
68+ /-- The until temporal operator. -/
69+ untl : F → F → F
70+
71+ /-- A type has a since temporal operator. -/
72+ class HasSince (F : Type *) where
73+ /-- The since temporal operator. -/
74+ snce : F → F → F
75+
76+ /-- A type has a next-step temporal operator. -/
77+ class HasNext (F : Type *) where
78+ /-- The next-step temporal operator. -/
79+ next : F → F
80+
5481/-- A type has a conjunction connective. -/
5582class HasAnd (F : Type *) where
5683 /-- The conjunction connective. -/
@@ -68,4 +95,25 @@ When all four connectives are needed, use
6895`[PropositionalConnectives F] [HasAnd F] [HasOr F]`. -/
6996class PropositionalConnectives (F : Type *) extends HasBot F, HasImp F
7097
98+ /-- Future temporal connectives: propositional connectives plus until (no since, no next).
99+
100+ This bundle is shared by both `LTLConnectives` (which adds `HasNext`) and
101+ `TemporalConnectives` (which adds `HasSince`). Factoring out the future fragment
102+ allows code generic over future-only temporal logics without committing to past or
103+ next-step operators. -/
104+ class FutureTemporalConnectives (F : Type *) extends PropositionalConnectives F, HasUntil F
105+
106+ /-- LTL connectives: future temporal connectives plus a primitive next-step operator.
107+
108+ Linear Temporal Logic uses `next` as a primitive rather than deriving it from `until`
109+ (the encoding `next φ = φ U ⊥` does not hold in all models). `FutureTemporalConnectives`
110+ provides `bot`, `imp`, and `untl`; this bundle adds `next`. -/
111+ class LTLConnectives (F : Type *) extends FutureTemporalConnectives F, HasNext F
112+
113+ /-- Temporal connectives: propositional connectives plus until and since.
114+
115+ Extends `FutureTemporalConnectives` with the `since` operator, forming the standard
116+ two-sorted temporal signature (future + past). -/
117+ class TemporalConnectives (F : Type *) extends FutureTemporalConnectives F, HasSince F
118+
71119end Cslib.Logic
0 commit comments