Course Runtime Verification

Size: px
Start display at page:

Download "Course Runtime Verification"

Transcription

1 Course Martin Leucker (ISP) Volker Stolz (Høgskolen i Bergen, NO) INF5140 / V17

2 Chapters of the Course Chapter 1 Recall in More Depth Chapter 2 Specification Languages on Words Chapter 3 LTL on Finite Words Chapter 4 Impartial Chapter 5 Anticipatory LTL Semantics Chapter 6 Alternating Büchi Automata Chapter 7 Monitor Construction for Anticipatory Chapter 8 LTL with a Predictive Semantics Chapter 9 Summary

3 Chapter 1 Recall in More Depth Course INF5140 / V17

4 Chapter 1 Learning Targets of Chapter Recall in More Depth. 1. Recall the underlying principle of runtime verification. 2. Get to know to applications of runtime verification. 3. See different frameworks for runtime verification.

5 Chapter 1 Outline of Chapter Recall in More Depth. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks

6 Section Recall Word Problem Good Monitors? Chapter 1 Recall in More Depth Course INF5140 / V17

7 (Recall) technique that allow for checking whether a run of a system under scrutiny satisfies or violates a given correctness property. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-5

8 Run and Execution (Recall) Run Run: possibly infinite sequence of the system s states. Run formally: possibly infinite word or trace. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-6

9 Run and Execution (Recall) Execution Run Run: possibly infinite sequence of the system s states. Run formally: possibly infinite word or trace. Execution: finite prefix of a run. Execution formally: finite word or trace. RV is primarly used on executions. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-6

10 Adding Monitors to a System (Recall) A monitor checks whether an execution meets a correctness property. A monitor is a device that reads a finite trace and yields a certain verdict. Recall Word Problem Good Monitors? C 1 C 3 Applications Reflection When to Use RV? RV Frameworks C 2 C 4 1-7

11 Adding Monitors to a System (Recall) A monitor checks whether an execution meets a correctness property. A monitor is a device that reads a finite trace and yields a certain verdict. M Recall Word Problem Good Monitors? C 1 C 3 Applications Reflection When to Use RV? RV Frameworks C 2 C 4 1-7

12 Monitors can Check Relations of Values (Recall) A monitor can use more than one input value. A monitor can check the relations of multiple values. M C Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-8

13 RV and the Word Problem A simple monitor outputs yes if the execution satisfies the correctness property, no if not. Let ϕ denote the set of valid executions given by property ϕ. Then runtime verification answers the word problem w ϕ. The word problem can be decided with lower complexity compared to the subset problem. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-9

14 How Does a Good Monitor Look? Impartiality and Anticipation (Impartiality) Impartiality requires that a finite trace is not evaluated to true or, respectively false, if there still exists a (possibly infinite) continuation leading to another verdict. (Anticipation) Anticipation requires that once every (possibly infinite) continuation of a finite trace leads to the same verdict, then the finite trace evaluates to this very same verdict. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks A monitor for RV should adhere to both maxims! 1-10

15 Section Applications Reflection When to Use RV? RV Frameworks Chapter 1 Recall in More Depth Course INF5140 / V17

16 Reflection reflection (RR) is an architecture pattern for the development of reliable systems. A monitoring layer is enriched with a diagnosis layer and a subsequent mitigation layer. Application Mitigation Diagnosis Monitoring Logging Reflection Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-12

17 Reflection Logging Recording of System Events The logging layer observes system events and provides them for the monitoring layer. Realization Add code annotations within the system to build or use separated stand-alone loggers. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-13

18 Reflection Monitoring Fault Detection The monitoring layer is implemented using runtime verification techniques, consists of a number of monitors, detects the presence of faults in the system and raises an alarm for the diagnosis layer in case of faults. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-14

19 Reflection Diagnosis Failure Identification The diagnosis layer collects the verdicts of the monitors and deduces an explanation for the current system state solely based upon the results of the monitors and general information on the system. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-15

20 Reflection Mitigation Reconfiguration The reconfiguration layer mitigates the failure, if possible, or else may store detailed diagnosis information for off-line treatment. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-16

21 When to Use RV? The verification verdict is often referring to a model of the real system. verification may then be used to easily check the actual execution of the system. Thus, runtime verification may act as a partner to theorem proving and model checking. Often, some information is available only at runtime. In such cases, runtime verification is an alternative to theorem proving and model checking. The behavior of an application may depend heavily on the environment of the target system. In this scenario, runtime verification adds on formal correctness proofs by model checking and theorem proving. In the case of systems where security is important, it is useful also to monitor behavior or properties that have been statically proved or tested. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-17

22 Taxonomy information collection finite performance evaluation finite noncompleted trace infinite inline security application area integration outline Recall Word Problem event sequence safety checking monitoring runtime verification stage online Good Monitors? Applications Reflection When to Use RV? RV Frameworks offline state sequence input/ output behavior steering interference invasive passive active noninvasive 1-18

23 Monitoring Systems/Logging: Overview dedicated tracing/- monitoring hardware source code Recall trace tools monitoring systems /logging instrumentation byte code Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks binary code logging APIs 1-19

24 Monitoring Systems/Logging: Overview junit Eagle RV TraceMatches J-LO TraceContract Larva Recall Temporal Rover RV frameworks LogScope Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks RulerR LoLa MOP MAC 1-20

25 1. verification deals with verification techniques that allow checking whether an execution of a system under scrutiny satisfies or violates a given correctness property. 2. A Monitor checks whether an execution meets a correctness property. 3. One of its main technical challenges is the synthesis of efficient monitors from logical specifications. Recall Word Problem Good Monitors? Applications Reflection When to Use RV? RV Frameworks 1-21

26 Chapter 2 Specification Languages on Words Course INF5140 / V17

27 Chapter 2 Learning Targets of Chapter Specification Languages on Words. 1. Understand that RV specifies shape of words. 2. Recall the idea of regular expressions and understand their limitations for practical specifications. 3. Get an idea about temporal logics. 4. Understand the difference of regular expressions and temporal logics. 5. Understand how to specify properties in LTL.

28 Chapter 2 Outline of Chapter Specification Languages on Words. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic

29 Section Runs Are Words States of the System Executions Are Words Chapter 2 Specification Languages on Words Course INF5140 / V17

30 Recap We want to monitor the execution of a system. We have already seen that A run of a system is a possibly infinite sequence of the system s states. An execution of a system is a finite prefix of a run. Observations We describe the execution of a system in a discrete way. The system is in exactly one state at a time. In the next step the system is in the next state. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-5

31 Atomic Propositions An atomic proposition is an indivisible bit. We consider a fixed set of finitely many such bits. In every state every atomic proposition is either true or false. In other words: In every state of the execution some atomic propositions hold. Example Variable count is greater than 5. Memory for a variable data is allocated. Memory for data is free. The file handle logfile points to an opened file. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-6

32 States Let AP be a fixed finite non empty set of atomic propositions. Σ = 2 AP is the power set of these. A state can be seen as an element a Σ. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-7

33 Executions Are Like Linear Paths Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-8

34 Languages over Alphabets Let Σ be an alphabet and n N. We then use the following notation: Notation Σ Σ n Σ n Σ n Σ + Σ ω Σ Meaning set of all finite words over Σ all words in Σ of length n all words in Σ of length at most n all words in Σ of length at least n = Σ 1 set of all infinite words over Σ = Σ Σ ω Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-9

35 Executions Are Words A state can be seen as an element a Σ. Now a run is an infinite word w Σ ω and an execution a finite prefix w Σ. verification is about checking if an execution is correct, so we need to specify the set of correct executions as a language L Σ. Therefore a correctness property is a language L. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-10

36 Section Regular Expressions The Idea Syntax and Semantics Limitations Chapter 2 Specification Languages on Words Course INF5140 / V17

37 Regular Expressions: The Idea Use a bottom up construction to construct a complex language by combining simpler languages together. Start with languages containing only one word of length 1. Use the common operations on languages to combine these into complexer languages. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-12

38 Operations on Languages Let L 1 Σ and L 2 Σ be two languages. We than have intersection L 1 L 2 = {w Σ w L 1 w L 2 } union L 1 L 2 = {w Σ w L 1 w L 2 } complement L = {w Σ w L} concatenation L 1 L 2 = {uv Σ u L 1 v L 2 } Kleene star L = {u 1 u 2... u n Σ i : u i L} Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-13

39 Regular Expressions Regular expressions use only the operations union, concatenation and Kleene star. These are enough to build all regular languages. Every symbol a Σ is a regular expression. The empty word ε describes the empty word. Concatenation is expressed by concatenating regular expressions. Union is expressed by the operator combining two regular expressions. Kleene star is expressed by the * operator at the end of a regular expression. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-14

40 Examples Examples Let Σ = {0, 1} be the finite alphabet. (0 1)* specifies all words w Σ. 1*0* specifies all words w Σ that do not contain the string 01. ((0 1)1)* specifies all words w Σ of even length where every second letter is 1. ((0 1)1)*(0 1 ε) specifies all words w Σ where every second letter is 1. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-15

41 Syntax of Regular Expressions (Syntax of regular expressions) Let x Σ be a symbol from a given alphabet. The syntax of regular expressions is inductively defined by the following grammar: ϕ ::= ε x ϕϕ (ϕ ϕ) (ϕ)* Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-16

42 Semantics of Regular Expression (Semantics of Regular Expressions) Let w, u i Σ be words over the given alphabet, x Σ be an element of the alphabet and R, R regular expressions. Then the semantics of a regular expression is inductively defined as relation = of a non empty word and a regular expression as follows. ε = ε x = x w = RR iff u 1, u 2 : w = u 1 u 2 and u 1 = R and u 2 = R w = (R R ) iff w = R or w = R w = (R)* iff u 1,..., u n : w = u 1... u n and i {1,..., n} : u i = R. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-17

43 Expressiveness of Regular Expressions Regular expressions describe regular languages: Every language described by a regular expression is a regular language. Proof: Structural induction on the syntax of regular expressions. Every regular language can be described using a regular expression. Proof: Standard translation of deterministic finite automata into regular expressions. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-18

44 Limitations Regular expressions sometimes look more like a swear word in a comic book than a specification of anything. Crash! ^[^\)]+$ Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-19

45 Specifying Correctness Properties Specifications must be easy to understand: Specification must be correct otherwise verification makes no sense at all. We need kind of negation: It is often easier to specify the behaviour we do not want. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-20

46 Section Linear Temporal Logic (LTL) Propositional Logic Temporal Logic Chapter 2 Specification Languages on Words Course INF5140 / V17

47 Another Idea A state of a system is a set of atomic propositions that hold in this state. An execution of a system is a finite sequence of such states. Let s use operators of propositional logic to describe properties of one state. temporal logic to describe the relationship of states. propositional logic to combine this. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-22

48 A Simple Analogy A state is like a day. The initial state is like today. The next state is like tomorrow. s 0 s 1 s 2... s 21 Runs Are Words States of the System Executions Are Words today tomorrow the day after tomorrow... in 21 days Regular Expressions The Idea Syntax and Semantics Limitations Remember A day is a state in the execution. A day is a letter in the word over Σ = 2 AP. Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-23

49 Propositional Logic Using propositional logic without temporal operators we describe only the first state (today). Example Consider AP = {p, q, r, s} and an initial state s 0 of an execution w in which p and r holds. We then have s 0 s 1 s 2... s 21 {p, r} w = true w = p w = false w = p r q w = q s w = q. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-24

50 Formula: ϕ The formula ϕ holds for an execution if ϕ holds in the first state s 0 of that execution. s 0 s 1 s 2... s 21 ϕ Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-25

51 Next: X ϕ The formula X ϕ holds in state s i if ϕ holds in state s i+1. If there is no state s i+1 then X ϕ never holds. s 0 s 1 s 2... s 21 ϕ Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-26

52 Weak Next: X ϕ The formula X ϕ holds in state s i if ϕ holds in state s i+1. If there is no state s i+1 then X ϕ always holds. s 0 s 1 s 2... s 21 ϕ Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-27

53 Globally: G ϕ The formula G ϕ holds in state s i if ϕ holds in all states s j for j i. s 0 s 1 s 2... s 21 ϕ ϕ ϕ ϕ ϕ Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-28

54 Finally: F ϕ The formula F ϕ holds in state s i if there is a state s j for j i in which ϕ holds. s 0 s 1... s 20 s 21 ϕ Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-29

55 Until: ϕ U ψ The formula ϕ U ψ holds in state s i if there is a state s j for j i in which ψ holds and ϕ holds in all states s k for i k < j. s 0 s 1... s 20 s 21 ϕ ϕ ϕ ψ Notice that a state in which ϕ holds is not required in all cases! Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-30

56 Release: ϕ R ψ The formula ϕ R ψ holds in state s i if there is a state s j for j i in which ϕ holds and ψ holds in all states s k for i k j. If there is no such state s j then the ϕ R ψ holds if ψ holds in all states s k for k i. s 0 s 1... s 20 s 21 ψ ψ ψ ψ ϕ s 0 s 1 or... s 20 s 21 ψ ψ ψ ψ ψ Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-31

57 1. The execution of a system is a word over the alphabet Σ = 2 AP where AP is the set of atomic propositions. 2. A correctness property is a language describing a set of executions. 3. Regular expressions describe regular languages and could be used to describe regular correctness properties. 4. Linear Temporal Logic (LTL) describes a subset of regular languages but is much better suited to describe correctness properties for runtime verification: Negation and Conjunction of LTL allows often to express correctness properties in a simple manner. Runs Are Words States of the System Executions Are Words Regular Expressions The Idea Syntax and Semantics Limitations Linear Temporal Logic (LTL) Propositional Logic Temporal Logic 2-32

58 Chapter 3 LTL on Finite Words Course INF5140 / V17

59 Chapter 3 Learning Targets of Chapter LTL on Finite Words. 1. Learn about LTL. 2. Understand the LTL syntax. 3. Understand the LTL semantics on finite words: FLTL. 4. See how RV can be implemented using FLTL and learn about monitors for finite, terminated traces.

60 Chapter 3 Outline of Chapter LTL on Finite Words. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea

61 Section LTL Syntax LTL SALT Chapter 3 LTL on Finite Words Course INF5140 / V17

62 Recall: Specify Correctness Properties Observing Executions LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-5

63 Recall: Specify Correctness Properties Observing Executions Idea Specify correctness properties in Linear Temporal Logic (LTL). LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-5

64 Recall: Specify Correctness Properties Observing Executions Idea Specify correctness properties in Linear Temporal Logic (LTL). Commercial Specify correctness properties in Regular Linear Temporal Logic (RLTL). LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-5

65 Syntax of LTL Formulae (Syntax of LTL Formulae) Let p AP be an atomic proposition from a finite set of atomic propositions AP. The set of LTL formulae is inductively defined by the following grammar: ϕ ::= true p ϕ ϕ X ϕ ϕ U ϕ F ϕ false p ϕ ϕ X ϕ ϕ R ϕ G ϕ ϕ LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-6

66 Order of Operations The operator precedence is needed to determine an unambiguous derivation of an LTL formula if braces are left out in nested expressions. The higher the rank of an operator is the later it is derivated. Braces only need to be added if an operator of lower or same rank should be derivated later than the current one. Example (operator precedence of arithmetic) 1. exponential operator: 2. multiplicative operators:, / 3. additive operators: +, LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-7

67 Order of Operations (operator precedence of LTL) 1. negation operator: 2. unary temporal operators: X, X, G, F 3. binary temporal logic operators: U, R 4. conjunction operator: 5. disjunction operator: LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Example G x x U G y z ( ( ) ) G ( x) ( x) U (G y) z Monitor Function for FLTL The Idea 3-8

68 LTL for the Working Engineer? Simple? LTL is for theoreticians but for practitioners? LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-9

69 LTL for the Working Engineer? Simple? LTL is for theoreticians but for practitioners? SALT Structured Assertion Language for Temporal Logic Syntactic Sugar for LTL LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-9

70 LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-10

71 Section FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Chapter 3 LTL on Finite Words Course INF5140 / V17

72 Parts of Words In the formal definition of LTL semantics we denote parts of a word as follows: Let w = a 1 a 2... a n Σ n be a finite word over the alphabet Σ = 2 AP and let i N with 1 i n be a position in this word. Then w := n is the length of the word, w i = a i is the i-th letter of the word and w i = a i a i+1... a n is the subword starting with letter i. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-12

73 FLTL Semantics (FLTL Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = true w = p iff p w 1 w = p iff p w 1 w = ϕ iff w = ϕ w = ϕ ψ w = ϕ ψ iff w = ϕ or w = ψ iff w = ϕ and w = ψ LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-13

74 FLTL Semantics (FLTL Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = X ϕ iff w > 1 w = X ϕ iff w = 1 and, for w > 1, w 2 = ϕ or, for w > 1, w 2 = ϕ LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-13

75 FLTL Semantics (FLTL Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = ϕ U ψ w = ϕ R ψ iff i, 1 i w : (w i = ψ and k, 1 k < i : w k = ϕ) iff i, 1 i w : (w i = ϕ and k, 1 k i : w k = ψ) or i, 1 i w : w i = ψ LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-13

76 FLTL Semantics (FLTL Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = F ϕ w = G ϕ iff i, 1 i w : w i = ϕ iff i, 1 i w : w i = ϕ LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-13

77 Finally and Globally Examples Examples (Finally and Globally) Consider words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} = F q. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-14

78 Finally and Globally Examples Examples (Finally and Globally) Consider words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} = F q. {q}{q}{p, q}{q}{q} = G q. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-14

79 Finally and Globally Examples Examples (Finally and Globally) Consider words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} = F q. {q}{q}{p, q}{q}{q} = G q. {p}{p, q} {q} {q} = G F q. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-14

80 Finally and Globally Examples Examples (Finally and Globally) Consider words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} = F q. {q}{q}{p, q}{q}{q} = G q. {p}{p, q} {q} {q} = G F q. {p} {q}{p}{p, q}{p, q}{q} = F G q. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-14

81 Finally and Globally Examples Examples (Finally and Globally) Consider words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} = F q. {q}{q}{p, q}{q}{q} = G q. {p}{p, q} {q} {q} = G F q. {p} {q}{p}{p, q}{p, q}{q} = F G q. G F ϕ can be read as: For every state (globally) there will be a state in the future (finally) in that ϕ holds. F G ϕ can be read as: There will be a state in the future (finally) that ϕ holds in every state (globally). LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-14

82 Practical Examples In the following examples we consider these scopes: everytime: all states before ψ: all states before the first state in which ψ holds (if there is such a state) after ψ: all states after and including the first state in which ψ holds (if there is such a state) Example (Absence) The formula ϕ does not hold everytime: G ϕ before ψ: (F ψ) ( ϕ U ψ) after ψ: G(ψ (G ϕ)) LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-15

