paper/src/paper.tex
author Eugen Sawin <sawine@me73.com>
Sun, 10 Jul 2011 00:02:03 +0200
changeset 31 343b7379b1ee
parent 30 1c25f1de63a6
child 32 e9bb32d8cecc
permissions -rw-r--r--
Started with on-the-fly methods.
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@19
    10
%\usepackage{a4wide}
sawine@19
    11
\usepackage[left=3.9cm, right=3.9cm]{geometry}
sawine@5
    12
%\usepackage[T1]{fontenc}
sawine@5
    13
%\usepackage{arev}
sawine@7
    14
%\pagestyle{headings}
sawine@19
    15
sawine@2
    16
\renewcommand{\familydefault}{\sfdefault}
sawine@22
    17
\renewenvironment{proof}{{\bfseries Proof.}}{}
sawine@17
    18
\newcommand{\M}{\mathcal{M}}
sawine@17
    19
\newcommand{\N}{\mathbb{N}_0}
sawine@19
    20
\newcommand{\F}{\mathcal{F}}
sawine@19
    21
\newcommand{\Prop}{\mathcal{P}}
sawine@22
    22
\newcommand{\A}{\mathcal{A}}
sawine@31
    23
\newcommand{\X}{\mathcal{X}}
sawine@31
    24
\newcommand{\U}{\mathcal{U}}
sawine@31
    25
\newcommand{\V}{\mathcal{V}}
sawine@31
    26
\newcommand{\dnf}{\mathsf{dnf}}
sawine@19
    27
sawine@7
    28
\title{\uppercase{\textbf{\Large{A}\large{lgorithmic} \Large{V}\large{erification of} \Large{R}\large{eactive} \Large{S}\large{ystems}}\\
sawine@7
    29
\tiny{Draft}
sawine@7
    30
}}
sawine@7
    31
\author{
sawine@19
    32
\uppercase{{\small{E}\scriptsize{UGEN} \small{S}\scriptsize{AWIN}}\thanks{\lowercase{\scriptsize{\texttt{sawine@informatik.uni-freiburg.de}}}}\\
sawine@19
    33
{\em \small{U}\scriptsize{NIVERSITY OF} \small{F}\scriptsize{REIBURG}}\thanks{\tiny{Computer Science Department, Research Group for Foundations of Artificial Intelligence}}\\
sawine@7
    34
%{\em \small{C}\scriptsize{omputer} \small{S}\scriptsize{cience} \small{D}\scriptsize{epartment}}\\
sawine@7
    35
{\em \small{G}\scriptsize{ERMANY}}}\\
sawine@7
    36
%\texttt{\footnotesize{sawine@informatik.uni-freiburg.de}}
sawine@7
    37
}
sawine@5
    38
\date{\textsc{\hfill}}
sawine@7
    39
sawine@24
    40
\theoremstyle{definition} %plain, definition, remark, proof, corollary
sawine@7
    41
\newtheorem*{def:finite words}{Finite words}
sawine@7
    42
\newtheorem*{def:infinite words}{Infinite words}
sawine@8
    43
\newtheorem*{def:regular languages}{Regular languages}
sawine@8
    44
\newtheorem*{def:regular languages closure}{Regular closure}
sawine@7
    45
\newtheorem*{def:omega regular languages}{$\omega$-regular languages}
sawine@8
    46
\newtheorem*{def:omega regular languages closure}{$\omega$-regular closure}
sawine@11
    47
\newtheorem*{def:buechi automata}{Automata}
sawine@11
    48
\newtheorem*{def:automata runs}{Runs}
sawine@11
    49
\newtheorem*{def:automata acceptance}{Acceptance}
sawine@21
    50
\newtheorem*{def:general automata}{Generalised automata}
sawine@21
    51
\newtheorem*{def:general acceptance}{Acceptance}
sawine@14
    52
\newtheorem*{def:vocabulary}{Vocabulary}
sawine@19
    53
\newtheorem*{def:frames}{Frames}
sawine@18
    54
\newtheorem*{def:models}{Models}
sawine@18
    55
\newtheorem*{def:satisfiability}{Satisfiability}
sawine@30
    56
\newtheorem*{def:fs closure}{Closure}
sawine@22
    57
\newtheorem*{def:atoms}{Atoms}
sawine@28
    58
