Journal/document/root.tex
author Christian Urban <urbanc@in.tum.de>
Wed, 02 Jan 2019 21:09:05 +0000
changeset 208 a5afc26b1d62
parent 204 5191a09d9928
permissions -rwxr-xr-x
final version
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
20
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 17
diff changeset
     1
%\documentclass{article}
208
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
     2
%\documentclass{llncs}
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
     3
\documentclass{svjour3}
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
     4
27
6b1141c5e24c cleaned up
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 24
diff changeset
     5
\pagestyle{headings}
6
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     6
\usepackage{isabelle}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     7
\usepackage{isabellesym}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     8
\usepackage{amsmath}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
     9
\usepackage{amssymb}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    10
\usepackage{mathpartir}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    11
\usepackage{tikz}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    12
\usepackage{pgf}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    13
\usepackage{pdfsetup}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    14
\usepackage{ot1patch}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    15
\usepackage{times}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    16
\usepackage{stmaryrd}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    17
\usepackage{url}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    18
\usepackage{color}
7
0514be2ad83e started code explanation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    19
\usepackage{courier}
142
10c16b85a839 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 75
diff changeset
    20
\usepackage{endnotes}
32
e861aff29655 made some modifications.
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 27
diff changeset
    21
\usetikzlibrary{patterns}
7
0514be2ad83e started code explanation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    22
\usepackage{listings}
0514be2ad83e started code explanation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    23
\lstset{language=C,
0514be2ad83e started code explanation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    24
        numbers=left,
0514be2ad83e started code explanation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    25
        basicstyle=\small\ttfamily,
0514be2ad83e started code explanation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    26
        numberstyle=\footnotesize, frame=tb}
6
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    27
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    28
\urlstyle{rm}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    29
\isabellestyle{it}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    30
\renewcommand{\isastyleminor}{\it}%
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    31
\renewcommand{\isastyle}{\normalsize\it}%
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    32
7
0514be2ad83e started code explanation
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 6
diff changeset
    33
%%%\titlerunning{Proving the Priority Inheritance Protocol Correct}
6
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    34
\def\dn{\,\stackrel{\mbox{\scriptsize def}}{=}\,}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    35
\renewcommand{\isasymequiv}{$\dn$}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    36
\renewcommand{\isasymemptyset}{$\varnothing$}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    37
\renewcommand{\isacharunderscore}{\mbox{$\_\!\_$}}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    38
\renewcommand{\isasymiota}{}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    39
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    40
\newcommand{\numbered}[1]{\refstepcounter{equation}{\rm(\arabic{equation})}\label{#1}}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    41
\definecolor{mygrey}{rgb}{.80,.80,.80}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    42
20
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 17
diff changeset
    43
%\newtheorem{definition}{Definition}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 17
diff changeset
    44
%\newtheorem{theorem}[definition]{Theorem}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 17
diff changeset
    45
%\newtheorem{lemma}[definition]{Lemma}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 17
diff changeset
    46
%\newtheorem{proof}{Proof}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 17
diff changeset
    47
%\renewcommand{\theproof}{}
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 17
diff changeset
    48
%\newcommand{\qed}{\hfill \mbox{\raggedright \rule{0.1in}{0.1in}}}
6
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    49
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    50
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    51
\begin{document}
208
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    52
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    53
\title{Priority Inheritance Protocol Proved Correct$^\star$\thanks{$^\star$ This paper is a revised, corrected and expanded version of \cite{ZhangUrbanWu12}.
190
312497c6d6b9 updated
Christian Urban <urbanc@in.tum.de>
parents: 142
diff changeset
    54
In Section 4 we improve our previous result by proving a finite bound for Priority Inversion.
312497c6d6b9 updated
Christian Urban <urbanc@in.tum.de>
parents: 142
diff changeset
    55
Moreover, we are giving in this paper
201
fcc6f4c3c32f updated
Christian Urban <urbanc@in.tum.de>
parents: 200
diff changeset
    56
more details about our proof and describe some of our (unverified) C-code for implementing the
fcc6f4c3c32f updated
Christian Urban <urbanc@in.tum.de>
parents: 200
diff changeset
    57
Priority Inversion
fcc6f4c3c32f updated
Christian Urban <urbanc@in.tum.de>
parents: 200
diff changeset
    58
Protocol, as well as surveying 
fcc6f4c3c32f updated
Christian Urban <urbanc@in.tum.de>
parents: 200
diff changeset
    59
the existing literature in more depth.
208
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    60
Our C-code follows closely all results we proved about optimisations of the Priority Inheritance Protocol.}}
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    61
\titlerunning{Priority Inheritance Protocol Proved Correct}
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    62
\author{Xingyuan Zhang \and Christian Urban \and Chunhan Wu}
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    63
\institute{Chunhan Wu \and Xingyuan Zhang \at PLA University of Science and Technology Nanjing, China \and
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    64
Christian Urban \at King's College London, United Kingdom}
6
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    65
\maketitle
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    66
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    67
\begin{abstract}
200
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    68
  In real-time systems with threads, resource locking and priority
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    69
  sched\-uling, one faces the problem of Priority Inversion. This
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    70
  problem can make the behaviour of threads unpredictable and the
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    71
  resulting bugs can be hard to find.  The Priority Inheritance
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    72
  Protocol is one solution implemented in many systems for solving
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    73
  this problem, but the correctness of this solution has never been
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    74
  formally verified in a theorem prover. As already pointed out in the
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    75
  literature, the original informal investigation of the Property
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    76
  Inheritance Protocol presents a correctness ``proof'' for an
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    77
  \emph{incorrect} algorithm. In this paper we fix the problem of this
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    78
  proof by making all notions precise and implementing a variant of a
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    79
  solution proposed earlier. We also generalise the scheduling problem
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    80
  to the practically relevant case where critical sections can
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    81
  overlap. Our formalisation in Isabelle/HOL is based on Paulson's
204
5191a09d9928 updated
Christian Urban <urbanc@in.tum.de>
parents: 201
diff changeset
    82
  inductive approach to  protocol verification.  The formalisation not
200
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    83
  only uncovers facts overlooked in the literature, but also helps
201
fcc6f4c3c32f updated
Christian Urban <urbanc@in.tum.de>
parents: 200
diff changeset
    84
  with an efficient implementation of this protocol. Earlier
200
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    85
  implementations were criticised as too inefficient. Our
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    86
  implementation builds on top of the small PINTOS operating system
ff826e28d85c updated
Christian Urban <urbanc@in.tum.de>
parents: 190
diff changeset
    87
  used for teaching.\medskip
6
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    88
208
a5afc26b1d62 final version
Christian Urban <urbanc@in.tum.de>
parents: 204
diff changeset
    89
\noindent
75
2aa37de77f31 updated paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 35
diff changeset
    90
{\bf Keywords:} Priority Inheritance Protocol, formal correctness proof, 
2aa37de77f31 updated paper
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents: 35
diff changeset
    91
real-time systems, Isabelle/HOL
6
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    92
\end{abstract}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    93
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    94
\input{session}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    95
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    96
%\bibliographystyle{plain}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    97
%\bibliography{root}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    98
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
    99
\end{document}
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   100
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   101
%%% Local Variables:
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   102
%%% mode: latex
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   103
%%% TeX-master: t
7f2493296c39 updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff changeset
   104
%%% End: