You are on page 1of 16

Department of Computer Science

Lecture 8: Introduction to Temporal Logic

Formal Methods of S/W Development

Dr. Saif U. R. Malik


Assistant Professor
Agenda
 Review of Lecture 7
 Temporal Logic
 Introduction to CTL*
 CTL* Syntax & Semantics
 CTL* Sublogics: LTL and CTL

2
Review of Lecture 7
 A high-level petri net 𝑁 = (𝑃, 𝑇, 𝐹, 𝜑, 𝑅, 𝐿, 𝑀0)
 𝑃 is a set of places
 𝑇 is a set of transitions
 𝐹 is the flow relation 𝐹 ⊆ 𝑃 × 𝑇 ∪ (𝑇 × 𝑃)
 𝜑 ∶ 𝑃 → 𝑇𝑦𝑝𝑒
 𝑅 ∶ 𝑇 → 𝐹𝑜𝑟𝑚𝑢𝑙𝑎
 𝐿 ∶ 𝐹 → 𝐿𝑎𝑏𝑒𝑙
 𝑀0 is the initial marking

3
Review of Lecture 7 (cont.)

4
Temporal Logic
 Representing and reasoning about propositions qualified
in terms of time

 Examples:
 Students are always late
 Students will eventually be early
 Students will be late until they lose points for tardiness

5
Temporal Logic (cont.)
 In the temporal logics we consider that time is not
mentioned explicitly

 Instead, a formula may specify things like:


 Eventually some designated state is reached
 Some erroneous state is never reached

 Properties like eventually and never are specified using


special temporal operators
 Can be combined with Boolean connectives

6
Introduction to CTL*
 We focus on a logic called CTL*,
in which formulas describe
properties of computation trees

 Formed by designating a state


in a Kripke structure as the initial
state (root) and unwinding it

 Tree shows all of the possible


executions of the system
starting from the initial state
7
Introduction to CTL* (cont.)
 CTL* formulas are composed of path quantifiers
and temporal operators

 Path quantifiers describe the branching-time structure


of the computation:
 A (“for all computation paths”)
 E (“for some computation path)

 Used in a particular state to specify that all or some of the


paths from that state have some property

8
Introduction to CTL* (cont.)
 Temporal operators describe properties of a path
i.e., linear-time

 Five basic temporal operators:

 X – Next
 F – Future
 G – Globally
 U – Until

9
CTL* Syntax
 CTL* combines branching-time and linear-time operators
 Path quantifiers prefix an assertion composed of a
combination of temporal operators, e.g., A (FG) p

10
Kripke Structure
 Let 𝐴𝑃 be a set of atomic propositions. A Kripke model 𝑀
over 𝐴𝑃 is a four tuple 𝑀 = 𝑆, 𝑆0, 𝑅, 𝐿 where,
 𝑆 is a set of finite states
 𝑆0 ⊆ 𝑆 is a set of initial states
 𝑅 ⊆ 𝑆 × 𝑆 is a transition relation
 𝐿 is a function that labels each state with a set of atomic
propositions true in that state
 Sometimes we will not be concerned with 𝑆0, and hence omit it
from the definition, i.e., 𝑀 = 𝑆, 𝑅, 𝐿

11
Kripke Structure (cont.)
 Our model of computation assumes that every state has at
least one possible successor, i.e.,
 ∀𝑠 ∈ 𝑆 ⋅ ∃𝑠 ′ ∈ 𝑆 such that (𝑠, 𝑠 ′ ) ∈ 𝑅

 A path in 𝑀 is an infinite sequence of states 𝜋 = 𝑠0, 𝑠1, 𝑠2 …


such that for 𝑖 ≥ 0, (𝑠𝑖 , 𝑠𝑖 + 1) ∈ 𝑅

 We use 𝜋 𝑖 to denote the suffix of 𝜋 starting at 𝑠 𝑖

12
Core

Resource HLCC
Manager

Pod(1) Pod(2) Pod(k)

LLCC LLCC LLCC

...

... ... ...

13
Control
Strategy

HLCC
New Job RM γ
Over Heat
Action

Processing Complete
Pod
LLCC

α δ S

14
NJ

RM

Pod HLCC

HLCC RM Pr

PoD RM Pr

PoD RM Pr Pod HLCC Cm Pr OH


Cm Pr OH

x x

Cm Pr OH CS
Cm Pr OH CS

x x x x x

Act
x x Act

x x

Pr
Pr

15
Cm Pr OH
Cm Pr OH
LTL and CTL
 Two useful sublogics of CTL*, which are distinguished by
how they handle branching in the computational tree

 Linear Temporal Logic (LTL) consists of formulas that


have the form A 𝑓 where 𝑓 is a path formula in which the
only state subformulas permitted are atomic propositions
 e.g., A ( FG 𝑝 )

 Computational Tree Logic (CTL) is a restricted subset of


CTL* in which each of the temporal operators must be
immediately preceded by a path operator
 e.g., AG ( EF ) 𝑝
16

You might also like