\newtheorem*{def:rep function}{Representation function}
sawine@31
    59
\newtheorem*{def:next}{Next function}
sawine@31
    60
\newtheorem*{def:dnf}{Dijunctive normal form}
sawine@31
    61
\newtheorem*{def:positive formulae}{Positive formulae}
sawine@14
    62
sawine@22
    63
\theoremstyle{plain}
sawine@21
    64
\newtheorem{prop:vocabulary sat}{Proposition}[section]
sawine@21
    65
\newtheorem{prop:general equiv}{Proposition}[section]
sawine@29
    66
\newtheorem{prop:computation set=language}{Proposition}[section]
sawine@15
    67
sawine@22
    68
\theoremstyle{plain}
sawine@22
    69
\newtheorem{thm:model language}{Theorem}[section]
sawine@24
    70
\newtheorem{cor:mod=model language}{Corollary}[thm:model language]
sawine@29
    71
\newtheorem{cor:mod=program language}[cor:mod=model language]{Corollary}
sawine@30
    72
\newtheorem{thm:model checking}{Theorem}[section]
sawine@31
    73
\newtheorem{lem:dnf}{Lemma}[section]
sawine@22
    74
sawine@0
    75
\begin{document}
sawine@0
    76
\maketitle
sawine@4
    77
\thispagestyle{empty}
sawine@2
    78
%\itshape
sawine@2
    79
%\renewcommand\abstractname{Abstract} 
sawine@0
    80
\begin{abstract}
sawine@28
    81
The algorithmic verification of reactive systems is based on automata-theoretic model checking. Linear temporal logic accommodates the capability for the characterisation of program specifications. For formulae composed in linear temporal logic, it is possible to construct B\"uchi automata constituting the model space of the specification. The verification of reactive systems is composed of such constructions and intersections of the program and specification automata. This paper provides an introduction to the construction techniques of automata and space-efficient on-the-fly verification methods for reactive systems. 
sawine@0
    82
\end{abstract}
sawine@2
    83
%\normalfont
sawine@4
    84
\newpage
sawine@2
    85
\section{Introduction}
sawine@2
    86
sawine@2
    87
sawine@8
    88
\section{$\omega$-regular languages}
sawine@7
    89
\begin{def:finite words}
sawine@24
    90
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
    91
\end{def:finite words}
sawine@7
    92
sawine@8
    93
\begin{def:regular languages}
sawine@8
    94
The class of regular languages is defined recursively over an alphabet $\Sigma$:
sawine@15
    95
\begin{multicols}{2}
sawine@8
    96
\begin{itemize}
sawine@8
    97
\item $\emptyset$ is regular
sawine@8
    98
\item $\{\varepsilon\}$ is regular
sawine@8
    99
\item $\forall_{a \in \Sigma}:\{a\}$ is regular
sawine@8
   100
\end{itemize}
sawine@15
   101
\end{multicols}
sawine@8
   102
\end{def:regular languages}
sawine@8
   103
sawine@8
   104
\begin{def:regular languages closure}
sawine@10
   105
Let $L_{R_1}, L_{R_2} \in \Sigma^*$ be regular. The class of regular languages is closed under following operations:
sawine@15
   106
\begin{multicols}{2}
sawine@8
   107
\begin{itemize}
sawine@8
   108
\item $L_{R_1}^*$
sawine@8
   109
\item $L_{R_1} \circ L_{R_2}$
sawine@8
   110
\item $L_{R_1} \cup L_{R_2}$
sawine@10
   111
\item $L_{R_1} \cap L_{R_2}$
sawine@10
   112
\item $\overline{L}_{R_1}$ and therefore $L_{R_1} - L_{R_2}$
sawine@8
   113
\end{itemize}
sawine@15
   114
\end{multicols}
sawine@8
   115
\end{def:regular languages closure}
sawine@8
   116
sawine@9
   117
\begin{def:infinite words}
sawine@24
   118
$\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
   119
\end{def:infinite words}
sawine@9
   120
sawine@7
   121
\begin{def:omega regular languages}
sawine@8
   122
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
   123
\end{def:omega regular languages}
sawine@7
   124
sawine@8
   125
\begin{def:omega regular languages closure}
sawine@8
   126
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
   127
\begin{itemize}
sawine@8
   128
