Temporal Logic - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Temporal Logic

Description:

forall X. mazda(X) mazda(7) = false. Is this a legitimate counter-example? Yes. forall X. car(X) implies mazda(X) not(car(7)) or mazda(7) = true ... – PowerPoint PPT presentation

Number of Views:160
Avg rating:3.0/5.0
Slides: 20
Provided by: wohl
Category:
Tags: logic | mazda | temporal

less

Transcript and Presenter's Notes

Title: Temporal Logic


1
Temporal Logic
  • CS410

2
Remaining Schedule
  • Today Temporal Logic
  • Thursday Model Checking
  • Extra OH Monday, 2pm to 5pm
  • Next Tuesday Term Review
  • November 30th, projects due at 1am (Dec 1st)
  • Dec 1st and Dec 2nd, Final Project Demos
  • E-mail cs410 to schedule time, include top 3
    choices
  • 9am-5pm except not Dec1st from 1pm to 2pm
  • Final
  • Dec 20th, 830am, DMP 310

3
Proof Techniques
  • forall X. Y
  • Find one X to act as a counter-example to show
    this is false
  • exists X. Y
  • Find one X to act as an example to show this is
    true
  • How do we show
  • forall X. Y is true?
  • exists X. Y is false?
  • Brute force
  • Proof by Contradiction (not covered)

4
Emulating Domains Using Properties
  • forall X. mazda(X)
  • mazda(7) false
  • Is this a legitimate counter-example?
  • Yes
  • forall X. car(X) implies mazda(X)
  • not(car(7)) or mazda(7) true
  • To find a counterexample, we are restricted to
    objects with have the property of being a car

5
Temporal Logic
  • Temporal Relating to time
  • Hard to reason about events which change over
    time in predicate logic
  • e.x. classroom(X) and empty(X)
  • alternates between true and false depending on
    the time
  • Solution Model time as a sequence of states. Use
    temporal logic to describe relationships between
    states.

6
Temporal Logic
S0
S1
S2
. . .
S
8
time
  • Divide time into a number of ordered discrete
    states starting from some origin S0
  • Each object has some number of properties related
    to it in each state?
  • e.x. empty(object X, state Y)
  • Is object X empty in state Y?

7
Simplifying Temporal Logic Notation
  • Most often we are always talking about one object
    of interest (i.e. a computer program) so we dont
    bother writing it
  • e.x. object is DMP 301
  • empty(Y) ?
  • Often we evaluate expression on all states to
    find out for which states it is true
  • We just write empty, to ask the question in
    which states is the object of interest empty?
  • i.e. properties dont need to be written as
    functions anymore

8
Temporal Logic
  • Types
  • boolean
  • properties
  • Axioms
  • globally(X)
  • true at state Sn if X is true for all states Sm
    such that Sm Sn
  • eventually(X)
  • true at state Sn if X is true at some state such
    that Sm Sn
  • next(X)
  • true at state Sn if X is true at state S(n1)
  • X until Y
  • true at state Sn if X is true at all states, Sm,
    such that Sp Sm
    Sn and Y is first true after Sn at Sp
  • Note Y must be true at some time in the future
    or else this is false

9
globally(X) from S1
S2
S0
S1
. . .
S
8
X must be true at all of these states
10
eventually(X) from S1
S2
S0
S1
. . .
S
8
X must be true at one these states
11
next(X) from S1
S2
S0
S1
. . .
S
8
X must be true at S2
12
(X until Y) from S1
Sn
S2
S0
S1
. . .
S
8
  • Y is first true
  • at this state, Sp,
  • where Sp S1

2. X must be true at all of these states
13
Temporal Logic Examples
  • Consider time divided into a state for each day
    starting today
  • thursday true for days that are Thursday
  • globally(friday) false at all states
  • thursday and next(saturday) false at all states

  • eventually(saturday) true at all states
  • eventually(lastDayOfThisClass) true for all
    states before the lastDayOfThisClass
  • not(dayOfClass) until lastDayOfThisClass false
    at all states

14
Example Problem
  • At which states are the following true?
  • globally(q) Si, i 8
  • eventually(next(not(p)) true at all states
  • q until globally(not(p)) S4, S5, S6, Si (i
    8)
  • p until not(q) false at all states

15
Example
  • The desired requirements on our device are as
    follows
  • If someone releases the button, the toy says hi
  • The hi only happens for one unit of time
  • The toy produces at most one hi per button
    push
  • Such devices are useful in real systems in an
    elevator, for example, even if someone holds the
    button down for several seconds, we only want to
    summon the elevator once

16
Transform Transitions into States
  • Allows us to talk about input and output at
    certain states
  • Details are simple and not important
  • You wont be required to perform transformation
    on a test
  • At each state any transition may be taken
  • i.e. the choice of transition is
    non-deterministic

17
Computation Trees
  • Properties should hold for all possible paths

Paths for this state
18
Example
  • If someone releases the button, the toy says hi
  • (but_dn and not(push)) implies eventually(hi)
  • i.e. eventually(hi) must be true at a state where
    (but_dn and not(push)) is true
  • The hi only happens for one unit of time
  • hi implies next(not(hi))
  • The device produces at most one hi per button
    push
  • hi implies (not(hi) until push)

19
Conclusion
  • Temporal Logic allows us to ask questions about
    sequences of states
  • Possible sequences of states for models can be
    derived using a computation tree
  • Questions are answered using algorithms on
    computation trees
  • Model Checking, Thursday
Write a Comment
User Comments (0)
About PowerShow.com