-
Home
- Model checking concurrent
- Model checking concurrent
- Using temporal logic to specify
Give an English translation of the following LTL formulae.
Try to give a natural wording for each, not just a transliterationof the logical operators.
-
-
- ``
is true before
.''
- ``
is false after
.''
In the following, give an LTL formula that formalizes
the given English wording.If the English is subject to any ambiguity, as it frequently is,
describe how you are disambiguating it, and why.
- ``
is true.''
- ``
becomes true before
.''
-
- ``
will happen at most once.''
- ``
will happen at most twice.''
- ``The light always blinks.''Use the following proposition:
= the light is on.
- ``The lights of a traffic signal always light in thefollowing sequence: green, yellow, red, and back to green,
etc. ,
with exactly one light on at any time.''Use the following propositions:
= the green light is on,
= the yellow light is on, and
= the red light is on.
- This looks so simple and obvious, right?Unfortunately, it is ambiguous.
The simple answer,
, says it's true
right now .
But, the likelier intended meaning is that it's always true,
.
- This can be reworded as``
becomes true while
is still false.''
- The version of LTL we use cannot capture the notion ofsomething being true for exactly one state.
Instead, we must instead think in terms of somethingbeing true for ``a while''.
Using that idea, we'll reword the original English intomore explicit, long-winded forms.``
will happen at most once''
becomes``
is false for a while, then
it may become true for a while, thenit may become false forever.''
It LTL, that can be written as
.Repeating that pattern,``
will happen at most twice''
becomes
.
- Here are three progressively simpler solutions which areequivalent.
-
-
-
- There are many ways to write this, but here's one.It states that whenever the green light is on,
no other light is on, and it will stay on until theyellow one is on.
Note that this implies the red light won't come onbefore the yellow one.
What happens when the other lights are on is entirely parallel.Finally, at least one light is on.
Recall the
Dining Philosophers Problem from the previous homework .
Using temporal logic, formally specify the following desiredproperties of solutions to the D.P. Problem.
Use the following logic variables, where
:
-
:
Philosopher
has his/her left fork.
-
:
Philosopher
has his/her left fork.
For each question, your answer should cover exactly the given
condition -- nothing more or less.You may assume
.
- No fork is ever claimed to be held bytwo philosophers simultaneously.
- Philosopher
gets to eat (at least once).
- Each philosopher gets to eat infinitely often.
- The philosophers don't deadlock.(The main difficulty is to conceptualize and restate
``deadlock''within this specific model in terms of the available
logic variables.)You may assume philosophers pick uptwo forks in some order, eat, and drop both forks.
- The philosophers don't deadlock.(The main difficulty is to conceptualize and restate
``deadlock''within this specific model in terms of the available
logic variables.)You may not assume philosophers pick uptwo forks in some order, eat, and drop both forks.
For example, one might pick up a single fork and then drop it.Or, the philosophers might be lazy and never pick up a fork.
- Describe a D.P. Problem run in which philosophers don'tdeadlock, but it is not the case that each philosopher gets
to eat infinitely often.
-
-
-
- Here are two solutions.
-
-
- This simply says that it never gets stuck in oneparticular fork configuration.
There would be many
if
statements, one per configuration,
and this is abbreviated.
- There are many possibilities. One is wherephilosopher 0 repeatedly eats, grabbing the forks so
quickly that neither other philosopher has a chance tograb one that is shared with him.
Source:
OpenStax, Model checking concurrent programs. OpenStax CNX. Oct 27, 2005 Download for free at http://cnx.org/content/col10294/1.3
Google Play and the Google Play logo are trademarks of Google Inc.