\item $L_R \circ L_{\omega_1}$, but \emph{not} $L_{\omega_1} \circ L_R$
sawine@8
   129
\item $L_{\omega_1} \cup L_{\omega_2}$, but only \emph{finitely} many times
sawine@8
   130
\end{itemize}
sawine@8
   131
\end{def:omega regular languages closure}
sawine@7
   132
sawine@8
   133
\section{B\"uchi automata}
sawine@11
   134
\begin{def:buechi automata}
sawine@22
   135
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
   136
sawine@22
   137
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
   138
sawine@19
   139
Within this text \emph{automaton} will refer to the non-deterministic B\"uchi automaton, unless otherwise noted. 
sawine@11
   140
\end{def:buechi automata}
sawine@11
   141
sawine@11
   142
\begin{def:automata runs}
sawine@24
   143
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
   144
\end{def:automata runs}
sawine@11
   145
sawine@11
   146
\begin{def:automata acceptance}
sawine@22
   147
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
   148
sawine@22
   149
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
   150
sawine@22
   151
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)$.
sawine@11
   152
\end{def:automata acceptance}
sawine@11
   153
sawine@21
   154
\subsection{Generalised B\"uchi automata}
sawine@21
   155
\begin{def:general automata}
sawine@22
   156
A \emph{generalised B\"uchi automaton} is a tuple $\A = (\Sigma, S, S_0, \Delta, \{F_i\}_{i < k})$ for $i, k \in \N$, where the \emph{acceppting states} $F_i$ are composed within a finite set with $F_i \subseteq S$.
sawine@21
   157
\end{def:general automata}
sawine@21
   158
sawine@21
   159
\begin{def:general acceptance}
sawine@22
   160
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
   161
\end{def:general acceptance}
sawine@21
   162
sawine@21
   163
\begin{prop:general equiv}
sawine@22
   164
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 equivalance condition holds:
sawine@29
   165
\[L_\omega(\A) = \bigcap_{i < k} L_\omega(\A_i)\]
sawine@21
   166
\end{prop:general equiv}
sawine@21
   167
\noindent Intuitively follows the equivalance of the language recognition abilities of general and non-deterministic B\"uchi automata.
sawine@21
   168
sawine@8
   169
\section{Linear temporal logic}
sawine@19
   170
\subsection{Syntax}
sawine@31
   171
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
   172
\[\varphi ::= p \in \Prop \,|\, \neg \varphi \,|\, \varphi \lor \varphi \,|\, \X \varphi \,|\, \varphi \U \varphi\]
sawine@13
   173
sawine@18
   174
\subsection{Interpretation}
sawine@31
   175
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
   176
sawine@13
   177
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
   178
sawine@18
   179
\subsection{Semantics}
sawine@19
   180
\begin{def:frames}
sawine@22
   181
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
   182
\end{def:frames}
sawine@19
   183
sawine@18
   184
\begin{def:models}
sawine@22
   185
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
   186
%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
   187
\end{def:models}
sawine@13
   188
sawine@18
   189
\begin{def:satisfiability}
sawine@19
   190
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
   191
\begin{itemize}
sawine@22
   192
\item $\M,i \models p$ for $p \in \Prop \iff p \in V(i)$
sawine@22
   193
\item $\M,i \models \neg \varphi \iff$ not $\M,i \models \varphi$
sawine@22
   194
\item $\M,i \models \varphi \lor \psi \iff \M,i \models \varphi$ or $\M,i \models \psi$
sawine@31
   195
\item $\M,i \models \X \varphi \iff \M,i+1 \models \varphi$
sawine@31
   196
\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
   197
\end{itemize}
sawine@22
   198
sawine@18
   199
\end{def:satisfiability}
sawine@18
   200
sawine@14
   201
\begin{def:vocabulary}
sawine@22
   202
Let $\varphi$ be an LTL-formula over atomic propositions $\Prop$, we define the \emph{vocabulary} $Voc(\varphi)$ of $\varphi$ inductively:
sawine@15
   203
\begin{multicols}{2}
sawine@14
   204
\begin{itemize}
sawine@19
   205
\item $Voc(p) = \{p\}$ for $p \in \Prop$
sawine@14
   206
\item $Voc(\neg \varphi) = Voc(\varphi)$
sawine@14
   207
\item $Voc(\varphi \lor \psi) = Voc(\varphi) \cup Voc(\psi)$
sawine@31
   208
\item $Voc(\X \varphi) = Voc(\varphi)$
sawine@31
   209
\item $Voc(\varphi \U \psi) = Voc(\varphi) \cup Voc(\psi)$
sawine@14
   210
\end{itemize}
sawine@15
   211
\end{multicols}
sawine@17
   212
%
sawine@22
   213
\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
   214
\[\forall{i \in \N}: V_{Voc(\varphi)}(i) = V(i) \cap Voc(\varphi)\]
sawine@21
   215
Henceforth, we will abbreviate $\M_{Voc(\varphi)}$ and $V_{Voc(\varphi)}$ with $\M_\varphi$ and $V_\varphi$ accordingly. 
sawine@22
   216
%\noindent Let $\M$ be a model and $\varphi$ an LTL-formula, we define model $\M_{Voc(\varphi)}$:
sawine@21
   217
%\[\forall{i \in \N}: \M_{Voc(\varphi)} = \M(i) \cap Voc(\varphi)\]
sawine@17
   218
\end{def:vocabulary}
sawine@17
   219
%
sawine@17
   220
\begin{prop:vocabulary sat}
sawine@22
   221
Let $\M$ be a model and $\varphi$ an LTL-formula, then following holds:
sawine@21
   222
\[\forall{i \in \N}: \M,i \models \varphi \iff \M_\varphi,i \models \varphi\] 
sawine@17
   223
\end{prop:vocabulary sat}
sawine@17
   224
%
sawine@19
   225
\subsection{Derived connectives}
sawine@31
   226
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
   227
sawine@19
   228
Let $\varphi$ and $\psi$ be $L_{LTL}(\Prop)$-formulae:
sawine@15
   229
\begin{multicols}{2}
sawine@15
   230
\begin{itemize}
sawine@19
   231
\item $\top \equiv p \lor \neg p$ for $p \in \Prop$
sawine@15
   232
\item $\bot \equiv \neg \top$
sawine@15
   233
\item $\varphi \land \psi \equiv \neg (\neg \varphi \lor \neg \psi)$
sawine@15
   234
\item $\varphi \rightarrow \psi \equiv \neg \varphi \lor \psi$
sawine@15
   235
\item $\varphi \leftrightarrow \psi \equiv (\varphi \rightarrow \psi) \land (\psi \rightarrow \varphi)$
sawine@31
   236
\item $\Diamond \varphi \equiv \top \U \varphi$
sawine@15
   237
\item $\Box \varphi \equiv \neg \Diamond \neg \varphi$
sawine@15
   238
\end{itemize}
sawine@15
   239
\end{multicols}
sawine@28
   240
\noindent From the derivations for operators $\Diamond$, \emph{read diamond}, and $\Box$, \emph{read box}, it follows:
sawine@17
   241
\begin{multicols}{2}
sawine@16
   242
\begin{itemize}
sawine@31
   243
\item $\M,i \models \Diamond \varphi \iff \exists{k \geq i}: \M,k \models \varphi$
sawine@31
   244
\item $\M,i \models \Box \varphi \iff \forall{k \geq i}: \M,k \models \varphi$
sawine@16
   245
\end{itemize}
sawine@17
   246
\end{multicols}
sawine@19
   247
sawine@28
   248
\noindent With the additional derived connectives we get the following $L_{LTL}(\Prop)$-formulae productions:
sawine@31
   249
\[\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
   250
sawine@21
   251
\section{Automata construction}
sawine@28
   252
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
   253
sawine@28
   254
\subsection{Specification automata}
sawine@28
   255
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
   256
sawine@28
   257
\begin{def:rep function}
sawine@24
   258
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), ...)$. Additionaly, we provide the \emph{inverted representation function} $rep^{-1}: 2^\Prop \to \M$, which compiles an infinite word to the corresponding model, i.e., $rep^{-1}(V_\varphi^\rightarrow(\N)) = \M_\varphi$.
sawine@22
   259
\[Mod(\varphi) = \{rep(\M_\varphi) \mid \M_\varphi = (\F, V_\varphi) \land \M_\varphi,0 \models \varphi\}\]
sawine@21
   260
$Mod(\varphi)$ is the set of all infinite words, which represent models for $\varphi$.
sawine@28
   261
\end{def:rep function}
sawine@21
   262
sawine@22
   263
\begin{def:fs closure}
sawine@30
   264
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
   265
%\begin{multicols}{2}
sawine@22
   266
\begin{itemize}
sawine@30
   267
\item $\varphi \in CL(\varphi)$
sawine@30
   268
\item $\neg \psi \in CL(\varphi) \implies \psi \in CL(\varphi)$
sawine@30
   269
\item $\psi \in CL(\varphi) \implies \neg \psi \in CL(\varphi)$
sawine@30
   270
\item $\psi \lor \chi \in CL(\varphi) \implies \psi, \chi \in CL(\varphi)$
sawine@31
   271
\item $\X \psi \in CL(\varphi) \implies \psi \in CL(\varphi)$
sawine@31
   272
\item $\psi \U \chi \in CL(\varphi) \implies \psi, \chi, \X(\psi \U \chi) \in CL(\varphi)$
sawine@22
   273
\end{itemize}
sawine@22
   274
%\end{multicols}
sawine@22
   275
\end{def:fs closure}
sawine@22
   276
sawine@30
   277
\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@31
   278
\[\mathbb{U}_\varphi = \{\psi \U \chi \in CL(\varphi)\} \text{ and } \mathbb{U}_{\varphi_i} \text{ denotes the $i^{th}$ element of } \mathbb{U_\varphi}\]
sawine@22
   279
sawine@22
   280
\begin{def:atoms}
sawine@30
   281
Let $\varphi$ be a formula and $CL(\varphi)$ its closure. $A \subseteq CL(\varphi)$ is an \emph{atom} if following holds:
sawine@22
   282
\begin{itemize}
sawine@30
   283
\item $\forall{\psi \in CL(\varphi)}: \psi \in A \iff \neg \psi \notin A$
sawine@30
   284
\item $\forall{\psi \lor \chi \in CL(\varphi)}: \psi \lor \chi \in A \iff \psi \in A$ or $\chi \in A$ 
sawine@31
   285
\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
   286
\end{itemize}
sawine@30
   287
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
   288
\end{def:atoms}
sawine@22
   289
sawine@22
   290
\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\}_{i < k})$ with:
sawine@22
   291
