# 0.6 Using temporal logic to specify properties: homework exercises

Give an English translation of the following LTL formulae. Try to give a natural wording for each, not just a transliterationof the logical operators.

• $\left(◇r\left(pUr\right)\right)$
• $\square \left(q\square p\right)$
•  $p$ is true before $r$ .''
•  $p$ is false after $q$ .''

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.

•  $p$ is true.''
•  $p$ becomes true before $r$ .''
•  $p$ will happen at most once.''
•  $p$ will happen at most twice.''
• The light always blinks.''Use the following proposition: $p$ = 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: $g$ = the green light is on, $y$ = the yellow light is on, and $r$ = the red light is on.
• This looks so simple and obvious, right?Unfortunately, it is ambiguous. The simple answer, $p$ , says it's true right now . But, the likelier intended meaning is that it's always true, $\square p$ .
• This can be reworded as $p$ becomes true while $r$ is still false.'' $\left(rW\left(pr\right)\right)$
• 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. $p$ will happen at most once'' becomes $p$ 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 $\left(pW\left(pW\square p\right)\right)$ .Repeating that pattern, $p$ will happen at most twice'' becomes $\left(pW\left(pW\left(pW\left(pW\square p\right)\right)\right)\right)$ .
• Here are three progressively simpler solutions which areequivalent.
• $\square \left(\left(p◇p\right)\left(p◇p\right)\right)$
• $\left(\square \left(pUp\right)\square \left(pUp\right)\right)$
• $\left(\square ◇p\square ◇p\right)$
• 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. $\square \left(\left(g\left(\left(yr\right)\left(gUy\right)\right)\right)\left(y\left(\left(rg\right)\left(yUr\right)\right)\right)\left(r\left(\left(gy\right)\left(rUy\right)\right)\right)\left(gyr\right)\right)$

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 $0i :

• ${l}_{i}$ : Philosopher $i$ has his/her left fork.
• ${r}_{i}$ : Philosopher $i$ has his/her left fork.

For each question, your answer should cover exactly the given condition -- nothing more or less.You may assume $N=3$ .

• No fork is ever claimed to be held bytwo philosophers simultaneously.
• Philosopher $i$ 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.
• $\square \left(\left({l}_{0}{r}_{2}\right)\left({l}_{1}{r}_{0}\right)\left({l}_{2}{r}_{1}\right)\right)$
• $◇\left({l}_{i}{r}_{i}\right)$
• $\left(\square ◇\left({l}_{0}{r}_{0}\right)\square ◇\left({l}_{1}{r}_{1}\right)\square ◇\left({l}_{2}{r}_{2}\right)\right)$
• Here are two solutions.
• $\square \left(\left({l}_{0}{l}_{1}{l}_{2}\right)\left({r}_{0}{r}_{1}{r}_{2}\right)\right)$
• $\square ◇\left(\left({l}_{0}{r}_{0}\right)\left({l}_{1}{r}_{1}\right)\left({l}_{2}{r}_{2}\right)\right)$
• 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. $\square \left(\left(\left({l}_{0}{l}_{1}{l}_{2}\right)◇\left({l}_{0}{l}_{1}{l}_{2}\right)\right)\left(\left({l}_{0}{l}_{1}{l}_{2}{r}_{2}\right)◇\left({l}_{0}{l}_{1}{l}_{2}{r}_{2}\right)\right)\text{}\right)$
• 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.

#### Questions & Answers

hello, I am happy to help!
please can go further on polynomials quadratic
Abdullahi
I need quadratic equation link to Alpa Beta
find the value of 2x=32
divide by 2 on each side of the equal sign to solve for x
corri
X=16
Michael
Want to review on complex number 1.What are complex number 2.How to solve complex number problems.
Beyan
use the y -intercept and slope to sketch the graph of the equation y=6x
how do we prove the quadratic formular
hello, if you have a question about Algebra 2. I may be able to help. I am an Algebra 2 Teacher
thank you help me with how to prove the quadratic equation
Seidu
may God blessed u for that. Please I want u to help me in sets.
Opoku
what is math number
4
Trista
x-2y+3z=-3 2x-y+z=7 -x+3y-z=6
Need help solving this problem (2/7)^-2
x+2y-z=7
Sidiki
what is the coefficient of -4×
-1
Shedrak
the operation * is x * y =x + y/ 1+(x × y) show if the operation is commutative if x × y is not equal to -1
An investment account was opened with an initial deposit of $9,600 and earns 7.4% interest, compounded continuously. How much will the account be worth after 15 years? Kala Reply lim x to infinity e^1-e^-1/log(1+x) given eccentricity and a point find the equiation Moses Reply 12, 17, 22.... 25th term Alexandra Reply 12, 17, 22.... 25th term Akash A soccer field is a rectangle 130 meters wide and 110 meters long. The coach asks players to run from one corner to the other corner diagonally across. What is that distance, to the nearest tenths place. Kimberly Reply Jeannette has$5 and \$10 bills in her wallet. The number of fives is three more than six times the number of tens. Let t represent the number of tens. Write an expression for the number of fives.
What is the expressiin for seven less than four times the number of nickels
How do i figure this problem out.
how do you translate this in Algebraic Expressions
why surface tension is zero at critical temperature
Shanjida
I think if critical temperature denote high temperature then a liquid stats boils that time the water stats to evaporate so some moles of h2o to up and due to high temp the bonding break they have low density so it can be a reason
s.
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
Got questions? Join the online conversation and get instant answers!