Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Linglib/Semantics/Events/Basic.lean
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,30 @@ theorem isState_iff_not_isAction {Time : Type*} [LinearOrder Time] (e : Event Ti
simp only [Event.isAction, Event.isState]
cases e.sort <;> decide

/-! ### Duration predicates -/

/-- Is this event punctual (instantaneous)? Its runtime is a single point.
The temporal-extent counterpart of the dynamicity sort; derived from the
runtime via `Interval.IsPoint`. -/
def Event.isPunctual {Time : Type*} [LinearOrder Time] (e : Event Time) : Prop :=
e.τ.IsPoint

/-- Is this event durative (temporally extended)? -/
def Event.isDurative {Time : Type*} [LinearOrder Time] (e : Event Time) : Prop :=
¬ e.isPunctual

instance {Time : Type*} [LinearOrder Time] :
DecidablePred (Event.isPunctual (Time := Time)) :=
fun e => by unfold Event.isPunctual Interval.IsPoint; infer_instance

instance {Time : Type*} [LinearOrder Time] :
DecidablePred (Event.isDurative (Time := Time)) :=
fun e => by unfold Event.isDurative; infer_instance

/-- `isDurative` and `isPunctual` are complementary. -/
theorem isDurative_iff_not_isPunctual {Time : Type*} [LinearOrder Time] (e : Event Time) :
e.isDurative ↔ ¬ e.isPunctual := Iff.rfl

/-! ### Concrete examples (ℤ-time events) -/

/-- Example: a running event from time 1 to 5. -/
Expand Down
Loading