\begin{itemize}
sawine@22
   292
\item $\Sigma = 2^{Voc(\varphi)}$
sawine@22
   293
\item $S = \mathbb{AT_\varphi}$
sawine@23
   294
\item $S_0 = \{A \in \mathbb{AT_\varphi} \mid \varphi \in A\}$
sawine@31
   295
%\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
   296
\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
   297
%\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@31
   298
\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\}$ and therefore $k = |\mathbb{U}_{\varphi}|$
sawine@22
   299
%Let $A, B \in \mathbb{AT}$ and $P \subseteq Voc(\varphi)$. Then $(A, P, B) \in \Delta$ iff the following holds:
sawine@31
   300
%$P = A \cap Voc(\varphi)$ and For all $\X \psi \in CL(\varphi): \X \psi \in A$ iff $\psi \in B$.
sawine@22
   301
\end{itemize}
sawine@22
   302
sawine@22
   303
\begin{thm:model language}
sawine@24
   304
\label{thm:model language}
sawine@22
   305
Let $\M_\varphi = (\F, V_\varphi)$ be a model and $rep(\M_\varphi)$ its infinite representation word, then following holds:
sawine@29
   306
\[rep(\M_\varphi) \in L_\omega(\A_\varphi) \iff \M_\varphi,0 \models \varphi\]
sawine@22
   307
