paper/src/paper.tex
author Eugen Sawin <sawine@me73.com>
Tue, 28 Jun 2011 22:03:45 +0200
changeset 17 9e5a3c5efff7
parent 16 23c4bc2af0b1
child 18 ebda6a5fc738
permissions -rw-r--r--
Added convenient commands.
sawine@7
     1
\documentclass[a4paper, pagesize, DIV=calc, smallheadings]{article}  
sawine@2
     2
\usepackage{graphicx}
sawine@2
     3
%\usepackage[latin1]{inputenc}
sawine@14
     4
\usepackage{amsmath, amsthm, amssymb, amsfonts, verbatim}
sawine@2
     5
\usepackage{typearea}
sawine@2
     6
\usepackage{algorithm}
sawine@2
     7
\usepackage{algorithmic}
sawine@15
     8
\usepackage{multicol}
sawine@11
     9
%\usepackage{fullpage}
sawine@5
    10
%\usepackage[T1]{fontenc}
sawine@5
    11
%\usepackage{arev}
sawine@7
    12
%\pagestyle{headings}
sawine@2
    13
\renewcommand{\familydefault}{\sfdefault}
sawine@17
    14
\newcommand{\M}{\mathcal{M}}
sawine@17
    15
\newcommand{\N}{\mathbb{N}_0}
sawine@7
    16
\title{\uppercase{\textbf{\Large{A}\large{lgorithmic} \Large{V}\large{erification of} \Large{R}\large{eactive} \Large{S}\large{ystems}}\\
sawine@7
    17
\tiny{Draft}
sawine@7
    18
}}
sawine@7
    19
\author{
sawine@17
    20
\uppercase{{\small{E}\scriptsize{UGEN} \small{S}\scriptsize{AWIN}}\thanks{\texttt{sawine@informatik.uni-freiburg.de}}\\
sawine@7
    21
{\em \small{U}\scriptsize{NIVERSITY OF} \small{F}\scriptsize{REIBURG}}\\
sawine@7
    22
%{\em \small{C}\scriptsize{omputer} \small{S}\scriptsize{cience} \small{D}\scriptsize{epartment}}\\
sawine@7
    23
{\em \small{G}\scriptsize{ERMANY}}}\\
sawine@7
    24
%\texttt{\footnotesize{sawine@informatik.uni-freiburg.de}}
sawine@7
    25
}
sawine@5
    26
\date{\textsc{\hfill}}
sawine@7
    27
sawine@15
    28
\theoremstyle{definition} %plain, definition, remark, proposition, proof, corrolary
sawine@7
    29
\newtheorem*{def:finite words}{Finite words}
sawine@7
    30
\newtheorem*{def:infinite words}{Infinite words}
sawine@8
    31
\newtheorem*{def:regular languages}{Regular languages}
sawine@8
    32
\newtheorem*{def:regular languages closure}{Regular closure}
sawine@7
    33
\newtheorem*{def:omega regular languages}{$\omega$-regular languages}
sawine@8
    34
\newtheorem*{def:omega regular languages closure}{$\omega$-regular closure}
sawine@11
    35
\newtheorem*{def:buechi automata}{Automata}
sawine@11
    36
\newtheorem*{def:automata runs}{Runs}
sawine@11
    37
\newtheorem*{def:automata acceptance}{Acceptance}
sawine@14
    38
\newtheorem*{def:vocabulary}{Vocabulary}
sawine@14
    39
sawine@15
    40
\theoremstyle{proposition}
sawine@14
    41
\newtheorem{prop:vocabulary sat}{Proposition}
sawine@15
    42
sawine@0
    43
\begin{document}
sawine@0
    44
\maketitle
sawine@4
    45
\thispagestyle{empty}
sawine@2
    46
%\itshape
sawine@2
    47
%\renewcommand\abstractname{Abstract} 
sawine@0
    48
\begin{abstract}
sawine@0
    49
Over the past two decades, temporal logic has become a very basic tool for spec-
sawine@0
    50
ifying properties of reactive systems. For finite-state systems, it is possible to use
sawine@0
    51
techniques based on B\"uchi automata to verify if a system meets its specifications.
sawine@0
    52
This is done by synthesizing an automaton which generates all possible models of
sawine@0
    53
the given specification and then verifying if the given system refines this most gen-
sawine@0
    54
eral automaton. In these notes, we present a self-contained introduction to the basic
sawine@0
    55
