Objectives:

• Write temporal logic properties
• Master the semantics of temporal logic

## Problems

1. (12 points) For the transition system, which states satisfy the formulas. L(s1) = {a}. L(s2) = {a}. L(s3) = {a,b}. L(s4) = {b}. s1 → s2. s2 → s3. s3 → s1. s4 → s2. s3 and s4 are initial states.

• A(X a)
• A(XXX a)
• A([] b)
• A([]<>a)
• A([](b U a))
• A(<>(b U a))

Hint: consider each state as the starting state for the formula.

2. (16 points) This problem is Exercise 5.5 in Principles of Model Checking (page 321 of the PDF document), consider an elevator system that services N > 0 floors numbered 0 through N-1. There is an elevator door at each floor with a call-button and an indicator light that signals whether or not the elevator has been called. For simplicity, consider N=4. Present a set of atomic propositions-try to minimize that set-that are needed to describe the following properties of the elevator as LTL formulae and give the LTL formulae:

• Any door on any floor is never open when the elevator is not present
• A requested floor will be served eventually
• The elevator repeatedly returns to floor 0
• When the top floor is requested, the elevator serves it immediately and does not stop on any floor on the way up

3. (16 points) For each of the following properties: label as either safety or liveness, express in a CTL* formula, and create a minimal label trace to satisfy written formula.

• The number of items in a buffer may not exceed n
• If a process reaches a location li just before a critical section, it should not be blocked forever
• Clients may not retain resources forever
• It is always cloudy before it rains

4. (4 points) Express the following property in LTL (the '!' operator is a logical not):

the transition from !p to p will happen at most once

5. (4 points) Express the following property in LTL:

there are infinitely many transitions from !p to p (and vice versa)

6. (8 points) Express the following property in LTL using r, y, g as atomic propositions denoting the states of the traffic light (r = red, y = yellow, g = green):

The lights of a traffic signal light in the following periodic sequence: red, yellow, green, red, yellow, green,… and only one light is on at any given time, starting with red. You cannot make any assumptions on how long a light is on other than it will be on for a finite length of time.

7. (5 points) Express the following property in LTL:

if q holds in a state si and r holds in some subsequent state (sj , j > i) then p must not hold in any state sk in between si and sj (i < k < j , where j is the first such subsequent state)
{"ft_lang_label":"__label__en","ft_lang_prob":0.9050754,"math_prob":0.9704729,"size":1940,"snap":"2020-45-2020-50","text_gpt3_token_len":494,"char_repetition_ratio":0.1322314,"word_repetition_ratio":0.038781162,"special_character_ratio":0.27113402,"punctuation_ratio":0.13461539,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98527265,"pos_list":[0,1,2],"im_url_duplicate_count":[null,null,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-11-29T16:58:45Z\",\"WARC-Record-ID\":\"<urn:uuid:8eb6c7ba-24ca-4823-967c-6f4f854c894f>\",\"Content-Length\":\"12801\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:301a7440-ce5f-4e3b-9360-f41904a5f0a3>\",\"WARC-Concurrent-To\":\"<urn:uuid:40c92714-704e-4f06-b86b-4520aee1797d>\",\"WARC-IP-Address\":\"128.187.106.175\",\"WARC-Target-URI\":\"https://wiki.cs.byu.edu/cs-486/homework-7\",\"WARC-Payload-Digest\":\"sha1:STZIE2FNYSUEY4K37VMPZ27EABICPU2X\",\"WARC-Block-Digest\":\"sha1:ROQJ4A4VQNOBW32V7XOEG6EGQTN3PDLO\",\"WARC-Identified-Payload-Type\":\"application/xhtml+xml\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-50/CC-MAIN-2020-50_segments_1606141201836.36_warc_CC-MAIN-20201129153900-20201129183900-00555.warc.gz\"}"}