\end{thm:model language}
sawine@22
   308
\noindent
sawine@22
   309
\begin{proof}
sawine@22
   310
For the eloberate proof, consult \cite{ref:ltl&büchi}.
sawine@22
   311
\end{proof}
sawine@24
   312
\begin{cor:mod=model language}
sawine@24
   313
\label{cor:mod=model language}
sawine@31
   314
From Theorem \ref{thm:model language} follows $Mod(\varphi) = L_\omega(\A_\varphi)$.
sawine@24
   315
\end{cor:mod=model language}
sawine@21
   316
sawine@28
   317
\subsection{Program automata}
sawine@28
   318
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
   319
sawine@28
   320
We construct automaton $\A_P = (\Sigma, S, S_0, \Delta, F)$, with:
sawine@28
   321
\begin{itemize}
sawine@28
   322
\begin{multicols}{2}
sawine@28
   323
\item $\Sigma = 2^\Prop$
sawine@28
   324
\item $S = S_P$
sawine@29
   325
\item $S_0 = \{s_0\}$
sawine@28
   326
\item $F = S$
sawine@28
   327
\end{multicols}
sawine@28
   328
\item $\Delta = \{(s, V(s), s') \mid \exists{a \in \Prop}: (s, a, s') \in R\}$
sawine@28
   329
