Skip to content

feat: Linear Temporal Logic#413

Open
mell-o-tron wants to merge 1 commit intoleanprover:mainfrom
mell-o-tron:main
Open

feat: Linear Temporal Logic#413
mell-o-tron wants to merge 1 commit intoleanprover:mainfrom
mell-o-tron:main

Conversation

@mell-o-tron
Copy link

Hi! Here is my first attempt at formalizing LTL, by providing a semantics on omega-sequences and a few simple rules. I think this could be quite easily adapted to obtain a semantics on paths of transition systems.

I hope you'll forgive my naive proof style, I'm fairly new to Lean, and I hope we can work on this together to make it up to standards :)


/-- Satisfaction relation for ω-sequences of atom valuations. -/
@[simp, scoped grind =]
def Satisfies (ls : ωSequence (Set T)) (φ : Proposition T) := match φ with
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def Satisfies (ls : ωSequence (Set T)) : Proposition T) := match φ with
def Satisfies (ls : ωSequence (Set T)) : Proposition TProp

| .or φ₁ φ₂ => Satisfies ls φ₁ ∨ Satisfies ls φ₂
| .atom (p) => p ∈ ls 0
| .not φ => ¬ (Satisfies ls φ)
| .next φ => Satisfies (ωSequence.drop 1 ls) φ
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
| .next φ => Satisfies (ωSequence.drop 1 ls) φ
| .next φ => Satisfies (ls.drop 1) φ

etc


/-- Equivalence of LTL propositions on ω-sequences. -/
@[simp, scoped grind =]
def Proposition.equiv (φ₁ : Proposition T) (φ₂ : Proposition T) :=
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
def Proposition.equiv (φ₁ : Proposition T) (φ₂ : Proposition T) :=
def Proposition.equiv (φ₁ : Proposition T) (φ₂ : Proposition T) : Prop :=

Comment on lines +79 to +80
theorem next_self_dual {T} : ∀ (φ : Proposition T), φ.next.not ≈ φ.not.next :=
by simp
Copy link
Collaborator

Choose a reason for hiding this comment

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

style should be

Suggested change
theorem next_self_dual {T} : ∀ (φ : Proposition T), φ.next.not ≈ φ.not.next :=
by simp
theorem next_self_dual {T} : ∀ (φ : Proposition T), φ.next.not ≈ φ.not.next := by
simp

(throughout)

Comment on lines +93 to +96
theorem expansion_until {T} : ∀ (φ : Proposition T) (ψ : Proposition T) ,
Proposition.until_op φ ψ ≈ Proposition.or ψ (Proposition.and φ ((Proposition.until_op φ ψ).next)) :=
by
intros
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
theorem expansion_until {T} : ∀ (φ : Proposition T) (ψ : Proposition T) ,
Proposition.until_op φ ψ ≈ Proposition.or ψ (Proposition.and φ ((Proposition.until_op φ ψ).next)) :=
by
intros
theorem expansion_until {T} (φ : Proposition T) (ψ : Proposition T) :
φ.until_op ψ ≈ ψ.or (φ.and ((φ.until_op ψ).next)) := by

namespace Cslib.Logic.LTL

/-- Propositions, where `T` is the type of atoms. -/
inductive Proposition (T : Type) : Type u where
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
inductive Proposition (T : Type) : Type u where
inductive Proposition (T : Type u) : Type u where

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