83 Practical Examples In the following examples we consider these scopes: everytime: all states before ψ: all states before the first state in which ψ holds (if there is such a state) after ψ: all states after and including the first state in which ψ holds (if there is such a state) Example (Existence) The formula ϕ holds in the future everytime: F ϕ before ψ: G ψ ψ U(ϕ ψ) after ψ: G ψ F(ψ F ϕ) LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-15

84 Practical Examples In the following examples we consider these scopes: everytime: all states before ψ: all states before the first state in which ψ holds (if there is such a state) after ψ: all states after and including the first state in which ψ holds (if there is such a state) Example (Universality) The formula ϕ holds everytime: G ϕ before ψ: (F ψ) (ϕ U ψ) after ψ: G(ψ G ϕ) LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-15

85 Equivalences (Equivalence of Formulae) Let Σ = 2 AP and ϕ and ψ be LTL formulae over AP. ϕ and ψ are equivalent, denoted by ϕ ψ, iff w Σ + : w = ϕ w = ψ. Globally and finally can easily be expressed using until and release: F ϕ true U ϕ G ϕ false R ϕ LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-16

86 De Morgan Rules The negation can always be moved in front of the atomic propositions using the dual operators: De Morgan Rules of Propositional Logic (ϕ ψ) ϕ ψ (ϕ ψ) ϕ ψ LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-17

87 De Morgan Rules The negation can always be moved in front of the atomic propositions using the dual operators: De Morgan Rules of Temporal Logic (ϕ U ψ) ϕ R ψ (ϕ R ψ) ϕ U ψ (G ϕ) F ϕ (F ϕ) G ϕ (X ϕ) X ϕ (X ϕ) X ϕ LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-17

88 Fixed Point Equations The following fixed point equations can be used to step-wise unwind until and release: ϕ U ψ ψ (ϕ X(ϕ U ψ)) ϕ R ψ ψ (ϕ X(ϕ R ψ)) Consequently such fix point equations for globally and finally are special cases of the above ones: G ϕ ϕ X(G ϕ) F ϕ ϕ X(F ϕ) LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-18

89 Negation Normal Form (NNF) (Negation Normal Form (NNF)) An LTL formula ϕ is in Negation Normal Form (NNF) iff only occurs in front of atomic propositions p AP. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-19

90 Negation Normal Form (NNF) (Negation Normal Form (NNF)) An LTL formula ϕ is in Negation Normal Form (NNF) iff only occurs in front of atomic propositions p AP. Lemma For every LTL formula there exists an equivalent formula in NNF. Proof. Recursively apply De Morgan rules of propositional logic and De Morgan rules of temporal logic. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-19

91 Section Monitor Function for FLTL The Idea Chapter 3 LTL on Finite Words Course INF5140 / V17

92 The Idea Build up a function that takes an LTL formula ϕ in NNF and a word w Σ +, performs recursion on the structure of ϕ returns true iff w = ϕ. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-21

93 First Ideas Let p AP be an atomic proposition and w Σ + a word. We then can evaluate true and false. ϕ ψ by evaluating ϕ, evaluating ψ and computing ϕ ψ. p by checking if p w 1. p by checking if p w 1. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-22

94 Further Ideas What about next? We can check if w = X ϕ holds by omitting the first letter of w and the next operator and checking if w 2 = ϕ holds. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-23

95 Further Ideas What about next? We can check if w = X ϕ holds by omitting the first letter of w and the next operator and checking if w 2 = ϕ holds. What about until and release? Use the already presented fixpoint equations and the above ideas to evaluate conjunction, disjunction and next. ϕ U ψ ψ (ϕ X(ϕ U ψ)) ϕ R ψ ψ (ϕ X(ϕ R ψ)) LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-23

96 evlfltl Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, w Σ + a finite non-empty word, ϕ and ψ LTL formulae and B 2 = {, }. We then define the function evlfltl : Σ + LTL B 2 inductively as follows: evlfltl(w, true) = evlfltl(w, false) = evlfltl(w, ϕ ψ) = evlfltl(w, ϕ) evlfltl(w, ψ) evlfltl(w, ϕ ψ) = evlfltl(w, ϕ) evlfltl(w, ψ) evlfltl(w, p) = (p w 1 ) evlfltl(w, p) = (p w 1 ) LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-24

97 evlfltl Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, w Σ + a finite non-empty word, ϕ and ψ LTL formulae and B 2 = {, }. We then define the function evlfltl : Σ + LTL B 2 inductively as follows: evlfltl(w, ϕ U ψ) = evlfltl(w, ψ (ϕ X(ϕ U ψ))) evlfltl(w, ϕ R ψ) = evlfltl(w, ψ (ϕ X(ϕ R ψ))) evlfltl(w, F ϕ) = evlfltl(w, ϕ X F ϕ) evlfltl(w, G ϕ) = evlfltl(w, ϕ X G ϕ) evlfltl(w, X ϕ) = ( w > 1) evlfltl(w 2, ϕ) evlfltl(w, X ϕ) = ( w = 1) evlfltl(w 2, ϕ) LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-24

98 1. The LTL operations negation, disjunction, until and next are enough to gain the full expressiveness of LTL. 2. If you add the dual operators every LTL formula has a negation normal form (NNF). 3. The fix point equations can be used to step-wise unwind until and release using next and weak next. 4. evlfltl is as inductively defined function that answers the question if a given finite non-empty word models a correctness property given as an LTL formula in NNF and can easily be implemented recursively. LTL Syntax LTL SALT FLTL Semantics Semantics Examples and Equivalences Negation Normal Form Monitor Function for FLTL The Idea 3-25

99 Chapter 4 Impartial Course INF5140 / V17

100 Chapter 4 Learning Targets of Chapter Impartial. 1. Understand the idea of impartiality and why we want to use impartial evaluation of LTL formulae. 2. Learn the basics of truth domains and lattices. 3. Understand the four-valued LTL semantics on finite words: FLTL See how impartial RV can be implemented using FLTL 4 and learn about automata based monitors for finite, non-completed traces.

101 Chapter 4 Outline of Chapter Impartial. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV

102 Section Truth Domains Motivation Chapter 4 Impartial Course INF5140 / V17

103 Words Aren t Terminated They Are Growing In the last chapters we considered finite terminated words. A monitor for RV does not get a formula and a finite terminated word. A monitor for RV gets a formula and one letter after another. With every new system state the monitor gets one more letter. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-5

104 Examples of Evaluating Growing Words Consider the alphabet Σ = 2 AP where AP = {p, q}, the properties ϕ = G p and ϕ = F p and words w and w growing with every new state. Lets watch monitors for RV at work: w = {p, q} w = ϕ Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-6

105 Examples of Evaluating Growing Words Consider the alphabet Σ = 2 AP where AP = {p, q}, the properties ϕ = G p and ϕ = F p and words w and w growing with every new state. Lets watch monitors for RV at work: w = {p, q} {p} w = ϕ w = ϕ Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-6

106 Examples of Evaluating Growing Words Consider the alphabet Σ = 2 AP where AP = {p, q}, the properties ϕ = G p and ϕ = F p and words w and w growing with every new state. Lets watch monitors for RV at work: w = {p, q} {p} {q} w = ϕ w = ϕ w = ϕ Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-6

107 Examples of Evaluating Growing Words Consider the alphabet Σ = 2 AP where AP = {p, q}, the properties ϕ = G p and ϕ = F p and words w and w growing with every new state. Lets watch monitors for RV at work: w = {p, q} {p} {q} {p} w = ϕ w = ϕ w = ϕ w = ϕ Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-6

108 Examples of Evaluating Growing Words Consider the alphabet Σ = 2 AP where AP = {p, q}, the properties ϕ = G p and ϕ = F p and words w and w growing with every new state. Lets watch monitors for RV at work: w = {p, q} {p} {q} {p} w = {q} Truth Domains Motivation w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-6

109 Examples of Evaluating Growing Words Consider the alphabet Σ = 2 AP where AP = {p, q}, the properties ϕ = G p and ϕ = F p and words w and w growing with every new state. Lets watch monitors for RV at work: w = {p, q} {p} {q} {p} w = {q} {q} Truth Domains Motivation w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-6

110 Examples of Evaluating Growing Words Consider the alphabet Σ = 2 AP where AP = {p, q}, the properties ϕ = G p and ϕ = F p and words w and w growing with every new state. Lets watch monitors for RV at work: w = {p, q} {p} {q} {p} w = {q} {q} {p, q} Truth Domains Motivation w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-6

111 Examples of Evaluating Growing Words Consider the alphabet Σ = 2 AP where AP = {p, q}, the properties ϕ = G p and ϕ = F p and words w and w growing with every new state. Lets watch monitors for RV at work: w = {p, q} {p} {q} {p} w = {q} {q} {p, q} {p} Truth Domains Motivation w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ w = ϕ Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-6

112 Impartiality Be Impartial! go for a final verdict ( or ) only if you really know be a rational being: stick to your word Truth Domains Motivation (Impartiality) Impartiality requires that a finite trace is not evaluated to true or, respectively false, if there still exists an (possibly infinite) continuation leading to another verdict. Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-7

113 Semantic Function (Semantic Function) The semantic function sem k : Σ + LTL B k maps a word w Σ + and a an LTL formula ϕ to a logic value b B k. We use w = ϕ k = b instead of sem k (w, ϕ) = b. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-8

114 Semantic Function for FLTL We defined the FLTL semantics as relation w = ϕ between a word w Σ + and an LTL formula ϕ. This can be interpreted as semantic function sem 2 : Σ + LTL B 2, { if w = ϕ sem 2 (w, ϕ) = w = ϕ 2 := else. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-9

115 Impartiality (Impartial Semantics) Let Σ = 2 AP be an alphabet, w Σ + a word and ϕ an LTL formula. A semantic function is called impartial iff for all u Σ w = ϕ = implies wu = ϕ = w = ϕ = implies wu = ϕ =. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Target Create monitors which only answer or if the result keeps stable for a growing word. Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-10

116 We Need Multiple Values FLTL semantics are not impartial: w = {a}, ϕ = G a and wu = {a}{b} is a counterexample for w = ϕ = implies wu = ϕ =. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-11

117 We Need Multiple Values FLTL semantics are not impartial: w = {a}, ϕ = G a and wu = {a}{b} is a counterexample for w = ϕ = implies wu = ϕ =. Truth Domains Motivation Impartiality implies multiple values Every two-valued logic is not impartial. Impartiality forbids switching from to and vice versa. Therefore we need more logic values than and. Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-11

118 Lattice (Lattice) A lattice is a partially ordered set (L, ) where for each x, y L, there exists 1. a unique greatest lower bound (glb), which is called the meet of x and y, and is denoted with x y, and 2. a unique least upper bound (lub), which is called the join of x and y, and is denoted with x y. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines If the ordering relation is obvious we denote the lattice with the set L. Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-12

119 Finite Lattice (Finite Lattice) A lattice (L, ) is called finite iff L is finite. Truth Domains Motivation Every non-empty finite lattice has two well-defined unique elements: A least element, called bottom, denoted with and a greatest element, called top, denoted with. Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-13

120 Hasse diagram Hasse diagrams are used to represent a finite partially ordered set. Each element of the set is represented as a vertex in the plane. For all x, y L where x y but no z L exists where x z y a line that goes upward from x to y is drawn. Example Hasse diagram for B 2 = {, } with : Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-14

121 Example Lattices B 2 : B 2 2 : (, ) (, ) Truth Domains Motivation B : Four-Valued LTL Semantics: FLTL 4 (,, ) (,, ) (,, ) (,, ) (,, ) (,, ) Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-15

122 Example Lattices II B 2 : B 3 : B 4 :? p Truth Domains Motivation p Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-16

123 Distributive Lattices (Distributive Lattices) A lattice (L, ) is called a distributive lattice iff we have for all elements x, y, z L x (y z) = (x y) (x z) and x (y z) = (x y) (x z). Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-17

124 De Morgan Lattice (De Morgan Lattice) A distributive lattice (L, ) is called a De Morgan lattice iff every element x L has a unique dual element x, such that x = x and x y implies y x. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-18

125 Boolean Lattice (Boolean Lattice) A De Morgan lattice is called Boolean lattice iff for every element x and its dual element x we have x x = and x x =. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Every Boolean lattice has 2 n elements for some n N. Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-19

126 Truth Domain (Truth Domain) A Truth Domain is a finite De Morgan Lattice. Examples (Truth Domains) The following lattices are all Truth Domains: B 2 = {, } with and = and =. B 3 = {,?, } with? and =,? =? and =. B 4 = {, p, p, } with p p and =, p = p, p = p and =. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-20

127 Section Four-Valued LTL Semantics: FLTL 4 Monitor Function Chapter 4 Impartial Course INF5140 / V17

128 Examples of Impartial LTL Semantics We want to create impartial four-valued semantics for LTL on finite, non-completed words using the truth domain (B 4, ). Examples (FLTL vs. FLTL 4 ) The indices 2 and 4 denote FLTL resp. FLTL 4. Truth Domains Motivation = X a 2 = = X a 2 = {a} = X a 2 = = X a 2 = = X a 2 = {a} = X a 2 = = X a 4 = p = X a 4 = {a} = X a 4 = = X a 4 = p = X a 4 = {a} = X a 4 = Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-22

129 How To Create Impartial LTL Semantics? At the end of the word X evaluates to p instead of and X evaluates to p instead of. Idea of p : Semantics if the word ends here. Fulfilling the introduced equivalences and fix point equations we get at the end of the word: U evaluates to p instead of, R evaluates to p instead of, F evaluates to p instead of and G evaluates to p instead of. Idea of p : Semantics if the word ends here or goes on like this forever. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-23

130 Properties of (B 4, ) (B 4, ) is no Boolean Lattice. Some equivalences in FLTL do not hold in FLTL 4. For any LTL formula ϕ using FLTL semantics we have ϕ ϕ 2 true and ϕ ϕ 2 false. Truth Domains Motivation Examples (FLTL vs. FLTL 4 ) For any w Σ + and a Σ we have w = G a G a 2 = w = G a G a 4 = p w = F a F a 2 = w = F a F a 4 = p Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-24

131 FLTL 4 Semantics (FLTL 4 Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = true 4 = w = false 4 = { if p w1 w = p 4 = if p w 1 { if p w1 w = p 4 = if p w 1 Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-25

132 FLTL 4 Semantics (FLTL 4 Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = ϕ 4 = w = ϕ 4 w = ϕ ψ 4 = w = ϕ 4 w = ψ 4 w = ϕ ψ 4 = w = ϕ 4 w = ψ 4 Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-25

133 FLTL 4 Semantics (FLTL 4 Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: { w 2 = ϕ 4 if w > 1 w = X ϕ 4 = p else { w 2 = ϕ 4 if w > 1 w = X ϕ 4 = p else Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-25

134 FLTL 4 Semantics (FLTL 4 Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = ϕ U ψ 4 = 1 i w w i = ψ 4 1 j<i p w j = ϕ 4 1 i w w i = ϕ 4 Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-25

135 FLTL 4 Semantics (FLTL 4 Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = ϕ R ψ 4 = 1 i w w i = ϕ 4 1 j i p w j = ψ 4 1 i w w i = ψ 4 Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-25

136 FLTL 4 Semantics (FLTL 4 Semantics) Let ϕ, ψ be LTL formulae and let w Σ + be a finite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = F ϕ 4 = p w i = ϕ 4 w = G ϕ 4 = p 1 i w 1 i w w i = ϕ 4 Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-25

137 Equivalences (Equivalence of Formulae) Let Σ = 2 AP and ϕ and ψ be LTL formulae over AP. ϕ and ψ are equivalent, denoted by ϕ ψ, iff w Σ + : w = ϕ = w = ψ. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 The equivalences desribed in the previous chapter are still valid using the semantic function of FLTL 4. Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-26

138 Monitor Function Left-to-right! Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-27

139 The Idea Build up a monitor function for evaluating each subsequent letter of non-completed words. Such a function takes an LTL formula ϕ in NNF and a letter a Σ, performs (not recursive) formula rewriting (progression) and returns a = ϕ 4 and a new LTL formula ϕ that the next letter has to fulfill. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-28

140 The Idea of Progression Compute only the semantics of the first letter and let someone else do the rest. Rewrite the LTL formula to keep track of what is done and what still needs to be checked. Thanks to the impartial semantics we don t need to know the whole word to compute a valid semantics. Truth Domains Motivation Examples Let w Σ + be a word and a Σ a letter. We can compute w = X a 4 by doing nothing and letting someone else check w 2 = a 4. We can compute w = a 4 by checking a w 1. Then the LTL formula is over. This is denoted by true or false as new formula. Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-29

141 Further Ideas We know how to evaluate atomic propositions, positive operators of propositional logic (, ) and next-formulas. Truth Domains Motivation That s it thanks to equivalences for G and F, De Morgan rules of propositional and temporal logic for negation ( ) and and fixed point equations for U and R. Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-30

142 evlfltl 4 Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, and ϕ and ψ LTL formulae. We then define the function evlfltl 4 : Σ LTL B 4 LTL inductively as follows: evlfltl 4 (a, true) = (, true) evlfltl 4 (a, false) = (, false) { (, true) if p a evlfltl 4 (a, p) = (, false) else { (, false) if p a evlfltl 4 (a, p) = (, true) else Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-31

143 evlfltl 4 Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, and ϕ and ψ LTL formulae. We then define the function evlfltl 4 : Σ LTL B 4 LTL inductively as follows: evlfltl 4 (a, ϕ ψ) = (v ϕ v ψ, ϕ ψ ), where (v ϕ, ϕ ) = evlfltl 4 (a, ϕ) and (v ψ, ψ ) = evlfltl 4 (a, ψ) evlfltl 4 (a, ϕ ψ) = (v ϕ v ψ, ϕ ψ ), where (v ϕ, ϕ ) = evlfltl 4 (a, ϕ) and (v ψ, ψ ) = evlfltl 4 (a, ψ) Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-31

144 evlfltl 4 Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, and ϕ and ψ LTL formulae. We then define the function evlfltl 4 : Σ LTL B 4 LTL inductively as follows: evlfltl 4 (a, X ϕ) = ( p, ϕ) evlfltl 4 (a, X ϕ) = ( p, ϕ) evlfltl 4 (a, ϕ U ψ) = evlfltl 4 (a, ψ (ϕ X(ϕ U ψ))) evlfltl 4 (a, ϕ R ψ) = evlfltl 4 (a, ψ (ϕ X(ϕ R ψ))) evlfltl 4 (a, F ϕ) = evlfltl 4 (a, ϕ X F ϕ) evlfltl 4 (a, G ϕ) = evlfltl 4 (a, ϕ X G ϕ) Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-31

145 Examples Example (Impartial Evaluation of Globally) Consider w = {a}{a}. First letter: evlfltl 4 ({a}, G a) = evlfltl 4 ({a}, a X G a) = (v 1 v 2, ϕ 1 ϕ 2 ) = ( p, true G a) = ( p, G a) where (v 1, ϕ 1 ) = evlfltl 4 ({a}, a) = (, true) (v 2, ϕ 2 ) = evlfltl 4 ({a}, X G a) = ( p, G a). Next letters: evlfltl 4 ({a}, G a) = ( p, G a) evlfltl 4 (, G a) = (, false) Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-32

146 Examples Example (Impartial Evaluation of Finally) Consider w = {a}. First letter: evlfltl 4 (, F a) = evlfltl 4 (, a X F a) = (v 1 v 2, ϕ 1 ϕ 2 ) = ( p, false F a) = ( p, F a) where (v 1, ϕ 1 ) = evlfltl 4 (, a) = (, false) (v 2, ϕ 2 ) = evlfltl 4 (, X F a) = ( p, F a). Next letters: evlfltl 4 (, F a) = ( p, F a) evlfltl 4 ({a}, F a) = (, true) Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-32

147 Section Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV Chapter 4 Impartial Course INF5140 / V17

148 Monitoring LTL on finite but expanding words Automata-theoretic approach Synthesize automaton Monitoring = stepping through automaton Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-34

149 Finite-state Machines With Output Moore Machines and Mealy Machines consists of states and transitions. read input and write output. change current state depending on input. Truth Domains Motivation Moore Machines output depends only on current state. generate first output in initial state. Mealy Machines output depends on current state and input. generate no output without input. Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-35

150 Moore Machine q 1 {p} q 0 p {q}, {p, q} q 2, {p}, {q}, {p, q}, {p}, {q}, {p, q} Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-36

151 Moore Machine Input q 1 {p} q 0 p {q}, {p, q} q 2, {p}, {q}, {p, q}, {p}, {q}, {p, q} Output p Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-36

152 Moore Machine Input {p} q 1 {p} q 0 p {q}, {p, q} q 2, {p}, {q}, {p, q}, {p}, {q}, {p, q} Output p p Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-36

153 Moore Machine Input {p}{p, q} q 1 {p} q 0 p {q}, {p, q} q 2, {p}, {q}, {p, q}, {p}, {q}, {p, q} Output p p Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-36

154 Moore Machine Input {p}{p, q} q 1 {p} q 0 p {q}, {p, q} q 2, {p}, {q}, {p, q}, {p}, {q}, {p, q} Output p p Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-36

155 Mealy Machine {p}/ p q 0 / {q}, {p, q}/ Truth Domains Motivation q 1 q 2 Four-Valued LTL Semantics: FLTL 4, {p}, {q}, {p, q}/, {p}, {q}, {p, q}/ Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-37

156 Mealy Machine {p}/ p q 0 / {q}, {p, q}/ Truth Domains Motivation q 1 q 2 Four-Valued LTL Semantics: FLTL 4, {p}, {q}, {p, q}/, {p}, {q}, {p, q}/ Monitor Function Mealy Machines Input Output Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-37

157 Mealy Machine {p}/ p q 0 / {q}, {p, q}/ Truth Domains Motivation q 1 q 2 Four-Valued LTL Semantics: FLTL 4, {p}, {q}, {p, q}/, {p}, {q}, {p, q}/ Monitor Function Mealy Machines Input {p} Output p Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-37

158 Mealy Machine {p}/ p q 0 / {q}, {p, q}/ Truth Domains Motivation q 1 q 2 Four-Valued LTL Semantics: FLTL 4, {p}, {q}, {p, q}/, {p}, {q}, {p, q}/ Monitor Function Mealy Machines Input {p}{p, q} Output p Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-37

159 Mealy Machine {p}/ p q 0 / {q}, {p, q}/ Truth Domains Motivation q 1 q 2 Four-Valued LTL Semantics: FLTL 4, {p}, {q}, {p, q}/, {p}, {q}, {p, q}/ Monitor Function Mealy Machines Input {p}{p, q} Output p Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-37

160 Translation Translating Moore into Mealy Machine Keep states. Label transitions with output of target state. Truth Domains Motivation Translating Mealy into Moore Machine Four-Valued LTL Semantics: FLTL 4 Add some extra states for those with multiple incoming transitions labeled with different output. Label state with output from its incoming transitions. Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-38

161 From evlfltl 4 To Mealy Machine evlfltl 4 gets a letter and a formula and outputs a logic value and a new formula. Use formula as state of the Mealy Machine. Use letter as input and logic value as output. Next state (new formula) depends on state (formula) and input (letter). Output depends on state (formula) and input (letter). Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-39

162 Determinstic Mealy Machine (Deterministic Mealy Machine) A (deterministic) Mealy machine is a tupel M = (Σ, Q, q 0, Γ, δ) where Σ is the input alphabet, Q is a finite set of states, q 0 Q is the initial state, Γ is the output alphabet and δ : Q Σ Γ Q is the transition function Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-40

163 Run of a Deterministic Mealy Machine (Run of a Deterministic Mealy Machine) A run of a (deterministic) Mealy machine M = (Σ, Q, q 0, Γ, δ) on a finite word w Σ n with outputs o i Γ is a sequence such that (w 1,o 1 ) (w 2,o 2 ) t 0 t 1... (w n 1,o n 1 ) (w n,o n) t n 1 t n t 0 = q 0 and (t i, o i ) = δ(t i 1, w i ) The output of the run is o n. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-41

164 Machine Types Deterministic in one state at a time transition function provides one state Nondeterministic in one state at a time transition function provides set of states Universal in many states simultaneously transition function provides set of states Alternating in many states simultaneously transition function provides positive Boolean combination of states FLTL 4 Monitoring Needs Alternating Mealy Machines We need all positive Boolean combinations of subformulae with finitely many states. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-42

165 Alternating Mealy Machine, {q}/ p {p}, {p, q}/ p q 0 Truth Domains Motivation false, {p}/ q 1 Four-Valued LTL Semantics: FLTL 4 Monitor Function {q}, {p, q}/ p Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-43

166 Alternating Mealy Machine, {q}/ p {p}, {p, q}/ p q 0 Truth Domains Motivation false, {p}/ q 1 Four-Valued LTL Semantics: FLTL 4 Monitor Function {q}, {p, q}/ p Mealy Machines Determinstic Mealy Machines Input Output Alternating Mealy Machines Automata Based RV 4-43

167 Alternating Mealy Machine, {q}/ p {p}, {p, q}/ p q 0 Truth Domains Motivation false, {p}/ q 1 Four-Valued LTL Semantics: FLTL 4 Monitor Function {q}, {p, q}/ p Mealy Machines Determinstic Mealy Machines Input Output p Alternating Mealy Machines Automata Based RV 4-43

168 Alternating Mealy Machine, {q}/ p {p}, {p, q}/ p q 0 Truth Domains Motivation false, {p}/ q 1 Four-Valued LTL Semantics: FLTL 4 Monitor Function {q}, {p, q}/ p Mealy Machines Determinstic Mealy Machines Input {p} Output p p Alternating Mealy Machines Automata Based RV 4-43

169 Alternating Mealy Machine, {q}/ p {p}, {p, q}/ p q 0 Truth Domains Motivation false, {p}/ q 1 Four-Valued LTL Semantics: FLTL 4 Monitor Function {q}, {p, q}/ p Mealy Machines Determinstic Mealy Machines Input {p}{q} Output p p p Alternating Mealy Machines Automata Based RV 4-43

170 Alternating Mealy Machine, {q}/ p {p}, {p, q}/ p q 0 Truth Domains Motivation false, {p}/ q 1 Four-Valued LTL Semantics: FLTL 4 Monitor Function {q}, {p, q}/ p Mealy Machines Determinstic Mealy Machines Input {p}{q} Output p p p Alternating Mealy Machines Automata Based RV 4-43

171 Alternating Mealy Machine, {q}/ p {p}, {p, q}/ p q 0 Truth Domains Motivation false, {p}/ q 1 Four-Valued LTL Semantics: FLTL 4 Monitor Function {q}, {p, q}/ p Mealy Machines Determinstic Mealy Machines Input {p}{q} {q} Output p p p Alternating Mealy Machines Automata Based RV 4-43

172 Positive Boolean Combination (PBC) (Positive Boolean Combination (PBC)) Given a set Q we define the set of all positive Boolean combinations (PBC) over Q, denoted by B + (Q), inductively as follows: {true, false} B + (Q), Q B + (Q) and α, β B + (Q) : α β, α β B + (Q). Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Examples Consider AP = {a, b, c} a B + (AP), {a} B + (AP), a b a c B + (AP), true B + (AP) and false B + (AP). Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-44

173 Alternating Mealy Machine (AMM) (Alternating Mealy Machine (AMM)) A alternating Mealy machine (AMM) is a tupel M = (Σ, Q, q 0, Γ, δ) where Σ is the input alphabet, Q is a finite set of states, q 0 Q is the initial state and Γ is a finite, distributive lattice, the output lattice, δ : Q Σ B + (Γ Q) is the transition function Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-45

174 Alternating Mealy Machine (AMM) (Alternating Mealy Machine (AMM)) A alternating Mealy machine (AMM) is a tupel M = (Σ, Q, q 0, Γ, δ) where Σ is the input alphabet, Q is a finite set of states, q 0 Q is the initial state and Γ is a finite, distributive lattice, the output lattice, δ : Q Σ B + (Γ Q) is the transition function Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Convention Understand δ : Q Σ B + (Γ Q) as a function δ : Q Σ Γ B + (Q) Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-45

175 Extended Transition Function (Extended Transition Function) Let δ : Q Σ Γ B + (Q) be the transition function of an alternating mealy machine. Then the extended transition function ˆδ : B + (Q) Σ Γ B + (Q) is inductively defined as follows ˆδ(q, a) = δ(q, a), ˆδ(true, a) = (, true), ˆδ(q1 q 2, a) = (o 1 o 2, q 1 q 2 ) and ˆδ(false, a) = (, false), ˆδ(q1 q 2, a) = (o 1 o 2, q 1 q 2 ), where (o 1, q 1 ) = ˆδ(q 1, a) and (o 2, q 2 ) = ˆδ(q 2, a). Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-46

176 Run of an Alternating Mealy Machine (Run of an Alternating Mealy Machine) A run of an alternating Mealy machine M = (Σ, Q, q 0, Γ, δ) on a finite word w Σ n with outputs o i Γ is a sequence such that (w 1,o 1 ) (w 2,o 2 ) t 0 t 1... (w n 1,o n 1 ) (w n,o n) t n 1 t n t 0 = q 0 and (t i, o i ) = ˆδ(t i 1, w i ), where ˆδ is the extended transition function of M. The output of the run is o n. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-47

177 Equivalence of PBCs (Model Relation for PBCs) Let Q be a set. A subset S Q is a model of a positive Boolean combination α B + (Q), denoted by S = α, iff α evaluates to true in propositional logic interpreting all p S as true and all p Q\S as false. Truth Domains Motivation (Equivalence of PBCs) Let Q be a set and α B + (Q) and β B + (Q) be positive Boolean combinations over Q. α and β are equivalent, denoted by α β, iff S Q : S = α S = β. Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-48

178 Equivalence Classes of PBCs (Equivalence Classes of PBCs) Let Q be a set. The equivalence class [α] of a positive Boolean combination α B + (Q) over Q is defined as follows [α] = {β B + (Q) α β}. The set of all equivalence classes of positive Boolean combinations over Q is denoted by the following quotient set B + (Q)/ = {[α] α B + (Q)}. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-49

179 Translating AMM to MM Use B + (Q) instead of Q as states. The extended transition function ˆδ then can be used as transition function of a MM. Problem: B + (Q) is infinite. There are infinitely many positive Boolean combinations over any set with at least two elements. Solution: Use B + (Q)/ instead of B + (Q). Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-50

180 Equivalence of Output and Next State Lemma Let ˆδ be the extended transition function of an AMM M = (Σ, Q, q 0, Γ, δ), a Σ, o, p Γ and α, β, α, β B + (Q) such that α β, (o, α ) = ˆδ(α, a) and Truth Domains Motivation Then (p, β ) = ˆδ(β, a). o = p and ( ) α β. Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV The proof of ( ) requires the output lattice to be distributive. 4-51

181 Representatives of [q] We can now use B + (Q)/ instead of Q as states. We still need a well defined representative for [α] for α B + (Q). In other words: Given α Q, howto find [α]? Solution: Use disjunctive normal form of α. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-52

182 Disjunctive Normal Form (DNF) (Disjunctive Normal Form (DNF)) A positive Boolean combination α B + (Q) over a set Q is in disjunctive normal form (DNF) iff n m α = q i,j i=1 j=1 for q i,j Q. A disjunctive normal form α B + (Q) is called minimal if there is no disjunctive normal form β B + (Q) s. t. α β and β contains less operators. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-53

183 Disjunctive Normal Form (DNF) (Disjunctive Normal Form (DNF)) A positive Boolean combination α B + (Q) over a set Q is in disjunctive normal form (DNF) iff n m α = q i,j i=1 j=1 for q i,j Q. A disjunctive normal form α B + (Q) is called minimal if there is no disjunctive normal form β B + (Q) s. t. α β and β contains less operators. Lemma For every positive Boolean combination α B + (Q) there exists a positive Boolean combination β such that α β and β is in minimal DNF. Proof uses distributivity of propositional logic. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-53

184 B + (Q)/ is finite Let Q be the set of states of an AMM. Then Q is finite. Then there are at most 2 Q many different α for n α = q i and n different q i Q. i=1 Then there are at most 2 2 Q many different β for n m β = q i,j minimal and q i,j Q. i=1 j=1 Then there are at most 2 2 Q many different [β] for β B + (Q). Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-54

185 Example: Alternating Mealy Machine, {q}/ p {p}, {p, q}/ p q 0 Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 false, {p}/ q 1 Monitor Function Mealy Machines {q}, {p, q}/ p Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-55

186 Example: Translated Mealy Machine, {q}/ p {q}/ p q 0 {p}, {p, q}/ p q 0 q 1, {p}/ q false, {p}, {q}, {p, q}/ {p, q}/ p Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-56

187 Translating AMM to Non-Deterministic or Universal MM Analogous we can use sets of (not equivalent) disjunctions or conjunctions of Q as states instead of B + (Q)/. alternating non-deterministic: translate t B + (Q) into equivalent minimal disjunctive normal form and use monomials as new states. alternating universal: translate t B + (Q) into equivalent minimal conjunctive normal form and use clauses as new states. alternating deterministic: translate t B + (Q) into equivalent minimal conjunctive or disjunctive normal form and use normal forms as new states. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-57

188 Automata Based RV We monitor an LTL formula ϕ by evaluating its current subformula ψ w.r.t. the current letter a. The monitor function evlfltl 4, which takes an LTL formula ψ in NNF and a letter a Σ and returns a = ψ 4 and a new LTL formula ψ, Truth Domains Motivation can be interpreted as transition function of an AMM where the states are subformulae of ϕ, the initial state is ϕ, the current state is ψ, we read the letter a, we output a = ψ 4 and Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV the next state is the new formula ψ. 4-58

189 Transition function of an AMM Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, ϕ, ψ 1, ψ 2 LTL formulae in NNF and Q the set of all subformulae of ϕ. We then define the transition function δ4 a : Q Σ B+ (B 4 Q) of the monitor AMM M ϕ = (Σ, Q, ϕ, B 4, δ4 a ) inductively as follows: δ a 4(true, a) = (, true) δ4(false, a a) = (, false) { (, true) if p a δ4(p, a a) = (, false) else { (, true) if p a δ4( a p, a) = (, false) else Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-59

190 Transition function of an AMM Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, ϕ, ψ 1, ψ 2 LTL formulae in NNF and Q the set of all subformulae of ϕ. We then define the transition function δ4 a : Q Σ B+ (B 4 Q) of the monitor AMM M ϕ = (Σ, Q, ϕ, B 4, δ4 a ) inductively as follows: δ a 4(ψ 1 ψ 2, a) = δ a 4(ψ 1, a) δ a 4(ψ 2, a) δ a 4(ψ 1 ψ 2, a) = δ a 4(ψ 1, a) δ a 4(ψ 2, a) δ a 4(X ψ 1, a) = ( p, ψ 1 ) δ a 4(X ψ 1, a) = ( p, ψ 1 ) Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-59

191 Transition function of an AMM Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, ϕ, ψ 1, ψ 2 LTL formulae in NNF and Q the set of all subformulae of ϕ. We then define the transition function δ4 a : Q Σ B+ (B 4 Q) of the monitor AMM M ϕ = (Σ, Q, ϕ, B 4, δ4 a ) inductively as follows: δ a 4(ψ 1 U ψ 2, a) = δ a 4(ψ 2 (ψ 1 X(ψ 1 U ψ 2 )), a) δ a 4(ψ 1 R ψ 2, a) = δ a 4(ψ 2 (ψ 1 X(ψ 1 R ψ 2 )), a) δ a 4(F ψ 1, a) = δ a 4(ψ 1 (X(F ψ 1 )), a) δ a 4(G ψ 1, a) = δ a 4(ψ 1 (X(G ψ 1 )), a) Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-59

192 Example Graph of the monitor M ϕ of the formula ϕ = G(p X G q):, {q}/ p {p}, {p, q}/ p G( p X G q) Truth Domains Motivation false, {p}/ G q {q}, {p, q}/ p Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-60

193 Generating Deterministic Monitors In practical implementations one may omit the AMM and generate the MM directly out of the LTL formula. Define a function smplfy : LTL LTL that transforms LTL formulae into a unique normal form. Use all simplified positive Boolean combinations of subformulae of ϕ as states for M ϕ. Define δ 4 : Q Σ B 4 Q inductively as follows: δ 4 (ψ 1 ψ 2, a) = (v ψ1 v ψ2, smplfy(ψ 1 ψ 2)), where (v ψ1, ψ 1) = δ 4 (ψ 1, a) and (v ψ2, ψ 2) = δ 4 (ψ 2, a) δ 4 (ψ 1 ψ 2, a) = (v ψ1 v ψ2, smplfy(ψ 1 ψ 2)), where (v ψ1, ψ 1) = δ 4 (ψ 1, a) and (v ψ2, ψ 2) = δ 4 (ψ 2, a) δ 4 (ψ 1, a) = δ a 4(ψ 1, a) for any other formula ψ 1. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-61

194 Automata-theoretic Approach Further Topics Alternating vs. non-deterministic vs. deterministic machines. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-62

195 Automata-theoretic Approach Further Topics Alternating vs. non-deterministic vs. deterministic machines. Complexity of the translations. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-62

196 Automata-theoretic Approach Further Topics Alternating vs. non-deterministic vs. deterministic machines. Complexity of the translations. Size vs. power. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-62

197 Automata-theoretic Approach Further Topics Alternating vs. non-deterministic vs. deterministic machines. Complexity of the translations. Size vs. power. State sequence for an input word. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-62

198 1. Every two-valued logic is not impartial. Impartiality implies multiple values. 2. We use the distributive De Morgan lattice B 4 = {, p, p, } in the impartial FLTL 4 semantics. 3. At the end of the word X evaluates to p and X evaluates to p. 4. evlfltl 4 performs formula rewriting (progression) for an LTL formula and one letter. 5. evlfltl 4 can be used to describe the transition function of an alternating mealy machine using the subformulae as states. 6. Such an alternating mealy machine can be translated into a deterministic mealy machine using the fact that equivalent positive combinations of states leads to the same next states and output. Truth Domains Motivation Four-Valued LTL Semantics: FLTL 4 Monitor Function Mealy Machines Determinstic Mealy Machines Alternating Mealy Machines Automata Based RV 4-63

199 Chapter 5 Anticipatory LTL Semantics Course INF5140 / V17

200 Chapter 5 Learning Targets of Chapter Anticipatory LTL Semantics. 1. Understand that LTL semantics can be defined over infinite words as well. 2. Understand the difference of LTL over finite and infinite words. 3. Recall anticipation and understand why impartiality is not enough to build good monitors. 4. Get used to the three-valued sematics for LTL. 5. Understand the concept of safety and co-safety properties and get an idea of monitorable properties.

201 Chapter 5 Outline of Chapter Anticipatory LTL Semantics. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability

202 Section LTL on Infinite Words Semantics Equivalences and Examples Chapter 5 Anticipatory LTL Semantics Course INF5140 / V17

203 Need of LTL on Infinite Words in RV? Impartiality Say or only if you are sure. Anticipation Say or once you can be sure. We want do define impartial LTL semantics: Say if every infinite continuation evaluates to. Say if every infinite continuation evaluates to. Otherwise say?. We Need LTL on Infinite Words Impartial LTL semantics will be based on infinite continuations. Properties of infinite continuations cannot be expressed using LTL on finite words. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-5

204 Infinite Words An infinite word w is an infinite sequence over the alphabet Σ = 2 AP. w can be interpreted as function w : N\{0} Σ. w can be interpreted as concatenation of many finite and one infinite words. Examples (Infinite Words) Consider the alphabet Σ = 2 AP with AP = {p, q}. {p} ω denotes the infinite word where every letter is {p} and can be interpreted as w(i) = {p} for all i 1. ({q}{p}) ω can be interpreted as if i = 1 w(i) = {q} if i 0 mod 2 {p} else LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-6

205 Finally and Globally Examples Examples (Finally and Globally) Consider infinite words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} ω = F q. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-7

206 Finally and Globally Examples Examples (Finally and Globally) Consider infinite words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} ω = F q. {q}{q}({p, q}{q}) ω = G q. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-7

207 Finally and Globally Examples Examples (Finally and Globally) Consider infinite words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} ω = F q. {q}{q}({p, q}{q}) ω = G q. ( {p}{p, q} ) ω = G F q. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-7

208 Finally and Globally Examples Examples (Finally and Globally) Consider infinite words over the alphabet Σ = 2 AP with AP = {p, q}. {p} {q} ω = F q. {q}{q}({p, q}{q}) ω = G q. ( {p}{p, q} ) ω = G F q. {p} {q}{p}({p, q}{q}) ω = F G q. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-7

209 Parts of Infinite Words In the formal definition of LTL semantics we denote parts of a word as follows: Let w = a 1 a 2 a 3... Σ ω be an infinite word over the alphabet Σ = 2 AP and let i N with i 1 be a position in this word. Then w i = a i is the i-th letter of the word, w (i) = a 1 a 2... a i is the prefix of w of length i and w i is the subword of w s. t. w = w (i 1) w i. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-8

210 LTL Semantics on Infinite Words (LTL Semantics on Infinite Words) Let ϕ, ψ be LTL formulae and let w Σ ω be an infinite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = true w = p iff p w 1 w = p iff p w 1 w = ϕ iff w = ϕ w = ϕ ψ w = ϕ ψ iff w = ϕ or w = ψ iff w = ϕ and w = ψ LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-9

211 LTL Semantics on Infinite Words (LTL Semantics on Infinite Words) Let ϕ, ψ be LTL formulae and let w Σ ω be an infinite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = X ϕ w = X ϕ iff w 2 = ϕ iff w 2 = ϕ LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-9

212 LTL Semantics on Infinite Words (LTL Semantics on Infinite Words) Let ϕ, ψ be LTL formulae and let w Σ ω be an infinite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = ϕ U ψ w = ϕ R ψ iff i 1 : (w i = ψ and k, 1 k < i : w k = ϕ) iff i 1 : (w i = ϕ and k, 1 k i : w k = ψ) or i 1 : w i = ψ LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-9

213 LTL Semantics on Infinite Words (LTL Semantics on Infinite Words) Let ϕ, ψ be LTL formulae and let w Σ ω be an infinite word. Then the semantics of ϕ with respect to w is inductively defined as follows: w = F ϕ w = G ϕ iff i 1 : w i = ϕ iff i 1 : w i = ϕ LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-9

214 Semantic Function for LTL on Infinite Words We defined the LTL semantics on infinite words as relation w = ϕ between a word w Σ ω and a LTL formula ϕ. This can be interpreted as semantic function sem ω : Σ ω LTL B 2, { if w = ϕ sem ω (w, ϕ) = w = ϕ ω := else. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-10

215 Languages Defined by LTL Formulae The set of models of an LTL formula ϕ defines a language L(ϕ) Σ ω of infinite words over Σ = 2 AP as follows: L(ϕ) = {w Σ ω w = ϕ ω = }. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-11

216 Equivalences Weak Next Let w Σ ω be an infinite word. w has no last character. For every position i 1 the word w i Σ ω is infinite. X and X have the same semantics. The De Morgan rules, equivalences for G and F and the fixed point equations for U and R are still valid. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-12

217 Finite and Infinite Semantics Examples (Globally and Finally) We know {p}({p}{q}) ω = F q ω = from {p}{p}{q} = F q 4 =. We know {p}({p}{q}) ω = G p ω = from {p}{p}{q} = G p 4 =. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-13

218 Finite and Infinite Semantics Examples (Until) We know {p}({p}{q}) ω = p U q ω = from {p}{p}{q} = p U q 4 =. We know {p} {q} ω = p U q ω = from {p} = p U q 4 =. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-13

219 Section Anticipatory LTL Semantics: LTL 3 Anticipation Examples Chapter 5 Anticipatory LTL Semantics Course INF5140 / V17

220 Anticipation Be Anticipatory go for a final verdict ( or ) once you really know do not delay the decision (Anticipation) Anticipation requires that once every (possibly infinite) continuation of a finite trace leads to the same verdict, then the finite trace evaluates to this very same verdict. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-15

221 FLTL 4 is Not Anticipatory Example (Next Operator) We have {p} = X X false 4 = p {p}{p} = X X false 4 = {p} = X false 4 = p {p}{p}{p} = X X false 4 = {p}{p} = X false 4 = {p} = false 4 =, but it would be anticipatory to have {p} = X X false 3 =. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-16

222 FLTL 4 is Not Anticipatory Example (Globally and Finally Operator) We have w = G true 4 = w = false R true 4 = p and w = F false 4 = w = true U false 4 = p but it would be anticipatory to have w = G true 3 = and w = F false 3 =. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-16

223 Impartial Anticipation Define LTL semantics for finite, non-terminated words. The set of all infinite continuations of a finite word contains only infinite words. Define semantics for finite words based on semantics of these infinite continuations. If the semantic function yields the same verdict for all infinite continuations use that verdict. Combine p and p to a common? for the other cases. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-17

224 Anticipatory Three-Valued LTL Semantics (LTL 3 Semantics) Let ϕ be an LTL formula and let u Σ be a finite word. Then the semantics of ϕ with respect to u is defined as follows: if w Σ ω : uw = ϕ ω = u = ϕ 3 = if w Σ ω : uw = ϕ ω =? else. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-18

225 Example Consider ϕ = G(p F false) and {q}{p} Σ for Σ = 2 AP and AP = {p, q}. We then have = ϕ 3 =? {q} = ϕ 3 =? {q}{p} = ϕ 3 = {q}{p} = ϕ 3 = LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-19

226 Example Consider ϕ = G(p F false) and {q}{p} Σ for Σ = 2 AP and AP = {p, q}. We then have = ϕ 3 =? {q} = ϕ 3 =? {q}{p} = ϕ 3 = {q}{p} = ϕ 3 = {q}{p}u = ϕ 3 = for all u Σ LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-19

227 Possible Verdicts of LTL Formulae Consider a word w Σ for Σ = 2 AP and propositions p, q AP. We then have w = p U q 3 {,?, } w = p R q 3 {,?, } LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-20

228 Possible Verdicts of LTL Formulae Consider a word w Σ for Σ = 2 AP and propositions p, q AP. We then have w = p U q 3 {,?, } w = p R q 3 {,?, } w = F p 3 {,?} w = G p 3 {?, } LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-20

229 Possible Verdicts of LTL Formulae Consider a word w Σ for Σ = 2 AP and propositions p, q AP. We then have w = p U q 3 {,?, } w = p R q 3 {,?, } w = F p 3 {,?} w = G p 3 {?, } w = G F p 3 =? w = F G p 3 =? LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-20

230 Section Monitorable Properties (Co-)Safety Examples Monitorability Chapter 5 Anticipatory LTL Semantics Course INF5140 / V17

231 Monitorability When Does Anticipation Help? LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-22

232 The Good, The Bad and The Ugly (Good, Bad and Ugly Prefixes) Given a language L Σ ω of infinite words over Σ we call a finite word u Σ a good prefix for L if w Σ ω : uw L, a bad prefix for L if w Σ ω : uw L and an ugly prefix for L if v Σ : uv is neither a good prefix nor a bad prefix. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-23

233 Examples for Good, Bad and Ugly Examples (The Good, The Bad and The Ugly) {p}{q} is a good prefix for L(F q). {p}{q}{p} is a good prefix for L(F q). {p}{q} is a bad prefix for L(G p). every w Σ is an ugly prefix for L(G F p). {p} is an ugly prefix for L(p G F p). LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-24

234 LTL 3 indentifies good/bad prefixes Given an LTL formula ϕ and a finite word u Σ, then if u is a good prefix for L(ϕ) u = ϕ 3 = if u is a bad prefix for L(ϕ)? otherwise LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-25

235 The Idea of Saftey and Co-Safety Safety Properties assert that nothing bad happens. Such a property is violated iff something bad happens after finitely many steps. ( A bad prefix exists.) Co-Safety Properties assert that something good happens. Such a property is fulfilled iff something good happens after finitely many steps. ( A good prefix exists.) LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-26

236 (Co-)Safety Languages and Properties ((Co-)Safety Languages) A language L Σ ω is called a safety language if for all w L there is a prefix u Σ of w which is a bad prefix for L. a co-safety language if for all w L there is a prefix u Σ of w which is a good prefix for L. ((Co-)Safety Properties) An LTL formula ϕ is called a safety property if its set of models L(ϕ) is a safety language. a co-safety property if its set of models L(ϕ) is a co-safety language. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-27

237 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

238 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

239 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

240 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

241 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

242 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

243 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

244 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

245 Examples Consider propositions p, q AP. Formula Safety Co-Safety G p F p X p G F p F G p X p G F p p U q p R q LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-28

246 Details on The Examples p U q is not a safety property, because {p} ω = p U q, but there is no bad prefix. p U q is a co-safety property, because every infinite word w Σ ω with w = p U q must contain the releasing q in a finite prefix. p R q is not a co-safety property, because {q} ω = p R q, but there is no good prefix. p R q is a safety property, because every infinite word w Σ ω with w = p R q must contain the violating absence of q in a finite prefix. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-29

247 Monitorability (Monitorable Languages) A language L Σ ω is called monitorable iff L has no ugly prefix. (Monitorable Properties) An LTL formula ϕ is called monitorable iff its set of models L(ϕ) is monitorable. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-30

248 Monitorable Properties Safety Properties LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-31

249 Monitorable Properties Safety Properties LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-31

250 Monitorable Properties Safety Properties LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-31

251 Monitorable Properties Safety Properties Co-Safety Properties LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-31

252 Monitorable Properties Safety Properties Co-Safety Properties LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-31

253 Monitorable Properties Safety Properties Co-Safety Properties LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-31

254 Monitorable Properties Safety Properties Co-Safety Properties Remark Safety and Co-Safety Properties are monitorable. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-31

255 Safety- and Co-Safety-Properties Theorem The class of monitorable properties comprises safety- and co-safety properties, but is strictly larger than their union. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-32

256 Safety- and Co-Safety-Properties Proof. Consider AP = {p, q, r} and ϕ = ((p q) U r) G p. {p} ω = ϕ without good prefix, therefore ϕ is not a co-safety property. {q} ω = ϕ without bad prefix, therefore ϕ is not a safety property. Every finite word u Σ that is not a bad prefix can become a good prefix by appending {r}. Every finite word u Σ that is not a good prefix can become a bad prefix by appending. No ugly prefix exists as every prefix is either good, bad or can become good or bad by appending {r} or. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-32

257 Safety- and Co-Safety-Properties Proof by Another Counterexample. Consider AP = {p, q} and ϕ = F p G q. {q} ω = ϕ without good prefix, therefore ϕ is not a co-safety property. ω = ϕ without bad prefix, therefore ϕ is not a safety property. Every finite word u Σ that is not a bad prefix can become a good prefix by appending {p}. No ugly prefix exists as every prefix is either bad or can become good by appending {p}. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-32

258 1. In the semantics for LTL on infinite words there is no difference between X and X. 2. The semantics LTL 3 for finite, non-terminated words is defined based on the LTL semantics for infinite words on the lattice B 3 = {,?, }. 3. FLTL 4 is not anticipatory, LTL 3 is. 4. w = ϕ 3 is for all good prefixes of L(ϕ), for all bad prefixes of L(ϕ) and? for all ugly prefixes of L(ϕ). 5. The class of monitorable properties comprises safetyand co-safety properties, but is strictly larger than their union. LTL on Infinite Words Semantics Equivalences and Examples Anticipatory LTL Semantics: LTL 3 Anticipation Examples Monitorable Properties (Co-)Safety Examples Monitorability 5-33

259 Chapter 6 Alternating Büchi Automata Course INF5140 / V17

260 Chapter 6 Learning Targets of Chapter Alternating Büchi Automata. 1. Recall the definition of DFA and NFA. 2. Understand the acceptance condition of Büchi automata (BA) on infinite words. 3. Learn about alternating Büchi automata (ABA). 4. Know how ABA can be translated into BA.

261 Chapter 6 Outline of Chapter Alternating Büchi Automata. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA

262 Section Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Chapter 6 Alternating Büchi Automata Course INF5140 / V17

263 Recall Finite Automata Finite Automata consist of finitely many states and transitions. read a word over an alphabet letter by letter. change current state depending on the current letter. accept or reject a word depending after reading it. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-5

264 Deterministic Finite Automata, {p} q 0 q 1, {p} {q}, {p, q} {q}, {p, q} q 2 {q}, {p, q}, {p} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-6

265 Deterministic Finite Automata, {p} q 0 q 1, {p} {q}, {p, q} {q}, {p, q} q 2 {q}, {p, q}, {p} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-6

266 Deterministic Finite Automata, {p} q 0 q 1, {p} {q}, {p, q} {q}, {p, q} q 2 {q}, {p, q}, {p} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-6

267 Deterministic Finite Automata, {p} q 0 q 1, {p} {q}, {p, q} {q}, {p, q} q 2 {q}, {p, q}, {p} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {q} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-6

268 Deterministic Finite Automata, {p} q 0 q 1, {p} {q}, {p, q} {q}, {p, q} Word {q}{p} q 2 {q}, {p, q}, {p} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-6

269 Deterministic Finite Automata, {p} q 0 q 1, {p} {q}, {p, q} {q}, {p, q} Word {q}{p}{q} q 2 {q}, {p, q}, {p} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-6

270 Deterministic Finite Automata, {p} q 0 q 1, {p} {q}, {p, q} {q}, {p, q} Word {q}{p}{q}{p, q} q 2 {q}, {p, q}, {p} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-6

271 Deterministic Finite Automata (DFA) (Deterministic Finite Automata (DFA)) A deterministic finite automata (DFA) is a tuple A = (Σ, Q, q 0, δ, F ) such that Σ is the input alphabet, Q is a finite non-empty set of states, q 0 Q is the initial state, δ : Q Σ Q is the transition function and F Q is the set of accepting states. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-7

272 Run of a DFA (Run of a DFA) A Run of a DFA A = (Σ, Q, q 0, δ, F ) on a finite word w Σ is a function ρ : {0,..., w } Q such that ρ(0) = q 0 and i {1,..., w } : ρ(i) = δ(ρ(i 1), w i ). A run is called accepting iff ρ( w ) F. A accepts w if the run ρ of A on w is accepting. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-8

273 Non-determinstic Finite Automata, {p}, {q}, {p, q}, {p}, {q}, {p, q} q 0 q 2 {p}, {p, q} {p}, {p, q} q 1 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-9

274 Non-determinstic Finite Automata, {p}, {q}, {p, q}, {p}, {q}, {p, q} q 0 q 2 {p}, {p, q} {p}, {p, q} q 1 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-9

275 Non-determinstic Finite Automata, {p}, {q}, {p, q}, {p}, {q}, {p, q} q 0 q 2 {p}, {p, q} {p}, {p, q} q 1 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-9

276 Non-determinstic Finite Automata, {p}, {q}, {p, q}, {p}, {q}, {p, q} q 0 q 2 {p}, {p, q} {p}, {p, q} q 1 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {p} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-9

277 Non-determinstic Finite Automata, {p}, {q}, {p, q}, {p}, {q}, {p, q} q 0 q 2 {p}, {p, q} {p}, {p, q} q 1 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {p}{q} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-9

278 Non-determinstic Finite Automata, {p}, {q}, {p, q}, {p}, {q}, {p, q} q 0 q 2 {p}, {p, q} {p}, {p, q} q 1 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {p}{q}{p} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-9

279 Non-determinstic Finite Automata, {p}, {q}, {p, q}, {p}, {q}, {p, q} q 0 q 2 {p}, {p, q} {p}, {p, q} q 1 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {p}{q}{p}{p, q} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-9

280 Non-deterministic Finite Automata (NFA) (Non-deterministic Finite Automata (NFA)) A non-deterministic finite automata (NFA) is a tuple A = (Σ, Q, Q 0,, F ) such that Σ is the input alphabet, Q is a finite non-empty set of states, Q 0 Q is the set of initial states, Q Σ Q is the transition relation and F Q is the set of accepting states. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-10

281 Run of an NFA (Run of an NFA) A Run of an NFA A = (Σ, Q, Q 0,, F ) on a finite word w Σ is a function ρ : {0,..., w } Q such that ρ(0) Q 0 and i {1,..., w } : (ρ(i 1), w i, ρ(i)). A run is called accepting iff ρ( w ) F. A accepts w if there is an accepting run ρ of A on w. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-11

282 Language of Automata (Language of Automata) The language L(A) Σ of an automaton A with the alphabet Σ is defined as follows: L(A) = {w Σ A accepts w}. We say that A accepts a language L iff L(A) = L. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-12

283 Power of Finite Automata Every NFA can be translated into an equivalent DFA using the power set construction. DFAs can accept all regular languages. (Proof: Construct a DFA from a regular grammar using its nonterminals as states.) For every regular language one can construct a DFA. (Proof: See regular expressions.) Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-13

284 Section Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Chapter 6 Alternating Büchi Automata Course INF5140 / V17

285 ω-regular Languages (ω-regular Languages) A language L Σ ω over an alphabet Σ is called ω-regular iff there are regular languages U i, V i Σ for i {1,..., m} such that L = m i=1 U i V ω i. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-15

286 ω-regular Languages (ω-regular Languages) A language L Σ ω over an alphabet Σ is called ω-regular iff there are regular languages U i, V i Σ for i {1,..., m} such that L = m i=1 Example (ω-regular Languages) U i V ω i. Consider an alphabet Σ = 2 AP for AP = {p, q}. L(G p) = {{p}, {p, q}} ω L(F p) = Σ {{p}, {p, q}} Σ ω Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-15

287 Finite Automata on Infinite Words Finite automata can be used on infinite words as well. of run ρ can be reused. Problem: There is no last state ρ( w ). Solution: New acceptance condition. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-16

288 Acceptance Condition of Büchi Automata Büchi automata can accept all ω-regular languages. An accepting run of a Büchi automaton visits at least one accepting state infinitely often. Automata on Finite Words ω-regular Languages union concatenation regular language U i regular language V ω i Büchi Automata non-determinism simple transition like an NFA new acceptance condition Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-17

289 Non-deterministic Büchi Automata, {p}, {q}, {p, q} {p}, {p, q} q 0 q 1 {p}, {p, q}, {p}, {q}, {p, q} q 2 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-18

290 Non-deterministic Büchi Automata, {p}, {q}, {p, q} {p}, {p, q} q 0 q 1 {p}, {p, q}, {p}, {q}, {p, q} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Word q 2 Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-18

291 Non-deterministic Büchi Automata, {p}, {q}, {p, q} {p}, {p, q} q 0 q 1 {p}, {p, q}, {p}, {q}, {p, q} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Word {p} q 2 Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-18

292 Non-deterministic Büchi Automata, {p}, {q}, {p, q} {p}, {p, q} q 0 q 1 {p}, {p, q}, {p}, {q}, {p, q} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Word {p}{p, q} q 2 Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-18

293 Non-deterministic Büchi Automata, {p}, {q}, {p, q} {p}, {p, q} q 0 q 1 {p}, {p, q}, {p}, {q}, {p, q} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Word {p}{p, q} {q} q 2 Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-18

294 Non-deterministic Büchi Automata, {p}, {q}, {p, q} {p}, {p, q} q 0 q 1 {p}, {p, q}, {p}, {q}, {p, q} q 2 Word {p}{p, q} {q}{p} Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-18

295 Non-deterministic Büchi Automata, {p}, {q}, {p, q} {p}, {p, q} q 0 q 1 {p}, {p, q}, {p}, {q}, {p, q} q 2 Word {p}{p, q}({q}{p}) ω Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-18

296 Non-deterministic Büchi Automata (BA) (Non-deterministic Büchi Automata (BA)) A (non-deterministic) Büchi automaton is a tuple A = (Σ, Q, Q 0,, F ) such that Σ is the input alphabet, Q is the finite non-empty set of states, Q 0 Q is the set of initial states, Q Σ Q is the transition relation and F Q is the set of accepting states. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-19

297 Run of a BA (Run of a BA) A run of a BA A = (Σ, Q, Q 0,, F ) on an infinite word w Σ ω is a function ρ : N Q such that ρ(0) Q 0 and i N\{0} : (ρ(i 1), w i, ρ(i)). Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-20

298 Accepting Runs of a BA (Accepting Runs of a BA) A run ρ of a BA A = (Σ, Q, Q 0,, F ) is called accepting iff Inf(ρ) F, where Inf(ρ) denotes the set of states visited infinitely often given by { } Inf(ρ) = q Q {k N ρ(k) = q} =. A accepts w if there is an accepting run ρ of A on w. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-21

299 Accepting Runs of a BA (Accepting Runs of a BA) A run ρ of a BA A = (Σ, Q, Q 0,, F ) is called accepting iff Inf(ρ) F, where Inf(ρ) denotes the set of states visited infinitely often given by { } Inf(ρ) = q Q {k N ρ(k) = q} =. A accepts w if there is an accepting run ρ of A on w. Again the language L(A) Σ ω of an automata A with the alphabet Σ is defined as follows: L(A) = {w Σ ω A accepts w}. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-21

300 Deterministic Büchi Automata (Deterministic Büchi Automata) A BA A = (Σ, Q, Q 0,, F ) is called determistic iff for every q Q and a Σ there is exactly one q Q such that (q, a, q ). The successor state is determined by the current state and the action. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-22

301 Deterministic Büchi Automata (Deterministic Büchi Automata) A BA A = (Σ, Q, Q 0,, F ) is called determistic iff for every q Q and a Σ there is exactly one q Q such that (q, a, q ). The successor state is determined by the current state and the action. Non-deterministic BA are strictly more expressive than deterministic BA. The language {p, q} {q} ω cannot be accepted by a deterministic BA. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-22

302 BA for {p, q} {q} ω p, q q q 0 q 1 Impossible to handle with determistic transition function. There are infinitely many possible finite prefixes in {p, q}. You don t know when to stop scanning the finite prefix and start scanning the infinite loop. q Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-23

303 Section Alternating Büchi Automata (ABA) The Idea Translating ABA into BA Chapter 6 Alternating Büchi Automata Course INF5140 / V17

304 Alternating Automata Extend non-deterministic automata by universal choices. Non-deterministic transition relations denote a set of possible next states. Alternating transition functions denote a positive Boolean combination of next states. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-25

305 Alternating Büchi Automaton, {p}, {q}, {p, q}, {q} q 0 q 1 Automata on Finite Words {p}, {p, q} true Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-26

306 Alternating Büchi Automaton, {p}, {q}, {p, q}, {q} q 0 q 1 Automata on Finite Words {p}, {p, q} true Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-26

307 Alternating Büchi Automaton, {p}, {q}, {p, q}, {q} q 0 q 1 Automata on Finite Words {p}, {p, q} true Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {p} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-26

308 Alternating Büchi Automaton, {p}, {q}, {p, q}, {q} q 0 q 1 Automata on Finite Words {p}, {p, q} true Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {p}{q} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-26

309 Alternating Büchi Automaton, {p}, {q}, {p, q}, {q} q 0 q 1 Automata on Finite Words {p}, {p, q} true Word {p}{q}{p, q} Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-26

310 Alternating Büchi Automaton, {p}, {q}, {p, q}, {q} q 0 q 1 Automata on Finite Words {p}, {p, q} true Word {p}{q}{p, q}{p} Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-26

311 Alternating Büchi Automaton, {p}, {q}, {p, q}, {q} q 0 q 1 Automata on Finite Words {p}, {p, q} true Word {p}{q}{p, q}{p} ω Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-26

312 Recall: Positive Boolean Combination The set B + (Q) of all positive boolean combinations (PBC) over Q contains true, false and all elements of Q and all conjunctions and disjunctions of its elements. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) A subset S Q is a model of α B + (Q), denoted by S = α, iff α evaluates to true in propositional logic interpreting all p S as true and all p Q\S as false. Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-27

313 Alternating Büchi Automata (ABA) (Alternating Büchi Automata (ABA)) A alternating Büchi automaton is a tuple A = (Σ, Q, Q 0, δ, F ) such that Σ is the input alphabet, Q is the finite non-empty set of states, Q 0 B + (Q) is the PBC of initial states, δ : Q Σ B + (Q) is the transition function and F Q is the set of accepting states. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-28

314 Minimal Models of a PBC (Minimal Models of a PBC) A model S = α of a PBC α B + (Q) is called minimal, denoted by S α, if none of its proper subsets S S is a model S = α. Examples Consider α = (q 1 q 2 ) (q 1 q 3 ) B + ({q 0, q 1, q 2, q 3 }) {q 1, q 2 } α {q 1, q 3 } α {q 1, q 2, q 3 } = α but {q 1, q 2, q 3 } α Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-29

315 Minimal Models of a PBC (Minimal Models of a PBC) A model S = α of a PBC α B + (Q) is called minimal, denoted by S α, if none of its proper subsets S S is a model S = α. Examples true S Q : S S true S Q : S = false Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-29

316 Run of an ABA (Run of an ABA) A run of an ABA A = (Σ, Q, Q 0, δ, F ) on an infinite word w Σ ω is a Q-labeled directed acyclic graph (V, E) such that there exist labelings l : V Q and h : V N which satisfy the following properties: {l(v) v h 1 (0)} Q 0. E i N (h 1 (i) h 1 (i + 1)). v V : h(v ) 1 {v V (v, v ) E}. v, v V : v v l(v) = l(v ) h(v) h(v ). v V : {l(v ) (v, v ) E} δ(l(v), w h(v)+1 ). Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-30

317 Run of an ABA, {p}, {q}, {p, q}, {q} q 0 q 1 Automata on Finite Words {p}, {p, q} true Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-31

318 Run of an ABA, {p}, {q}, {p, q}, {q} q 0 q 0 q 1 Automata on Finite Words {p}, {p, q} true Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-31

319 Run of an ABA, {p}, {q}, {p, q}, {q} q 0 {p} q 1 q 0 q 0 q 1 Automata on Finite Words {p}, {p, q} true Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {p} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-31

320 Run of an ABA, {p}, {q}, {p, q}, {q} q 0 {p} q 1 q 0 q 0 q 1 {q} Automata on Finite Words Deterministic Finite {p}, {p, q} true q 1 q 0 Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Word {p}{q} Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-31

321 Run of an ABA, {p}, {q}, {p, q}, {q} q 0 {p} q 1 q 0 q 0 q 1 {p}, {p, q} true Word {p}{q}{p, q} {q} q 1 q 0 {p, q} q 1 q 0 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-31

322 Run of an ABA, {p}, {q}, {p, q}, {q} q 0 {p} q 1 q 0 q 0 q 1 {q} Automata on Finite Words Deterministic Finite {p}, {p, q} true q 1 q 0 {p, q} Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Word {p}{q}{p, q}{p} ω q 1 q 0 {p} ω Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-31

323 Run of an ABA, {p}, {q}, {p, q}, {q} 0 q 0 {p} 1 q 1 q 0 q 0 q 1 {q} Automata on Finite Words Deterministic Finite {p}, {p, q} true 2 q 1 q 0 {p, q} Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Word {p}{q}{p, q}{p} ω 3 q 1 q 0 {p} ω Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-31

324 Accepting Run of an ABA A run of a BA is accepting, if infinitely many accepting states are visited. Think of the run of an ABA as runs of several copies of BAs at the same time. Every copy has to visit infinitely many accepting states. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-32

325 Accepting Run of an ABA A run of a BA is accepting, if infinitely many accepting states are visited. Think of the run of an ABA as runs of several copies of BAs at the same time. Every copy has to visit infinitely many accepting states. Automata on Finite Words Deterministic Finite Automata (DFA) (Accepting Run of an ABA) A run (V, E) on w Σ ω is accepting if every maximal infinite path, with respect to the labeling l, visits at least one accepting state infinitely often. Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Note that every maximal finite path ends in a node v V with δ(l(v), w h(v)+1 ) = true. Translating ABA into BA 6-32

326 Translating ABA into BA Theorem For every alternating Büchi automaton A, there is a Büchi automaton A with L(A) = L(A ). The size of A is exponential in the size of A. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-33

327 The Idea Transition function of ABA points to PBCs. Use minimal models X Q of these PBCs as states of the BA q 0 q 1 q 2 q 3 q 4 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Problem: What are the new accepting states? 3 q 1 q 2 Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Accepting only if every state of X is accepting is not enough. 4 q 3 q 4 Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-34

328 The Idea: The new accepting states Idea: Keep track of the paths on which we already visited an accepting state. Split states into two components. Shift successor states of the current states into the second component if they are accepting. An empty first component indicates that accepting states have been seen on all paths. Such states are accepting and all not accpeting successors are shifted back to the first component. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-35

329 The Idea: The New Accepting States 0 q 0 ({q 0 }, ) 1 q 1 q 2 ({q 1 }, {q 2 }) Automata on Finite Words 2 q 3 q 4 (, {q 3, q 4 }) Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) 3 q 1 q 2 ({q 1 }, {q 2 }) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? 4 q 3 q 4 (, {q 3, q 4 }) Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-36

330 Translating ABA into BA Proof. Let A = (Σ, Q, Q 0, δ, F ) be an ABA. We then define the BA A = (Σ, Q, Q 0,, F ) such that L(A) = L(A ), where Q = 2 Q 2 Q, Q Σ Q as defined next, Q 0 = {(X, ) X Q, X Q 0} and F = 2 Q. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-37

331 Translating ABA into BA Proof. A pair (U, V ) Q, an action a Σ and a pair (U, V ) Q are element of the transition relation iff case U : there are X, Y Q satisfying X δ(q, a) and Y δ(q, a) q U q V and U = X\F and V = (X F ) (Y \U ). case U = : there is Y Q satisfying Y δ(q, a) q V and U = Y \F and V = Y F. Note that we identify an empty conjunction with true, so that e. g. ((, ), a, (, )). Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-37

332 Translating ABA into BA Proof. By Q = 2 Q 2 Q we get Q = 2 Q 2 Q = 2 2 Q, but since the components U and V of a state (U, V ) have an empty intersection U V = we get an upper bound for the number of needed states of Q ( ) ( Q k ( )) k k l k=0 l=0 Q ( ) Q = 2 k k k=0 = 3 Q = 2 Q log 2 3 Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-37

333 Example: ABA, {p}, {q}, {p, q}, {q} Automata on Finite Words q 0 q 1 Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) {p}, {p, q} true Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-38

334 Example: Matching BA ({q 0 }, ), {p}, {q}, {p, q} ({q 1 }, {q 0 }), {q}, {p}, {q}, {p, q} {p}, {p, q} (, {q 0, q 1 }) Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-39

335 1. DFA and NFA are finite automata on finite words and accept a word depending on the last state of a run on it. 2. Büchi automata (BA) are finite automata on infintite words and accept a word depending on the set of states visited infinitely often in a run on it. 3. Non-deterministic BA can accept all ω-regular languages, deterministic BA cannot. 4. Alternating Büchi Automata (ABA) use transition functions mapping to positive Boolean combinations (PBCs) of states. 5. Every ABA can be translated into an BA accepting the same language using minimal models of the PBCs as states and keeping track of the paths on which accepting states were already visited. Automata on Finite Words Deterministic Finite Automata (DFA) Non-determinstic Finite Automata (NFA) Büchi Automata (BA) Non-deterministic Büchi Automata (BA) Deterministic Büchi Automata? Alternating Büchi Automata (ABA) The Idea Translating ABA into BA 6-40

336 Chapter 7 Monitor Construction for Anticipatory Course INF5140 / V17

337 Chapter 7 Learning Targets of Chapter Monitor Construction for Anticipatory. 1. Understand the translation from LTL to alternating Büchi automata. 2. Understand the monitor construction for LTL Know the single steps of this construction, especially how a satisfiability check is implemented in the emptiness per state function. 4. Learn about its complexity and its relation to monitorable properties.

338 Chapter 7 Outline of Chapter Monitor Construction for Anticipatory. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties

339 Section The Idea Impartial Anticipation The Construction Chapter 7 Monitor Construction for Anticipatory Course INF5140 / V17

340 Impartial Anticipation Impartiality Go for a final verdict ( or ) only if you really know. Be a rational being: Stick to your word. Every two-valued logic is not impartial. We therefore use B 3 = {,?, }. Anticipation Go for a final verdict ( or ) once you really know. Don t be a cunctator: Don t delay the decision. Implementing anticipation is dificult you need to identify all shortest bad resp. good prefixes. Consider for example X X X false or F false. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-5

341 The Semantics Let ϕ be an LTL formula and let u Σ be a finite word. Then the semantics of ϕ with respect to u is given as follows: if w Σ ω : uw = ϕ ω = u = ϕ 3 = if w Σ ω : uw = ϕ ω =? else. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-6

342 Target Construct a Moore machine M ϕ for an LTL formula ϕ that reads a word letter by letter outputs in every state the value of w = ϕ 3 where w is the word read so far. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-7

343 First Idea Remember the evlfltl 4 function: It reads a word letter by letter and outputs the subformula that has to be satisfied next for every letter it gets. First idea: Perform a satisfiability check on the returned formula of such a function. Return? if the formula is satisfiable. Return if the formula is a tautology. Return if the formula is a contradiction. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-8

344 Satisfiability Checking for LTL Satisfiability checking for LTL is a difficult task. The problem of deciding if there exists a word w Σ ω for an LTL formula ϕ such that w = ϕ is pspace-complete. We will use a translation of LTL formulae to Büchi automata to perform this task. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-9

345 Monitor construction Construct a BA of the LTL formula and identify: For example consider AP = {p, q} and Σ = 2 AP : {p}, {p, q} q 0 q 1, {q} {p}, {p, q}, {q} q 2 {p}, {p, q} q 3 q 4, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-10

346 Monitor construction Construct a BA of the LTL formula and identify: good states BA will accept on every continuation. For example consider AP = {p, q} and Σ = 2 AP : {p}, {p, q} q 0 q 1, {q} {p}, {p, q}, {q} q 2 {p}, {p, q} q 3 q 4, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-10

347 Monitor construction Construct a BA of the LTL formula and identify: good states BA will accept on every continuation. bad states BA will reject on every continuation. For example consider AP = {p, q} and Σ = 2 AP : {p}, {p, q} q 0 q 1, {q} {p}, {p, q}, {q} q 2 {p}, {p, q} q 3 q 4, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-10

348 Monitor construction Construct a BA of the LTL formula and identify: good states BA will accept on every continuation. bad states BA will reject on every continuation. other states? We don t know (yet). For example consider AP = {p, q} and Σ = 2 AP :? {p}, {p, q} q 0 q 1, {q} {p}, {p, q}, {q} q 2 {p}, {p, q} q 3 q 4, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-10

349 Monitor construction Construct a BA of the LTL formula and identify: good states BA will accept on every continuation. bad states BA will reject on every continuation. other states? We don t know (yet). For example consider AP = {p, q} and Σ = 2 AP :? {p}, {p, q} q 0 q 1, {q} {p}, {p, q}, {q} q 2 {p}, {p, q} q 3 q 4, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties Create a Moore machine using these labels as outputs. 7-10

350 Analysis of the Construction It s an LTL 3 Monitor! One can construct an ABA from LTL. We can translate an ABA into a BA. The monitor performs the desired satisfiability check. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-11

351 Analysis of the Construction It s an LTL 3 Monitor! One can construct an ABA from LTL. We can translate an ABA into a BA. The monitor performs the desired satisfiability check. How to detect regions? The bad regions ( ) are subautomata S without accepting states and without edges leaving S. They can be identified using linear-time nested depth-first search algorithms. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-11

352 Analysis of the Construction It s an LTL 3 Monitor! One can construct an ABA from LTL. We can translate an ABA into a BA. The monitor performs the desired satisfiability check. How to detect regions? The bad regions ( ) are subautomata S without accepting states and without edges leaving S. They can be identified using linear-time nested depth-first search algorithms. The good regions ( ) are universal subautomata accepting every possible word. Universality check for BA is pspace-complete. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-11

353 Identifying The Good States {p}, {p, q} {p}, {p, q} q 0 q 1 q 2, {q}, {q} {p}, {p, q} q 3 q 4, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-12

354 Identifying The Good States Only identify bad states ( ) and {p}, {p, q} {p}, {p, q} q 0 q 1 q 2, {q}, {q} {p}, {p, q} q 3 q 4, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-12

355 Identifying The Good States Only identify bad states ( ) and label everything else as not bad ( ). {p}, {p, q} {p}, {p, q} q 0 q 1 q 2, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis, {q} {p}, {p, q} Complexity Monitorable Properties q 3 q 4, {q} 7-12

356 Identifying The Good States Only identify bad states ( ) and label everything else as not bad ( ). Perform this for the LTL formulae ϕ and ϕ. Good states for ϕ are bad states for ϕ. {p}, {p, q} {p}, {p, q} q 0 q 1 q 2, {q}, {p}, {q}, {p, q} The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis, {q} {p}, {p, q} Complexity Monitorable Properties q 3 q 4, {q} 7-12

357 Identifying The Good States Only identify bad states ( ) and label everything else as not bad ( ). Perform this for the LTL formulae ϕ and ϕ. Good states for ϕ are bad states for ϕ. Remark An LTL formula can be complemented by adding. Computing the NNF can be done in linear time. Complementing a BA potentially needs exponential time. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-12

358 The Complete Construction 1. Translate ϕ and ϕ into ABA. 2. Translate ABAs into BAs. 3. Create NFAs based on bad states in BAs. 4. Determinize NFAs to DFAs. 5. Compute Moore machine out of both DFAs. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-13

359 Section The Construction From LTL to ABA Emptiness per State The Monitor Chapter 7 Monitor Construction for Anticipatory Course INF5140 / V17

360 Recall the Idea of the AMM for FLTL 4 We monitor an LTL formula ϕ by evaluating its current subformula ψ w.r.t. the current letter a. Progression provides the LTL formula ψ that has to be fulfilled next. The set of states consists of all subformulae of ϕ. The initial state is ϕ. The current state is ψ. It reads the letter a and sets ψ as new state. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-15

361 Recall the Idea of the AMM for FLTL 4 We monitor an LTL formula ϕ by evaluating its current subformula ψ w.r.t. the current letter a. Progression provides the LTL formula ψ that has to be fulfilled next. The set of states consists of all subformulae of ϕ. The initial state is ϕ. The current state is ψ. It reads the letter a and sets ψ as new state. But when to accept? ABA accepts if all paths are finite (ending in true). Only Release R and Globally G allow for infinite loops. Make these states accepting. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-15

362 LTL to ABA Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, ϕ, ψ 1, ψ 2 LTL formulae in NNF and Q the set of all subformulae of ϕ. We then define ABA ϕ = (Σ, Q, ϕ, δ, F ) with F = {ψ 1 R ψ 2, G ψ 1 ψ 1, ψ 2 Q}. and its transition function δ : Q Σ B + (Q) inductively given as follows: δ(true, a) = true δ(false, a) = false { true if p a δ(p, a) = false else { true if p a δ( p, a) = false else The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-16

363 LTL to ABA Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, ϕ, ψ 1, ψ 2 LTL formulae in NNF and Q the set of all subformulae of ϕ. We then define ABA ϕ = (Σ, Q, ϕ, δ, F ) with F = {ψ 1 R ψ 2, G ψ 1 ψ 1, ψ 2 Q}. and its transition function δ : Q Σ B + (Q) inductively given as follows: δ(ψ 1 ψ 2, a) = δ(ψ 1, a) δ(ψ 2, a) δ(ψ 1 ψ 2, a) = δ(ψ 1, a) δ(ψ 2, a) δ(x ψ 1, a) = ψ 1 δ(x ψ 1, a) = ψ 1 The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-16

364 LTL to ABA Let Σ = 2 AP be the finite alphabet, p AP an atomic proposition, a Σ a letter, ϕ, ψ 1, ψ 2 LTL formulae in NNF and Q the set of all subformulae of ϕ. We then define ABA ϕ = (Σ, Q, ϕ, δ, F ) with F = {ψ 1 R ψ 2, G ψ 1 ψ 1, ψ 2 Q}. and its transition function δ : Q Σ B + (Q) inductively given as follows: δ(ψ 1 U ψ 2, a) = δ(ψ 2 (ψ 1 X(ψ 1 U ψ 2 )), a) δ(ψ 1 R ψ 2, a) = δ(ψ 2 (ψ 1 X(ψ 1 R ψ 2 )), a) δ(f ψ 1, a) = δ(ψ 1 (X(F ψ 1 )), a) δ(g ψ 1, a) = δ(ψ 1 (X(G ψ 1 )), a) The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-16

365 Example Consider AP = {p, q}, Σ = 2 AP and ϕ = G(p U q). δ(g(p U q), a) = G(p U q) δ(p U q, a) a Σ δ(p U q, ) = δ(q, ) (δ(p, ) (p U q)) = false (false (p U q)) = false δ(p U q, {p}) = δ(q, {p}) (δ(p, {p}) (p U q)) = false (true (p U q)) = p U q δ(p U q, {q}) = δ(q, {q}) (δ(p, {q}) (p U q)) = true (false (p U q)) = true δ(p U q, {p, q}) = δ(q, {p, q}) (δ(p, {p, q}) (p U q)) = true (true (p U q)) = true The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-17

366 Example Consider AP = {p, q}, Σ = 2 AP and ϕ = G(p U q). true {q}, {p, q} {p} {q}, {p, q} G(p U q) p U q {p} false false The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-17

367 The Monitor Construction For a given LTL formula ϕ over an alphabet Σ we construct a Moore machine M ϕ that reads finite words w Σ and outputs w = ϕ 3 B 3. For the next steps let A ϕ = (Σ, Q ϕ, Q ϕ 0, δϕ, F ϕ ) denote the BA accepting all models of ϕ and A ϕ = (Σ, Q ϕ, Q ϕ 0, δ ϕ, F ϕ ) The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties denote the BA accepting all words falsifying ϕ. 7-18

368 Emptiness per State (BA With Adjusted Initial State) For an BA A, we denote by A(q) the BA that coincides with A except for the set of initial states Q 0, which is redefined in A(q) as Q 0 = {q}. (Emptiness per State) We then define a function F ϕ : Q ϕ B 2 (with B 2 = {, }) where we set F ϕ (q) = iff L(A ϕ (q)). The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-19

369 Emptiness per State (BA With Adjusted Initial State) For an BA A, we denote by A(q) the BA that coincides with A except for the set of initial states Q 0, which is redefined in A(q) as Q 0 = {q}. (Emptiness per State) We then define a function F ϕ : Q ϕ B 2 (with B 2 = {, }) where we set F ϕ (q) = iff L(A ϕ (q)). Using F ϕ, we define the NFA Âϕ = (Σ, Q ϕ, Q ϕ 0, δϕ, ˆF ϕ ) with ˆF ϕ = {q Q ϕ F ϕ (q) = }. Analogously, we set  ϕ = (Σ, Q ϕ, Q ϕ 0, δ ϕ, ˆF ϕ ) with ˆF ϕ = {q Q ϕ F ϕ (q) = }. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-19

370 LTL 3 Evaluation Lemma (LTL 3 Evaluation) With the notation as before, we have if w / L(Â ϕ ) w = ϕ 3 = if w / L(Âϕ )? if w L(Âϕ L(Â ϕ )) The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-20

371 LTL 3 Evaluation Proof. w = ϕ 3 = if w / L(Â ϕ ) Feeding a finite prefix w Σ to the BA A ϕ, we reach the set δ ϕ (Q ϕ 0, w) Q ϕ of states. If q δ ϕ (Q ϕ 0, w) : L(A ϕ (q)) then we can choose σ L(A ϕ (q)) such that wσ L(A ϕ ). Such a state q exists by definition iff w L(Â ϕ ). If w / L(Â ϕ ) then every possible continuation wσ of w will be rejected by A ϕ, i.e. wσ = ϕ ω = for all σ Σ ω. Therefore we have w = ϕ 3 =. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties w = ϕ 3 = if w / L(Âϕ ) can be seen by substituting ϕ for ϕ. 7-20

372 LTL 3 Evaluation Proof. w = ϕ 3 =? if w L(Â ϕ ) L(Âϕ ) If q δ ϕ (Q ϕ 0, w) : L(A ϕ (q)) and q δ ϕ (Q ϕ 0, w) : L(Aϕ (q )) then we can choose σ L(A ϕ (q)) and σ L(A ϕ (q )) such that wσ = ϕ 2 = and wσ = ϕ 2 =. Hence we have w = ϕ 3 =?. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-20

373 Deterministic Moore Machine (FSM), {p}, {q}, {p, q}, {p}, {q}, {p, q} q 1 q 0 {q}, {p, q}? q 2 The Idea Impartial Anticipation The Construction {p} The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-21

374 Deterministic Moore Machine (FSM), {p}, {q}, {p, q}, {p}, {q}, {p, q} q 1 q 0 {q}, {p, q}? q 2 The Idea Impartial Anticipation The Construction {p} The Construction From LTL to ABA Emptiness per State The Monitor Input Output? Analysis Complexity Monitorable Properties 7-21

375 Deterministic Moore Machine (FSM), {p}, {q}, {p, q}, {p}, {q}, {p, q} q 1 q 0 {q}, {p, q}? q 2 The Idea Impartial Anticipation The Construction {p} The Construction From LTL to ABA Emptiness per State The Monitor Input {p} Output?? Analysis Complexity Monitorable Properties 7-21

376 Deterministic Moore Machine (FSM), {p}, {q}, {p, q}, {p}, {q}, {p, q} q 1 q 0 {q}, {p, q}? q 2 The Idea Impartial Anticipation The Construction {p} The Construction From LTL to ABA Emptiness per State The Monitor Analysis Input {p}{p, q} Output?? Complexity Monitorable Properties 7-21

377 Deterministic Moore Machine (FSM), {p}, {q}, {p, q}, {p}, {q}, {p, q} q 1 q 0 {q}, {p, q}? q 2 The Idea Impartial Anticipation The Construction {p} The Construction From LTL to ABA Emptiness per State The Monitor Analysis Input {p}{p, q} Output?? Complexity Monitorable Properties 7-21

378 Determinstic Moore Machine (FSM) (Deterministic Moore Machine (FSM)) A (deterministic) Moore machine is a tupel M = (Σ, Q, q 0, Γ, δ, λ) where Σ is the input alphabet, Q is a finite set of states, q 0 Q is the initial state, Γ is the output alphabet, δ : Q Σ Q is the transition function and λ : Q Γ is the output function. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-22

379 Run of a Deterministic Moore Machine (Run of a Deterministic Moore Machine) A run of a (deterministic) Moore machine M = (Σ, Q, q 0, Γ, δ, λ) on a finite word w Σ n with outputs o i Γ is a sequence such that t 0 = q 0, t i = δ(t i 1, w i ) and o i = λ(t i ). w t 1 w 0 2 w n 1 w t1... t n n 1 tn The output of the run is o n = λ(t n ). The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-23

380 Monitor M ϕ for an LTL Formula ϕ Let Ãϕ = (Σ, Q ϕ, q ϕ 0, δ ϕ, F ϕ ) and à ϕ = (Σ, Q ϕ, q ϕ 0, δ ϕ, F ϕ ) be the equivalent DFAs of the NFAs Âϕ and  ϕ. (Monitor M ϕ for an LTL formula ϕ) We define the product automaton A ϕ = Ãϕ à ϕ as the Moore machine (Σ, Q, q 0, B 3, δ, λ), where Q = Q ϕ Q ϕ, q 0 = ( q ϕ 0, q ϕ 0 ), δ((q, q ), a) = ( δ ϕ (q, a), δ ϕ (q, a)) and λ : Q B 3 with if q / F ϕ λ((q, q )) = if q / F ϕ? if q F ϕ and q F ϕ. The monitor M ϕ of ϕ is obtained by minimizing A ϕ. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-24

381 The Complete Construction The Construction LTL BA Emptiness per State NFA ϕ A ϕ F ϕ Â ϕ The Idea Impartial Anticipation The Construction LTL 3 Evaluation u = ϕ 3 = if u / L(NFA ϕ )? The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-25

382 The Complete Construction The Construction LTL BA Emptiness per State NFA ϕ ϕ A ϕ F ϕ Â ϕ The Idea Impartial Anticipation The Construction LTL 3 Evaluation u = ϕ 3 = if u / L(NFA ϕ )? The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-25

383 The Complete Construction The Construction LTL BA Emptiness per State NFA ϕ ϕ A ϕ A ϕ F ϕ F ϕ Âϕ Â ϕ The Idea Impartial Anticipation The Construction LTL 3 Evaluation if u / L(NFA ϕ ) u = ϕ 3 = if u / L(NFA ϕ )? else The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-25

384 The Complete Construction The Construction LTL BA Emptiness per State NFA ϕ ϕ ϕ A ϕ A ϕ F ϕ F ϕ Âϕ Â ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-25

385 The Complete Construction The Construction LTL BA Emptiness per State NFA DFA ϕ ϕ ϕ A ϕ A ϕ F ϕ F ϕ Âϕ Â ϕ Ã ϕ Ã ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-25

386 The Complete Construction The Construction LTL BA Emptiness per State NFA DFA FSM ϕ ϕ ϕ A ϕ A ϕ F ϕ F ϕ Âϕ Â ϕ Ã ϕ Ã ϕ M ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-25

387 Example LTL p U q (p U q) The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-26

388 Example LTL p U q (p U q) BA {p} {q}, {p, q} Σ {p} Σ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-26

389 Example LTL p U q (p U q) BA {p} {q}, {p, q} Σ {p} Σ DFA {p} {q}, {p, q} Σ Σ {p} {q}, {p, q} Σ Σ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-26

390 Example LTL p U q (p U q) BA {p} {q}, {p, q} Σ {p} Σ DFA {p} {q}, {p, q} Σ Σ {p} {q}, {p, q} Σ Σ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties FSM Σ {q}, {p, q}? Σ {p} 7-26

391 Section Analysis Complexity Monitorable Properties Chapter 7 Monitor Construction for Anticipatory Course INF5140 / V17

392 Complexity The Construction LTL ϕ ϕ ϕ BA A ϕ A ϕ Emptiness per State F ϕ F ϕ NFA Âϕ Â ϕ DFA Ã ϕ Ã ϕ FSM M ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-28

393 Complexity The Construction LTL ϕ ϕ ϕ BA A ϕ A ϕ Emptiness per State F ϕ F ϕ NFA Âϕ Â ϕ DFA Ã ϕ Ã ϕ FSM M ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-28

394 Complexity The Construction LTL ϕ ϕ ϕ BA A ϕ A ϕ Emptiness per State F ϕ F ϕ NFA Âϕ Â ϕ DFA Ã ϕ Ã ϕ FSM M ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-28

395 Complexity The Construction LTL ϕ ϕ ϕ BA A ϕ A ϕ Emptiness per State F ϕ F ϕ NFA Âϕ Â ϕ DFA Ã ϕ Ã ϕ FSM M ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Complexity M 2 2O( ϕ ) Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-28

396 Complexity The Construction LTL ϕ ϕ ϕ BA A ϕ A ϕ Emptiness per State F ϕ F ϕ NFA Âϕ Â ϕ DFA Ã ϕ Ã ϕ FSM M ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Complexity M 2 2O( ϕ ) Emptiness per State The Monitor Analysis Complexity Monitorable Properties Optimal result! FSM can be minimised (Myhill-Nerode) 7-28

397 On-the-fly Construction The Construction LTL ϕ ϕ ϕ BA A ϕ A ϕ Emptiness per State F ϕ F ϕ NFA Âϕ Â ϕ DFA Ã ϕ Ã ϕ FSM M ϕ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-29

398 Evaluation on Dwyer s Specification Patterns I Number of States Both NBAs together Resulting monitor Formula size The Idea Impartial Anticipation Total number of states The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties The 53 monitorable LTL specification patterns 7-30

399 Evaluation on Dwyer s Specification Patterns II Total Size 1000 Both NBAs together Resulting monitor Formula size Total number of states and transitions The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties The 53 monitorable LTL specification patterns 7-31

400 Monitorability When Does Anticipation Help? The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-32

401 Recall The Good, The Bad and The Ugly Given a language L Σ ω of infinite words over Σ we call a finite word u Σ a good prefix for L if w Σ ω : uw L, a bad prefix for L if w Σ ω : uw L and an ugly prefix for L if v Σ : uv is neither a good prefix nor a bad prefix. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-33

402 Recall The Good, The Bad and The Ugly Given a language L Σ ω of infinite words over Σ we call a finite word u Σ a good prefix for L if w Σ ω : uw L, a bad prefix for L if w Σ ω : uw L and an ugly prefix for L if v Σ : uv is neither a good prefix nor a bad prefix. LTL 3 indentifies good/bad prefixes: if u is a good prefix for L(ϕ) u = ϕ 3 = if u is a bad prefix for L(ϕ)? otherwise. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-33

403 Monitors Revisited Structure of Monitors? The Idea Impartial Anticipation The Construction bad ugly? good Σ Σ Σ The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-34

404 Monitors Revisited Structure of Monitors? The Idea Impartial Anticipation The Construction bad ugly? good Σ Σ Σ The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties Classification of Prefixes of Words Bad prefixes 7-34

405 Monitors Revisited Structure of Monitors? The Idea Impartial Anticipation The Construction bad ugly? good Σ Σ Σ The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties Classification of Prefixes of Words Bad prefixes Good prefixes 7-34

406 Monitors Revisited Structure of Monitors? The Idea Impartial Anticipation The Construction bad ugly? good Σ Σ Σ The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties Classification of Prefixes of Words Bad prefixes Ugly prefixes Good prefixes 7-34

407 Monitorable Non-Monitorable ϕ is non-monitorable after u, if u cannot be extended to a bad oder good prefix. Monitorable ϕ is monitorable if there is no such u. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-35

408 Monitorable Non-Monitorable ϕ is non-monitorable after u, if u cannot be extended to a bad oder good prefix. Monitorable ϕ is monitorable if there is no such u. Ugly occurs Consider G F p bad ugly?? good Σ Σ Σ The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-35

409 1. LTL formulae on infinite words can be translated into alternating Büchi automata. 2. The emptiness per state function computes the satisfiability of an LTL formla and can be used to generate an NFA accepting in the not bad states of the BA of the LTL formula. 3. The impartial anticipatory LTL monitor is based on such an NFA for the LTL formula and one for its complement and identifies good, bad and ugly prefixes. 4. Universalitiy testing for Büchi automata can be avoided by complementing the LTL formula instead of the Büchi automaton. 5. The size of the generated monitor is double-exponential in the size of the LTL formula. The Idea Impartial Anticipation The Construction The Construction From LTL to ABA Emptiness per State The Monitor Analysis Complexity Monitorable Properties 7-36

410 Chapter 8 LTL with a Predictive Semantics Course INF5140 / V17

411 Chapter 8 Learning Targets of Chapter LTL with a Predictive Semantics. 1. Understand how the underlying program to monitor could be taken into account. 2. Understand how to build a corresponding monitor synthesis procedure.

412 Chapter 8 Outline of Chapter LTL with a Predictive Semantics. Predictive Semantics Motivation Monitoring LTL P 4

413 Section Predictive Semantics Motivation Chapter 8 LTL with a Predictive Semantics Course INF5140 / V17

414 Fusing model checking and runtime verification LTL with a predictive semantics Predictive Semantics Motivation Monitoring LTL P 4 8-5

415 Recall anticipatory LTL semantics The truth value of a LTL 3 formula ϕ with respect to u, denoted by u = ϕ, is an element of B 3 defined by if σ Σ ω : uσ = ϕ u = ϕ = if σ Σ ω : uσ = ϕ? otherwise. Predictive Semantics Motivation Monitoring LTL P 4 8-6

416 Applied to the Empty Word Empty word ε ε = ϕ P = iff σ Σ ω with εσ P : εσ = ϕ iff L(P) = ϕ RV more difficult than MC? Then runtime verification implicitly answers model checking Predictive Semantics Motivation Monitoring LTL P 4 8-7

417 Abstraction An over-abstraction or and over-approximation of a program P is a program ˆP such that L(P) L( ˆP) Σ ω. Predictive Semantics Motivation Monitoring LTL P 4 8-8

418 Predictive Semantics (Predictive Semantics of LTL) Let P be a program and let ˆP be an over-approximation of P. Let u Σ denote a finite trace. The truth value of u and an LTL formula ϕ with respect to ˆP, denoted by u = ϕ ˆP B 4 = {,,?, }, and defined as follows: if u ω L( ˆP) w Σ ω : uw L( ˆP) uw = ϕ ω = if u ω L( ˆP) w Σ ω : u = ϕ ˆP = uw L( ˆP) uw = ϕ ω =? if w, w Σ ω : uw, uw L( ˆP) uw = ϕ ω = uw = ϕ ω = if u / ω L( ˆP) Predictive Semantics Motivation Monitoring LTL P 4 We use LTL P 4 to indicate LTL with predictive semantics. 8-9

419 Properties of Predictive Semantics Remark Let ˆP be an over-approximation of a program P over Σ, u Σ, and ϕ LTL. Model checking is more precise than RV with the predictive semantics: P = ϕ implies u = ϕ ˆP {,?} RV has no false negatives: u = ϕ ˆP = implies P = ϕ The predictive semantics of an LTL formula is more precise than LTL 3 : u = ϕ 3 = implies u = ϕ ˆP = u = ϕ 3 = implies u = ϕ ˆP = Predictive Semantics Motivation Monitoring LTL P 4 The reverse directions are in general not true. 8-10

420 Section Monitoring LTL P 4 Chapter 8 LTL with a Predictive Semantics Course INF5140 / V17

421 Predictive Semantics Motivation Monitoring LTL P

422 1. LTL P 4 only considers extensions of the current word leading to executions of an over-abstraction ˆP of the underlying program P. 2. We introduced the new value of the output alphabet indicating that the current execution has left the over-abstraction. 3. The use of an over-abstraction is the tradeoff between model checking and runtime verification as the use of the program P itself would implicitly solve the model checking problem. Predictive Semantics Motivation Monitoring LTL P

423 Chapter 9 Summary Course INF5140 / V17

424 Chapter 9 Learning Targets of Chapter Summary. 1. Understand that FLTL, FLTL 4 and LTL on infinite words share a very similar semantics. 2. Understand that LTL 3 and LTL P 4 are defined with respect to existing semantics. 3. Understand the difference of propositions and events.

425 Chapter 9 Outline of Chapter Summary. Impartial RV Common LTL Semantics RV on Finite, Terminated Executions Impartial RV on Finite, Non-Terminated Words Anticipatory RV LTL on Infinite Words Anticipatory RV on Finite, Non-Terminated Words Other LTL Semantics Events vs. Propositions Further Topics

426 Section Impartial RV Common LTL Semantics RV on Finite, Terminated Executions Impartial RV on Finite, Non-Terminated Words Chapter 9 Summary Course INF5140 / V17

427 LTL Semantics We know the following LTL semantics FLTL LTL on finite, completed words FLTL 4 impartial LTL on finite, non-completed words LTL LTL on infinite words LTL 3 anticipatory LTL on finite, non-completed words LTL P 4 anticipatory LTL on finite, non-completed words with respect to an over-abstraction of a program P FLTL, FLTL 4 and LTL have very similar semantics with a big common part LTL 3 and LTL P 4 are defined based on LTL Impartial RV Common LTL Semantics RV on Finite, Terminated Executions Impartial RV on Finite, Non-Terminated Words Anticipatory RV LTL on Infinite Words Anticipatory RV on Finite, Non-Terminated Words Other LTL Semantics Events vs. Propositions Further Topics 9-5

428 The Common Parts of LTL Semantics Let AP be a finite set of atomic propositions, Σ = 2 AP, p AP, ϕ, ψ LTL formulae, and w Σ a (finite or infinite) word. The the common part of the LTL semantics FLTL, FLTL 4 and LTL (indicated by L) of an LTL formula with respect to w is inductively defined as follows: Boolean Constants w = true L = w = false L = Impartial RV Common LTL Semantics RV on Finite, Terminated Executions Impartial RV on Finite, Non-Terminated Words Anticipatory RV LTL on Infinite Words Boolean Combinations Anticipatory RV on Finite, Non-Terminated Words Other LTL Semantics w = ϕ L = w = ϕ L w = ϕ ψ L = w = ϕ L w = ψ L Further Topics Events vs. Propositions w = ϕ ψ L = w = ϕ L w = ψ L 9-6

429 The Common Parts of LTL Semantics Let AP be a finite set of atomic propositions, Σ = 2 AP, p AP, ϕ, ψ LTL formulae, and w Σ a (finite or infinite) word. The the common part of the LTL semantics FLTL, FLTL 4 and LTL (indicated by L) of an LTL formula with respect to w is inductively defined as follows: Atomic Propositions w = p L = { if p w1 if p / w 1 Impartial RV Common LTL Semantics RV on Finite, Terminated Executions Impartial RV on Finite, Non-Terminated Words Anticipatory RV LTL on Infinite Words Local Temporal Operators w = X ϕ L = defined dependent of L later w = X ϕ L = defined dependent of L later Anticipatory RV on Finite, Non-Terminated Words Other LTL Semantics Events vs. Propositions Further Topics 9-6

430 The Common Parts of LTL Semantics Let AP be a finite set of atomic propositions, Σ = 2 AP, p AP, ϕ, ψ LTL formulae, and w Σ a (finite or infinite) word. The the common part of the LTL semantics FLTL, FLTL 4 and LTL (indicated by L) of an LTL formula with respect to w is inductively defined as follows: Fixed Point Operators if i, 1 i w : ( w i = ψ L = w = ϕ U ψ L = and k, 1 k < i : w k = ϕ L = ) defined dependent of L later else w = ϕ R ψ L = w = ϕ U ψ L w = F ϕ L = w = true U ϕ L Impartial RV Common LTL Semantics RV on Finite, Terminated Executions Impartial RV on Finite, Non-Terminated Words Anticipatory RV LTL on Infinite Words Anticipatory RV on Finite, Non-Terminated Words Other LTL Semantics Events vs. Propositions Further Topics w = G ϕ L = w = false R ϕ L 9-6

431 LTL on Finite, Terminated Words Impartial RV Common LTL Semantics RV on Finite, Terminated Executions Impartial RV on Finite, Non-Terminated Words Anticipatory RV LTL on Infinite Words Anticipatory RV on Finite, Non-Terminated Words Other LTL Semantics Events vs. Propositions Further Topics 9-7

Comparing LTL Semantics for Runtime Verification

Comparing LTL Semantics for Runtime Verification Comparing LTL Semantics for Runtime Verification Andreas Bauer 1, Martin Leucker 2, and Christian Schallhart 2 1 National ICT Australia (NICTA) 2 Institut für Informatik, Technische Universität München

More information

Timo Latvala. March 7, 2004

Timo Latvala. March 7, 2004 Reactive Systems: Safety, Liveness, and Fairness Timo Latvala March 7, 2004 Reactive Systems: Safety, Liveness, and Fairness 14-1 Safety Safety properties are a very useful subclass of specifications.

More information

Chapter 3: Linear temporal logic

Chapter 3: Linear temporal logic INFOF412 Formal verification of computer systems Chapter 3: Linear temporal logic Mickael Randour Formal Methods and Verification group Computer Science Department, ULB March 2017 1 LTL: a specification

More information

Automata-based Verification - III

Automata-based Verification - III COMP30172: Advanced Algorithms Automata-based Verification - III Howard Barringer Room KB2.20: email: howard.barringer@manchester.ac.uk March 2009 Third Topic Infinite Word Automata Motivation Büchi Automata

More information

Theoretical Foundations of the UML

Theoretical Foundations of the UML Theoretical Foundations of the UML Lecture 17+18: A Logic for MSCs Joost-Pieter Katoen Lehrstuhl für Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ws-1718/fuml/ 5.

More information

Impartial Anticipation in Runtime-Verification

Impartial Anticipation in Runtime-Verification Impartial Anticipation in Runtime-Verification Wei Dong 1, Martin Leucker 2, and Christian Schallhart 2 1 School of Computer, National University of Defense Technology, P.R.China 2 Institut für Informatik,

More information

A Hierarchy for Accellera s Property Specification Language

A Hierarchy for Accellera s Property Specification Language A Hierarchy for Accellera s Property Specification Language Thomas Türk May 1st, 2005 Diploma Thesis University of Kaiserslautern Supervisor: Prof. Dr. Klaus Schneider Vorliegende Diplomarbeit wurde von

More information

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège

Temporal logics and explicit-state model checking. Pierre Wolper Université de Liège Temporal logics and explicit-state model checking Pierre Wolper Université de Liège 1 Topics to be covered Introducing explicit-state model checking Finite automata on infinite words Temporal Logics and

More information

Temporal Logic. Stavros Tripakis University of California, Berkeley. We have designed a system. We want to check that it is correct.

Temporal Logic. Stavros Tripakis University of California, Berkeley. We have designed a system. We want to check that it is correct. EE 244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2016 Temporal logic Stavros Tripakis University of California, Berkeley Stavros Tripakis (UC Berkeley) EE 244, Fall 2016

More information

Property Checking of Safety- Critical Systems Mathematical Foundations and Concrete Algorithms

Property Checking of Safety- Critical Systems Mathematical Foundations and Concrete Algorithms Property Checking of Safety- Critical Systems Mathematical Foundations and Concrete Algorithms Wen-ling Huang and Jan Peleska University of Bremen {huang,jp}@cs.uni-bremen.de MBT-Paradigm Model Is a partial

More information

Automata-based Verification - III

Automata-based Verification - III CS3172: Advanced Algorithms Automata-based Verification - III Howard Barringer Room KB2.20/22: email: howard.barringer@manchester.ac.uk March 2005 Third Topic Infinite Word Automata Motivation Büchi Automata

More information

Alan Bundy. Automated Reasoning LTL Model Checking

Alan Bundy. Automated Reasoning LTL Model Checking Automated Reasoning LTL Model Checking Alan Bundy Lecture 9, page 1 Introduction So far we have looked at theorem proving Powerful, especially where good sets of rewrite rules or decision procedures have

More information

Chapter 5: Linear Temporal Logic

Chapter 5: Linear Temporal Logic Chapter 5: Linear Temporal Logic Prof. Ali Movaghar Verification of Reactive Systems Spring 94 Outline We introduce linear temporal logic (LTL), a logical formalism that is suited for specifying LT properties.

More information

From Liveness to Promptness

From Liveness to Promptness From Liveness to Promptness Orna Kupferman Hebrew University Nir Piterman EPFL Moshe Y. Vardi Rice University Abstract Liveness temporal properties state that something good eventually happens, e.g., every

More information

CSE 1400 Applied Discrete Mathematics Definitions

CSE 1400 Applied Discrete Mathematics Definitions CSE 1400 Applied Discrete Mathematics Definitions Department of Computer Sciences College of Engineering Florida Tech Fall 2011 Arithmetic 1 Alphabets, Strings, Languages, & Words 2 Number Systems 3 Machine

More information

PSL Model Checking and Run-time Verification via Testers

PSL Model Checking and Run-time Verification via Testers PSL Model Checking and Run-time Verification via Testers Formal Methods 2006 Aleksandr Zaks and Amir Pnueli New York University Introduction Motivation (Why PSL?) A new property specification language,

More information

Automata Theory and Formal Grammars: Lecture 1

Automata Theory and Formal Grammars: Lecture 1 Automata Theory and Formal Grammars: Lecture 1 Sets, Languages, Logic Automata Theory and Formal Grammars: Lecture 1 p.1/72 Sets, Languages, Logic Today Course Overview Administrivia Sets Theory (Review?)

More information

Computation Tree Logic (CTL) & Basic Model Checking Algorithms

Computation Tree Logic (CTL) & Basic Model Checking Algorithms Computation Tree Logic (CTL) & Basic Model Checking Algorithms Martin Fränzle Carl von Ossietzky Universität Dpt. of Computing Science Res. Grp. Hybride Systeme Oldenburg, Germany 02917: CTL & Model Checking

More information

Chapter 4: Computation tree logic

Chapter 4: Computation tree logic INFOF412 Formal verification of computer systems Chapter 4: Computation tree logic Mickael Randour Formal Methods and Verification group Computer Science Department, ULB March 2017 1 CTL: a specification

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 September 2, 2004 These supplementary notes review the notion of an inductive definition and

More information

Failure Diagnosis of Discrete Event Systems With Linear-Time Temporal Logic Specifications

Failure Diagnosis of Discrete Event Systems With Linear-Time Temporal Logic Specifications Failure Diagnosis of Discrete Event Systems With Linear-Time Temporal Logic Specifications Shengbing Jiang and Ratnesh Kumar Abstract The paper studies failure diagnosis of discrete event systems with

More information

Lecture Notes on Inductive Definitions

Lecture Notes on Inductive Definitions Lecture Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 28, 2003 These supplementary notes review the notion of an inductive definition and give

More information

Supplementary Notes on Inductive Definitions

Supplementary Notes on Inductive Definitions Supplementary Notes on Inductive Definitions 15-312: Foundations of Programming Languages Frank Pfenning Lecture 2 August 29, 2002 These supplementary notes review the notion of an inductive definition

More information

Automata, Logic and Games: Theory and Application

Automata, Logic and Games: Theory and Application Automata, Logic and Games: Theory and Application 1. Büchi Automata and S1S Luke Ong University of Oxford TACL Summer School University of Salerno, 14-19 June 2015 Luke Ong Büchi Automata & S1S 14-19 June

More information

T Reactive Systems: Temporal Logic LTL

T Reactive Systems: Temporal Logic LTL Tik-79.186 Reactive Systems 1 T-79.186 Reactive Systems: Temporal Logic LTL Spring 2005, Lecture 4 January 31, 2005 Tik-79.186 Reactive Systems 2 Temporal Logics Temporal logics are currently the most

More information

Comp487/587 - Boolean Formulas

Comp487/587 - Boolean Formulas Comp487/587 - Boolean Formulas 1 Logic and SAT 1.1 What is a Boolean Formula Logic is a way through which we can analyze and reason about simple or complicated events. In particular, we are interested

More information

Linear Temporal Logic and Büchi Automata

Linear Temporal Logic and Büchi Automata Linear Temporal Logic and Büchi Automata Yih-Kuen Tsay Department of Information Management National Taiwan University FLOLAC 2009 Yih-Kuen Tsay (SVVRL @ IM.NTU) Linear Temporal Logic and Büchi Automata

More information

Computer-Aided Program Design

Computer-Aided Program Design Computer-Aided Program Design Spring 2015, Rice University Unit 3 Swarat Chaudhuri February 5, 2015 Temporal logic Propositional logic is a good language for describing properties of program states. However,

More information

3 Propositional Logic

3 Propositional Logic 3 Propositional Logic 3.1 Syntax 3.2 Semantics 3.3 Equivalence and Normal Forms 3.4 Proof Procedures 3.5 Properties Propositional Logic (25th October 2007) 1 3.1 Syntax Definition 3.0 An alphabet Σ consists

More information

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism, CS 54, Lecture 2: Finite Automata, Closure Properties Nondeterminism, Why so Many Models? Streaming Algorithms 0 42 Deterministic Finite Automata Anatomy of Deterministic Finite Automata transition: for

More information

LTL is Closed Under Topological Closure

LTL is Closed Under Topological Closure LTL is Closed Under Topological Closure Grgur Petric Maretić, Mohammad Torabi Dashti, David Basin Department of Computer Science, ETH Universitätstrasse 6 Zürich, Switzerland Abstract We constructively

More information

CS256/Spring 2008 Lecture #11 Zohar Manna. Beyond Temporal Logics

CS256/Spring 2008 Lecture #11 Zohar Manna. Beyond Temporal Logics CS256/Spring 2008 Lecture #11 Zohar Manna Beyond Temporal Logics Temporal logic expresses properties of infinite sequences of states, but there are interesting properties that cannot be expressed, e.g.,

More information

Logic Model Checking

Logic Model Checking Logic Model Checking Lecture Notes 10:18 Caltech 101b.2 January-March 2004 Course Text: The Spin Model Checker: Primer and Reference Manual Addison-Wesley 2003, ISBN 0-321-22862-6, 608 pgs. the assignment

More information

Automata on Infinite words and LTL Model Checking

Automata on Infinite words and LTL Model Checking Automata on Infinite words and LTL Model Checking Rodica Condurache Lecture 4 Lecture 4 Automata on Infinite words and LTL Model Checking 1 / 35 Labeled Transition Systems Let AP be the (finite) set of

More information

CS156: The Calculus of Computation

CS156: The Calculus of Computation CS156: The Calculus of Computation Zohar Manna Winter 2010 It is reasonable to hope that the relationship between computation and mathematical logic will be as fruitful in the next century as that between

More information

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω

The non-logical symbols determine a specific F OL language and consists of the following sets. Σ = {Σ n } n<ω 1 Preliminaries In this chapter we first give a summary of the basic notations, terminology and results which will be used in this thesis. The treatment here is reduced to a list of definitions. For the

More information

Introduction to Temporal Logic. The purpose of temporal logics is to specify properties of dynamic systems. These can be either

Introduction to Temporal Logic. The purpose of temporal logics is to specify properties of dynamic systems. These can be either Introduction to Temporal Logic The purpose of temporal logics is to specify properties of dynamic systems. These can be either Desired properites. Often liveness properties like In every infinite run action

More information

The Complexity of Computing the Behaviour of Lattice Automata on Infinite Trees

The Complexity of Computing the Behaviour of Lattice Automata on Infinite Trees The Complexity of Computing the Behaviour of Lattice Automata on Infinite Trees Karsten Lehmann a, Rafael Peñaloza b a Optimisation Research Group, NICTA Artificial Intelligence Group, Australian National

More information

Tecniche di Verifica. Introduction to Propositional Logic

Tecniche di Verifica. Introduction to Propositional Logic Tecniche di Verifica Introduction to Propositional Logic 1 Logic A formal logic is defined by its syntax and semantics. Syntax An alphabet is a set of symbols. A finite sequence of these symbols is called

More information

Automata-Theoretic LTL Model-Checking

Automata-Theoretic LTL Model-Checking Automata-Theoretic LTL Model-Checking Arie Gurfinkel arie@cmu.edu SEI/CMU Automata-Theoretic LTL Model-Checking p.1 LTL - Linear Time Logic (Pn 77) Determines Patterns on Infinite Traces Atomic Propositions

More information

Trace Diagnostics using Temporal Implicants

Trace Diagnostics using Temporal Implicants Trace Diagnostics using Temporal Implicants ATVA 15 Thomas Ferrère 1 Dejan Nickovic 2 Oded Maler 1 1 VERIMAG, University of Grenoble / CNRS 2 Austrian Institute of Technology October 14, 2015 Motivation

More information

CS 154. Finite Automata, Nondeterminism, Regular Expressions

CS 154. Finite Automata, Nondeterminism, Regular Expressions CS 54 Finite Automata, Nondeterminism, Regular Expressions Read string left to right The DFA accepts a string if the process ends in a double circle A DFA is a 5-tuple M = (Q, Σ, δ, q, F) Q is the set

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 5-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY NON-DETERMINISM and REGULAR OPERATIONS THURSDAY JAN 6 UNION THEOREM The union of two regular languages is also a regular language Regular Languages Are

More information

Linear Temporal Logic (LTL)

Linear Temporal Logic (LTL) Chapter 9 Linear Temporal Logic (LTL) This chapter introduces the Linear Temporal Logic (LTL) to reason about state properties of Labelled Transition Systems defined in the previous chapter. We will first

More information

CS 154, Lecture 3: DFA NFA, Regular Expressions

CS 154, Lecture 3: DFA NFA, Regular Expressions CS 154, Lecture 3: DFA NFA, Regular Expressions Homework 1 is coming out Deterministic Finite Automata Computation with finite memory Non-Deterministic Finite Automata Computation with finite memory and

More information

CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC

CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC CHAPTER 2 INTRODUCTION TO CLASSICAL PROPOSITIONAL LOGIC 1 Motivation and History The origins of the classical propositional logic, classical propositional calculus, as it was, and still often is called,

More information

Timo Latvala. February 4, 2004

Timo Latvala. February 4, 2004 Reactive Systems: Temporal Logic LT L Timo Latvala February 4, 2004 Reactive Systems: Temporal Logic LT L 8-1 Temporal Logics Temporal logics are currently the most widely used specification formalism

More information

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:

ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear: ω-automata ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear: in verification, as encodings of non-terminating executions of a program. in arithmetic,

More information

Proving Completeness for Nested Sequent Calculi 1

Proving Completeness for Nested Sequent Calculi 1 Proving Completeness for Nested Sequent Calculi 1 Melvin Fitting abstract. Proving the completeness of classical propositional logic by using maximal consistent sets is perhaps the most common method there

More information

On simulations and bisimulations of general flow systems

On simulations and bisimulations of general flow systems On simulations and bisimulations of general flow systems Jen Davoren Department of Electrical & Electronic Engineering The University of Melbourne, AUSTRALIA and Paulo Tabuada Department of Electrical

More information

Regular Languages. Problem Characterize those Languages recognized by Finite Automata.

Regular Languages. Problem Characterize those Languages recognized by Finite Automata. Regular Expressions Regular Languages Fundamental Question -- Cardinality Alphabet = Σ is finite Strings = Σ is countable Languages = P(Σ ) is uncountable # Finite Automata is countable -- Q Σ +1 transition

More information

A brief introduction to Logic. (slides from

A brief introduction to Logic. (slides from A brief introduction to Logic (slides from http://www.decision-procedures.org/) 1 A Brief Introduction to Logic - Outline Propositional Logic :Syntax Propositional Logic :Semantics Satisfiability and validity

More information

Lecture Notes on Emptiness Checking, LTL Büchi Automata

Lecture Notes on Emptiness Checking, LTL Büchi Automata 15-414: Bug Catching: Automated Program Verification Lecture Notes on Emptiness Checking, LTL Büchi Automata Matt Fredrikson André Platzer Carnegie Mellon University Lecture 18 1 Introduction We ve seen

More information

Linear-time Temporal Logic

Linear-time Temporal Logic Linear-time Temporal Logic Pedro Cabalar Department of Computer Science University of Corunna, SPAIN cabalar@udc.es 2015/2016 P. Cabalar ( Department Linear oftemporal Computer Logic Science University

More information

Chapter 6: Computation Tree Logic

Chapter 6: Computation Tree Logic Chapter 6: Computation Tree Logic Prof. Ali Movaghar Verification of Reactive Systems Outline We introduce Computation Tree Logic (CTL), a branching temporal logic for specifying system properties. A comparison

More information

On the Succinctness of Nondeterminizm

On the Succinctness of Nondeterminizm On the Succinctness of Nondeterminizm Benjamin Aminof and Orna Kupferman Hebrew University, School of Engineering and Computer Science, Jerusalem 91904, Israel Email: {benj,orna}@cs.huji.ac.il Abstract.

More information

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS Automata Theory Lecture on Discussion Course of CS2 This Lecture is about Mathematical Models of Computation. Why Should I Care? - Ways of thinking. - Theory can drive practice. - Don t be an Instrumentalist.

More information

Temporal Logic. M φ. Outline. Why not standard logic? What is temporal logic? LTL CTL* CTL Fairness. Ralf Huuck. Kripke Structure

Temporal Logic. M φ. Outline. Why not standard logic? What is temporal logic? LTL CTL* CTL Fairness. Ralf Huuck. Kripke Structure Outline Temporal Logic Ralf Huuck Why not standard logic? What is temporal logic? LTL CTL* CTL Fairness Model Checking Problem model, program? M φ satisfies, Implements, refines property, specification

More information

What Is a Language? Grammars, Languages, and Machines. Strings: the Building Blocks of Languages

What Is a Language? Grammars, Languages, and Machines. Strings: the Building Blocks of Languages Do Homework 2. What Is a Language? Grammars, Languages, and Machines L Language Grammar Accepts Machine Strings: the Building Blocks of Languages An alphabet is a finite set of symbols: English alphabet:

More information

Structural Induction

Structural Induction Structural Induction In this lecture we ll extend the applicability of induction to many universes, ones where we can define certain kinds of objects by induction, in addition to proving their properties

More information

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed HKN CS/ECE 374 Midterm 1 Review Nathan Bleier and Mahir Morshed For the most part, all about strings! String induction (to some extent) Regular languages Regular expressions (regexps) Deterministic finite

More information

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r Syllabus R9 Regulation UNIT-II NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: In the automata theory, a nondeterministic finite automaton (NFA) or nondeterministic finite state machine is a finite

More information

CDS 270 (Fall 09) - Lecture Notes for Assignment 8.

CDS 270 (Fall 09) - Lecture Notes for Assignment 8. CDS 270 (Fall 09) - Lecture Notes for Assignment 8. ecause this part of the course has no slides or textbook, we will provide lecture supplements that include, hopefully, enough discussion to complete

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Section 1.1 Design an automaton that recognizes a given language. Specify each of

More information

Model Checking in the Propositional µ-calculus

Model Checking in the Propositional µ-calculus Model Checking in the Propositional µ-calculus Ka I Violet Pun INF 9140 - Specification and Verification of Parallel Systems 13 th May, 2011 Overview Model Checking is a useful means to automatically ascertain

More information

Linear-Time Logic. Hao Zheng

Linear-Time Logic. Hao Zheng Linear-Time Logic Hao Zheng Department of Computer Science and Engineering University of South Florida Tampa, FL 33620 Email: zheng@cse.usf.edu Phone: (813)974-4757 Fax: (813)974-5456 Hao Zheng (CSE, USF)

More information

INTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims

INTRODUCTION TO LOGIC. Propositional Logic. Examples of syntactic claims Introduction INTRODUCTION TO LOGIC 2 Syntax and Semantics of Propositional Logic Volker Halbach In what follows I look at some formal languages that are much simpler than English and define validity of

More information

Theory of Computation

Theory of Computation Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation / Lecture 3: Overview Decidability of Logical Theories Presburger arithmetic Decidability of Presburger Arithmetic Dr.

More information

Automata-Theoretic Model Checking of Reactive Systems

Automata-Theoretic Model Checking of Reactive Systems Automata-Theoretic Model Checking of Reactive Systems Radu Iosif Verimag/CNRS (Grenoble, France) Thanks to Tom Henzinger (IST, Austria), Barbara Jobstmann (CNRS, Grenoble) and Doron Peled (Bar-Ilan University,

More information

ECE473 Lecture 15: Propositional Logic

ECE473 Lecture 15: Propositional Logic ECE473 Lecture 15: Propositional Logic Jeffrey Mark Siskind School of Electrical and Computer Engineering Spring 2018 Siskind (Purdue ECE) ECE473 Lecture 15: Propositional Logic Spring 2018 1 / 23 What

More information

Propositional Logic Language

Propositional Logic Language Propositional Logic Language A logic consists of: an alphabet A, a language L, i.e., a set of formulas, and a binary relation = between a set of formulas and a formula. An alphabet A consists of a finite

More information

Sanjit A. Seshia EECS, UC Berkeley

Sanjit A. Seshia EECS, UC Berkeley EECS 219C: Computer-Aided Verification Explicit-State Model Checking: Additional Material Sanjit A. Seshia EECS, UC Berkeley Acknowledgments: G. Holzmann Checking if M satisfies : Steps 1. Compute Buchi

More information

Advanced Topics in LP and FP

Advanced Topics in LP and FP Lecture 1: Prolog and Summary of this lecture 1 Introduction to Prolog 2 3 Truth value evaluation 4 Prolog Logic programming language Introduction to Prolog Introduced in the 1970s Program = collection

More information

Mathematical Preliminaries. Sipser pages 1-28

Mathematical Preliminaries. Sipser pages 1-28 Mathematical Preliminaries Sipser pages 1-28 Mathematical Preliminaries This course is about the fundamental capabilities and limitations of computers. It has 3 parts 1. Automata Models of computation

More information

Operational Semantics

Operational Semantics Operational Semantics Semantics and applications to verification Xavier Rival École Normale Supérieure Xavier Rival Operational Semantics 1 / 50 Program of this first lecture Operational semantics Mathematical

More information

LOGIC PROPOSITIONAL REASONING

LOGIC PROPOSITIONAL REASONING LOGIC PROPOSITIONAL REASONING WS 2017/2018 (342.208) Armin Biere Martina Seidl biere@jku.at martina.seidl@jku.at Institute for Formal Models and Verification Johannes Kepler Universität Linz Version 2018.1

More information

11. Automata and languages, cellular automata, grammars, L-systems

11. Automata and languages, cellular automata, grammars, L-systems 11. Automata and languages, cellular automata, grammars, L-systems 11.1 Automata and languages Automaton (pl. automata): in computer science, a simple model of a machine or of other systems. ( a simplification

More information

Decidability of WS1S and S1S (An Exposition) Exposition by William Gasarch-U of MD

Decidability of WS1S and S1S (An Exposition) Exposition by William Gasarch-U of MD 1 Introduction Decidability of WS1S and S1S (An Exposition) Exposition by William Gasarch-U of MD We are going to prove that a (small) fragment of mathematics is decidable. 1. A Formula allows variables

More information

Partial model checking via abstract interpretation

Partial model checking via abstract interpretation Partial model checking via abstract interpretation N. De Francesco, G. Lettieri, L. Martini, G. Vaglini Università di Pisa, Dipartimento di Ingegneria dell Informazione, sez. Informatica, Via Diotisalvi

More information

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions?

Before We Start. The Pumping Lemma. Languages. Context Free Languages. Plan for today. Now our picture looks like. Any questions? Before We Start The Pumping Lemma Any questions? The Lemma & Decision/ Languages Future Exam Question What is a language? What is a class of languages? Context Free Languages Context Free Languages(CFL)

More information

Mathematical Logic Part Three

Mathematical Logic Part Three Mathematical Logic Part hree riday our Square! oday at 4:15PM, Outside Gates Announcements Problem Set 3 due right now. Problem Set 4 goes out today. Checkpoint due Monday, October 22. Remainder due riday,

More information

INF210 Datamaskinteori (Models of Computation)

INF210 Datamaskinteori (Models of Computation) INF210 Datamaskinteori (Models of Computation) Textbook: John Martin, Introduction to Languages and the Theory of Computation, McGraw Hill, Third Edition. Fedor V. Fomin Datamaskinteori 1 Datamaskinteori

More information

Logic Part I: Classical Logic and Its Semantics

Logic Part I: Classical Logic and Its Semantics Logic Part I: Classical Logic and Its Semantics Max Schäfer Formosan Summer School on Logic, Language, and Computation 2007 July 2, 2007 1 / 51 Principles of Classical Logic classical logic seeks to model

More information

The semantics of propositional logic

The semantics of propositional logic The semantics of propositional logic Readings: Sections 1.3 and 1.4 of Huth and Ryan. In this module, we will nail down the formal definition of a logical formula, and describe the semantics of propositional

More information

Essential facts about NP-completeness:

Essential facts about NP-completeness: CMPSCI611: NP Completeness Lecture 17 Essential facts about NP-completeness: Any NP-complete problem can be solved by a simple, but exponentially slow algorithm. We don t have polynomial-time solutions

More information

Automata, Logic and Games: Theory and Application

Automata, Logic and Games: Theory and Application Automata, Logic and Games: Theory and Application 2 Parity Games, Tree Automata, and S2S Luke Ong University of Oxford TACL Summer School University of Salerno, 14-19 June 2015 Luke Ong S2S 14-19 June

More information

Chapter 4: Classical Propositional Semantics

Chapter 4: Classical Propositional Semantics Chapter 4: Classical Propositional Semantics Language : L {,,, }. Classical Semantics assumptions: TWO VALUES: there are only two logical values: truth (T) and false (F), and EXTENSIONALITY: the logical

More information

Hierarchy among Automata on Linear Orderings

Hierarchy among Automata on Linear Orderings Hierarchy among Automata on Linear Orderings Véronique Bruyère Institut d Informatique Université de Mons-Hainaut Olivier Carton LIAFA Université Paris 7 Abstract In a preceding paper, automata and rational

More information

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler

Complexity Theory VU , SS The Polynomial Hierarchy. Reinhard Pichler Complexity Theory Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität Wien 15 May, 2018 Reinhard

More information

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181.

Outline. Complexity Theory EXACT TSP. The Class DP. Definition. Problem EXACT TSP. Complexity of EXACT TSP. Proposition VU 181. Complexity Theory Complexity Theory Outline Complexity Theory VU 181.142, SS 2018 6. The Polynomial Hierarchy Reinhard Pichler Institut für Informationssysteme Arbeitsbereich DBAI Technische Universität

More information

1 More finite deterministic automata

1 More finite deterministic automata CS 125 Section #6 Finite automata October 18, 2016 1 More finite deterministic automata Exercise. Consider the following game with two players: Repeatedly flip a coin. On heads, player 1 gets a point.

More information

Partially Ordered Two-way Büchi Automata

Partially Ordered Two-way Büchi Automata Partially Ordered Two-way Büchi Automata Manfred Kufleitner Alexander Lauser FMI, Universität Stuttgart, Germany {kufleitner, lauser}@fmi.uni-stuttgart.de June 14, 2010 Abstract We introduce partially

More information

Theory of computation: initial remarks (Chapter 11)

Theory of computation: initial remarks (Chapter 11) Theory of computation: initial remarks (Chapter 11) For many purposes, computation is elegantly modeled with simple mathematical objects: Turing machines, finite automata, pushdown automata, and such.

More information

ESE601: Hybrid Systems. Introduction to verification

ESE601: Hybrid Systems. Introduction to verification ESE601: Hybrid Systems Introduction to verification Spring 2006 Suggested reading material Papers (R14) - (R16) on the website. The book Model checking by Clarke, Grumberg and Peled. What is verification?

More information

Lecture 2: Syntax. January 24, 2018

Lecture 2: Syntax. January 24, 2018 Lecture 2: Syntax January 24, 2018 We now review the basic definitions of first-order logic in more detail. Recall that a language consists of a collection of symbols {P i }, each of which has some specified

More information

Lecture 2 Automata Theory

Lecture 2 Automata Theory Lecture 2 Automata Theory Ufuk Topcu Nok Wongpiromsarn Richard M. Murray Outline: Transition systems Linear-time properties Regular propereties EECI, 14 May 2012 This short-course is on this picture applied

More information

Temporal Logic Model Checking

Temporal Logic Model Checking 18 Feb, 2009 Thomas Wahl, Oxford University Temporal Logic Model Checking 1 Temporal Logic Model Checking Thomas Wahl Computing Laboratory, Oxford University 18 Feb, 2009 Thomas Wahl, Oxford University

More information

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties of Regular Languages Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism Closure Properties Recall a closure property is a statement

More information

Decidability: Church-Turing Thesis

Decidability: Church-Turing Thesis Decidability: Church-Turing Thesis While there are a countably infinite number of languages that are described by TMs over some alphabet Σ, there are an uncountably infinite number that are not Are there

More information

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018

Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Finite Automata Theory and Formal Languages TMV027/DIT321 LP4 2018 Lecture 4 Ana Bove March 23rd 2018 Recap: Formal Proofs How formal should a proof be? Depends on its purpose...... but should be convincing......

More information