paper/src/paper.tex
author Eugen Sawin <sawine@me73.com>
Thu, 21 Jul 2011 00:47:13 +0200
changeset 62 bb9b5ce427ae
parent 53 5ebf5aad12b5
child 77 a58b1c34b2d8
permissions -rw-r--r--
LTL semantics.
sawine@55
     1
\documentclass{beamer}
sawine@55
     2
%\documentclass[a4paper, pagesize, DIV=calc, smallheadings]{article}  
sawine@2
     3
\usepackage{graphicx}
sawine@2
     4
%\usepackage[latin1]{inputenc}
sawine@14
     5
\usepackage{amsmath, amsthm, amssymb, amsfonts, verbatim}
sawine@2
     6
\usepackage{typearea}
sawine@2
     7
\usepackage{algorithm}
sawine@2
     8
\usepackage{algorithmic}
sawine@15
     9
\usepackage{multicol}
sawine@47
    10
\usepackage{tikz}
sawine@47
    11
\usetikzlibrary{automata}
sawine@50
    12
\usepackage{sidecap}
sawine@50
    13
\usepackage{wrapfig}
sawine@51
    14
\usepackage{subfig}
sawine@11
    15
%\usepackage{fullpage}
sawine@19
    16
%\usepackage{a4wide}
sawine@19
    17
\usepackage[left=3.9cm, right=3.9cm]{geometry}
sawine@5
    18
%\usepackage[T1]{fontenc}
sawine@5
    19
%\usepackage{arev}
sawine@7
    20
%\pagestyle{headings}
sawine@19
    21
sawine@43
    22
\floatname{algorithm}{Function}
sawine@43
    23
\renewcommand{\algorithmicrequire}{\textbf{Input:}}
sawine@43
    24
\renewcommand{\algorithmicensure}{\textbf{Output:}}
sawine@43
    25
sawine@2
    26
\renewcommand{\familydefault}{\sfdefault}
sawine@22
    27
\renewenvironment{proof}{{\bfseries Proof.}}{}
sawine@17
    28
\newcommand{\M}{\mathcal{M}}
sawine@17
    29
\newcommand{\N}{\mathbb{N}_0}
sawine@19
    30
\newcommand{\F}{\mathcal{F}}
sawine@19
    31
\newcommand{\Prop}{\mathcal{P}}
sawine@22
    32
\newcommand{\A}{\mathcal{A}}
sawine@31
    33
\newcommand{\X}{\mathcal{X}}
sawine@31
    34
\newcommand{\U}{\mathcal{U}}
sawine@31
    35
\newcommand{\V}{\mathcal{V}}
sawine@31
    36
\newcommand{\dnf}{\mathsf{dnf}}
sawine@34
    37
\newcommand{\consq}{\mathsf{consq}}
sawine@19
    38
sawine@7
    39
\title{\uppercase{\textbf{\Large{A}\large{lgorithmic} \Large{V}\large{erification of} \Large{R}\large{eactive} \Large{S}\large{ystems}}\\
sawine@7
    40
}}
sawine@7
    41
\author{
sawine@35
    42
\uppercase{{\small{E}\scriptsize{UGEN} \small{S}\scriptsize{AWIN}}}\thanks{\texttt{sawine@informatik.uni-freiburg.de}}\\
sawine@35
    43
\uppercase{{\em \small{U}\scriptsize{NIVERSITY OF} \small{F}\scriptsize{REIBURG}}}\thanks{Computer Science Department, Research Group for Foundations of Artificial Intelligence}\\
sawine@7
    44
%{\em \small{C}\scriptsize{omputer} \small{S}\scriptsize{cience} \small{D}\scriptsize{epartment}}\\
sawine@35
    45
\uppercase{{\em \small{G}\scriptsize{ERMANY}}}\\
sawine@7
    46
%\texttt{\footnotesize{sawine@informatik.uni-freiburg.de}}
sawine@7
    47
}
sawine@5
    48
\date{\textsc{\hfill}}
sawine@7
    49
sawine@24
    50
\theoremstyle{definition} %plain, definition, remark, proof, corollary
sawine@7
    51
\newtheorem*{def:finite words}{Finite words}
sawine@7
    52
\newtheorem*{def:infinite words}{Infinite words}
sawine@8
    53
\newtheorem*{def:regular languages}{Regular languages}
sawine@8
    54
\newtheorem*{def:regular languages closure}{Regular closure}
sawine@7
    55
\newtheorem*{def:omega regular languages}{$\omega$-regular languages}
sawine@8
    56
\newtheorem*{def:omega regular languages closure}{$\omega$-regular closure}
sawine@11
    57
\newtheorem*{def:buechi automata}{Automata}
sawine@11
    58
\newtheorem*{def:automata runs}{Runs}
sawine@11
    59
\newtheorem*{def:automata acceptance}{Acceptance}
sawine@21
    60
\newtheorem*{def:general automata}{Generalised automata}
sawine@21
    61
\newtheorem*{def:general acceptance}{Acceptance}
sawine@14
    62
\newtheorem*{def:vocabulary}{Vocabulary}
sawine@19
    63
\newtheorem*{def:frames}{Frames}
sawine@18
    64
\newtheorem*{def:models}{Models}
sawine@18
    65
\newtheorem*{def:satisfiability}{Satisfiability}
sawine@30
    66
\newtheorem*{def:fs closure}{Closure}
sawine@22
    67
\newtheorem*{def:atoms}{Atoms}
sawine@28
    68
\newtheorem*{def:rep function}{Representation function}
sawine@31
    69
\newtheorem*{def:next}{Next function}
sawine@34
    70
\newtheorem*{def:dnf}{Disjunctive normal form}
sawine@31
    71
\newtheorem*{def:positive formulae}{Positive formulae}
sawine@34
    72
\newtheorem*{def:consq}{Logical consequences}
sawine@34
    73
\newtheorem*{def:partial automata}{Partial automata}
sawine@14
    74
sawine@22
    75
\theoremstyle{plain}
sawine@21
    76
\newtheorem{prop:vocabulary sat}{Proposition}[section]
sawine@21
    77
\newtheorem{prop:general equiv}{Proposition}[section]
sawine@29
    78
\newtheorem{prop:computation set=language}{Proposition}[section]
sawine@15
    79
sawine@22
    80
\theoremstyle{plain}
sawine@22
    81
\newtheorem{thm:model language}{Theorem}[section]
sawine@24
    82
\newtheorem{cor:mod=model language}{Corollary}[thm:model language]
sawine@29
    83
\newtheorem{cor:mod=program language}[cor:mod=model language]{Corollary}
sawine@30
    84
\newtheorem{thm:model checking}{Theorem}[section]
sawine@31
    85
\newtheorem{lem:dnf}{Lemma}[section]
sawine@34
    86
\newtheorem{lem:consq}[lem:dnf]{Lemma}
sawine@22
    87
sawine@0
    88
\begin{document}
sawine@0
    89
\maketitle
sawine@4
    90
\thispagestyle{empty}
sawine@2
    91
%\itshape
sawine@2
    92
%\renewcommand\abstractname{Abstract} 
sawine@0
    93
\begin{abstract}
sawine@47
    94
Algorithmic verification is an application of automated temporal reasoning based on model checking. Modal logics give us the power to specify system properties. System verification provides a correctness proof for the program design with respect to such properties. We apply methods, which are a composition of automata theory, graph theory and modal logics. This text is an introduction to the automata-theoretic constructions and space-efficient on-the-fly methods for the verification of reactive systems.
sawine@0
    95
\end{abstract}
sawine@2
    96
%\normalfont
sawine@4
    97
\newpage
sawine@2
    98
\section{Introduction}
sawine@47
    99
The rapid digital evolution of semi-conductor design has changed the way of development in the industry. Exponential growth in processing power has massive implications on the complexity of chip-design. When a considerable portion of the development cycle is dedicated to design validation, an increasingly high effort is invested in the realisation of efficient verification methods.
sawine@2
   100
sawine@47
   101
The computer hardware industry has adapted to the rise of complexity by the application of automated design verification. Another natural consequence was the preference of standard, non-specialised hardware solutions accompanied by software implementations of the required functionality. Software systems have penetrated all industries, and increasingly so in high-demand and safety-critical application areas. Software programs e.g. provide high-demand server infrastructures for the Internet, control our air traffic and increase safety in motor traffic. When handling such critical systems, it becomes inevitable to verify the correctness of the software solutions. 
sawine@36
   102
sawine@37
   103
Compared to hardware design, the highly dynamic properties of software components confront us with another state space explosion. Concurrent system designs increase the complexity of verification by some orders of magnitude; and concurrent applications have started to dominate recent software solutions, because we are closing the physical limits for single-core processor frequencies.
sawine@36
   104
sawine@47
   105
