CS1950Y Lecture 19: Temporal Logic
March 19, 2018
Quantifier Quiz Clarification
Graded only on participation! Part 1: provide a quantified formula that you found it's meaning surprising or particularly interesting. You can write it as a pred, a fact, whatever you want! Part 2: you are shown a bunch of formulas and asked whether they are true or false. That's it! This is to help Tim understand how well people are understanding things from lecture.
Temporal Logic
What does it even look like to talk about something eventually being true?
Let's check out: Propositional Linear Temporal Logic (LTL).
Syntax
For a given finite set A of propositional (or Boolean) variables p, q, ..., the set of formulas of LTL (denoted LTL(A)) is inductively defined as the smallest set satisfying the following:
- For every variable p ∈ A, p ∈ LTL(A)
- If α, β ∈ LTL(A), then α Λ β ∈ LTL(A), α v β ∈ LTL(A)
- If α ∈ LTL(A), then ¬ α ∈ LTL(A)
- If α ∈ LTL(A), then □ α ∈ LTL(A) // □ ≈ G, "always"
- If α ∈ LTL(A), then ◊ α ∈ LTL(A) // ◊ ≈ F, "eventually"
- If α, β ∈ LTL(A), then α ∪ β ∈ LTL(A) // "until"
- If α ∈ LTL(A), then X α ∈ LTL(A) //X is a temporal operator that means the next α
Semantics
What is an instance of temporal logic?
You move forward in steps, and you might hit a cycle or something, but in theory they are infinite.
A counterexample to a liveness property needs to be infinite.
We are going to have a propositional example over A for every state of the system.
Instances
Instances in LTL consist of infinite sequences of the form <I0, I1, ...> where each of the Ik is a total function that maps each of the propositional variables in A to a truth value:
For an instance w, we define two pieces of notation:
w(i) = Ii
// The i-th entry in the sequence.
wi = Ii, Ii+1, ...
// The sequence starting at the i-th entry.
An instance of LTL is an infinite sequence of the form <I0, I1, ...> where each Ik: A -> Bool
For example, if we think of a stop light, different I's might be the green light is lit, true or false or red light is lit, true or false.
Helpful syntax: "satisfies" can be represented by w |= α
A propositional variable is true at an individual state, not really over the infinite succession of states. So, what we are going to do is say:
α ∈ A, w |= α iff w(0)(α) = True
If we just are talking about a formula with boolean operators, we are only going to talk about the "present" which is the first state (w(0))
α ≡ ¬ β w |= α iff w doesn't satisfy β
α ≡ β1 Λ β2, w |= α iff w |= β1 and w |= β2
Why is this actually a helpful definition?
It is a construct in the syntax that we are finding a meaning for. So, the meaning of this symbol, Λ, is our normal "and".
We would define or similarly.
The βs are just sub formulas
α ≡ X β, w |= α iff w1 |= β
What's the definition of □?
α ≡ □β, w |= α iff all t: Time | wt |= β
This is how we give meanings to statements like "always eventually". Without constructing the semantics in this way we can't talk about nested boolean operators. In general, you can nest as many operators as you like.
The all t: Time
formally is all t ∈ ℕ
or all t in the natural numbers.
α ≡ ◊ β, w |= α iff some t: ∈ ℕ | wt |= β
α ≡ β1 ∪ β2, w |= α iff some t ∈ ℕ | wt |= β2 { all t' 0 ≤ t' < t | wt' |= β1}