techniques used for this automated verification. We also describe some recent space-
sawine@0
    56
efficient techniques which work on-the-fly.
sawine@0
    57
\end{abstract}
sawine@2
    58
%\normalfont
sawine@4
    59
\newpage
sawine@2
    60
\section{Introduction}
sawine@2
    61
Program verification is a fundamental area of study in computer science. The broad goal
sawine@5
    62
is to verify whether a program is ``correct''--i.e., whether the implementation of a program
sawine@2
    63
meets its specification. This is, in general, too ambitious a goal and several assumptions
sawine@2
    64
have to be made in order to render the problem tractable. In these lectures, we will focus
sawine@2
    65
on the verification of finite-state reactive programs. For specifying properties of programs,
sawine@2
    66
we use linear time temporal logic.
sawine@2
    67
sawine@2
    68
What is a reactive program? The general pattern along which a conventional program
sawine@2
    69
executes is the following: it accepts an input, performs some computation, and yields an
sawine@2
    70
output. Thus, such a program can be viewed as an abstract function from an input domain
sawine@2
    71
to an output domain whose behaviour consists of a transformation from initial states to
sawine@2
    72
final states.
sawine@2
    73
sawine@2
    74
In contrast, a reactive program is not expected to terminate. As the name suggests, such
sawine@2
    75
systems “react” to their environment on a continuous basis, responding appropriately to
sawine@2
    76
each input. Examples of such systems include operating systems, schedulers, discrete-event
sawine@2
    77
controllers etc. (Often, reactive systems are complex distributed programs, so concurrency
sawine@2
    78
also has to be taken into account. We will not stress on this aspect in these lectures—we
sawine@2
    79
take the view that a run of a distributed system can be represented as a sequence, by
sawine@2
    80
arbitrarily interleaving concurrent actions.)
sawine@2
    81
sawine@2
    82
To specify the behaviour of a reactive system, we need a mechanism for talking about
sawine@2
    83
the way the system evolves along potentially infinite computations. Temporal logic 
sawine@2
    84
has become a well-established formalism for this purpose. Many varieties of temporal logic
sawine@2
    85
have been defined in the past twenty years—we focus on propositional linear time temporal
sawine@2
    86
logic (LTL).
sawine@2
    87
sawine@2
    88
There is an intimate connection between models of LTL formulas and languages of
sawine@2
    89
infinite words—the models of an LTL formula constitute an ω-regular language over an
sawine@2
    90
appropriate alphabet. As a result, the satisfiability problem for LTL reduces to checking
sawine@2
    91
for emptiness of ω-regular languages. This connection was first explicitly pointed out in.
sawine@2
    92
sawine@8
    93
\section{$\omega$-regular languages}
sawine@7
    94
\begin{def:finite words}
sawine@11
    95
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
    96
\end{def:finite words}
sawine@7
    97
sawine@8
    98
\begin{def:regular languages}
sawine@8
    99
The class of regular languages is defined recursively over an alphabet $\Sigma$:
sawine@15
   100
\begin{multicols}{2}
sawine@8
   101
\begin{itemize}
sawine@8
   102
\item $\emptyset$ is regular
sawine@8
   103
\item $\{\varepsilon\}$ is regular
sawine@8
   104
\item $\forall_{a \in \Sigma}:\{a\}$ is regular
sawine@8
   105
\end{itemize}
sawine@15
   106
\end{multicols}
sawine@8
   107
\end{def:regular languages}
sawine@8
   108
sawine@8
   109
\begin{def:regular languages closure}
sawine@10
   110
Let $L_{R_1}, L_{R_2} \in \Sigma^*$ be regular. The class of regular languages is closed under following operations:
sawine@15
   111
\begin{multicols}{2}
sawine@8
   112
\begin{itemize}
sawine@8
   113
\item $L_{R_1}^*$
sawine@8
   114
\item $L_{R_1} \circ L_{R_2}$
sawine@8
   115
\item $L_{R_1} \cup L_{R_2}$
sawine@10
   116
\item $L_{R_1} \cap L_{R_2}$
sawine@10
   117
\item $\overline{L}_{R_1}$ and therefore $L_{R_1} - L_{R_2}$
sawine@8
   118
\end{itemize}
sawine@15
   119
\end{multicols}
sawine@8
   120
\end{def:regular languages closure}
sawine@8
   121
sawine@9
   122
\begin{def:infinite words}
sawine@17
   123
$\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
   124