\end{itemize}
sawine@29
   330
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
   331
sawine@29
   332
\begin{prop:computation set=language}
sawine@29
   333
\label{prop:computation set=language}
sawine@29
   334
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
   335
\[L_\omega(\A_P) = \{\rho \mid \rho \text{ is a run of } \A_P\}\]
sawine@29
   336
\end{prop:computation set=language}
sawine@29
   337
sawine@29
   338
 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
   339
\[Mod(P) = \{\rho \mid \rho \text{ is a computation of } P\}\]
sawine@29
   340
\begin{cor:mod=program language}
sawine@29
   341
\label{cor:mod=program language}
sawine@31
   342
From Theorem \ref{thm:model language} and Proposition \ref{prop:computation set=language} follows $Mod(P) = L_\omega(\A_P)$.
sawine@29
   343
\end{cor:mod=program language}
sawine@28
   344
sawine@8
   345
\section{Model checking}
sawine@29
   346
For effective automata-theoretic verification of reactive programs, we have modelled the program as a non-deterministic B\"uchi automaton $\A_P$ and the specification formula $\varphi$ as automaton $\A_\varphi$. 
sawine@29
   347
sawine@31
   348
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 contrapositive 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
   349
sawine@30
   350
In conclusion, the essence of model checking lies within the test for emptyness of the intersection between the recognised language of the program automaton and the recognised language of the automaton for its negated specification:
sawine@29
   351
\[L_\omega(\A_P) \cap L_\omega(\A_{\neg \varphi}) = \emptyset\]
sawine@30
   352
sawine@30
   353
\begin{thm:model checking}
sawine@30
   354
\label{thm:model checking}
sawine@30
   355
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
   356
\end{thm:model checking}
sawine@30
   357
sawine@31
   358
From Corollary \ref{cor:mod=model language} and \ref{cor:mod=program language} follows:
sawine@29
   359
\[L_\omega(\A_P) \cap L_\omega(\A_{\neg \varphi}) = \emptyset \iff Mod(P) \cap Mod(\neg \varphi) = \emptyset\]
sawine@29
   360
sawine@30
   361
\subsection{Complexity}
sawine@31
   362
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 asymptotical complexity of the presented automata-theoretic verification method is in time $O(|P| \cdot 2^{O(|\varphi|)})$ \cite{ref:concurrent checking}. 
sawine@30
   363
sawine@31
   364
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, that despite that the upper bound is polynomial in the size of the program, in practice, we are facing exponential growth in complexity \cite{ref:handbook}.
sawine@19
   365
sawine@19
   366
\section{On-the-fly methods}
sawine@31
   367
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 emptyness test. 
sawine@31
   368
sawine@31
   369
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
   370
sawine@31
   371
\begin{def:positive formulae}
sawine@31
   372
Let $\Prop$ be a set of atomic propositions, let $\overline{\Prop} = \{\neg p \mid p \in \Prop\}$ and let us extend the LTL-syntax with the binary operator $\V$ with $\varphi \V \psi \equiv \neg(\neg \varphi \U \psi)$. We define the set of LTL-formulae in \emph{positive form}:
sawine@31
   373