Again, the industry is facing a \emph{validation crisis} \cite{ref:automated verification}, and formal verification methods are in high demand. Deductive, computer-supported verification techniques are an interesting digression, but may not be applicable in the validation of software systems of high complexity. Theories for algorithmic verification have existed for decades and recent successful applications have demonstrated their practical value.
sawine@36
   106
sawine@37
   107
In this text, we provide an introduction to formal verification by means of algorithmic methods. Such an algorithmic approach is the base for automated verification procedures. We will concentrate on the validation of reactive programs, without any loss of the general applicability of the presented methods. Reactive systems are, in contrast to terminating programs, continuous processes. Once initiated, a reactive system persists in an active state, where it reacts to concurrent inputs with appropriate actions. Examples of reactive systems are monitoring processes, schedulers and even whole operating systems.
sawine@36
   108
sawine@47
   109
The first three sections define the preliminaries for the automata-theoretic constructions. At first, we provide the notion of reasoning about infinite computational paths within formal language theory. Then we tackle those infinite structures with the help of automata theory, which builds the framework of the formal verification theory. Next we introduce the reader to modal logics, in particular to linear temporal logic. Linear temporal logic is the language we use to talk about system properties, i.e., the system specification language. 
sawine@37
   110
sawine@37
   111
The fifth section interweaves automata theory and modal logics for the formalisation of the automata constructions, i.e., we construct automata depicting the program design and the specified properties. Based on this constructions, we apply the methods presented in the model checking section. The last section is a short excursion into the practical considerations of automated verification. For a successful application of automated verification, we consider ways of reducing the complexity of the automata-theoretic approach.
sawine@37
   112
sawine@47
   113
The formal frame of this text is mostly based on Madhavan Mukund's \cite{ref:ltl&büchi} and Moshe Y. Vardi's \cite[C.17]{ref:handbook} work. We conclude this paper with a discussion of \cite{ref:ltl&büchi}.
sawine@2
   114
sawine@8
   115
\section{$\omega$-regular languages}
sawine@37
   116
For the formalisation of non-terminating, reactive systems, we need to get familiar with the concept of infinity. When a system is persistently active, the conceptual model of its input becomes an infinite structure, and likewise the description of its computational path. We want to settle this infinite structures within a formal corset.
sawine@37
   117
sawine@7
   118
\begin{def:finite words}
sawine@24
   119
Let $\Sigma$ be a non-empty set of symbols, called the alphabet. $\Sigma^*$ is the set of all \emph{finite} words over $\Sigma$. A \emph{finite} word $w \in \Sigma^*$ is a \emph{finite} sequence $(v_0,...,v_{n-1})$ of symbols from alphabet $\Sigma$ with length $n = |w|$. $\varepsilon$ denotes the empty word with length $|\varepsilon| = 0$.
sawine@7
   120
\end{def:finite words}
sawine@7
   121
sawine@8
   122
\begin{def:regular languages}
sawine@8
   123
The class of regular languages is defined recursively over an alphabet $\Sigma$:
sawine@15
   124
\begin{multicols}{2}
sawine@8
   125
\begin{itemize}
sawine@8
   126
\item $\emptyset$ is regular
sawine@8
   127
\item $\{\varepsilon\}$ is regular
sawine@8
   128
\item $\forall_{a \in \Sigma}:\{a\}$ is regular
sawine@8
   129
\end{itemize}
sawine@15
   130
\end{multicols}
sawine@8
   131
\end{def:regular languages}
sawine@8
   132
sawine@8
   133
\begin{def:regular languages closure}
sawine@10
   134
Let $L_{R_1}, L_{R_2} \in \Sigma^*$ be regular. The class of regular languages is closed under following operations:
sawine@15
   135
\begin{multicols}{2}
sawine@8
   136
\begin{itemize}
sawine@8
   137
\item $L_{R_1}^*$
sawine@8
   138
\item $L_{R_1} \circ L_{R_2}$
sawine@8
   139
\item $L_{R_1} \cup L_{R_2}$
sawine@10
   140
\item $L_{R_1} \cap L_{R_2}$
sawine@10
   141
\item $\overline{L}_{R_1}$ and therefore $L_{R_1} - L_{R_2}$
sawine@8
   142
\end{itemize}
sawine@15
   143
\end{multicols}
sawine@8
   144
\end{def:regular languages closure}
sawine@8
   145
sawine@9
   146
\begin{def:infinite words}
sawine@24
   147
$\Sigma^\omega$ is the set of all \emph{infinite} words over $\Sigma$. An \emph{infinite} word $w \in \Sigma^\omega$ is an \emph{infinite} sequence $(v_0,...,v_\infty)$ with length $\infty$. To address the elements of the infinite sequence $w$, we view the word as a function $w : \N \to \Sigma$ with $w(i) = v_i$; thus $w(i)$ denotes the symbol at sequence position $i$ of word $w$; another notation used for $w(i)$ is $w_i$.
sawine@9
   148
\end{def:infinite words}
sawine@9
   149
sawine@7
   150
\begin{def:omega regular languages}
sawine@8
   151
Set $L$ is an $\omega$-language over alphabet $\Sigma$ iff $L \subseteq \Sigma^\omega$. Let $L_R \subseteq \Sigma^*$ be a non-empty regular finite language and $\varepsilon \notin L_R$. A set $L$ is $\omega$-regular iff $L$ is an $\omega$-language and $L = L_R^\omega$.
sawine@7
   152
\end{def:omega regular languages}
sawine@7
   153
sawine@8
   154
\begin{def:omega regular languages closure}
sawine@8
   155
Let $L_{\omega_1}, L_{\omega_2} \subseteq \Sigma^\omega$ be $\omega$-regular languages. The class of $\omega$-regular languages is closed under following operations:
sawine@8
   156
\begin{itemize}
sawine@8
   157
\item $L_R \circ L_{\omega_1}$, but \emph{not} $L_{\omega_1} \circ L_R$
sawine@8
   158
\item $L_{\omega_1} \cup L_{\omega_2}$, but only \emph{finitely} many times
sawine@8
   159
\end{itemize}
sawine@8
   160
\end{def:omega regular languages closure}
sawine@7
   161
sawine@8
   162
\section{B\"uchi automata}
sawine@47
   163
Automata theory is the foundation of state-based modelling of computation. Non-deter\-ministic automata provide an elegant way of describing interleaving systems. B\"uchi automata extend the idea of such automata to comfort the need for computational models on infinite inputs.
sawine@37
   164
sawine@11
   165
\begin{def:buechi automata}
sawine@22
   166
A non-deterministic B\"uchi automaton is a tuple $\A = (\Sigma, S, S_0, \Delta, F)$, where $\Sigma$ is a finite non-empty \emph{alphabet}, $S$ is a finite non-empty set of \emph{states}, $S_0 \subseteq S$ is the set of \emph{initial states}, $F \subseteq S$ is the set of \emph{accepting states} and $\Delta: S \times \Sigma \times S$ is a \emph{transition relation}. When suitable we will use the arrow notation for the transitions, where $s \xrightarrow{a} s'$ iff $(s, a, s') \in \Delta$.
sawine@11
   167
sawine@22
   168
A \emph{deterministic B\"uchi automaton} is a specialisation, where the \emph{transition relation} $\Delta$ is a \emph{transition function} $\delta: S \times \Sigma \to S$ and the set $S_0$ of \emph{initial states} contains only a single state $s_0$.
sawine@11
   169
sawine@19
   170
Within this text \emph{automaton} will refer to the non-deterministic B\"uchi automaton, unless otherwise noted. 
sawine@11
   171
\end{def:buechi automata}
sawine@11
   172
sawine@47
   173
With infinite inputs comes a new definition of acceptance. Automata on finite inputs define acceptance by the termination of the computation in an accepting state. This notion needs adjustments, when modelling non-terminating systems. First, we need to define the legal sequence of state transitions of an automaton when reading an infinite input word.
sawine@37
   174
sawine@11
   175
\begin{def:automata runs}
sawine@24
   176
Let $\A = (\Sigma, S, S_0, \Delta, F)$ be an automaton, a run $\rho$ of $\A$ on an infinite word $w = (a_0,a_1,...)$ over alphabet $\Sigma$ is a sequence $\rho = (s_0,s_1,...)$, where $s_0 \in S_0$ and $(s_i, a_i, s_{i+1}) \in \Delta$, for all $i \geq 0$. Again we may view the run sequence as a function $\rho : \N \to S$, where $\rho(i) = s_i$ denotes the state at the $i^{th}$ sequence position.
sawine@11
   177
\end{def:automata runs}
sawine@11
   178
sawine@11
   179
\begin{def:automata acceptance}
sawine@46
   180
Let $\A = (\Sigma, S, S_0, \Delta, F)$ be an automaton and let $\rho$ be a run of $\A$, we define $inf(\rho) = \{s \in S \mid \exists^\omega{n \in \N}: \rho(n) = s\}$, where $\exists^\omega$ denotes the existential quantifier for infinitely many occurrences, i.e., $s$ occurs infinitely often in $\rho$.
sawine@11
   181
sawine@22
   182
The run $\rho$ is \emph{accepting} iff $inf(\rho) \cap F \neq \emptyset$, i.e., there exists an \emph{accepting state} which occurs infinitely often in the run $\rho$. The automaton $\A$ \emph{accepts} an input word $w$, iff there exists a run $\rho$ of $\A$ on $w$, such that $\rho$ is \emph{accepting}. 
sawine@21
   183
sawine@39
   184
The language $L_\omega(\A)$ recognised by automaton $\A$ is the set of all infinite words accepted by $\A$. A language $L$ is \emph{B\"uchi-recognisable} iff there is an automaton $\A$ with $L = L_\omega(\A)$. The class of B\"uchi-recognisable languages corresponds to the class of $\omega$-regular languages.
sawine@11
   185
\end{def:automata acceptance}
sawine@11
   186
sawine@39
   187
Given all legal computations of an automaton, we have defined the acceptance condition. A computation is accepting, if it passes through an accepting state infinitely times. Since the set of states $S$ is finite, there must be a state $s \in S$, which occurs infinitely often within an infinite run; but it is not necessary, that $s$ is an accepting state; notice that $F$ can be an empty set.
sawine@37
   188
sawine@47
   189
\subsection{Example}
sawine@50
   190
\label{ex:automaton}
sawine@51
   191
Let $\A_1 = (\Sigma, S, S_0, \Delta, F)$ be an automaton with: $\Sigma = \{a, b\}$, $S = \{q_0, q_1, q_2\}$, $S_0 = \{q_0\}$, $\Delta = \{(q_0, a, q_0), (q_0, b, q_0), (q_1, a, q_1), (q_1, b, q_2), (q_2, a, q_1), (q_2, b, q_0)\}$ and $F = \{q_2\}$.
sawine@51
   192
sawine@51
   193
\begin{figure}[h]
sawine@51
   194
\centering
sawine@51
   195
%\begin{wrapfigure}{r}{0.5\textwidth}
sawine@51
   196
\subfloat[Automaton for $L_\omega(\A_1)$]
sawine@51
   197
{
sawine@50
   198
\label{fig:automaton}
sawine@51
   199
%\vspace{-22pt}
sawine@51
   200
%\begin{center}
sawine@51
   201
\begin{tikzpicture}[shorten >=1pt, node distance=2cm, auto, semithick, >=stealth
sawine@48
   202
    %every state/.style={fill, draw=none, gray, text=white},
sawine@48
   203
    ,accepting/.style={fill, gray!50!black, text=white}
sawine@48
   204
    %initial/.style ={gray, text=white}]%,  thick]
sawine@48
   205
    ]
sawine@48
   206
\node[state,initial, initial text=] (q_0) {$q_0$};
sawine@47
   207
\node[state] (q_1) [above right of= q_0] {$q_1$};
sawine@49
   208
\node[state,accepting](q_2) [below right of= q_1] {$q_2$};
sawine@48
   209
\path[->] 
sawine@48
   210
(q_0) edge node {$a$} (q_1)
sawine@49
   211
  edge [loop above] node {$b$} ()
sawine@49
   212
(q_1) edge node {$b$} (q_2)
sawine@48
   213
  edge [loop above] node {$a$} ()
sawine@49
   214
(q_2) %edge node {$a$} (q_1)
sawine@49
   215
  edge node {$b$} (q_0);
sawine@49
   216
\draw[->] (q_2) .. controls +(up:1cm) and +(right:1cm) .. node[above] {$a$} (q_1);
sawine@47
   217
\end{tikzpicture}
sawine@51
   218
}
sawine@51
   219
\hspace{2cm}
sawine@51
   220
\subfloat[Automaton for $\overline{L_\omega(\A_1)}$]
sawine@51
   221
{
sawine@51
   222
\label{fig:complement automaton}
sawine@51
   223
\begin{tikzpicture}[shorten >=1pt, node distance=2cm, auto, semithick, >=stealth   
sawine@51
   224
    ,accepting/.style={fill, gray!50!black, text=white}]
sawine@51
   225
\node[state, initial, initial text=] (q_0) {$q_0$};
sawine@51
   226
\node[state, accepting] (q_1) [above right of= q_0] {$q_1$};
sawine@51
   227
\node[state, accepting](q_2) [below right of= q_1] {$q_2$};
sawine@51
   228
\path[->] 
sawine@51
   229
(q_0) edge node {$a$} (q_1)
sawine@51
   230
  edge node {$b$} (q_2)
sawine@51
   231
  edge [loop above] node {$a, b$} ()
sawine@51
   232
(q_1) edge [loop above] node {$a$} ()
sawine@51
   233
(q_2) 
sawine@51
   234
  edge [loop above] node {$b$} ();
sawine@51
   235
\end{tikzpicture}
sawine@51
   236
}
sawine@51
   237
\caption{Automata from Example \ref{ex:automaton}}
sawine@51
   238
\end{figure}
sawine@51
   239
%\end{wrapfigure}
sawine@51
   240
%
sawine@51
   241
\noindent Figure \ref{fig:automaton} shows $\A_1$; the initial state $q_0$ is marked with an unlabelled incoming arrow and the only accepting state $q_2$ is a filled circle. By some further investigation of the automaton, we identify the recognised language $L = L_\omega(\A_1)$ of the automaton, it is the set of all infinite words with infinitely many occurrences of the sequence $ab$.
sawine@50
   242
sawine@51
   243
The complement language $\overline{L} = \overline{L_\omega(\A_1)}$ of $L$ is the set of all infinite words $w$, such that $w \notin L$, i.e., $\overline{L}$ does \emph{not} contain a word with an infinite sequence of $ab$. From the infinity of the input words, it follows that $\overline{L} = A \cup B \setminus A \cap B$, with $A = \{w \in \Sigma^\omega \mid w \text{ has infinitely many } a\}$ and $B = \{w \in \Sigma^\omega \mid w \text{ has infinitely many } b\}$.
sawine@50
   244
sawine@51
   245
Figure \ref{fig:complement automaton} shows the automaton for $\overline{L}$. We noticed that, in contrast to $\A_1$, it is non-deterministic. As stated in \cite{ref:ltl&büchi}, when dealing with B\"uchi automata, deterministic and non-deterministic automata are not of equivalent power, like we know it from automata theory on finite inputs. For some non-deterministic automata, we can not construct equivalent deterministic counterparts.
sawine@47
   246
sawine@21
   247
\subsection{Generalised B\"uchi automata}
sawine@46
   248
In the following two sections, we present the modal logic, which is used for the specification of system properties and automata construction on such specifications. To provide a more convenient link between linear temporal logic and B\"uchi automata, we introduce a slightly different formalisation of automata with an extended acceptance condition.
sawine@39
   249
sawine@21
   250
\begin{def:general automata}
sawine@46
   251
A \emph{generalised B\"uchi automaton} is a tuple $\A = (\Sigma, S, S_0, \Delta, \{F_i\}_{i < k})$ for $i \in \N$, where the \emph{accepting states} $F_i$ are composed within a finite set with $F_i \subseteq S$.
sawine@21
   252
\end{def:general automata}
sawine@21
   253
sawine@21
   254
\begin{def:general acceptance}
sawine@22
   255
The acceptance condition is adjusted accordingly. A run $\rho$ of $\A$ is \emph{accepting} iff $\forall{i < k}: inf(\rho) \cap F_i \neq \emptyset$. 
sawine@21
   256
\end{def:general acceptance}
sawine@21
   257
sawine@21
   258
\begin{prop:general equiv}
sawine@46
   259
Let $\A = (\Sigma, S, S_0, \Delta, \{F_i\}_{i < k})$ be a \emph{generalised automaton} and let $\A_i = (\Sigma, S, S_0, \Delta, F_i)$ be \emph{non-deterministic automata}, then following equivalence condition holds:
sawine@29
   260
\[L_\omega(\A) = \bigcap_{i < k} L_\omega(\A_i)\]
sawine@21
   261
\end{prop:general equiv}
sawine@46
   262
\noindent The equivalence of the language recognition abilities of general and non-deterministic B\"uchi automata follows intuitively.
sawine@21
   263
sawine@8
   264
\section{Linear temporal logic}
sawine@47
   265
%All arts and sciences interpret time in some way: historians prefer the past tense, while politicians make only promises for the future.
sawine@47
   266
Nothing escapes time, but time has successfully escaped its capture in computer science until the rise of the modal logics in the second half of the 20th century \cite[C.11]{ref:handbook}. Physicists know many time arrows, one of which constitutes the thermodynamic arrow of time, which happens to be the one we perceive by remembering the past and not the future. We compensate our inability to control the direction of time by the use of rigorous language constructs when reasoning about temporal events.
sawine@39
   267
sawine@45
   268
When natural language fails in providing unambiguousness, we have to resort to formal languages. To handle discrete time, we use \emph{propositional logic} as the base and extend it by some more or less modal connectives. There are two major temporal logics used in the specification of system properties, \emph{linear temporal logic}, short LTL, and \emph{branching temporal logic}, short CTL -- for computation tree logic. Throughout this text, we will restrict our attention to linear temporal logic.
sawine@39
   269
sawine@19
   270
\subsection{Syntax}
sawine@31
   271
Let $\Prop$ be the countable set of \emph{atomic propositions}. The \emph{alphabet} of the language $L_{LTL}(\Prop)$ is $\Prop \cup \{\neg, \lor, \X, \U\}$. We define the $L_{LTL}(\Prop)$-\emph{formulae} $\varphi$ using following productions:
sawine@31
   272
\[\varphi ::= p \in \Prop \,|\, \neg \varphi \,|\, \varphi \lor \varphi \,|\, \X \varphi \,|\, \varphi \U \varphi\]
sawine@45
   273
%
sawine@45
   274
The intuition should go as follows: $\neg$ and $\lor$ correspond to the Boolean \emph{negation} and \emph{disjunction}, the unary temporal operator $\X$ reads as \emph{next} and the binary temporal operator $\U$ reads as \emph{until}.
sawine@45
   275
\subsection{Semantics}
sawine@45
   276
Temporal logics are interpreted over computation paths; in LTL such a path depicts a linear sequence, where in CTL the path is a tree with branching connectives. In the interpretation of LTL over \emph{computation paths}, a computation corresponds to a model over a \emph{Kripke-frame} constructed by the order of natural numbers.
sawine@13
   277
sawine@19
   278
\begin{def:frames}
sawine@22
   279
An LTL-\emph{frame} is a tuple $\F = (S, R)$, where $S = \{s_i \mid i \in \N\}$ is the set of states and $R = \{(s_i, s_{i+1}) \mid i \in \N\}$ the set of accessibility relations. Hence $S$ is an isomorphism of $\N$ and $R$ an isomorphism of the strict linear order $(\N, <)$, which corresponds to the linear progression of discrete time. 
sawine@19
   280
\end{def:frames}
sawine@45
   281
%
sawine@55
   282
\noindent The frame defines the structure of linear time and the temporal flow of events. To perfect our structure for temporal reasoning, we need to give those events a formal meaning. We do so by assigning a value to each atomic proposition.
sawine@19
   283
sawine@18
   284
\begin{def:models}
sawine@22
   285
An LTL-\emph{model} is a tuple $\M = (\F, V)$, where $\F$ is a \emph{frame} and $V: S \to 2^\Prop$ a \emph{valuation function}. Intuitively we say $p \in \Prop$ is \emph{true} at time instant $i$ iff $p \in V(i)$. 
sawine@19
   286
%A \emph{model} is a function $\M: \N \to 2^\Prop$ over \emph{frame} $\F$. The frame constitutes a linear order over $\N$, which corresponds to the linear progression of time from the \emph{present/past} into the \emph{future}. Therefore $\M(i)$ assigns a set of \emph{positive atomic propositions} to each state of time instant $i$. Intuitively we say $p \in \Prop$ is \emph{true} at time instant $i$ iff $p \in \M(i)$.
sawine@18
   287
\end{def:models}
sawine@51
   288
sawine@51
   289
\subsubsection{Example}
sawine@52
   290
\label{ex:model}
sawine@52
   291
Figure \ref{fig:model} shows a model $\M_1$ over $\Prop = \{p_0, p_1, p_2\}$ with $V = \{(s_0, \{p_0\}), (s_1, \{p_0, p_2\}),$ $(s_2, \{p_1\})\} \cup \{(s_i, \{p_1\}) \mid i > 2\}$, where each time instant $i$ is represented by a circle, the accessibility relations via the arrows and the image of the valuation function as sets within the circles.
sawine@51
   292
sawine@51
   293
\begin{figure}[h]
sawine@51
   294
\centering
sawine@51
   295
\begin{tikzpicture}[shorten >=1pt, node distance=2.5cm, auto, semithick, >=stealth   
sawine@51
   296
    ,accepting/.style={fill, gray!50!black, text=white}]
sawine@51
   297
\node[state, initial, initial text=] (s_0) {$\{p_0\}$};
sawine@51
   298
\path (s_0) [late options={label=below:$s_0$}];
sawine@51
   299
\node[state] (s_1) [right of= s_0] {$\{p_0, p_2\}$};
sawine@51
   300
\path (s_1) [late options={label=below:$s_1$}];
sawine@51
   301
\node[state] (s_2) [right of= s_1] {$\{p_1\}$};
sawine@51
   302
\path (s_2) [late options={label=below:$s_2$}];
sawine@52
   303
\node[state] (s_i) [right of= s_2] {$\{p_1\}$};
sawine@51
   304
\path (s_i) [late options={label=below:$s_i$}];
sawine@51
   305
\path[->] 
sawine@51
   306
(s_0) edge node {$R$} (s_1) 
sawine@51
   307
(s_1) edge node {$R$} (s_2);
sawine@51
   308
\path[dashed,->] 
sawine@51
   309
(s_2) edge node {$R$} (s_i); 
sawine@51
   310
\end{tikzpicture}
sawine@52
   311
\caption{Example model $\M_1$}
sawine@51
   312
\label{fig:model}
sawine@51
   313
\end{figure}
sawine@45
   314
%
sawine@18
   315
\begin{def:satisfiability}
sawine@19
   316
A model $\M = (\F, V)$ \emph{satisfies} a formula $\varphi$ at time instant $i$ is denoted by $\M,i \models \varphi$. Satisfiability of a formula $\varphi$ is defined inductively over the structure of $\varphi$:
sawine@13
   317
\begin{itemize}
sawine@22
   318
\item $\M,i \models p$ for $p \in \Prop \iff p \in V(i)$
sawine@22
   319
\item $\M,i \models \neg \varphi \iff$ not $\M,i \models \varphi$
sawine@22
   320
\item $\M,i \models \varphi \lor \psi \iff \M,i \models \varphi$ or $\M,i \models \psi$
sawine@31
   321
\item $\M,i \models \X \varphi \iff \M,i+1 \models \varphi$
sawine@31
   322
\item $\M,i \models \varphi \U \psi \iff \exists{k \geq i}: \M,k \models \psi$ and $\forall{i \leq j < k}: \M,j \models\varphi$
sawine@13
   323
\end{itemize}
sawine@45
   324
\end{def:satisfiability}
sawine@45
   325
%
sawine@45
   326
\noindent From the strict linear order of the LTL-frame accessibility relation follows that an LTL-formula $\varphi$ is \emph{satisfiable}, iff there exists a model $\M$ with $\M,0 \models \varphi$.
sawine@22
   327
sawine@46
   328
We clearly see, that atomic propositions, which are not contained within the formula $\varphi$ are redundant to the the definition of the satisfiability. By defining the \emph{vocabulary} of a formula, we dispose such irrelevant atomic proposition from the alphabet.
sawine@18
   329
sawine@14
   330
\begin{def:vocabulary}
sawine@22
   331
Let $\varphi$ be an LTL-formula over atomic propositions $\Prop$, we define the \emph{vocabulary} $Voc(\varphi)$ of $\varphi$ inductively:
sawine@15
   332
\begin{multicols}{2}
sawine@14
   333
\begin{itemize}
sawine@19
   334
\item $Voc(p) = \{p\}$ for $p \in \Prop$
sawine@14
   335
\item $Voc(\neg \varphi) = Voc(\varphi)$
sawine@14
   336
\item $Voc(\varphi \lor \psi) = Voc(\varphi) \cup Voc(\psi)$
sawine@31
   337
\item $Voc(\X \varphi) = Voc(\varphi)$
sawine@31
   338
\item $Voc(\varphi \U \psi) = Voc(\varphi) \cup Voc(\psi)$
sawine@14
   339
\end{itemize}
sawine@15
   340
\end{multicols}
sawine@17
   341
%
sawine@22
   342
\noindent Let $\M = (\F, V)$ be a model and $\varphi$ an LTL-formula, we define model $\M_{Voc(\varphi)} = (\F, V_{Voc(\varphi)})$ with:
sawine@21
   343
\[\forall{i \in \N}: V_{Voc(\varphi)}(i) = V(i) \cap Voc(\varphi)\]
sawine@21
   344
Henceforth, we will abbreviate $\M_{Voc(\varphi)}$ and $V_{Voc(\varphi)}$ with $\M_\varphi$ and $V_\varphi$ accordingly. 
sawine@22
   345
%\noindent Let $\M$ be a model and $\varphi$ an LTL-formula, we define model $\M_{Voc(\varphi)}$:
sawine@21
   346
%\[\forall{i \in \N}: \M_{Voc(\varphi)} = \M(i) \cap Voc(\varphi)\]
sawine@17
   347
\end{def:vocabulary}
sawine@17
   348
%
sawine@17
   349
\begin{prop:vocabulary sat}
sawine@22
   350
Let $\M$ be a model and $\varphi$ an LTL-formula, then following holds:
sawine@21
   351
\[\forall{i \in \N}: \M,i \models \varphi \iff \M_\varphi,i \models \varphi\] 
sawine@17
   352
\end{prop:vocabulary sat}
sawine@17
   353
%
sawine@19
   354
\subsection{Derived connectives}
sawine@36
   355
\label{sec:derived connectives}
sawine@31
   356
For a more convenient description of system specifications, we present some derived symbols to be used in LTL-formulae. At first, we introduce the notion of \emph{truth} and \emph{falsity} using constants $\top$ and $\bot$. Then we expand our set of connectives with the Boolean \emph{and}, \emph{implication} and \emph{equivalence}. And at last we derive the commonly used modal operators \emph{eventually} and \emph{henceforth}. 
sawine@15
   357
sawine@52
   358
In anticipation of section \ref{sec:on-the-fly methods}, we extend our logic's syntax with the binary connective $\V$, the dual of $\U$, which will become useful in the interpretation known as \emph{two-state semantics}.
sawine@34
   359
sawine@19
   360
Let $\varphi$ and $\psi$ be $L_{LTL}(\Prop)$-formulae:
sawine@15
   361
\begin{multicols}{2}
sawine@15
   362
\begin{itemize}
sawine@19
   363
\item $\top \equiv p \lor \neg p$ for $p \in \Prop$
sawine@15
   364
\item $\bot \equiv \neg \top$
sawine@15
   365
\item $\varphi \land \psi \equiv \neg (\neg \varphi \lor \neg \psi)$
sawine@15
   366
\item $\varphi \rightarrow \psi \equiv \neg \varphi \lor \psi$
sawine@15
   367
\item $\varphi \leftrightarrow \psi \equiv (\varphi \rightarrow \psi) \land (\psi \rightarrow \varphi)$
sawine@31
   368
\item $\Diamond \varphi \equiv \top \U \varphi$
sawine@15
   369
\item $\Box \varphi \equiv \neg \Diamond \neg \varphi$
sawine@36
   370
\item $\varphi \V \psi \equiv \neg(\neg \varphi \U \neg \psi)$
sawine@15
   371
\end{itemize}
sawine@15
   372
\end{multicols}
sawine@28
   373
\noindent From the derivations for operators $\Diamond$, \emph{read diamond}, and $\Box$, \emph{read box}, it follows:
sawine@17
   374
\begin{multicols}{2}
sawine@16
   375
\begin{itemize}
sawine@31
   376
\item $\M,i \models \Diamond \varphi \iff \exists{k \geq i}: \M,k \models \varphi$
sawine@31
   377
\item $\M,i \models \Box \varphi \iff \forall{k \geq i}: \M,k \models \varphi$
sawine@16
   378
\end{itemize}
sawine@17
   379
\end{multicols}
sawine@19
   380
sawine@28
   381
\noindent With the additional derived connectives we get the following $L_{LTL}(\Prop)$-formulae productions:
sawine@31
   382
\[\varphi ::= p \in \Prop \,|\, \neg \varphi \,|\, \varphi \lor \varphi \,|\, \varphi \land \varphi \,|\, \X \varphi \,|\, \varphi \U \varphi \,|\, \varphi \rightarrow \varphi \,|\, \varphi \leftrightarrow \varphi \,|\, \Diamond \varphi \,|\, \Box \varphi\]
sawine@19
   383
sawine@52
   384
\subsection{Examples}
sawine@52
   385
Based on the examples in \cite{ref:ltl&büchi}, we provide following formulae:
sawine@52
   386
\begin{itemize}
sawine@52
   387
\item $\varphi = \Diamond \Box p_1$, i.e., eventually $p_1$ becomes a stable property
sawine@52
   388
\item $\psi = \Diamond p_2$, i.e., $p_2$ is eventually $true$
sawine@52
   389
\item $\chi = p_0 \lor p_1$, i.e., it always holds that either $p_0$ or $p_1$ are $true$
sawine@52
   390
\item $\xi = p_0\U p_1$, meaning $p_0$ holds until $p_1$ is $true$
sawine@52
   391
\end{itemize}
sawine@52
   392
It happens so, that the model $\M_1$, from our previous Example \ref{ex:model}, satisfies all these formulae:
sawine@52
   393
$\M_1,i \models \varphi$, $\M_1,i \models \psi$, $\M_1,i \models \chi$, $\M_1,i \models \xi$.
sawine@52
   394
sawine@21
   395
\section{Automata construction}
sawine@28
   396
Before applying the automata-theoretic verification methods, we need to construct the automaton for a given specification formula $\varphi$ and for the program $P$ in test.
sawine@24
   397
sawine@28
   398
\subsection{Specification automata}
sawine@36
   399
\label{sec:specification automata}
sawine@28
   400
For the construction of an automaton $\A_\varphi$ for an LTL-formula $\varphi$, we treat the model $\M = (\F, V)$ for an LTL-formula $\varphi$ as an infinite word over the finite alphabet $2^{Voc(\varphi)}$. 
sawine@28
   401
sawine@28
   402
\begin{def:rep function}
sawine@52
   403
We define the \emph{representation function} $rep: \M \to 2^\Prop$, which returns an infinite word representing the model $\M_\varphi = (\F, V_\varphi)$ over the ordered image $V_\varphi^\rightarrow(\N)$ of its validation function, i.e., $rep(\M_\varphi) = (V_\varphi(0), V_\varphi(1), ...)$. 
sawine@22
   404
\[Mod(\varphi) = \{rep(\M_\varphi) \mid \M_\varphi = (\F, V_\varphi) \land \M_\varphi,0 \models \varphi\}\]
sawine@21
   405
$Mod(\varphi)$ is the set of all infinite words, which represent models for $\varphi$.
sawine@28
   406
\end{def:rep function}
sawine@21
   407
sawine@22
   408
\begin{def:fs closure}
sawine@34
   409
\label{def:fs closure}
sawine@30
   410
Let $\varphi$ be an LTL-formula, then the \emph{Fischer-Ladner closure} $CL(\varphi)$ of $\varphi$ is the smallest set of formulae such that following holds:
sawine@22
   411
%\begin{multicols}{2}
sawine@22
   412
\begin{itemize}
sawine@34
   413
\begin{multicols}{2}
sawine@30
   414
\item $\varphi \in CL(\varphi)$
sawine@30
   415
\item $\neg \psi \in CL(\varphi) \implies \psi \in CL(\varphi)$
sawine@30
   416
\item $\psi \in CL(\varphi) \implies \neg \psi \in CL(\varphi)$
sawine@30
   417
\item $\psi \lor \chi \in CL(\varphi) \implies \psi, \chi \in CL(\varphi)$
sawine@31
   418
\item $\X \psi \in CL(\varphi) \implies \psi \in CL(\varphi)$
sawine@34
   419
\item $\psi \V \chi \in CL(\varphi) \implies \psi, \chi \in CL(\varphi)$
sawine@34
   420
\end{multicols}
sawine@34
   421
\vspace{-1.1em}
sawine@31
   422
\item $\psi \U \chi \in CL(\varphi) \implies \psi, \chi, \X(\psi \U \chi) \in CL(\varphi)$
sawine@22
   423
\end{itemize}
sawine@22
   424
%\end{multicols}
sawine@22
   425
\end{def:fs closure}
sawine@22
   426
sawine@30
   427
\noindent Let $CL(\varphi)$ be the closure of formula $\varphi$, we define a subset with the \emph{until}-formulae of the closure $\mathbb{U}_\varphi \subseteq CL(\varphi)$ where:
sawine@34
   428
\[\mathbb{U}_\varphi = \{\psi \U \chi \mid \psi \U \chi \in CL(\varphi)\} \text{ and } \mathbb{U}_{\varphi_i} \text{ denotes the $i^{th}$ element of } \mathbb{U_\varphi}\]
sawine@22
   429
sawine@22
   430
\begin{def:atoms}
sawine@30
   431
Let $\varphi$ be a formula and $CL(\varphi)$ its closure. $A \subseteq CL(\varphi)$ is an \emph{atom} if following holds:
sawine@22
   432
\begin{itemize}
sawine@30
   433
\item $\forall{\psi \in CL(\varphi)}: \psi \in A \iff \neg \psi \notin A$
sawine@30
   434
\item $\forall{\psi \lor \chi \in CL(\varphi)}: \psi \lor \chi \in A \iff \psi \in A$ or $\chi \in A$ 
sawine@31
   435
\item $\forall{\psi \U \chi \in CL(\varphi)}: \psi \U \chi \in A \iff \chi \in A$ or $\psi, \X(\psi \U \chi) \in A$ 
sawine@22
   436
\end{itemize}
sawine@30
   437
We define the set of all atoms of formula $\varphi$ with $\mathbb{AT}_\varphi = \{A \subseteq CL({\varphi}) \mid A \text{ is an atom}\}$.
sawine@22
   438
\end{def:atoms}
sawine@22
   439
sawine@35
   440
\noindent Now that we have the required ingredients, we begin with the construction of automaton $\A_\varphi$ for formula $\varphi$. Let $\A_\varphi = (\Sigma, S, S_0, \Delta, \{F_i\})$ with:
sawine@22
   441
\begin{itemize}
sawine@22
   442
\item $\Sigma = 2^{Voc(\varphi)}$
sawine@22
   443
\item $S = \mathbb{AT_\varphi}$
sawine@23
   444
\item $S_0 = \{A \in \mathbb{AT_\varphi} \mid \varphi \in A\}$
sawine@31
   445
%\item $(A, P, B) \in \Delta$ for $A, B \in \mathbb{AT_\varphi}$ and $P = A \cap Voc(\varphi) \iff (\X \psi \in A \iff \psi \in B)$
sawine@31
   446
\item $\Delta = \{(A, P, B) \mid A, B \in \mathbb{AT_\varphi}, P = A \cap Voc(\varphi), \X \psi \in A \iff \psi \in B\}$
sawine@31
   447
%\item $\forall{i \in \N, i < k = |\mathbb{U}_{CL(\varphi)}|}: F_i = \{A \in \mathbb{AT}_\varphi \mid \psi \U \chi \notin A$ or $\chi \in A\}$
sawine@35
   448
\item $F_i = \{A \in \mathbb{AT}_\varphi \mid \psi \U \chi = \mathbb{U}_{\varphi_i}, \psi \U \chi \notin A$ or $\chi \in A\}$
sawine@22
   449
%Let $A, B \in \mathbb{AT}$ and $P \subseteq Voc(\varphi)$. Then $(A, P, B) \in \Delta$ iff the following holds:
sawine@31
   450
%$P = A \cap Voc(\varphi)$ and For all $\X \psi \in CL(\varphi): \X \psi \in A$ iff $\psi \in B$.
sawine@22
   451
\end{itemize}
sawine@22
   452
sawine@22
   453
\begin{thm:model language}
sawine@24
   454
\label{thm:model language}
sawine@22
   455
Let $\M_\varphi = (\F, V_\varphi)$ be a model and $rep(\M_\varphi)$ its infinite representation word, then following holds:
sawine@29
   456
\[rep(\M_\varphi) \in L_\omega(\A_\varphi) \iff \M_\varphi,0 \models \varphi\]
sawine@22
   457
\end{thm:model language}
sawine@22
   458
\noindent
sawine@22
   459
\begin{proof}
sawine@46
   460
For the elaborate proof, consult \cite{ref:ltl&büchi}.
sawine@22
   461
\end{proof}
sawine@24
   462
\begin{cor:mod=model language}
sawine@24
   463
\label{cor:mod=model language}
sawine@31
   464
From Theorem \ref{thm:model language} follows $Mod(\varphi) = L_\omega(\A_\varphi)$.
sawine@24
   465
\end{cor:mod=model language}
sawine@21
   466
sawine@28
   467
\subsection{Program automata}
sawine@28
   468
In the next step, we model a given program $P$ as automaton $\A_P$. A program is a structure $P = (S_P, s_0, R, V)$, where $S$ is the set of possible states of the program, $s_0$ the initial state, $R : S \times \Prop \times S$ the transition relation and $V : S \to 2^\Prop$ a valuation function. A \emph{computation} of $P$ is a run $\rho = (V(s_0), V(s_1), ...)$. 
sawine@28
   469
sawine@28
   470
We construct automaton $\A_P = (\Sigma, S, S_0, \Delta, F)$, with:
sawine@28
   471
\begin{itemize}
sawine@28
   472
\begin{multicols}{2}
sawine@28
   473
\item $\Sigma = 2^\Prop$
sawine@28
   474
\item $S = S_P$
sawine@29
   475
\item $S_0 = \{s_0\}$
sawine@28
   476
\item $F = S$
sawine@28
   477
\end{multicols}
sawine@34
   478
\vspace{-1.1em}
sawine@28
   479
\item $\Delta = \{(s, V(s), s') \mid \exists{a \in \Prop}: (s, a, s') \in R\}$
sawine@28
   480
\end{itemize}
sawine@29
   481
In practical verification of programs, the specification covers only the properties of a system, which are vital to the program's correctness, where our program description contains all details of all possible execution paths. Let $\varphi$ be the specification formula, we can reduce the state exploration to the vocabulary of $\varphi$ by the reduction of the transition relation to $\Delta = \{(s, A, s') \mid \exists{a \in \Prop}: (s, a, s') \in R \land A = V(s) \cap Voc(\varphi)\}$.
sawine@28
   482
sawine@29
   483
\begin{prop:computation set=language}
sawine@29
   484
\label{prop:computation set=language}
sawine@29
   485
Let $\A_P = (\Sigma, S, S_0, \Delta, F)$, for $F = S$ it follows that each run of $\A_P$ is accepting, therefore is $L_\omega(\A_P)$ the set of all computations of $P$.
sawine@29
   486
\[L_\omega(\A_P) = \{\rho \mid \rho \text{ is a run of } \A_P\}\]
sawine@29
   487
\end{prop:computation set=language}
sawine@29
   488
sawine@29
   489
 We can view each run of $\A_P$, i.e., each computation of $P$, as a representation of model $\M_\rho = (\F, V)$, where $\F$ is a frame and $V$ the program's valuation function. In analogy to the specification, we define:
sawine@29
   490
\[Mod(P) = \{\rho \mid \rho \text{ is a computation of } P\}\]
sawine@29
   491
\begin{cor:mod=program language}
sawine@29
   492
\label{cor:mod=program language}
sawine@31
   493
From Theorem \ref{thm:model language} and Proposition \ref{prop:computation set=language} follows $Mod(P) = L_\omega(\A_P)$.
sawine@29
   494
\end{cor:mod=program language}
sawine@28
   495
sawine@8
   496
\section{Model checking}
sawine@46
   497
For effective automata-theoretic verification of reactive programs, we have modeled the program as a non-deterministic B\"uchi automaton $\A_P$ and the specification formula $\varphi$ as automaton $\A_\varphi$. 
sawine@29
   498
sawine@46
   499
Given a program $P$ and specification $\varphi$, the verification problem is the following: \emph{does every run of $P$ satisfy $\varphi$?} To show this we use the previously introduced automata constructions and reduce the problem to $L_\omega(\A_P) \subseteq L_\omega(\A_\varphi)$, i.e., all runs accepted by $\A_P$ are also accepted by $\A_\varphi$. By this problem definition, we clearly have to explore the whole state space of $\A_\varphi$ for each run of $\A_P$. This prevents efficient on-demand constructions. Therefore we rephrase the problem with the contra-positive definition $L_\omega(\A_P) \cap \overline{L_\omega(\A_\varphi)} = \emptyset$, where $\overline{L_\omega(\A_\varphi)} = \Sigma^\omega - L_\omega(\A_\varphi) = L_\omega(\A_{\neg \varphi})$ \cite{ref:alternating verification}.
sawine@30
   500
sawine@46
   501
In conclusion, the essence of model checking lies within the test for emptiness of the intersection between the recognised language of the program automaton and the recognised language of the automaton for its negated specification:
sawine@29
   502
\[L_\omega(\A_P) \cap L_\omega(\A_{\neg \varphi}) = \emptyset\]
sawine@30
   503
sawine@30
   504
\begin{thm:model checking}
sawine@30
   505
\label{thm:model checking}
sawine@30
   506
Let $P$ be a finite-state program and $\A_P$ its automaton, let $\varphi$ be an LTL-formula and $\A_\varphi$ its automaton. P satisfies $\varphi$ iff $L_\omega(\A_P) \cap L_\omega(\A_{\neg \varphi}) = \emptyset$.
sawine@30
   507
\end{thm:model checking}
sawine@30
   508
sawine@35
   509
\noindent From Corollary \ref{cor:mod=model language} and \ref{cor:mod=program language} follows:
sawine@29
   510
\[L_\omega(\A_P) \cap L_\omega(\A_{\neg \varphi}) = \emptyset \iff Mod(P) \cap Mod(\neg \varphi) = \emptyset\]
sawine@29
   511
sawine@30
   512
\subsection{Complexity}
sawine@46
   513
Let the size $|P|$ of a program $P = (S, s_0, R, V)$ be proportional to the sum of its structural components, i.e., $|P| = |S| + |R|$. The size $|\varphi|$ is the length of the formula string. The asymptotic complexity of the presented automata-theoretic verification method is in time $O(|P| \cdot 2^{O(|\varphi|)})$ \cite{ref:concurrent checking}. 
sawine@30
   514
sawine@47
   515
The size of $\varphi$ is usually short \cite{ref:concurrent checking}, so the exponential growth by it is reasonable. Generally, the number of states is at least exponential in the size of its description by means of a programming language. This concludes: despite that the upper bound is polynomial in the size of the program, in practice, we are facing exponential growth in complexity \cite[C.17]{ref:handbook}.
sawine@19
   516
sawine@19
   517
\section{On-the-fly methods}
sawine@34
   518
\label{sec:on-the-fly methods}
sawine@46
   519
The automata-theoretic approach on verification in Theorem \ref{thm:model checking} requires a fully constructed automaton for the specification, when applying the graph-theoretic emptiness test. 
sawine@31
   520
sawine@31
   521
A more space-efficient strategy is the on-the-fly construction of the automaton during a depth-first search, short DFS. The DFS explores the product states of both automata incrementally, testing for cycles in each iteration. If the program does not satisfy a formula, an accepting cycle will occur and lead to termination of the search. In the case of a valid program, i.e., the program does meet the specification, no cycles will occur. In the latter case, such a strategy would inevitably explore the whole state space of the automata.
sawine@31
   522
sawine@35
   523
\subsection{Two-state semantics}
sawine@44
   524
A new interpretation for the infinite computation paths will help us in the incremental construction of automata. We separate the computation paths in two states by applying temporal reasoning; and we do so incrementally for each time instant. The two states resemble the satisfiability requirements for any time instant $i$ and its successor $i+1$.
sawine@35
   525
sawine@35
   526
\subsubsection{Example}
sawine@35
   527
Let $\varphi = a \U b$. We apply the two-state semantics on $\varphi$ and it follows:
sawine@35
   528
\[\forall{i \in \N}: \M,i \models \varphi \iff \M,i \models b \text{ or } \M,i+1 \models a \land \X(\varphi)\]
sawine@35
   529
In this example, we construct the specification automaton incrementally for each time instant; the states are constructed from the union of the current-state and next-state requirements $\{b\} \cup \{a, \X(\varphi)\}$.
sawine@35
   530
sawine@52
   531
Let us capture the notion of the incremental automaton construction based on the idea of the two-state semantics.
sawine@35
   532
sawine@31
   533
\begin{def:positive formulae}
sawine@34
   534
Let $\Prop$ be a set of atomic propositions and let $\overline{\Prop} = \{\neg p \mid p \in \Prop\}$. We define the set of LTL-formulae in \emph{positive form}:
sawine@31
   535
\[\Phi^+ = \Prop \cup \overline{\Prop} \cup \{\top, \bot\} \cup \{\varphi \lor \psi, \varphi \land \psi, \X\varphi, \varphi \U \psi, \varphi \V \psi \mid \varphi, \psi \in \Phi^+\} \]
sawine@31
   536
\end{def:positive formulae}
sawine@31
   537
sawine@46
   538
The positive form of a formula contains only negations at the level of atomic propositions. This is the reason for the introduction of the dual $\V$ in \ref{sec:derived connectives}; to provide a way of shifting the negation of $\U$-formulae inwards by the substitution with its contra-positive form. 
sawine@36
   539
sawine@31
   540
\begin{def:next}
sawine@31
   541
Let $\Phi$ be a set of LTL-formulae, we define:
sawine@31
   542
\[next(\Phi) = \{ \X\varphi \mid \X\varphi \in \Phi\} \text{ and } snext(\Phi) = \{ \varphi \mid \X\varphi \in \Phi\}\]
sawine@31
   543
\end{def:next}
sawine@31
   544
sawine@31
   545
\begin{def:dnf}
sawine@34
   546
Let $\Phi^+$ be the set of LTL-formulae in positive form and let $Q = \Prop \cup \overline{\Prop} \cup next(\Phi^+)$. We define the function $\dnf: \Phi^+ \to 2^Q$ inductively:
sawine@31
   547
\begin{align*}
sawine@31
   548
&\dnf(\top) &=  &\, \{\emptyset\}\\
sawine@31
   549
&\dnf(\bot) &= &\, \emptyset\\
sawine@31
   550
&\dnf(x) &=  &\, \{\{x\}\}, \text{ for } x = p, \neg p, \X\varphi\\
sawine@31
   551
&\dnf(\varphi \lor \psi) &=  &\, \dnf(\varphi) \cup \dnf(\psi)\\
sawine@31
   552
&\dnf(\varphi \land \psi) &=  &\, \{C \cup D \mid C \in \dnf(\varphi), D \in \dnf(\psi), C \cup D \text{ is consistent}\}\\
sawine@31
   553
&\dnf(\varphi \U \psi) &=  &\, \dnf(\varphi \land \X(\varphi \U \psi)) \cup \dnf(\psi)\\
sawine@36
   554
&\dnf(\varphi \V \psi) &=  &\, \dnf(\varphi \land \psi) \cup \dnf(\psi \land \X(\varphi \V \psi))
sawine@31
   555
\end{align*}
sawine@31
   556
\end{def:dnf}
sawine@36
   557
\noindent The disjunctive normal form provides the partitioning for the automata state construction over the two-state semantics. The modal connectives $\U$ and $\V$ are interpreted as disjunctions over the path of computation.
sawine@31
   558
sawine@31
   559
\begin{lem:dnf}
sawine@35
   560
Let $\Phi^+$ be the set of formulae in positive form and let $\M_\varphi$ be a model over the vocabulary of $\varphi$ then following holds:
sawine@35
   561
\[\forall{\varphi \in \Phi^+}: \M_\varphi,0 \models \varphi \iff \M_\varphi,0 \models \bigvee_{D \in \dnf(\varphi)} \bigwedge D\]
sawine@31
   562
\end{lem:dnf}
sawine@19
   563
sawine@34
   564
\begin{def:consq}
sawine@34
   565
Let $C \subseteq CL(\varphi)$, then $\consq(C)$ is the smallest subset of $CL(\varphi)$ such that following holds:
sawine@34
   566
\begin{itemize}
sawine@34
   567
%\begin{tabular}{ll}
sawine@34
   568
\begin{multicols}{2}
sawine@34
   569
\item $C \subseteq \consq(C)$
sawine@34
   570
\item $\top \in \consq(C)$, if $\top \in CL(\varphi)$
sawine@34
   571
\end{multicols}
sawine@36
   572
\vspace{-1em}
sawine@34
   573
\item $\psi \lor \chi \in \consq(C)$, if $\psi \lor \chi \in CL(\varphi)$ and $\psi \in \consq(C) \lor \chi \in \consq(C)$
sawine@34
   574
\item $\psi \land \chi \in \consq(C)$, if $\psi \land \chi \in CL(\varphi)$ and $\psi, \chi \in \consq(C)$
sawine@34
   575
\item $\psi \U \chi \in \consq(C)$, if $\psi \U \chi \in CL(\varphi)$ and $\psi, \X(\psi \U \chi) \in \consq(C) \lor \chi \in \consq(C)$
sawine@34
   576
\item $\psi \V \chi \in \consq(C)$, if $\psi \V \chi \in CL(\varphi)$ and $\psi, \X(\psi \U \chi) \in \consq(C) \lor \psi, \chi \in \consq(C)$
sawine@34
   577
%\end{tabular}
sawine@34
   578
\end{itemize}
sawine@34
   579
\end{def:consq}
sawine@34
   580
sawine@34
   581
\begin{lem:consq}
sawine@34
   582
Let $\psi \in CL(\varphi)$, let $C, D \subseteq CL(\varphi)$ and let $\M$ be a model, then following holds:
sawine@34
   583
\begin{itemize}
sawine@34
   584
\begin{multicols}{2}
sawine@34
   585
\item $\consq(C) \subseteq \consq(D)$, if $C \subseteq D$
sawine@34
   586
\item $\psi \in \consq(C)$, if $C \in \dnf(\psi)$
sawine@34
   587
\item $\psi \in \consq(D)$, if $\psi \in C \land D \in \dnf(\bigwedge C)$
sawine@34
   588
\item $\M,0 \models \bigwedge \consq(C)$, if $\M,0 \models \bigwedge C$
sawine@34
   589
\end{multicols}
sawine@34
   590
\end{itemize}
sawine@34
   591
\end{lem:consq}
sawine@34
   592
sawine@34
   593
\begin{def:partial automata}
sawine@34
   594
Let $\varphi$ be a formula with its disjunctive normal form $\dnf(\varphi)$ and let $Q = \Prop \cup \overline{\Prop} \cup next(CL(\varphi))$. Again we use the subset $\mathbb{U}_\varphi \subseteq CL(\varphi)$ of \emph{until}-formulae of the closure as defined in \ref{def:fs closure}. We define the \emph{partial automaton} $\A_\varphi = (\Sigma, S, S_0, \Delta, \{F_i\})$ with:
sawine@34
   595
\begin{itemize}
sawine@34
   596
\item $\Sigma = 2^{Voc(\varphi)}$
sawine@34
   597
\item $S = 2^Q$
sawine@34
   598
\item $S_0 = \dnf(\varphi)$
sawine@34
   599
\item $\Delta = \{(A, P, B) \mid \A \cap \Prop \subseteq P$ and $\{p \mid \neg p \in A\} \cap P = \emptyset$ and $B \in \dnf(\bigwedge snext(A)) \}$
sawine@34
   600
\item $F_i = \{A \in S \mid \psi \U \chi = \mathbb{U}_{\varphi_i}$ and $\psi \U \chi \notin \consq(A) \lor \chi \in \consq(A) \}$
sawine@34
   601
\end{itemize}
sawine@34
   602
\end{def:partial automata}
sawine@34
   603
sawine@46
   604
\noindent The soundness and completeness proofs are provided in \cite{ref:ltl&büchi}; the equivalence of the partial automata and the specification automata as defined in \ref{sec:specification automata} follows from the proofs.  
sawine@36
   605
sawine@36
   606
\subsection{On-the-fly construction}
sawine@44
   607
The sequential description of the program design makes it trivial to incrementally construct the program automaton state by state. The more difficult part is the construction of the partial specification automaton on-the-fly. 
sawine@43
   608
sawine@52
   609
To archive this, we begin with a set of states built by applying $\dnf(\varphi)$. In the next step we determine a state within the current set of states, which is consistent with the program automaton. We use this state $S$ to expand its successor states by applying $dnf(\bigwedge snext(S))$. Now, we analyse the expanded state space for cycles. If no cycles are detected, we repeat this procedure, while there are still consistent states left. 
sawine@44
   610
sawine@52
   611
When the procedure terminates and we have explored the whole state space of both automata without registered cycles, the program does satisfy the specification. Otherwise, the procedure was prematurely aborted by a cycle detection, i.e., the program does satisfy the \emph{negated} specification and therefore does \emph{not} meet the specification properties. 
sawine@43
   612
sawine@52
   613
Given formula length $n = |\varphi|$, the described algorithm runs in $2^{O(n^2)}$ time \cite{ref:ltl&büchi}, some optimisations can reduce it to $2^{O(n)}$ \cite{ref:on-the-fly verification}.
sawine@44
   614
sawine@52
   615
%\begin{algorithm}
sawine@52
   616
%\caption{expand: $\Phi^+ \times 2^Q \to 2^Q$}
sawine@52
   617
%\label{alg:expand}
sawine@52
   618
%\begin{algorithmic}
sawine@52
   619
%\REQUIRE $Node : node, NodeSet: set\, of\, nodes$
sawine@52
   620
%\STATE $ExpandedNodes = \dnf(\bigwedge snext(Node)) - NodeSet$
sawine@52
   621
%\RETURN $ExpandedNodes$
sawine@52
   622
%\end{algorithmic}
sawine@52
   623
%\end{algorithm}
sawine@52
   624
sawine@52
   625
%\begin{algorithm}
sawine@52
   626
%\caption{verify: $\A \times L_{LTL}(\Prop) \to Boolean$}
sawine@52
   627
%\label{alg:create}
sawine@52
   628
%\begin{algorithmic}
sawine@52
   629
%\REQUIRE $\A_P: automaton, \varphi: formula$
sawine@52
   630
%\STATE $S = \dnf(\varphi)$
sawine@44
   631
%\WHILE {$Mod(\bigvee_{s \in S} \bigwedge s) \cap Mod(\A_P) = \emptyset$}
sawine@52
   632
%\WHILE {$consistent(S, \A_P) \neq \emptyset \land \neg cycle(S, \A_P)$}
sawine@52
   633
%\STATE $Node \in consistent(S, \A_P)$
sawine@52
   634
%\STATE $S = S \cup expand(Node, S)$
sawine@52
   635
%\ENDWHILE
sawine@52
   636
%\RETURN $\neg complete(S, \varphi)$
sawine@52
   637
%\end{algorithmic}
sawine@52
   638
%\end{algorithm}
sawine@41
   639
sawine@41
   640
\section*{Discussion}
sawine@44
   641
\emph{Linear-Time Temporal Logic and B\"uchi Automata} \cite{ref:ltl&büchi} is an in-depth introduction to automated verification. It delivers the core concepts of model checking in a comprehensible way. The formal proofs are clean and well absorbable. The referenced material effectively fills the gaps, when looking for more detailed explanations, e.g. about the on-the-fly method. Some few, but good examples support the substantiation of the theoretic material. The introduction section provides a good overview of the text structure and the basic theory behind most concepts used. 
sawine@41
   642
sawine@47
   643
However, the author does not make an effort to deliver a motivation for the topic. From the beginning, the substance of the text resides within the context of model checking. Without an external view on the practical applications, the significance of formal verification to the industry remains unclear.
sawine@41
   644
sawine@46
   645
A few definitions are either lacking formality or are inconsistent. It seems like several concepts are introduced ad-hoc and without rigor. In an introductory text, such inaccuracies may lead to confusion and divert the reader's attention from the essence of the presented topic.
sawine@36
   646
sawine@0
   647
\begin{thebibliography}{99}
sawine@5
   648
\bibitem{ref:ltl&büchi} 
sawine@6
   649
\uppercase{M{\footnotesize adhavan} M{\footnotesize ukund}.}
sawine@5
   650
{\em Linear-Time Temporal Logic and B\"uchi Automata}.
sawine@2
   651
Winter School on Logic and Computer Science, Indian Statistical Institute, Calcutta, 1997.
sawine@0
   652
sawine@19
   653
\bibitem{ref:alternating verification} 
sawine@19
   654
\uppercase{M{\footnotesize oshe} Y. V{\footnotesize ardi}.}
sawine@19
   655
{\em Alternating Automata and Program Verification}.
sawine@19
   656
Computer Science Today, Volume 1000 of Lecture Notes in Computer Science, Springer-Verlag, Berlin, 1995.
sawine@19
   657
sawine@37
   658
\bibitem{ref:automated verification} 
sawine@37
   659
\uppercase{M{\footnotesize oshe} Y. V{\footnotesize ardi}.}
sawine@37
   660
{\em Automated Verification: Graphs, Logic and Automata}.
sawine@37
   661
Proceeding of the International Joint Conference on Artificial Intelligence, Acapulco, 2003.
sawine@37
   662
sawine@36
   663
\bibitem{ref:on-the-fly verification} 
sawine@36
   664
\uppercase{R{\footnotesize ob} G{\footnotesize erth,}  D{\footnotesize oron} P{\footnotesize eled,} M{\footnotesize oshe} Y. V{\footnotesize ardi and} P{\footnotesize ierre} W{\footnotesize olper}.}
sawine@36
   665
{\em Simple On-the-fly Automatic Verification of Linear Temporal Logic}.
sawine@36
   666
Proceeding IFIO/WG6.1 Symposium on Protocol Specification, Testing and Verification, Warsaw, 1995.
sawine@36
   667
sawine@30
   668
\bibitem{ref:concurrent checking}
sawine@30
   669
\uppercase{O{\footnotesize rna} L{\footnotesize ichtenstein and} A{\footnotesize mir} P{\footnotesize nueli}.}
sawine@30
   670
{\em Checking that finite state concurrent programs satisfy their linear specification}.
sawine@30
   671
Proceeding 12th ACM Symposium on Principles of Programming Languages, New York, 1985.
sawine@30
   672
sawine@7
   673
\bibitem{ref:infpaths}
sawine@7
   674
\uppercase{P{\footnotesize ierre} W{\footnotesize olper}, 
sawine@7
   675
M{\footnotesize oshe} Y. V{\footnotesize ardi and}
sawine@7
   676
A. P{\footnotesize rasad} S{\footnotesize istla}.}
sawine@7
   677
{\em Reasoning about Infinite Computation Paths}.
sawine@37
   678
Proceedings of the 24th IEEE FOCS, 1983.
sawine@7
   679
sawine@30
   680
\bibitem{ref:handbook} 
sawine@30
   681
\uppercase{P{\footnotesize atrick} B{\footnotesize lackburn}, 
sawine@30
   682
F{\footnotesize rank} W{\footnotesize olter and} J{\footnotesize ohan van} B{\footnotesize enthem}.}
sawine@30
   683
{\em Handbook of Modal Logic (Studies in Logic and Practical Reasoning)}.
sawine@39
   684
3rd Edition, Elsevier, Amsterdam, Chapter 11 P. 655-720 and Chapter 17 P. 975-989, 2007.
sawine@0
   685
\end{thebibliography}
sawine@0
   686
\end{document}