\end{def:infinite words}
sawine@9
   125
sawine@7
   126
\begin{def:omega regular languages}
sawine@8
   127
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
   128
\end{def:omega regular languages}
sawine@7
   129
sawine@8
   130
\begin{def:omega regular languages closure}
sawine@8
   131
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
   132
\begin{itemize}
sawine@8
   133
\item $L_R \circ L_{\omega_1}$, but \emph{not} $L_{\omega_1} \circ L_R$
sawine@8
   134
\item $L_{\omega_1} \cup L_{\omega_2}$, but only \emph{finitely} many times
sawine@8
   135
\end{itemize}
sawine@8
   136
\end{def:omega regular languages closure}
sawine@7
   137
sawine@8
   138
\section{B\"uchi automata}
sawine@11
   139
\begin{def:buechi automata}
sawine@15
   140
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
   141
sawine@11
   142
A 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
   143
sawine@11
   144
Within this text \emph{automata/automaton} will refer to non-deterministic B\"uchi automata/automaton, unless otherwise noted. 
sawine@11
   145
\end{def:buechi automata}
sawine@11
   146
sawine@11
   147
\begin{def:automata runs}
sawine@17
   148
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
   149
\end{def:automata runs}
sawine@11
   150
sawine@11
   151
\begin{def:automata acceptance}
sawine@17
   152
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 occurances, i.e., $s$ occurs infinitely often in $\rho$.
sawine@11
   153
sawine@15
   154
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}. The language $L_\omega(A)$ recognised by automaton $A$ is the set of all infinite words accepted by $A$.
sawine@11
   155
\end{def:automata acceptance}
sawine@11
   156
sawine@8
   157
\section{Linear temporal logic}
sawine@13
   158
\subsection*{Sytnax}
sawine@17
   159
Let $\mathcal{P}$ be the countable set of \emph{atomic propositions}. The \emph{alphabet} of the language $L_{LTL}(\mathcal{P})$ is $\mathcal{P} \cup \{\neg, \lor, X, U\}$. We define the $L_{LTL}(\mathcal{P})$-\emph{formulae} $\varphi$ using following productions:
sawine@17
   160
\[\varphi ::= p \in \mathcal{P} \,|\, \neg \varphi \,|\, \varphi \lor \varphi \,|\, X \varphi \,|\, \varphi U \varphi\]
sawine@13
   161
sawine@13
   162
\subsection*{Interpretation}
sawine@13
   163
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@13
   164
sawine@13
   165
LTL is interpreted over \emph{computation paths}, where a computation corrensponds to a model over a \emph{Kripke-frame} constructed by the order of natural numbers.
sawine@13
   166
sawine@13
   167
\subsection*{Semantics}
sawine@17
   168
A \emph{model} is a function $\M: \N \to 2^\mathcal{P}$ over \emph{frame} $\mathcal{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 \mathcal{P}$ is \emph{true} at time instant $i$ iff $p \in \M(i)$.
sawine@13
   169
sawine@17
   170
A model $\M$ \emph{satisfies} an LTL-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
   171
\begin{itemize}
sawine@17
   172
\item $\M,i \models p$ for $p \in \mathcal{P}$ iff $p \in \M(i)$
sawine@17
   173
\item $\M,i \models \neg \varphi$ iff not $\M,i \models \varphi$
sawine@17
   174
\item $\M,i \models \varphi \lor \psi$ iff $\M,i \models \varphi$ or $\M,i \models \psi$
sawine@17
   175
\item $\M,i \models X \varphi$ iff $\M,i+1 \models \varphi$
sawine@17
   176
\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
   177
\end{itemize}
sawine@17
   178
%
sawine@14
   179
\begin{def:vocabulary}
sawine@17
   180
Let $\varphi$ be a LTL-formula over atomic propositions $\mathcal{P}$, we define the \emph{vocabulary} $Voc(\varphi)$ of $\varphi$ inductively:
sawine@15
   181
\begin{multicols}{2}
sawine@14
   182
\begin{itemize}
sawine@17
   183
\item $Voc(p) = \{p\}$ for $p \in \mathcal{P}$
sawine@14
   184
\item $Voc(\neg \varphi) = Voc(\varphi)$
sawine@14
   185
\item $Voc(\varphi \lor \psi) = Voc(\varphi) \cup Voc(\psi)$
sawine@14
   186
\item $Voc(X \varphi) = Voc(\varphi)$
sawine@14
   187
\item $Voc(\varphi U \psi) = Voc(\varphi) \cup Voc(\psi)$
sawine@14
   188
\end{itemize}
sawine@15
   189
\end{multicols}
sawine@17
   190
%
sawine@17
   191
\noindent Let $\M$ be a model and $\varphi$ a LTL-formula, we define model $\M_{Voc(\varphi)}$:
sawine@17
   192
\[\forall{i \in \N}: \M_{Voc(\varphi)} = \M(i) \cap Voc(\varphi)\]
sawine@17
   193
\end{def:vocabulary}
sawine@17
   194
%
sawine@17
   195
\begin{prop:vocabulary sat}
sawine@17
   196
Let $\M$ be a model and $\varphi$ a LTL-formula, then following holds:
sawine@17
   197
\[\forall{i \in \N}: \M,i \models \varphi \iff \M_{Voc(\varphi)},i \models \varphi\] 
sawine@17
   198
\end{prop:vocabulary sat}
sawine@17
   199
%
sawine@17
   200
\subsection*{Derived connectives}
sawine@17
   201
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
   202
sawine@17
   203
Let $\varphi$ and $\psi$ be $L_{LTL}(\mathcal{P})$-formulae:
sawine@15
   204
\begin{multicols}{2}
sawine@15
   205
\begin{itemize}
sawine@17
   206
\item $\top \equiv p \lor \neg p$ for $p \in \mathcal{P}$
sawine@15
   207
\item $\bot \equiv \neg \top$
sawine@15
   208
\item $\varphi \land \psi \equiv \neg (\neg \varphi \lor \neg \psi)$
sawine@15
   209
\item $\varphi \rightarrow \psi \equiv \neg \varphi \lor \psi$
sawine@15
   210
\item $\varphi \leftrightarrow \psi \equiv (\varphi \rightarrow \psi) \land (\psi \rightarrow \varphi)$
sawine@15
   211
\item $\Diamond \varphi \equiv \top U \varphi$
sawine@15
   212
\item $\Box \varphi \equiv \neg \Diamond \neg \varphi$
sawine@15
   213
\end{itemize}
sawine@15
   214
\end{multicols}
sawine@16
   215
From the derivations for operators $\Diamond$, \emph{read diamond}, and $\Box$, \emph{read box}, it follows:
sawine@17
   216
\begin{multicols}{2}
sawine@16
   217
\begin{itemize}
sawine@17
   218
\item $\M,i \models \Diamond \varphi$ iff $\exists{k \geq i}: \M,k \models \varphi$
sawine@17
   219
\item $\M,i \models \Box \varphi$ iff $\forall{k \geq i}: \M,k \models \varphi$
sawine@16
   220
\end{itemize}
sawine@17
   221
\end{multicols}
sawine@8
   222
\section{Model checking}
sawine@15
   223
sawine@0
   224
\begin{thebibliography}{99}
sawine@5
   225
\bibitem{ref:ltl&büchi} 
sawine@6
   226
\uppercase{M{\footnotesize adhavan} M{\footnotesize ukund}.}
sawine@5
   227
{\em Linear-Time Temporal Logic and B\"uchi Automata}.
sawine@2
   228
Winter School on Logic and Computer Science, Indian Statistical Institute, Calcutta, 1997.
sawine@0
   229
sawine@2
   230
\bibitem{ref:handbook} 
sawine@6
   231
\uppercase{P{\footnotesize atrick} B{\footnotesize lackburn}, 
sawine@6
   232
F{\footnotesize rank} W{\footnotesize olter and} J{\footnotesize ohan van} B{\footnotesize enthem}.}
sawine@2
   233
{\em Handbook of Modal Logic (Studies in Logic and Practical Reasoning)}.
sawine@3
   234
3rd Edition, Elsevier, Amsterdam, 2007.
sawine@7
   235
sawine@7
   236
\bibitem{ref:infpaths}
sawine@7
   237
\uppercase{P{\footnotesize ierre} W{\footnotesize olper}, 
sawine@7
   238
M{\footnotesize oshe} Y. V{\footnotesize ardi and}
sawine@7
   239
A. P{\footnotesize rasad} S{\footnotesize istla}.}
sawine@7
   240
{\em Reasoning about Infinite Computation Paths}.
sawine@7
   241
In Proceedings of the 24th IEEE FOCS, 1983.
sawine@7
   242
sawine@0
   243
\end{thebibliography}
sawine@0
   244
\end{document}