\[\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
   374
\end{def:positive formulae}
sawine@31
   375
sawine@31
   376
\begin{def:next}
sawine@31
   377
Let $\Phi$ be a set of LTL-formulae, we define:
sawine@31
   378
\[next(\Phi) = \{ \X\varphi \mid \X\varphi \in \Phi\} \text{ and } snext(\Phi) = \{ \varphi \mid \X\varphi \in \Phi\}\]
sawine@31
   379
\end{def:next}
sawine@31
   380
sawine@31
   381
\begin{def:dnf}
sawine@31
   382
Let $\Phi^+$ be the set of LTL-formulae in positive form and let $Q = \Prop \cup \overline{\Prop} \cup next(\Phi^+)$, we define function $\dnf: \Phi^+ \to Q$ inductively:
sawine@31
   383
\begin{align*}
sawine@31
   384
&\dnf(\top) &=  &\, \{\emptyset\}\\
sawine@31
   385
&\dnf(\bot) &= &\, \emptyset\\
sawine@31
   386
&\dnf(x) &=  &\, \{\{x\}\}, \text{ for } x = p, \neg p, \X\varphi\\
sawine@31
   387
&\dnf(\varphi \lor \psi) &=  &\, \dnf(\varphi) \cup \dnf(\psi)\\
sawine@31
   388
&\dnf(\varphi \land \psi) &=  &\, \{C \cup D \mid C \in \dnf(\varphi), D \in \dnf(\psi), C \cup D \text{ is consistent}\}\\
sawine@31
   389
&\dnf(\varphi \U \psi) &=  &\, \dnf(\varphi \land \X(\varphi \U \psi)) \cup \dnf(\psi)\\
sawine@31
   390
&\dnf(\varphi \V \psi) &=  &\, \dnf(\varphi \land \psi) \cup \dnf(\psi \land \X(\varphi \V \psi))\\
sawine@31
   391
\end{align*}
sawine@31
   392
\end{def:dnf}
sawine@31
   393
sawine@31
   394
\begin{lem:dnf}
sawine@31
   395
Let $\Phi^+$ be the set of formulae in positive form, following holds:
sawine@31
   396
\[\forall{\varphi \in \Phi^+}: \varphi \iff \bigvee_{D \in \dnf(\varphi)} \bigwedge D\]
sawine@31
   397
\end{lem:dnf}
sawine@19
   398
sawine@0
   399
\begin{thebibliography}{99}
sawine@5
   400
\bibitem{ref:ltl&büchi} 
sawine@6
   401
\uppercase{M{\footnotesize adhavan} M{\footnotesize ukund}.}
sawine@5
   402
{\em Linear-Time Temporal Logic and B\"uchi Automata}.
sawine@2
   403
Winter School on Logic and Computer Science, Indian Statistical Institute, Calcutta, 1997.
sawine@0
   404
sawine@19
   405
\bibitem{ref:alternating verification} 
sawine@19
   406
\uppercase{M{\footnotesize oshe} Y. V{\footnotesize ardi}.}
sawine@19
   407
{\em Alternating Automata and Program Verification}.
sawine@19
   408
Computer Science Today, Volume 1000 of Lecture Notes in Computer Science, Springer-Verlag, Berlin, 1995.
sawine@19
   409
sawine@30
   410
\bibitem{ref:concurrent checking}
sawine@30
   411
\uppercase{O{\footnotesize rna} L{\footnotesize ichtenstein and} A{\footnotesize mir} P{\footnotesize nueli}.}
sawine@30
   412
{\em Checking that finite state concurrent programs satisfy their linear specification}.
sawine@30
   413
Proceeding 12th ACM Symposium on Principles of Programming Languages, New York, 1985.
sawine@30
   414
sawine@7
   415
\bibitem{ref:infpaths}
sawine@7
   416
\uppercase{P{\footnotesize ierre} W{\footnotesize olper}, 
sawine@7
   417
M{\footnotesize oshe} Y. V{\footnotesize ardi and}
sawine@7
   418
A. P{\footnotesize rasad} S{\footnotesize istla}.}
sawine@7
   419
{\em Reasoning about Infinite Computation Paths}.
sawine@7
   420
In Proceedings of the 24th IEEE FOCS, 1983.
sawine@7
   421
sawine@30
   422
\bibitem{ref:handbook} 
sawine@30
   423
\uppercase{P{\footnotesize atrick} B{\footnotesize lackburn}, 
sawine@30
   424
F{\footnotesize rank} W{\footnotesize olter and} J{\footnotesize ohan van} B{\footnotesize enthem}.}
sawine@30
   425
{\em Handbook of Modal Logic (Studies in Logic and Practical Reasoning)}.
sawine@30
   426
3rd Edition, Elsevier, Amsterdam, 2007.
sawine@0
   427
\end{thebibliography}
sawine@0
   428
\end{document}