From 76b637eca195b2149fa8f6035dc3881eeba8a614 Mon Sep 17 00:00:00 2001 From: DavidCok <cok@frontiernet.net> Date: Thu, 27 Sep 2018 13:37:53 +0200 Subject: [PATCH] Initial documentation --- VERSION | 1 + doc/userman/Makefile | 97 +++ doc/userman/biblio.bib | 154 +++++ doc/userman/cealistlogo.jpg | Bin 0 -> 17028 bytes doc/userman/changes.tex | 16 + doc/userman/description.tex | 1146 +++++++++++++++++++++++++++++++++ doc/userman/eacslversion.tex | 2 + doc/userman/fclangversion.tex | 2 + doc/userman/introduction.tex | 26 + doc/userman/limitations.tex | 188 ++++++ doc/userman/macros.tex | 295 +++++++++ doc/userman/main.tex | 99 +++ 12 files changed, 2026 insertions(+) create mode 100644 VERSION create mode 100644 doc/userman/Makefile create mode 100644 doc/userman/biblio.bib create mode 100644 doc/userman/cealistlogo.jpg create mode 100644 doc/userman/changes.tex create mode 100644 doc/userman/description.tex create mode 100644 doc/userman/eacslversion.tex create mode 100644 doc/userman/fclangversion.tex create mode 100644 doc/userman/introduction.tex create mode 100644 doc/userman/limitations.tex create mode 100644 doc/userman/macros.tex create mode 100644 doc/userman/main.tex diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..c042c380 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +Chlorine+ diff --git a/doc/userman/Makefile b/doc/userman/Makefile new file mode 100644 index 00000000..197a040a --- /dev/null +++ b/doc/userman/Makefile @@ -0,0 +1,97 @@ +MAIN=main + +C_CODE=$(wildcard examples/*.[ci]) +VERSION_FILE=../../../../../VERSION +ifeq ("$(wildcard $(VERSION_FILE))", "") +VERSION_FILE=../../VERSION +FC_VERSION+=Chlorine+ +else +#internal mode +FC_VERSION=$(shell cat $(VERSION_FILE)) +endif +FCLANG_VERSION= $(shell cat $(VERSION_FILE)) + +DEPS_MODERN=fclangversion.tex biblio.bib macros.tex \ + introduction.tex \ + provides.tex \ + limitations.tex \ + changes.tex \ + $(C_CODE) \ + $(VERSION_FILE) + +default: main.pdf + +main.pdf: $(DEPS_MODERN) + +EACSL_DIR=../.. +DISTRIB_DIR=$(HOME)/frama-c/doc/www/distrib +install: + mkdir -p $(EACSL_DIR)/doc/manuals/ + cp -f main.pdf $(EACSL_DIR)/doc/manuals/e-acsl-manual.pdf +# cp -f main.pdf \ + $(DISTRIB_DIR)/download/e-acsl/e-acsl-manual-$(EACSL_VERSION).pdf + +include $(EACSL_DIR)/doc/support/MakeLaTeXModern + +fclangversion.tex: Makefile + rm -f $@ + printf '\\newcommand{\\fclangversion}{$(FCLANG_VERSION)\\xspace}\n' > $@ + printf '\\newcommand{\\fcversion}{$(FC_VERSION)\\xspace}\n' >> $@ + chmod a-w $@ + +%.1: %.mp + mpost -interaction=batchmode $< + +%.mps: %.1 + mv $< $@ + +%.pp: %.tex pp + ./pp -utf8 $< > $@ + +%.pp: %.c pp + ./pp -utf8 -c $< > $@ + +%.tex: %.ctex pp + rm -f $@ + ./pp $< > $@ + chmod a-w $@ + +%.bnf: %.tex transf + rm -f $@ + ./transf $< > $@ + chmod a-w $@ + +%_modern.bnf: %.tex transf + rm -f $@ + ./transf -modern $< > $@ + chmod a-w $@ + +%.ml: %.mll + ocamllex $< + +%.pdf: %.tex + pdflatex $* + makeindex $* + bibtex $* + pdflatex $* + pdflatex $* + +%.cmo: %.ml + ocamlc -c $< + +pp: pp.ml + ocamlopt -o $@ str.cmxa $^ + +transf: transf.cmo transfmain.cmo + ocamlc -o $@ $^ + +transfmain.cmo: transf.cmo + +.PHONY: clean + +clean: + rm -rf *~ *.aux *.log *.nav *.out *.snm *.toc *.lof *.pp *.bnf \ + *.haux *.hbbl *.htoc \ + *.cb* *.cm? *.bbl *.blg *.idx *.ind *.ilg \ + transf trans.ml pp.ml pp + rm -f fclangversion.tex diff --git a/doc/userman/biblio.bib b/doc/userman/biblio.bib new file mode 100644 index 00000000..3a444b97 --- /dev/null +++ b/doc/userman/biblio.bib @@ -0,0 +1,154 @@ +@manual{userman, + title = {Frama-C User Manual}, + author = {Loïc Correnson and Pascal Cuoq and Florent Kirchner and + André Maroneze and Virgile Prevosto and + Armand Puccetti and Julien Signoles and + Boris Yakobowski}, + note = {\url{http://frama-c.cea.fr/download/user-manual.pdf}} +} + +@manual{plugin-dev-guide, + author = {Julien Signoles and Loïc Correnson and Matthieu Lemerre and + Virgile Prevosto}, + title = {{Frama-C Plug-in Development Guide}}, + note = {\newline \url{http://frama-c.cea.fr/download/plugin-developer.pdf}}, +} + +@manual{eva, + author = {David B\"uhler and Pascal Cuoq and Boris Yakobowski and + Matthieu Lemerre and André Maroneze and Valentin Perelle and + Virgile Prevosto}, + title = {{EVA} -- The Evolved Value Analysis plug-in}, + note = {\mbox{\url{http://frama-c.cea.fr/download/value-analysis.pdf}}}, +} + +@manual{acsl, + author = {Baudin, Patrick and Filli\^{a}tre, Jean-Christophe and + March\'{e}, Claude and Monate, Benjamin and Moy, Yannick and + Prevosto, Virgile}, + title = {{ACSL: ANSI/ISO C Specification Language.}}, +} + +@manual{acsl-implem, + author = {Baudin, Patrick and Pascal Cuoq and Filli\^{a}tre, Jean-Christophe + and March\'{e}, Claude and Monate, Benjamin and Moy, Yannick and + Prevosto, Virgile}, + title = {ACSL: ANSI/ISO C Specification Language. --- + Frama-C Silicon implementation.}, +} + +@manual{eacsl, + author = {Julien Signoles}, + title = {E-ACSL: Executable ANSI/ISO C Specification Language.}, + note = {\mbox{\url{http://frama-c.com/download/e-acsl/e-acsl.pdf}}} +} + +@manual{eacsl-implem, + author = {Julien Signoles}, + title = {E-ACSL. Implementation in Frama-C Plug-in E-ACSL}, + note = {\mbox{\url{http://frama-c.com/download/e-acsl/e-acsl-implementation.pdf}}} +} + +@inproceedings{sac13, + author = {Micka\"{e}l Delahaye and Nikolai Kosmatov and Julien Signoles}, + title = {Common Specification Language for Static and Dynamic Analysis of + {C} Programs}, + booktitle = {the 28th Annual ACM Symposium on Applied Computing ({SAC})}, + publisher = {ACM}, + year = 2013, + month = mar, + pages = {1230--1235}, +} + + +@inproceedings{rv13tutorial, + author = {Nikolaï Kosmatov and Julien Signoles}, + title = {A Lesson on Runtime Assertion Checking with {Frama-C}}, + booktitle = {International Conference on Runtime Verification ({RV 2013})}, + publisher = {Springer}, + series= {LNCS}, + volume= {8174}, + pages= {386--399}, + year = 2013, + month = sep, +} + +@manual{wp, + author = {Patrick Baudin and François Bobot and Loïc Correnson + and Zaynah Dargaye}, + title = {{Frama-C}'s {WP} plug-in}, + note = {\mbox{\url{http://frama-c.com/download/frama-c-wp-manual.pdf}}}, +} + +@manual{rte, + author = {Philippe Herrmann and Julien Signoles}, + title = {Annotation Generation: {Frama-C}'s {RTE} plug-in}, + note = {\mbox{\url{http://frama-c.com/download/frama-c-rte-manual.pdf}}}, +} + +@article{fac15, +year={2015}, +month={jan}, +journal={Formal Aspects of Computing}, +title={{Frama-C: A Software Analysis Perspective}}, +publisher={Springer}, +keywords={Formal verification; Static analysis; Dynamic analysis; C}, +author={Kirchner, Florent and Kosmatov, Nikolai and Prevosto, Virgile and +Signoles, Julien and Yakobowski, Boris}, +pages={1-37}, +} + +@article{runtime-assertion-checking, + author = {Lori A. Clarke and + David S. Rosenblum}, + title = {A historical perspective on runtime assertion checking in + software development}, + journal = {ACM SIGSOFT Software Engineering Notes}, + volume = {31}, + number = {3}, + year = {2006}, + pages = {25-37}, +} + +@inproceedings{rv13, + author = {Nikolaï Kosmatov and Guillaume Petiot and Julien Signoles}, + title = {An Optimized Memory Monitoring for Runtime Assertion Checking of + {C} Programs}, + booktitle = {International Conference on + Runtime Verification ({RV 2013})}, + publisher = {Springer}, + series = {LNCS}, + volume = {8174}, + pages = {167--182}, + year = 2013, + month = sep, +} + +@inproceedings{jfla15, + title = {{Rester statique pour devenir plus rapide, plus pr{\'e}cis et plus mince}}, + author = {Arvid Jakobsson and Nikolai Kosmatov and Julien Signoles}, + booktitle = {Journées Francophones des Langages Applicatifs (JFLA'15)}, + editor = {David Baelde and Jade Alglave}, + year = {2015}, + month = jan, + note = {In French}, +} + +@article{scp16, + title = {{Fast as a Shadow, Expressive as a Tree: Optimized Memory Monitoring +for C}}, + author = {Arvid Jakobsson and Nikolai Kosmatov and Julien Signoles}, + journal = {Science of Computer Programming}, + publisher = {Elsevier}, + pages = {226-246}, + language = {English}, + year = {2016}, + month = oct, +} + +@article{pldi16, + title = {{Shadow State Encoding for Efficient Monitoring of Block-level +Properties}}, + author = {Kostyantyn Vorobyov and Julien Signoles and Nikolai Kosmatov}, + note = {Submitted for publication}, +} diff --git a/doc/userman/cealistlogo.jpg b/doc/userman/cealistlogo.jpg new file mode 100644 index 0000000000000000000000000000000000000000..966be5a8ff6d50d9a7f50759633ca144c4c5db1c GIT binary patch literal 17028 zcmbum1yEeiwl_MsySux)LvRc3?(Ph3!QFy8!QCaeOK^90g1bXL@;~Q%_ug0as@|*H zQ#G}F_Uc}1_wHH!TlQ!9&o%&AMnYNw00II6kox=p{;UB+0brni+uv`n&jt<&{<lFx zLP9{oK*PeqK*PYm!Xv@M!Xd)Jz#yO?AR-|nqaee=qoScAqkUc@|D6Qn??^Ck=+A-3 za4>M6zyAMhe|i8Y(0~$9RWJ}z04NFw7z)Ur0RRC21ON*5DJ}@$KMe#F3K|9s5**_5 zwk0wE1oV?F7z_+F92^t^;2&~u2oy*t5@=KwVHh+ebW&C$C%1scc?@haE^dkM$wgQq z${Nmjbq$zooRY>s*My|r860v7HT9t2{QB7)N-B0y^Tat0F>w`BGnc@Sg2KM5PfqwC z01$An|B~WU8gK|mC=gIE=+C>-D1YSufrNsGgn{^n=&#tHa*#lNN}=Qgg~o0a@VyQl z1Cx}MO~g4NarTN*Sw%H(hK!tpQ&bI@zk?-a+<RUBXB7bd$pjPy3<V$rILRO-fs<%H zTvgz$cjqkQwqRr_X+>YD<OB7iM*<d6auu|ho5lLwSt>YQ8r5pzS@rE#xjo*Wt31uV zB4(bQUV44)5~LQi9DUi}oex3G&4?XIZK@$Qu+m@Lex;yhYh|HeVIzaM1cETSP@>9B zlBcZSRo-8ou9jREJrHoM%xx_-DeTFf@j5h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TBMQQC?0x3yPc;<u5XJwuD#rg&()j<m1E;__uzbnJ88kj>&eoee z&O$*!Ard4Tfmp`Df=ClN5)mF8fCx8qab|w%y-vW57KkK4>6@Fq4EEx4S)WgN+}P?d z#e$D8#amCKOM8HUD?=ctHom(P1=omXcT!RSCxkS42J$ZGzJj430qK{Uz4Glo__Cgq zfp3bg_P%I1RJT+xQy}2EJSXbxLx}I@58xDL%T!GO%kxe0qMPZXHv2(L%sofP=v12! zyFTl;w}5}S7h}WQ+vV70C6(`Y)jM4~fS-ri<04wuukeP=2)nQ<AU~5C%iYQugvyLv zBgpekYPY8RD{0wr<0^RWMyUR~5#L#O_~qB;{>3JKh69qj^uLs5jVS*`S-Xn3)sEls z(&xQ`g6TcSP<vm61p6%EOX&@wdZ%Fr^`Uuiw1~F(>&KnC9kk@dFq2?y&R;pp4gSiB zeiQui^+BZUxO^4;?PjdI(xUTIPStaGKTor*MYheqa<=-0Ratr{j)MJWTY)Xf&$TqU z9b@dO%Xtu2nUQVec|J%r(46unCFNUU`pX=q>Gn6*3M`U1<qXtOj-IcHz?pSPew5{B z-3O!J=O}jZoCn!60UOaiHIEm$zr25}lE2-K<$m&x5kAgcrT$L`h2SjUb4CT|`~JT( zmgKuz7TnG;3Vu$)LA0K=%JkMa7Wa1)ibZEF&&y&-u=dJb=2_{-{^HEHgJRvktZm$z ziC2zrZ5NU;Y~f<dU8H|MpNSGyAyQECYu1Wkjme52P||bTZ*KbEe6hkL(<er84Wfbt rYgj4bRC8`C(n@7*5HtU*O=)BZ5fdwu_)KH@cZ$vbx+vS=&&vM+0!~4C literal 0 HcmV?d00001 diff --git a/doc/userman/changes.tex b/doc/userman/changes.tex new file mode 100644 index 00000000..cf26227b --- /dev/null +++ b/doc/userman/changes.tex @@ -0,0 +1,16 @@ +\chapter{Changes}\label{chap:changes} + +This chapter summarizes the changes in this documentation between each \fclang +release, with the most recent releases first. + +\begin{itemize} +\item New section \textbf{Additional Verifications}. +\item Update each section with respect to the changes introduced since \eacsl + Sulfur-20180101. +\end{itemize} + +\section*{Frama-C Chlorine-20180101} + +\begin{itemize} +\item First release of this manual. +\end{itemize} diff --git a/doc/userman/description.tex b/doc/userman/description.tex new file mode 100644 index 00000000..57288d32 --- /dev/null +++ b/doc/userman/description.tex @@ -0,0 +1,1146 @@ +The \fclang plug-in intends to provide a full translation of C++ and ACSL++ into the \framac internal representation, and from there be able to be analyzed by other \framac plug-ins. This is a work in progress. The following sections describe the limitations of the current implementation. +\begin{itemize} + \item The plug-in aims for the TBD version of C++ + \item \acslpp is described in the companion \acslpp reference manual, also a part of the \framac release. +\end{itemize} + + +Notes +\begin{itemize} + \item Which version of Clang? + \item Clang (8) support C++98 (except exported templates, later removed) and C++11 and current draft standard for C++1y + \item see https://clang.llvm.org/docs/UsersManual.html\#cxx for supported features in clang C++ +\end{itemize} + +\chapter{Installation} + +TBD - installation instructions + +\chapter{Running the plug-in} + +TBD - including command-line options + +\chapter{Current implementation details and limitations} + +\section{Preprocessing} + +As a refresher, the C/C++ preprocessor (CPP) (cf. \url{https://gcc.gnu.org/onlinedocs/cpp/}) conceptually implements the following operations on a C++ source file: +\begin{itemize} + \item The input is read and broken it into a sequence of physical lines according to the line terminators (ASCII character sequences \\r, \\n, or \\r\\n). + \item Each C trigraph is replaced by its corresponding character. + \item Any backslash-whitespace-line-terminator sequence is removed and the line that it ends is combined with the following line. + \item Comments are replaced by single spaces. This requires tokenizing the input to avoid recognizing comment markers within strings as indicating a comment. Note that this allows block comments to hide line terminations. + \item The input text is divided into preprocessing tokens grouped in logical lines. Each preprocessor token becomes a compiler token (except where \#\# concatenation occurs). However, \acslb tokens are slightly different, as described below. + \item The source text is transformed according to any preprocessing directives contained within it. Each preprocessing directive must be contained within one logical line + +\end{itemize} +The result is a sequence of preprocessing tokens that is passed on to the +remaining compiler phases. + +\subsection{Trigraphs} + +TBD - are these supported by clang? + +\subsection{Preprocessor tokens} +Preprocessor tokens (per CPP) belong to one of five categories. White space (space, tab, TBD) serves only to separate tokens; it is not needed between tokens whose concatenation is not a single token. Line terminators also separate tokens and also delineate certain features: preprocessing directives and string literals do not extend over more than one (logical) line. +\begin{itemize} + \item identifiers: character sequences that match the regular expression \texttt{[a-zA-Z\_][a-zA-Z\_0-9]*} . Dollar signs are allowed as non-digit identifier characters if the clang option \texttt{-fdollars-in-identifiers} is used. (TBD - on by default?) + \item number: character sequences that match the regular expression \texttt{[.]?[0-9]([0-9a-zA-Z.]|[eEpP][+-]))*} . (TBD - dollar signs also allowed?) + \item string literals: character sequence enclosed in " " or ' ' or < >, with \textbackslash " for " in a double-quoted literal (that is not a header file name) and \' for ' in a single-quoted literal. + \item punctuator: all single non-alphanumeric printable characters except \@, \# and `, and all multi-punctuation sequences that meaningful to C/C++ (e.g. >>>= ), but not an arbitrary multi-punctuation character sequence. + \\item other tokens: \@, \#, ` and all non-ASCII single characters. +\end{itemize} +TBD - unicode characters +Note that not all preprocessor tokens are valid C/C++ parser tokens. Tokens in the other category have no meaning to C/C++ and the \texttt{number} category allows many sequences that are not legal C/C++ numeric tokens. These tokens will generally provoke compiler errors. For example in C/C++, 0..2 is one token and is not interpreted as two consecutive numeric tokens. + +\acsl and \acslpp have slightly different tokens than the above, so the preprocessor tokens need to be re-tokenized in some cases: +\begin{itemize} + \item The \@ token is a whitespace character in \acslb. + \item There are some \acslb multi-character punctuator tokens that are not + preprocessor tokens: + \begin{itemize} + \item[] $==>$ (logical implies) + \item[] $-->$ (bit-wise implies) + \item[] $<==>$ (logical equality) + \item[] $<-->$ (bit-wise equality) + \item[] TBD any more? + \end{itemize} + These ACSL/ACSL++ tokens need to be assembled from multiple CPP tokens (and those CPP tokens must not be separated by white space) + \item A CPP numeric token that contains .. will not be a legal C/C++ number, but may be multiple legal \acslb tokens with the .. representing the range operator. For example, the single CPP token \texttt{0..last} is retokenized for \acslb as if it were written \texttt{0 .. last} . + \item \acslb allows certain built-in non-ASCII symbols, namely + \begin{itemize} + \item[] $\forall$ (unicode 0x2200) - universal quantifier + \item[] $\exists$ (unicode 0x2203) - existential quantifier +% \item[] $\equal$ (unicode 0x2261) - equality +% \item[] $\notequal$ (unicode 0x2262) - inequality + \item[] $\leq$ (unicode 0x2264) - less than or equal + \item[] $\geq$ (unicode 0x2265) - greater than or equal +% \item[] $\minus$ (unicode 0x2212) - minus +% \item[] $\implies$ (unicode 0x21D2) - implies +% \item[] $\equiv$ (unicode 0x21D4) - equivalence + \item[] $\bigwedge$ (unicode 0x2227) - logical and + \item[] $\bigvee$ (unicode 0x2228) - logical or + \item[] $\neg$ (unicode 0x00AC) - logical negation +% \item[] $\logicalxor$ (unicode 0x22BB) - logical inequivalence + \item[] $\subset$ (unicode 0x2208) - subset +% \item[] $\Boolean$ (unicode 0x1D539) - set of booleans +% \item[] $\Integer$ (unicode 0x2124) - set of integers +% \item[] $\Real$ (unicode 0x211D) - set of reals + \item TBD - more - ensure unicode equivalent + \end{itemize} +\end{itemize} + +\subsection{Preprocessor directives} +A preprocessing directive consists of a line (after the previous preprocessing phaseshave been completed) that begins with optional white space, the '\#' character, additional optional white space, and a preprocessor directive identifier. +The preprocessing language contains a fixed set of preprocessing directive identifiers: +\begin{itemize} + \item \texttt{define}, \texttt{undef} + \item \texttt{if}, \texttt{ifdef}, \texttt{ifndef}, \texttt{elif}, \texttt{else}, \texttt{endif} + \item \texttt{warning}, \texttt{error} + \item \texttt{include} + \item \texttt{line} + \item \texttt{pragma} +\end{itemize} +In addition, identifiers that have been defined (by a \#define directive) as macros are expanded according to the macro expansion rules (not described here). + +Now ACSL/ACSL++ annotations are contained in C/C++ comments. +Consequently, any directives contained in the annotation are not seen when the source file is processed simply as a C/C++ source file. However, the effect of some directives lasts until the end of the source file. +Accordingly, ACSL++ imposes constrains on the directives that may be present within annotations: +\begin{itemize} + \item \texttt{define} and \texttt{undef} are not permitted in an annotation + \item \texttt{if}, \texttt{ifdef}, \texttt{ifndef}, \texttt{elif}, \texttt{else}, \texttt{endif} are permitted but must be completely nested within the annotation in which they appear (an \#endif and its corresponding \#if/\#ifdef/\#ifndef must be in the same annotation comment.) + \item \texttt{warning} and \texttt{error} are permitted + \item \texttt{include} is permitted, but will cause errors if it contains, as is almost always the case, either \texttt{define} or \texttt{pragma} directives + \item \texttt{line} - TBD + \item \texttt{pragma} is not permitted +\end{itemize} + + + +\section{ACSL++ constructs} + +%This chapter is the core of this manual and describes how to use the \fclang +%plug-in. + + +%% You can still call the option \shortopt{e-acsl-help} to get the list of +%% available options with few lines of documentation. +%First, Section~\ref{sec:simple} shows how to run the plug-in on a toy example, +%compile the generated code with the \gcc compiler and detect invalid +%annotations at runtime. Further, Section~\ref{sec:wrapper} describes \eacslgcc\ +%-- a convenience wrapper script around \framac and \gcc. The aim of this script +%is to simplify instrumentation and compilation of the instrumented code. +%Section~\ref{sec:exec-env} gives additional details on the execution of the +%generated code. Next, Section~\ref{sec:incomplete} focuses on how to deal with +%incomplete programs, \emph{i.e.} in which some functions are not defined or in +%which there are no main function. Section~\ref{sec:combine} explains how to +%combine the \eacsl plug-in with other \framac plug-ins. Finally, +%Section~\ref{sec:custom} introduces how to customize the plug-in, and +%Section~\ref{sec:verbose} details the verbosing policy of the plug-in. + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%\section{Simple Example} % <<< +%\label{sec:simple} +% +%This section is a mini-tutorial which explains from scratch how to use the +%\eacsl plug-in to detect whether an \eacsl annotation is violated at runtime. +% +%% All tool invocations and code listings shown in this section assume a Linux +%% distribution with system-wide \framac installation. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Running \eacsl} +%\label{sec:run} +% +%Consider the following program containing two \eacsl assertions such that +%the first assertion is valid, whereas the second one is not. +% +%\listingname{first.i} +%\cinput{examples/first.i} +% +%Running \eacsl on \texttt{first.i} consists of adding \shortopt{e-acsl} option +%to the \framac command line: +%\begin{shell} +%\$ frama-c -e-acsl first.i +%[kernel] Parsing FRAMAC_SHARE/libc/__fc_builtin_for_normalization.i (no preprocessing) +%[kernel] Parsing FRAMAC_SHARE/e-acsl/e_acsl.h (with preprocessing) +%[kernel] Parsing FRAMAC_SHARE/e-acsl/e_acsl_gmp.h (with preprocessing) +%[kernel] Parsing FRAMAC_SHARE/e-acsl/e_acsl_mmodel_api.h (with preprocessing) +%[kernel] Parsing first.i (no preprocessing) +%[e-acsl] beginning translation. +%<skip a warning when translating the Frama-C libc> +%[e-acsl] translation done in project "e-acsl". +%\end{shell} +% +%Even though \texttt{first.i} has already been pre-processed, \eacsl first asks +%the \framac kernel to process and combine it against several header files +%provided by the \eacsl plug-in. Further \eacsl translates the annotated code +%into a new \framac project named \texttt{e-acsl}\footnote{The notion of +%\emph{project} is explained in Section 8.1 of the \framac user +%manual~\cite{userman}.}. By default, the option \shortopt{e-acsl} does nothing +%more. It is however possible to have a look at the generated code in the +%\framac GUI. This is also possible through the command line thanks to the +%kernel options \shortopt{then-last} and \shortopt{print}. The former +%switches to the last generated project, while the latter pretty prints the \C +%code~\cite{userman}: +% +%\input{examples/instrumented_first.c} +% +%As you can see, the generated code contains additional type declarations, +%constant declarations and global \acsl annotations not present in the initial +%file \texttt{first.i}. They are part of the \eacsl monitoring library. You can +%safely ignore them for now. The translated \texttt{main} function of +%\texttt{first.i} is displayed at the end. After each \eacsl annotation, +%a call to \texttt{\_\_e\_acsl\_assert}\codeidx{e\_acsl\_assert} has been added. +% +%\begin{minipage}{\linewidth} +%\begin{ccode} +% /*@ assert x == 0; */ +% __e_acsl_assert(x == 0,(char *)"Assertion",(char *)"main",(char *)"x == 0",3); +% /*@ assert x == 1; */ +% __e_acsl_assert(x == 1,(char *)"Assertion",(char *)"main",(char *)"x == 1",4); +%\end{ccode} +%\end{minipage} +% +%Each call to \texttt{\_\_e\_acsl\_assert}\codeidx{e\_acsl\_assert}, function +%defined by the \eacsl monitoring library, dynamically verifies the validity of +%the corresponding assertion. In other words, it checks that its first argument +%(here \texttt{x == 0} or \texttt{x == 1}) is not equal to 0 and fails +%otherwise. The extra arguments are used to display error reports as shown in +%Section~\ref{sec:exec}. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Executing the generated code} +%\label{sec:exec} +% +%Using \shortopt{ocode} \framac~\cite{userman} option, the code generated by the +%\eacsl plug-in can be redirected into a file as follows: +%\begin{shell} +%\$ frama-c -e-acsl first.i -then-last -print -ocode monitored_first.c +%\end{shell} +% +%\framac uses architecture-dependent configuration which +%affects sizes of integer types, endianness and potentially other features. It +%can be seen that the code generated from \texttt{first.i} (shown in the +%previous section) defines \C type \texttt{size\_t} as \texttt{unsigned int}, whereas +%in 64-bit architectures \texttt{size\_t} is typically defined as +%\texttt{unsigned long}. Architecture used during \framac translation is +%controlled through \framac \shortopt{machdep} option that specifies the +%architecture type to use during translation. The default value of +%\shortopt{machdep} is \texttt{x86\_32} (a generic 32-bit x86 architecture). +%Note that since code generated by \eacsl is aimed at being compiled it is +%important that the architecture used by \framac matches the architecture +%corresponding to your compiler and your system. For instance, in a 64-bit +%machine you should also pass +%\shortopt{machdep} \texttt{x86\_64} option as follows: +%\begin{shell} +% \$ frama-c -machdep x86_64 -e-acsl first.i -then-last \ +% -print -ocode monitored_first.c +%\end{shell} +% +%This file can be compile with a \C compiler (for instance \gcc), as follows: +% +%\lstset{escapechar=£} +%\begin{shell} +%\$ gcc -c -Wno-attributes monitored_first.c +%\end{shell} +% +%However, creating an executable through a proper invokation to \gcc is painful +%and is not documented. Instead, \eacsl comes with a companion wrapper script for +%this purpose. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%>>> +%\section{\eacsl Wrapper Script} % <<< +%\label{sec:wrapper} +% +%\begin{important}\index{Gcc} +% Presently, \eacslgcc is a recommended way of running the \eacsl plug-in. +% This manual further describes features of the \eacsl plug-in using \eacslgcc +% as its main driver for source code instrumentation and compilation of the +% instrumented programs. +%\end{important} +% +%In this section we describe \eacslgcc and provide several examples of its use. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\subsection{Standard Usage} +% +%The default behaviour of \eacslgcc is to instrument an annotated C program +%with runtime assertions via a run of \framac. +% +%\begin{shell} +% \$ e-acsl-gcc.sh -omonitored_first.i first.i +%\end{shell} +% +%The above command instruments \texttt{first.i} with runtime assertions and +%outputs the generated code to \texttt{monitored\_first.i}. Unless the name of +%the output file is specified via the \shortopt{o} option (i.e., +%\shortopt{-omonitored\_first.i} in the above example), the generated +%code is placed to a file named \texttt{a.out.frama.c}. +% +%Compilation and Linking of the original and the instrumented sources +%is enabled using the \shortopt{c} option. For instance, command +% +%\begin{shell} +% \$ e-acsl-gcc.sh -c -omonitored_first.i first.i +%\end{shell} +% +%instruments the code in \texttt{first.i}, outputs it to +%\texttt{monitored\_first.i} and produces 2 executables: \texttt{a.out} and +%\texttt{a.out.e-acsl}, such that \texttt{a.out} is an executable compiled from +%\texttt{first.i}, while \texttt{a.out.e-acsl} is an executable compiled from +%\texttt{monitored\_first.i} generated by \eacsl. +% +%You can execute the generate binaries, in particular \texttt{a.out.e-acsl} which +%detects at runtime the incorrect annotation. +%\begin{shell} +%\$ ./a.out.e-acsl +%Assertion failed at line 4 in function main. +%The failing predicate is: +%x == 1. +%Aborted +%\$ echo \$? +%134 +%\end{shell} +%The execution aborts with a non-zero exit code (134) and an error message +%indicating \eacsl annotation that has been violated. There is no output for the +%valid \eacsl annotation. That is, the run of an executable generated from the +%instrumented source file (i.e., \texttt{monitored\_first.i}) detects that the +%second annotation in the initial program is invalid, whereas the first +%annotation holds for this execution. +% +%Named executables can be created using the \shortopt{O} option. This is such +%that a value supplied to the \shortopt{O} option is used to name the executable +%generated from the original program and the executable generated from the +%\eacsl-instrumented code is suffixed \texttt{.e-acsl}. +% +%For example, command +%\begin{shell} +% \$ e-acsl-gcc.sh -c -omonitored_first.i -Omonitored_first first.i +%\end{shell} +%names the executables generated from \texttt{first.i} and +%\texttt{monitored\_first.i}: \texttt{monitored\_first} and +%\texttt{monitored\_first.e-acsl} respectively. +% +%The \eacslgcc \shortopt{C} option allows to skip the instrumentation step and +%compile a given program as if it was already instrumented by the \eacsl +%plug-in. This option is useful if one makes changes to an already +%instrumented source file by hand and only wants to recompile it. +% +%\begin{shell} +% \$ e-acsl-gcc.sh -C -Omonitored_first monitored_first.i +%\end{shell} +% +%The above command generates a single executable named +%\texttt{monitored\_first.e-acsl}. This is because \texttt{monitored\_first.i} is +%considered to be instrumented code and thus no original program is provided. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\subsection{Customising \framac and \gcc Invocations} +% +%By default \eacslgcc uses \T{frama-c} and \T{gcc} executables by looking them +%up in a system's path. If either of the tools are not found the script fails +%with an appropriate error message. Paths to \framac and \gcc executables can +%also be passed using \shortopt{I} and \shortopt{G} options +%respectively, for instance as follows: +% +%\begin{shell} +% \$ e-acsl-gcc.sh -I/usr/local/bin/frama-c -G/usr/bin/gcc6 foo.c +%\end{shell} +% +%Runs of \framac and \gcc issued by \eacslgcc can further be customized by using +%additional flags. \framac flags can be passed using the \shortopt{F} option, +%while \shortopt{l} and \shortopt{e} options allow for passing additional +%pre-processor and linker flags during \gcc invocations. For example, command +% +%\begin{shell} +% \$ e-acsl-gcc.sh -c -F"-unicode" -e"-I/bar -I/baz" foo.c +%\end{shell} +% +%yields an instrumented program \texttt{a.out.frama.c} where ACSL formulas +%are output using the UTF-8 character set. Further, during the compilation of +%\texttt{a.out.frama.c} \gcc adds directories \texttt{/bar} and +%\texttt{/baz} to the list of directories to be searched for header files. +% +%It is worth mentioning that \eacslgcc implements several convenience flags for +%setting some of the \framac options. For instance, \shortopt{E} can be used to +%pass additional arguments to the \framac pre-processor (see +%Section~\ref{sec:eacsl-gcc:doc}). +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\subsection{Verbosity Levels and Output Redirection} +% +%By default \eacslgcc prints the executed \framac and \gcc commands and pipes +%their output to the terminal. The verbosity of \framac output can be changed +%using \shortopt{v} and \shortopt{d} options used to pass values to +%\shortopt{verbose} and \shortopt{debug} flags of \framac respectively. For +%instance, to increase the verbosity of plug-ins but suppress the verbosity of +%the \framac kernel while instrumenting \texttt{foo.c} one can use the following +%command: +% +%\begin{shell} +% \$ e-acsl-gcc.sh -v5 -F"-kernel-verbose 0" foo.c +%\end{shell} +% +%Verbosity of the \eacslgcc output can also be reduced using the \shortopt{q} +%option that suppresses any output except errors or warnings issued by \gcc, +%\framac, and \eacslgcc itself. +% +%The output of \eacslgcc can also be redirected to a specified file using the +%\shortopt{s} option. For example, the following command redirects all +%output during instrumentation and compilation of \texttt{foo.c} to the +%file named \texttt{/tmp/log}. +% +%\begin{shell} +% \$ e-acsl-gcc.sh -c -s/tmp/log foo.c +%\end{shell} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\subsection{Architecture Dependency} +% +%As pointed out in Section~\ref{sec:exec} the execution of a \C program depends +%on the underlying machine architecture it is executed on. The program must be +%compiled on the very same architecture (or cross-compiled for it) for the +%compiler being able to generate a correct binary. +% +%\framac makes assumptions about the machine architecture when analyzing source +%code. By default, it assumes an X86 32-bit platform, but it can be customized +%through \shortopt{machdep} switch~\cite{userman}. This option is of primary +%importance when using the \eacsl plug-in: it must be set to the value +%corresponding to the machine architecture which the generated code will be +%executed on, otherwise the generated program is likely to fail to link against +%the \eacsl library. Note that the library is built using the default +%machine architecture. +% +%One of the benefits of using the wrapper script is that it makes sure that +%\framac is invoked with the correct \shortopt{machdep} option. By default +%\eacslgcc uses \shortopt{machdep gcc\_x86\_64} for 64-bit architectures and +%\shortopt{machdep gcc\_x86\_32} for 32-bit ones. Compiler invocations are +%further passed \shortopt{m64} or \shortopt{m32} options to generate code using +%64-bit or 32-bit ABI respectively. +% +%At the present stage of implementation \eacsl does not support generating +%executables with ABI different to the default one. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\subsection{Documentation}\label{sec:eacsl-gcc:doc} +% +%For full up-to-date documentation of \eacslgcc see its man page: +% +%\begin{shell} +% \$ man e-acsl-gcc.sh +%\end{shell} +% +%Alternatively, you can also use the \shortopt{h} option of \eacslgcc: +% +%\begin{shell} +% \$ man e-acsl-gcc.sh -h +%\end{shell} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%>>> +%\section{Execution Environment of the Generated Code} %<<< +%\label{sec:exec-env} +% +%The environment in which the code is executed is not necessarily the same as +%the one assumed by \framac. You should take care of that when running the \eacsl +%plug-in and when compiling the generated code with \gcc. In this aspect, the +%plug-in offers a few possibilities of customization. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Runtime Errors in Annotations} +%\label{sec:runtime-error} +%\index{Runtime Error} +% +%The major difference between \acsl~\cite{acsl} and \eacsl~\cite{eacsl} +%specification languages is that the logic is total in the former while it is +%partial in the latter one: the semantics of a logic construct $c$ denoting a \C +%expression $e$ +%is undefined if $e$ leads to a runtime error and, consequently, the semantics of +%any term $t$ (resp. predicate $p$) containing such a construct $c$ is +%undefined as soon as $e$ has to be evaluated in order to evaluate $t$ +%(resp. $p$). The \eacsl Reference Manual also states that \emph{``it is the +%responsibility of each tool which interprets \eacsl to ensure that an +%undefined term is never evaluated''}~\cite{eacsl}. +% +%Accordingly, the \eacsl plug-in prevents an undefined term from being +%evaluated. If an annotation contains such a term, \eacsl will report a proper +%error at runtime instead of evaluating it. +% +%Consider for instance the following annotated program. +% +%\listingname{rte.i} +%\cinput{examples/rte.i} +% +%The terms and predicates containing the modulo `\%' in the \T{assumes} clause +%are undefined in the context of the \T{main} function call since the second +%argument is equal to 0. However, we can generate an instrumented code and +%compile it using the following command: +% +%\begin{shell} +%\$ e-acsl-gcc.sh -c -omonitored_rte.i -Orte rte.i +%\end{shell} +% +%Now, when \T{rte.e-acsl} is executed, you get the following output indicating +%that your function contract is invalid because it contains a division by zero. +% +%\begin{shell} +%\$ ./rte.e-acsl +%RTE failed at line 5 in function is_dividable. +%The failing predicate is: +%division_by_zero: y != 0. +%Aborted +%\end{shell} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Libc}\index{Libc} +% +%By default, \framac uses its own standard library (\emph{aka} libc) instead of +%the one of your system. If you do not want to use it, you have to add the option +%\shortopt{no-framac-stdlib}\optionidx{-}{framac-stdlib} to the \framac command +%line. +% +%It might be particularly useful in one of the following contexts: +%\begin{itemize} +%\item several libc functions used by the analyzed program are still not defined +% in the \framac libc; or +%\item your system libc and the \framac libc mismatch about several function +% types (for instance, your system libc is not 100\% POSIX compliant); or +%\item several \framac lib functions get a contract and you are not interested in +% verifying them (for instance, only checking undefine behaviors matters). +%\end{itemize} +% +%\begin{important} \index{eacslgcc} +%Notably, \eacslgcc disables \framac libc by default. This is because most of +%its functions are annotated with \eacsl contracts and generating code for +%these contracts results in additional runtime overheads. To enforce default +%\framac contracts with \eacslgcc you can pass \shortopt{L} option to the wrapper +%script. +%\end{important} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Integers} +%\label{sec:integers} +%\index{GMP} +% +%\eacsl uses an \texttt{integer}\codeidx{integer} type corresponding to +%mathematical integers which does not fit in any integral \C type. To circumvent +%this issue, \eacsl uses the \gmp library\footnote{\url{http://gmplib.org}}. +%Thus, even if \eacsl does its best to use standard integral types instead of +%\gmp~\cite{sac13,jfla15}, it may generate such integers from time to time. It is +%notably the case if your program contains \lstinline|long long|, either signed +%or unsigned. +% +%Consider for instance the following program. +% +%\listingname{gmp.i} +%\cinput{examples/gmp.i} +% +%Even on a 64-bit machine, it is not possible to compute the assertion with a +%standard \C type. In this case, the \eacsl plug-in generates \gmp code. Note +%that E-ACSL library already includes \gmp, thus no additional arguments need to +%be provided. We can generate and execute the instrumented code as usual via +%the following command: +% +%\begin{shell} +%\$ e-acsl-gcc.sh -omonitored_gmp.i -Ogmp gmp.i +%\$ ./gmp.e-acsl +%\end{shell} +% +%Since the assertion is valid, there is no output in this case. +% +%Note that it is possible to use \gmp arithmetic in all cases (even if not +%required). This option is controlled through \shortopt{g} switch of \eacslgcc +%which passes the \shortopt{e-acsl-gmp-only} option to the \eacsl +%plug-in. However it could slow down the execution of the instrumented program +%significantly. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Memory-related Annotations} +%\label{sec:memory} +% +%The \eacsl plug-in handles memory-related annotations such as +%\lstinline|\valid|. Consider for instance the following program. +% +%\listingname{valid.c} +%\cinput{examples/valid.c} +% +%Even though the first annotation holds, the second annotation (labelled +%\I{freed}) is invalid. This is because at the point of its execution memory +%allocated via \texttt{malloc} has been deallocated and \T{x} is a stale pointer +%referencing unallocated memory. The execution of the instrumented program thus +%reports the violation of the second annotation: +% +%\begin{shell} +%\$ e-acsl-gcc.sh -c -Ovalid valid.c +%\$ ./valid.e-acsl +%Assertion failed at line 11 in function main. +%The failing predicate is: +%freed: \valid(x). +%Aborted +%\end{shell} +% +%To check memory-related predicates (such as \lstinline|\valid|) \eacsl tracks +%memory allocated by a program at runtime. \eacsl records memory blocks in a +%meta-storage tracking each block's boundaries (i.e., its base address and +%length), per-byte initialization and the notion of an address being freeable +%(i.e., whether it can be safely passed to the \texttt{free} function). During +%an execution of the instrumented program code injected by \eacsl +%transformations queries the meta-storage to identify properties of an address +%in question. For instance, during the execution of the above program the +%monitor injected by \eacsl first records information about the memory block +%allocated via a call to \texttt{malloc}. Further, during the execution of the +%first assertion the monitor queries the meta-storage about the address of the +%memory location pointed to by \texttt{x}. Since the location belongs to an +%allocated memory block, the meta-storage identifies it as belonging to the +%tracked allocation. Consequently, the assertion evaluates to true and the +%monitors allows the execution to continue. The second assertion, however, +%fails. This is because the block pointed to by \T{x} has been removed from the +%meta-storage by a call to \T{free}, and thus a meta-storage query identifies +%location \T{x} as belonging unallocated memory space. +% +%\subsubsection{\eacsl Memory Models} +% +%Memory tracking implemented by the \eacsl library comes in two flavours dubbed +%\I{bittree-based} and \I{segment-based} memory models. With the bittree-based +%model meta-storage is implemented as a compact prefix trie called Patricia +%trie~\cite{rv13}, whereas segment-based memory model +%\footnote{Segment-based model of \eacsl has not yet appeared in the literature.} +%is based on shadow memory~\cite{pldi16}. The functionality of the provided +%memory models is equivalent, however they differ in performance. We further +%discuss performance considerations. +% +%The \eacsl models allocate heap memory using a customized version of the +%\dlmalloc\footnote{\url{http://dlmalloc.net/}} memory allocator replacing +%system-wide \T{malloc} and similar functions (e.g., \T{calloc} or \T{free}). +% +%At the level of \eacslgcc you can choose between different memory models using +%the \shortopt{m} switch followed by the name of the memory model to link +%against. For instance, command +%\begin{shell} +%\$ e-acsl-gcc.sh -mbittree -c -Ovalid valid.c +%\end{shell} +%links a program generated from \T{valid.c} against the library implementing the +%bittree-based memory model, whereas the following invocation uses shadow-based +%tracking: +%\begin{shell} +%\$ e-acsl-gcc.sh -msegment -c -Ovalid valid.c +%\end{shell} +%It is also possible to generate executables using both models as follows: +%\begin{shell} +%\$ e-acsl-gcc.sh -msegment,bittree -c -Ovalid valid.c +%\end{shell} +%In this case, \eacslgcc produces 3 executables: \T{valid}, +%\T{valid.e-acsl-segment} and \T{valid.e-acsl-bittree} corresponding to an +%executable generated from the original source code, and the executables +%generated from the \eacsl-instrumented sources linked against +%segment-based and bittree-based memory models. +% +%Unless specified, \eacsl defaults to the segment-based memory model. +% +%\subsubsection{Performance Considerations} +%\label{sec:perf} +% +%As pointed out in the previous section the functionalities provided by both +%segment-based and bittree-based memory models are equivalent but differ in +%performance. The bittree-based model uses compact memory representation of +%metadata. The segment-based model on the other hand uses significantly more +%memory. You can expect over 2x times memory overheads when using it. However It +%is often an order of magnitude faster than the bittree-based +%model~\cite{pldi16}. +% +%%[Need ref here with comparison of the performance. Ideally a reference to the PLDI paper]. +% +%\subsubsection{Maximized Memory Tracking} +% +%By default \eacsl uses static analysis to reduce instrumentation and therefore +%runtime and memory overheads~\cite{scp16}. With respect to memory tracking this +%means that +%\eacsl may omit recording memory blocks irrelevant for runtime analysis. It +%is, however, still possible to systematically instrument the code for handling +%potential memory-related annotations even when it is not required. This +%feature can be enabled using the \shortopt{M} switch of \eacslgcc or +%\shortopt{e-acsl-full-mmodel} option of the \eacsl plug-in. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%% \subsection{Debug Libraries} +%%% \label{sec:runtime-debug} +% +%%% \eacsl memory models mentioned in Section~\ref{sec:memory} are optimized for +%%% performance (via \shortopt{-O2} compiler flag). An \eacsl installation also +%%% provides unoptimized versions of these libraries (suffixed \T{-dbg.a}) aimed at +%%% being used during debugging. +% +%%% The main difference between unoptimized (debug) and optimized (production) +%%% libraries is that debug libraries include assertions validating the correctness +%%% of the RTL itself. For instance, during memory tracking such assertions ensure +%%% that during a run of a program all tracked memory blocks are disjoint. +% +%%% Consider the following program that violates an annotation +%%% in function \T{foo} via a call \T{bar(p+1)} in the main function: +% +%%% \listingname{rte\_debug.i} +%%% \cinput{examples/rte_debug.i} +% +%%% A monitored executable linked against a debug version of \eacsl RTL +%%% can ge generated using +%%% \longopt{rt-debug} flag of \eacslgcc as follows: +% +%%% \begin{shell} +%%% \$ e-acsl-gcc.sh --rt-debug -c -omonitored_rte_debug.c -Orte_debug rte_debug.i +%%% \end{shell} +% +%%% A run of the monitored executable shows violation of the \eacsl annotation. +%%% \begin{shell} +%%% \$ rte_debug.e-acsl +%%% Assertion failed at line 2 in function foo. +%%% The failing predicate is: +%%% \valid(p). +%%% /** Backtrace **************************/ +%%% trace at e_acsl_trace.h:45 +%%% - exec_abort at e_acsl_assert.h:58 +%%% - runtime_assert at e_acsl_assert.h:93 +%%% - foo at monitored_rte_debug.c:92 +%%% - bar at monitored_rte_debug.c:102 +%%% - main at monitored_rte_debug.c:119 +%%% /***************************************/ +%%% Aborted +%%% \end{shell} +% +%%% A run of an executable linked against an unoptimized RTL shows a stack trace on +%%% the instrumented program saved to \T{monitored\_rte\_debug.c}. In the example +%%% above calls to \T{exec\_abort} and \T{runtime\_assert} belong to the \eacsl +%%% RTL, whereas calls to \T{foo}, \T{bar} and \T{main} belong to the input +%%% program. +% +%%% It should be noted that because debug versions of \eacsl RTL are compiled +%%% without compile-time optimizations and execute additional assertions the +%%% runtime overheads of the instrumented programs linked against the debug +%%% versions of \eacsl RTL can be up to 10 times greater than those linked against +%%% the production versions. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Runtime Monitor Behavior} +% +%When a predicate is checked at runtime function +%\texttt{\_\_e\_acsl\_assert}\codeidxdef{e\_acsl\_assert} is called. By +%default this function does nothing if the predicate is valid, and prints +%an error message and aborts the execution (by raising an \texttt{ABORT} +%signal via a call to the \C function \texttt{abort}) if the predicate is invalid. +% +%The default behavior of \texttt{\_\_e\_acsl\_assert}\codeidxdef{e\_acsl\_assert} +%can be altered using \longopt{fail-with-code=CODE} option of \eacslgcc +%that uses \texttt{exit(CODE)} instead of \texttt{abort}. +% +%For instance, the program generated using the following command +%exits with code \texttt{5} on a predicate violation. +%\begin{shell} +% \$ e-acsl-gcc.sh -c --fail-with-code=5 foo.c +%\end{shell} +% +%Forceful termination of a monitored program can be disabled using +%\longopt{keep-going} option. If specified, \eacslgcc generates code that +%reports each property violated at runtime but allows the monitored program to +%continue execution. \longopt{keep-going} should be used with caution: +%such unterminated executions may lead to incorrect verification results. +% +%\eacslgcc also provides a way to use an alternative definition of +%\texttt{\_\_e\_acsl\_assert}\codeidxdef{e\_acsl\_assert}. +% +%Custom implementation of \texttt{\_\_e\_acsl\_assert}\codeidxdef{e\_acsl\_assert} +%should be provided in a separate \C (or object file) and respect the +%following signature: +% +%\cinput{examples/assert_sign.c} +% +%Below is an example which prints the validity status of each property but never +%exits. +% +%\listingname{my\_assert.c} +%\cinput{examples/my_assert.c} +% +%A monitored program that uses custom definition of +%\texttt{\_\_e\_acsl\_assert}\codeidxdef{e\_acsl\_assert} can then be generated +%as follows using \longopt{external-assert} option of \eacslgcc to replace the +%default implementation of \texttt{\_\_e\_acsl\_assert}\codeidxdef{e\_acsl\_assert} +%with the customized one specified in \texttt{my\_assert.c} +% +%\begin{shell} +%\$ e-acsl-gcc.sh -c first.i my_assert.c -Ofirst --external-assert=my\_assert.c +%\$ ./first.e-acsl +%Assertion at line 3 in function main is valid. +%The verified predicate was: `x == 0'. +%Assertion at line 4 in function main is invalid. +%The verified predicate was: `x == 1'. +%\end{shell} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%>>> +%\section{Additional Verifications} % <<< +% +%In addition to checking annotations at runtime, \eacsl is able to detect a few +%errors at runtime. +% +%\subsection{Format String Vulnerabilities} +%\index{Format String Vulnerabilities} +% +%Whenever option \longopt{validate-format-strings} of \eacslgcc is set, \eacsl +%detects format-string vulnerabilities in \texttt{printf}-like function. Below is +%an example which incorrectly tries to print a string through a \texttt{\%d} +%format. +% +%\listingname{printf.c} +%\cinput{examples/printf.c} +% +%This error can be detected by \eacsl as follows. +% +%\begin{shell} +%\$ e-acsl-gcc.sh -Oprintf -c --validate-format-strings printf.c +%\$ ./printf.e-acsl +%printf: directive 1 ('%d') expects argument of type 'int' but the corresponding +%argument has type 'char*' +%Abort +%\end{shell} +% +%\subsection{Incorrect Usage of Libc Functions} +%\index{Libc} +% +%Whenever option \longopt{libc-replacements} of \eacslgcc is set, \eacsl is +%able to detect incorrect usage of the following libc functions: +%\begin{itemize} +%\item \texttt{memcmp} +%\item \texttt{memcpy} +%\item \texttt{memmove} +%\item \texttt{memset} +%\item \texttt{strcat} +%\item \texttt{strncat} +%\item \texttt{strcmp} +%\item \texttt{strcpy} +%\item \texttt{strncpy} +%\item \texttt{strlen} +%\end{itemize} +% +%For instance, the program below incorrectly uses \texttt{strcpy} because the +%destination string should contain at least 7 \texttt{char} (and not only 6). +% +%\listingname{strcpy.c} +%\cinput{examples/strcpy.c} +% +%This error can be reported by \eacsl as follows. +% +%\begin{shell} +%\$ e-acsl-gcc.sh -Ostrcpy -c --libc-replacements strcpy.c +%\$ ./strcpy.e-acsl +%strlen: insufficient space in destination string, at least 7 bytes required +%Abort +%\end{shell} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%>>> +%\section{Incomplete Programs} % <<< +%\label{sec:incomplete} +% +%Executing a \C program requires to have a complete application. However, the +%\eacsl plug-in does not necessarily require to have it to generate the +%instrumented code. It is still possible to instrument a partial program with no +%entry point or in which some functions remain undefined. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Programs without Main} +%\label{sec:no-main} +%\index{Program!Without main} +% +%The \eacsl plug-in can instrument a program without the \T{main} function. +%Consider for instance the following annotated program without \texttt{main}. +% +%\listingname{no\_main.i} +%\cinput{examples/no_main.i} +% +%The instrumented code is generated as usual, even though you get an additional +%warning. +%\begin{shell} +%\$ e-acsl-gcc.sh no_main.i -omonitored_no_main.i +%<skip preprocessing command line> +%[e-acsl] beginning translation. +%[e-acsl] warning: cannot find entry point `main'. +% Please use option `-main' for specifying a valid entry point. +% The generated program may miss memory instrumentation. +% if there are memory-related annotations. +%[e-acsl] translation done in project "e-acsl". +%\end{shell} +% +%This warning indicates that the instrumentation could be incorrect if the +%program contains memory-related annotations (see +%Section~\ref{sec:limits:no-main}). That is not the case here, so you can +%safely ignore it. Now, it is possible to compile the generated code with a \C +%compiler in a standard way, and even link it against additional files such as +%the following: +% +%\listingname{main.c} +%\cinput{examples/main.c} +% +%\begin{shell} +%\$ e-acsl-gcc.sh -C monitored_no_main.i main.c -Owith_main +%\$ ./with_main.e-acsl +%x = 65536 +%\end{shell} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%\ +%\subsection{Undefined Functions} +%\label{sec:no-code} +%\index{Function!Undefined} +% +%Similar to the above section \eacsl is capable of instrumenting a program which +%has definitions of arbitrary functions missing. Consider for instance the +%following annotated program for which the implementation of the function +%\texttt{my\_pow} is not provided. +% +%\listingname{no\_code.c} +%\cinput{examples/no_code.c} +% +%The instrumented code is generated as usual, even though you get an additional +%warning. +%\begin{shell} +%\$ e-acsl-gcc.sh -omonitored_no_code.i no_code.c +%[e-acsl] beginning translation. +%[e-acsl] warning: annotating undefined function `my_pow': +% the generated program may miss memory instrumentation +% if there are memory-related annotations. +%no_code.c:9:[kernel] warning: No code nor implicit assigns clause for function my_pow, +%generating default assigns from the prototype +%[e-acsl] translation done in project "e-acsl". +%\end{shell} +% +%Similar to the previous Section the warning indicates that the instrumentation +%could be incorrect if the program contains memory-related annotations (see +%Section~\ref{sec:limits:no-code}). That is still not the case here, so you can +%safely ignore it. +% +%\listingname{pow.i} +%\cinput{examples/pow.i} +% +%Similar to the example shown in the previous section you can generate the +%executable by providing definition of \T{my\_pow}. +% +%\begin{shell} +%\$ e-acsl-gcc.sh -C -Ono_code pow.i monitored_no_code.i +%\$ ./no_code.e-acsl +%Postcondition failed at line 5 in function my_pow. +%The failing predicate is: +%\old(n % 2 == 0) ==> \result >= 1. +%Aborted +%\end{shell} +% +%The execution of the corresponding binary fails at runtime: actually, our +%implementation of the function \texttt{my\_pow} overflows in case of large +%exponentiations. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%>>> +%\section{Combining E-ACSL with Other Plug-ins} % <<< +%\label{sec:combine} +% +%As the \eacsl plug-in generates a new \framac project, it is easy to run any +%plug-in on the generated program, either in the same \framac session (thanks to +%the option \shortopt{then} or through the GUI), or in another one. The only +%issue might be that, depending on the plug-in, the analysis may be imperfect if +%the generated program uses \gmp or the dedicated memory library: both make +%intensive use of dynamic structures which are usually difficult to handle by +%analysis tools. +% +%Another way to combine \eacsl with other plug-ins is to run \eacsl last. For +%instance, the \rte plug-in~\cite{rte} may be used to generate annotations +%corresponding to runtime errors. Then the \eacsl plug-in may generate an +%instrumented program to verify that there are no such runtime errors during the +%execution of the program. +% +%Consider the following program. +% +%\listingname{combine.i} +%\cinput{examples/combine.i} +%To check at runtime that this program does not perform any runtime error (which +%are potential overflows in this case), just do: +% +%\begin{shell} +%\$ frama-c -rte combine.i -then -e-acsl -then-last -print +% -ocode monitored_combine.i +%\$ e-acsl-gcc.sh -C -Ocombine monitored_combine.i +%\$ ./combine. +%\end{shell} +% +%Automatic assertion generation can also be enabled via \eacslgcc directly via +%the following command: +%\begin{shell} +%\$ e-acsl-gcc.sh -c -Ocombine -omonitored_combine.i --rte=all +%\end{shell} +% +%Note the use of \eacslgcc \longopt{rte} option which asks \framac to combine +%\eacsl with \rte plug-in. This plug-in automatically instruments the input +%program with runtime +%assertions before running the \eacsl plug-in on it. \longopt{rte} option of +%\eacslgcc also accepts a comma-separated list of arguments indicating the types +%of assertions to generate. Consult the \eacslgcc man page for a detailed +%list of arguments accepted by \longopt{rte}. +% +%The present implementation of \eacslgcc does not fully support combining \eacsl +%with other \framac plug-ins. However it is still possible to instrument programs +%with \eacsl directly and use \eacslgcc to compile the generated code. +% +%If you run the \eacsl plug-in after another one, it first generates +%a new temporary project in which it links the analyzed program against its own +%library in order to generate the \framac internal representation of the \C +%program (\emph{aka} AST), as explained in Section~\ref{sec:run}. Consequently, +%even if the \eacsl plug-in keeps the maximum amount of information, the results +%of already executed analyzers (such as validity status of annotations) are not +%known in this new project. If you want to keep them, you have to set the option +%\shortopt{e-acsl-prepare} when the first analysis is asked for. +% +%In this context, the \eacsl plug-in does not generate code for annotations +%proven valid by another plug-in, except if you explicitly set the option +%\shortopt{e-acsl-valid}. For instance, \Eva~\cite{eva} is able to +%prove that there is no potential overflow in the previous program, so the \eacsl +%plug-in does not generate additional code for checking them if you run the +%following command. +%\begin{shell} +%\$ frama-c -e-acsl-prepare -rte combine.i -then -val -then -e-acsl \ +% -then-last -print -ocode monitored_combine.i +%\end{shell} +%The additional code will be generated with one of the two following commands. +%\begin{shell} +%\$ frama-c -e-acsl-prepare -rte combine.i -then -val -then -e-acsl \ +% -e-acsl-valid -then-last -print -ocode monitored_combine.i +%\$ frama-c -rte combine.i -then -val -then -e-acsl \ +% -then-last -print -ocode monitored_combine.i +%\end{shell} +%In the first case, that is because it is explicitly required by the option +%\shortopt{e-acsl-valid} while, in the second case, that is because the option +%\shortopt{e-acsl-prepare} is not provided on the command line which results in +%the fact that the result of the value analysis are unknown when the \eacsl +%plug-in is running. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%>>> +%\section{Customization} % <<< +%\label{sec:custom} +% +%There are several ways to customize the \eacsl plug-in. +% +%First, the name of the generated project -- which is \texttt{e-acsl} by default +%-- may be changed by setting the option \shortopt{e-acsl-project} option of the +%\eacsl plug-in. While there is not direct support for this option in \eacslgcc +%you can pass it using \shortopt{F} switch: +% +%\listingname{check.i} +%\cinput{examples/check.i} +% +%\begin{shell} +%\$ e-acsl-gcc.sh -F"-e-acsl-project foobar" check.i +%<skip preprocessing commands> +%[e-acsl] beginning translation. +%check.i:4:[e-acsl] warning: E-ACSL construct `right shift' is not yet supported. +% Ignoring annotation. +%[e-acsl] translation done in project "foobar". +%\end{shell} +% +%Further, the \eacsl plug-in option \shortopt{e-acsl-check} does not generate a +%new project but verifies that each annotation is translatable. Then it produces +%a summary as shown in the following example (left or right shifts in annotations +%are not yet supported by the \eacsl plug-in~\cite{eacsl-implem}). +% +%\begin{shell} +%\$ frama-c -e-acsl-check check.i +%<skip preprocessing commands> +%check.i:4:[e-acsl] warning: E-ACSL construct `left/right shift' is not yet supported. +% Ignoring annotation. +%[e-acsl] 0 annotation was ignored, being untypable. +%[e-acsl] 1 annotation was ignored, being unsupported. +%\end{shell} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%>>> +%\section{Verbosity Policy} % <<< +%\label{sec:verbose} +% +%By default, \eacsl does not provide much information when it is running. Mainly, +%it prints a message when it begins the translation, and another one when the +%translation is done. It may also display warnings when something requires the +%attention of the user, for instance if it is not able to translate an +%annotation. Such information is usually enough but, in some cases, you might +%want to get additional control on what is displayed. As quite usual with +%\framac plug-ins, \eacsl offers two different ways to do this: the verbosity +%level which indicates the \emph{amount} of information to display, and the +%message categories which indicate the \emph{kind} of information to display. +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Verbosity Level} +% +%The amount of information displayed by the \eacsl plug-in is settable by the +%option \shortopt{e-acsl-verbose}. It is 1 by default. Below is indicated +%which information is displayed according to the verbosing level. The level $n$ +%also displays the information of all the lower levels. +% +%\begin{center} +%\begin{tabular}{|l|l|} +%\hline +%\shortopt{e-acsl-verbose 0}& only warnings and errors\\ +%\hline +%\shortopt{e-acsl-verbose 1}& beginning and ending of the translation\\ +%\hline +%\shortopt{e-acsl-verbose 2}& different parts of the translation and +% functions-related information\\ +%\hline +%\shortopt{e-acsl-verbose 3}& predicates- and statements-related information\\ +%\hline +%\shortopt{e-acsl-verbose 4}& terms- and expressions-related information +%\\ +%\hline +%\end{tabular} +%\end{center} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +%\subsection{Message Categories} +% +%The kind of information to display is settable by the option +%\shortopt{e-acsl-msg-key} (and unsettable by the option +%\shortopt{e-acsl-msg-key-unset}). The different keys refer to different +%parts of the translation, as detailed below. +% +%\begin{center} +%\begin{tabular}{|l|l|} +%\hline +%analysis & minimization of the instrumentation for memory-related annotation +%(section~\ref{sec:memory}) \\ +%\hline +%duplication & duplication of functions with contracts +%(section~\ref{sec:no-code}) \\ +%\hline +%translation & translation of an annotation into \C code\\ +%\hline +%typing & minimization of the instrumentation for integers +%(section~\ref{sec:integers}) \\ +%\hline +%\end{tabular} +%\end{center} +% >>> diff --git a/doc/userman/eacslversion.tex b/doc/userman/eacslversion.tex new file mode 100644 index 00000000..921e0d99 --- /dev/null +++ b/doc/userman/eacslversion.tex @@ -0,0 +1,2 @@ +\newcommand{\eacslversion}{Chlorine-20180501+dev\xspace} +\newcommand{\fcversion}{Chlorine\xspace} diff --git a/doc/userman/fclangversion.tex b/doc/userman/fclangversion.tex new file mode 100644 index 00000000..b542d412 --- /dev/null +++ b/doc/userman/fclangversion.tex @@ -0,0 +1,2 @@ +\newcommand{\fclangversion}{Chlorine+\xspace} +\newcommand{\fcversion}{Chlorine+\xspace} diff --git a/doc/userman/introduction.tex b/doc/userman/introduction.tex new file mode 100644 index 00000000..809a738b --- /dev/null +++ b/doc/userman/introduction.tex @@ -0,0 +1,26 @@ +\chapter{Introduction} + +\framac~\cite{userman,fac15} is a modular analysis framework for the C +programming language which supports the \acsl specification +language~\cite{acsl}. This manual documents the \fclang plug-in of \framac, +version \fclangversion. +The \fclang plug-in supports the \acslpp extension of \acsl for C++ programs and specifications; +it is built on the Clang\footnote{https://clang.llvm.org/} compiler infrastructure and uses Clang for +parsing C++. + +%The \fclang version you are using is indicated by the +%command \texttt{frama-c -e-acsl-version}\optionidx{-}{e-acsl-version}. \fclang +%automatically translates an annotated C program into another program that fails +%at runtime if an annotation is violated. If no annotation is violated, the +%behavior of the new program is exactly the same as the one of the original +%program. + + +%This manual does \emph{not} explain how to install the \eacsl plug-in. For +%installation instructions please refer to the \texttt{INSTALL} file in the +%\eacsl distribution. \index{Installation} Furthermore, even though this manual +%provides examples, it is \emph{not} a full comprehensive tutorial on +%\framac or \eacsl. + +% You can still refer to any external +% tutorial~\cite{rv13tutorial} for additional examples. diff --git a/doc/userman/limitations.tex b/doc/userman/limitations.tex new file mode 100644 index 00000000..29097433 --- /dev/null +++ b/doc/userman/limitations.tex @@ -0,0 +1,188 @@ +\chapter{Known Limitations} + +The development of the \fclang plug-in is still ongoing. +%First, the \eacsl +%reference manual~\cite{eacsl} is not yet fully supported. Which annotations can +%already be translated into \C code and which cannot is defined in a separate +%document~\cite{eacsl-implem}. Second, even though we do our best to avoid them, +%bugs may exist. If you find a new one, please report it on the bug tracking +%system\footnote{\url{http://bts.frama-c.com}} (see Chapter 10 of the \framac +%User Manual~\cite{userman}). Third, there +%are some additional known limitations, which could be annoying for the user in +%some cases, but are tedious to lift. Please contact us if you are interested in +%lifting these limitations\footnote{Read \url{http://frama-c.com/support.html} +% for additional details.}. + +%\section{Uninitialized Values} +%\index{Uninitialized value} +% +%As explained in Section~\ref{sec:runtime-error}, the \eacsl plug-in should never +%translate an annotation into \C code which can lead to a runtime error. This is +%enforced, except for uninitialized values which are values read before having +%been written. +% +%\listingname{uninitialized.i} +%\cinput{examples/uninitialized.i} +% +%If you generate the instrumented code, compile it, and finally execute it, you +%may get no runtime error depending on your \C compiler, but the behavior is +%actually undefined because the assertion reads the uninitialized variable +%\lstinline|x|. You should be caught by the \eacsl plug-in, but that is not +%the case yet. +%\begin{shell} +% +%\$ e-acsl-gcc.sh uninitialized.i -c -Omonitored_uninitialized +%monitored_uninitialized.i: In function 'main': +%monitored_uninitialized.i:44:16: warning: 'x' is used uninitialized in this function +%[-Wuninitialized] +%\$ ./monitored_uninitialized.e-acsl +%\end{shell} +% +%This is more a design choice than a limitation: should the \eacsl plug-in +%generate additional instrumentation to prevent such values from being evaluated, +%the generated code would be much more verbose and slower. +% +%If you really want to track such uninitializations in your annotation, you have +%to manually add calls to the \eacsl predicate +%\lstinline|\initialized|~\cite{eacsl}. +% +%\section{Incomplete Programs} +% +%Section~\ref{sec:incomplete} explains how the \eacsl plug-in is able to handle +%incomplete programs, which are either programs without main, or programs +%containing undefined functions (\emph{i.e.} functions without body). +% +%However, if such programs contain memory-related annotations, the generated code +%may be incorrect. That is made explicit by a warning displayed when the \eacsl +%plug-in is running (see examples of Sections~\ref{sec:no-main} and +%\ref{sec:no-code}). +% +%\subsection{Programs without Main} +%\index{Program!Without main} +%\label{sec:limits:no-main} +% +%The instrumentation in the generated program is partial for every program +%without main containing memory-related annotations, except if the option +%\optionuse{-}{e-acsl-full-mmodel} or the \eacsl plug-in (of \shortopt{M} option +%of \eacslgcc) is provided. In that case, violations of such annotations are +%undetected. +% +%Consider the following example. +% +%\listingname{valid\_no\_main.c} +%\cinput{examples/valid_no_main.c} +% +%You can generate the instrumented program as follows. +%\begin{shell} +%\$ e-acsl-gcc.sh -ML -omonitored_valid_no_main.i valid_no_main.c +%<skip preprocessing commands> +%[e-acsl] beginning translation. +%<skip warnings about annotations from the Frama-C libc +% which cannot be translated> +%[kernel] warning: no entry point specified: +% you must call function `__e_acsl_memory_init' by yourself. +%[e-acsl] translation done in project "e-acsl". +%\end{shell} +% +%The last warning states an important point: if this program is linked against +%another file containing \texttt{main} function, then this main function must +%be modified to insert a call to the function \texttt{\_\_e\_acsl\_memory\_init} +%\index{e\_acsl\_memory\_init@\texttt{\_\_e\_acsl\_memory\_init}} at the very +%beginning. This function plays a very important role: it initializes metadata +%storage used for tracking of memory blocks. Unless this call is inserted the +%run of a modified program is likely to fail. +% +%While it is possible to add such intrumentation manually we recommend using +%\eacslgcc. Consider the following incomplete program containing \T{main}: +% +%\listingname{modified\_main.c} +%\cinput{examples/modified_main.c} +% +%Then just compile and run it as explained in Section~\ref{sec:memory}. +% +%\begin{shell} +%\$ e-acsl-gcc.sh -M -omonitored_modified_main.i modified_main.c +%\$ e-acsl-gcc.sh -C -Ovalid_no_main monitored_modified_main.i monitored_valid_no_main.i +%\$ ./valid_no_main.e-acsl +%Assertion failed at line 11 in function f. +%The failing predicate is: +%freed: \valid(x). +%Aborted +%\end{shell} +% +%Also, if the unprovided main initializes some variables, running the +%instrumented code (linked against this main) could print some warnings from the +%\eacsl memory library\footnote{see +% \url{https://bts.frama-c.com/view.php?id=1696} for an example}. +% +%\subsection{Undefined Functions} +%\label{sec:limits:no-code} +%\index{Function!Undefined} +% +%The instrumentation in the generated program is partial for a program $p$ if and +%only if $p$ contains a memory-related annotation $a$ and an undefined function +%$f$ such that: +%\begin{itemize} +%\item either $f$ has an (even indirect) effect on a left-value occurring in $a$; +%\item or $a$ is one of the post-conditions of $f$. +%\end{itemize} +%A violation of such an annotation $a$ is undetected. There is no workaround yet. +% +%Also, the option \optionuse{-}{e-acsl-check} does not verify the annotations of +%undefined functions. There is also no workaround yet. +% +%\section{Recursive Function} +%\index{Function!Recursive} +% +%Programs containing recursive functions have the same limitations as the ones +%containing undefined functions (Section~\ref{sec:limits:no-code}) and +%memory-related annotations. +% +%%% JS: this issue should have been fixed: +%%% Also, even though there is no such annotations, the generated code may call a +%%% function before it is declared. When this behavior appears remains +%%% unspecifed. The generated code is however easy to fix by hand. +% +%\section{Variadic Functions} +%\index{Function!Variadic} +% +%Programs containing undefined variadic functions with contracts +%are not yet supported. Using the \variadic plug-in of \framac could be a +%solution in some cases, but its generated code cannot always be compiled. +% +%\section{Function Pointers} +%\index{Function!Pointer} +% +%Programs containing function pointers have the same limitations on +%memory-related annotations as the ones containing undefined or recursive +%functions. +% +%\section{Requirements to Input Programs} +%\index{Function!Input} +% +%\subsection{\eacsl Namespace} +%While \eacsl uses source-to-source transformations and not binary +%instrumentations it is important that the source code provided at input does +%not contain any variables or functions prefixed \T{\_\_e\_acsl\_}. \eacsl +%reserves this namespace for its transformations, and therefore an input program +%containing such symbols beforehand may fail to be instrumented or compiled. +% +%\subsection{Memory Management Functions} +%Programs providing custom definitions of \T{syscall}, \T{mmap} or +%\T{sbrk} should be rejected. Also, an input programs should not modify +%memory-management functions namely \T{malloc}, \T{calloc}, \T{realloc}, +%\T{free}, \T{cfree}, \T{posix\_memalign} and \T{aligned\_alloc}. \eacsl relies +%on these functions in order to track heap memory. Further, correct heap memory +%monitoring requires to limit allocation and deallocation of heap memory to +%POSIX-compliant memory management functions +%listed above. Monitoring of programs that allocate memory using non-standard or +%obsolete functions (e.g., \T{valloc}, \T{memalign}, \T{pvalloc}) may not work +%correctly. +% +%\section{Limitations of E-ACSL Monitoring Libraries} +%\index{Function!Libraries} +% +%\eacsl monitoring library implementing segment-based memory model is fairly +%recent and presently has very limited support for 32-bit architectures. When +%using a 32-bit machine we recommend using the bittree-based memory model +%instead. diff --git a/doc/userman/macros.tex b/doc/userman/macros.tex new file mode 100644 index 00000000..e92cba83 --- /dev/null +++ b/doc/userman/macros.tex @@ -0,0 +1,295 @@ +%%% Environnements dont le corps est suprimé, et +%%% commandes dont la définition est vide, +%%% lorsque PrintRemarks=false + +\usepackage{comment} + +\newcommand{\framac}{\textsc{Frama-C}\xspace} +\newcommand{\acsl}{\textsc{ACSL}\xspace} +\newcommand{\eacsl}{\textsc{E-ACSL}\xspace} + +\newcommand{\eacslgcc}{\texttt{e-acsl-gcc.sh}\xspace} +\newcommand{\rte}{\textsc{RTE}\xspace} +\newcommand{\C}{\textsc{C}\xspace} +\newcommand{\jml}{\textsc{JML}\xspace} +\newcommand{\Eva}{\textsc{Eva}\xspace} +\newcommand{\variadic}{\textsc{Variadic}\xspace} +\newcommand{\wpplugin}{\textsc{Wp}\xspace} +\newcommand{\pathcrawler}{\textsc{PathCrawler}\xspace} +\newcommand{\gcc}{\textsc{Gcc}\xspace} +\newcommand{\gmp}{\textsc{GMP}\xspace} +\newcommand{\dlmalloc}{\textsc{dlmalloc}\xspace} + +\newcommand{\nodiff}{\emph{No difference with \acsl.}} +\newcommand{\except}[1]{\emph{No difference with \acsl, but #1.}} +\newcommand{\limited}[1]{\emph{Limited to #1.}} +\newcommand{\absent}{\emph{No such feature in \eacsl.}} +\newcommand{\absentwhy}[1]{\emph{No such feature in \eacsl: #1.}} +\newcommand{\absentexperimental}{\emph{No such feature in \eacsl, since it is + still experimental in \acsl.}} +\newcommand{\absentexcept}[1]{\emph{No such feature in \eacsl, but #1.}} +\newcommand{\difficultwhy}[2]{\emph{#1 is usually difficult to implement, since + it requires #2. Thus you would not wonder if most tools do not support it + (or support it partially).}} +\newcommand{\difficultswhy}[2]{\emph{#1 are usually difficult to implement, + since they require #2. Thus you would not wonder if most tools do not + support them (or support them partially).}} +\newcommand{\difficult}[1]{\emph{#1 is usually difficult to implement. Thus + you would not wonder if most tools do not support it (or support + it partially).}} +\newcommand{\difficults}[1]{\emph{#1 are usually difficult to implement. Thus + you would not wonder if most tools do not support them (or support + them partially).}} + +\newcommand{\changeinsection}[2]{\textbf{Section \ref{sec:#1}:} #2.} + +\newcommand{\todo}[1]{{\large \textbf{TODO: #1.}}} + +\newcommand{\markdiff}[1]{{\color{blue}{#1}}} +\newenvironment{markdiffenv}[1][]{% + \begin{changebar}% + \markdiff\bgroup% +}% +{\egroup\end{changebar}} + +% true = prints remarks for the ACSL working group. +% false = prints no remark for the distributed version of ASCL documents +\newboolean{PrintRemarks} +\setboolean{PrintRemarks}{false} + +% true = prints marks signaling the state of the implementation +% false = prints only the ACSL definition, without remarks on implementation. +\newboolean{PrintImplementationRq} +\setboolean{PrintImplementationRq}{true} + +% true = remarks about the current state of implementation in Frama-C +% are in color. +% false = they are rendered with an underline +\newboolean{ColorImplementationRq} +\setboolean{ColorImplementationRq}{true} + +%% \ifthenelse{\boolean{PrintRemarks}}% +%% {\newenvironment{todo}{% +%% \begin{quote}% +%% \begin{tabular}{||p{0.8\textwidth}}TODO~:\itshape}% +%% {\end{tabular}\end{quote}}}% +%% {\excludecomment{todo}} + +\ifthenelse{\boolean{PrintRemarks}}% + {\newenvironment{remark}[1]{% + \begin{quote}\itshape% + \begin{tabular}{||p{0.8\textwidth}}Remarque de {#1}~:}% + {\end{tabular}\end{quote}}}% + {\excludecomment{remark}} + +\newcommand{\oldremark}[2]{% +\ifthenelse{\boolean{PrintRemarks}}{% + %\begin{quote}\itshape% + %\begin{tabular}{||p{0.8\textwidth}}Vieille remarque de {#1}~: #2% + %\end{tabular}\end{quote}% +}% +{}} + +\newcommand{\highlightnotreviewed}{% +\color{blue}% +}% + +\newcommand{\notreviewed}[2][]{% +\ifthenelse{\boolean{PrintRemarks}}{% + \begin{changebar}% + {\highlightnotreviewed #2}% + \ifthenelse{\equal{#1}{}}{}{\footnote{#1}}% + \end{changebar}% +}% +{}} + +\ifthenelse{\boolean{PrintRemarks}}{% +\newenvironment{notreviewedenv}[1][]{% + \begin{changebar}% + \highlightnotreviewed% + \ifthenelse{\equal{#1}{}}{}{\def\myrq{#1}}% + \bgroup}% + {\egroup% + \ifthenelse{\isundefined{\myrq}}{}{\footnote{\myrq}}\end{changebar}}}% +{\excludecomment{notreviewedenv}} + +%%% Commandes et environnements pour la version relative à l'implementation +\newcommand{\highlightnotimplemented}{% +\ifthenelse{\boolean{ColorImplementationRq}}{\color{red}}% + {\ul}% +}% + +\newcommand{\notimplemented}[2][]{% +\ifthenelse{\boolean{PrintImplementationRq}}{% + \begin{changebar}% + {\highlightnotimplemented #2}% + \ifthenelse{\equal{#1}{}}{}{\footnote{#1}}% + \end{changebar}% +}% +{#2}} + +\newenvironment{notimplementedenv}[1][]{% +\ifthenelse{\boolean{PrintImplementationRq}}{% + \begin{changebar}% + \highlightnotimplemented% + \ifthenelse{\equal{#1}{}}{}{\def\myrq{#1}}% + \bgroup +}{}}% +{\ifthenelse{\boolean{PrintImplementationRq}}{% + \egroup% + \ifthenelse{\isundefined{\myrq}}{}{\footnote{\myrq}}\end{changebar}}{}} + +%%% Environnements et commandes non conditionnelles +\newcommand{\experimental}{\textsc{Experimental}} + +\newsavebox{\fmbox} +\newenvironment{cadre} + {\begin{lrbox}{\fmbox}\begin{minipage}{0.98\textwidth}} + {\end{minipage}\end{lrbox}\fbox{\usebox{\fmbox}}} + + +\newcommand{\keyword}[1]{\lstinline|#1|\xspace} +\newcommand{\keywordbs}[1]{\lstinline|\\#1|\xspace} + +\newcommand{\integer}{\keyword{integer}} +\newcommand{\real}{\keyword{real}} +\newcommand{\bool}{\keyword{boolean}} + +\newcommand{\assert}{\keyword{assert}} +\newcommand{\terminates}{\keyword{terminates}} +\newcommand{\assume}{\keyword{assume}} +\newcommand{\requires}{\keyword{requires}} +\newcommand{\ensures}{\keyword{ensures}} +\newcommand{\exits}{\keyword{exits}} +\newcommand{\returns}{\keyword{returns}} +\newcommand{\breaks}{\keyword{breaks}} +\newcommand{\continues}{\keyword{continues}} +\newcommand{\assumes}{\keyword{assumes}} +\newcommand{\assigns}{\keyword{assigns}} +\newcommand{\reads}{\keyword{reads}} +\newcommand{\decreases}{\keyword{decreases}} + +\newcommand{\boundseparated}{\keywordbs{bound\_separated}} +\newcommand{\Exists}{\keywordbs{exists}~} +\newcommand{\Forall}{\keywordbs{forall}~} +\newcommand{\bslambda}{\keywordbs{lambda}~} +\newcommand{\freed}{\keywordbs{freed}} +\newcommand{\fresh}{\keywordbs{fresh}} +\newcommand{\fullseparated}{\keywordbs{full\_separated}} +\newcommand{\distinct}{\keywordbs{distinct}} +\newcommand{\Max}{\keyword{max}} +\newcommand{\nothing}{\keywordbs{nothing}} +\newcommand{\numof}{\keyword{num\_of}} +\newcommand{\offsetmin}{\keywordbs{offset\_min}} +\newcommand{\offsetmax}{\keywordbs{offset\_max}} +\newcommand{\old}{\keywordbs{old}} +\newcommand{\at}{\keywordbs{at}} + +\newcommand{\If}{\keyword{if}~} +\newcommand{\Then}{~\keyword{then}~} +\newcommand{\Else}{~\keyword{else}~} +\newcommand{\For}{\keyword{for}~} +\newcommand{\While}{~\keyword{while}~} +\newcommand{\Do}{~\keyword{do}~} +\newcommand{\Let}{\keywordbs{let}~} +\newcommand{\Break}{\keyword{break}} +\newcommand{\Return}{\keyword{return}} +\newcommand{\Continue}{\keyword{continue}} + +\newcommand{\exit}{\keyword{exit}} +\newcommand{\main}{\keyword{main}} +\newcommand{\void}{\keyword{void}} + +\newcommand{\struct}{\keyword{struct}} +\newcommand{\union}{\keywordbs{union}} +\newcommand{\inter}{\keywordbs{inter}} +\newcommand{\typedef}{\keyword{typedef}} +\newcommand{\result}{\keywordbs{result}} +\newcommand{\separated}{\keywordbs{separated}} +\newcommand{\sizeof}{\keyword{sizeof}} +\newcommand{\strlen}{\keywordbs{strlen}} +\newcommand{\Sum}{\keyword{sum}} +\newcommand{\valid}{\keywordbs{valid}} +\newcommand{\validrange}{\keywordbs{valid\_range}} +\newcommand{\offset}{\keywordbs{offset}} +\newcommand{\blocklength}{\keywordbs{block\_length}} +\newcommand{\baseaddr}{\keywordbs{base\_addr}} +\newcommand{\comparable}{\keywordbs{comparable}} + +\newcommand{\N}{\ensuremath{\mathbb{N}}} +\newcommand{\ra}{\ensuremath{\rightarrow}} +\newcommand{\la}{\ensuremath{\leftarrow}} + +% BNF grammar +\newcommand{\indextt}[1]{\index{#1@\protect\keyword{#1}}} +\newcommand{\indexttbs}[1]{\index{#1@\protect\keywordbs{#1}}} +\newif\ifspace +\newif\ifnewentry +\newcommand{\addspace}{\ifspace ~ \spacefalse \fi} +\newcommand{\term}[2]{\addspace\hbox{\lstinline|#1|% +\ifthenelse{\equal{#2}{}}{}{\indexttbase{#2}{#1}}}\spacetrue} +\newcommand{\nonterm}[2]{% + \ifthenelse{\equal{#2}{}}% + {\addspace\hbox{\textsl{#1}\ifnewentry\index{grammar entries!\textsl{#1}}\fi}\spacetrue}% + {\addspace\hbox{\textsl{#1}\footnote{#2}\ifnewentry\index{grammar entries!\textsl{#1}}\fi}\spacetrue}} +\newcommand{\repetstar}{$^*$\spacetrue} +\newcommand{\repetplus}{$^+$\spacetrue} +\newcommand{\repetone}{$^?$\spacetrue} +\newcommand{\lparen}{\addspace(} +\newcommand{\rparen}{)} +\newcommand{\orelse}{\addspace$\mid$\spacetrue} +\newcommand{\sep}{ \\[2mm] \spacefalse\newentrytrue} +\newcommand{\newl}{ \\ & & \spacefalse} +\newcommand{\alt}{ \\ & $\mid$ & \spacefalse} +\newcommand{\is}{ & $::=$ & \newentryfalse} +\newenvironment{syntax}{\begin{tabular}{@{}rrll@{}}\spacefalse\newentrytrue}{\end{tabular}} +\newcommand{\synt}[1]{$\spacefalse#1$} +\newcommand{\emptystring}{$\epsilon$} +\newcommand{\below}{See\; below} + +% colors + +\definecolor{darkgreen}{rgb}{0, 0.5, 0} + +% theorems + +\newtheorem{example}{Example}[chapter] + +% for texttt + +\newcommand{\bs}{\ensuremath{\backslash}} + +% Index + +\newcommand{\optionidx}[2]{\index{#2@\texttt{#1#2}}} +\newcommand{\codeidx}[1]{\index{#1@\texttt{#1}}} +\newcommand{\scodeidx}[2]{\index{#1@\texttt{#1}!#2@\texttt{#2}}} +\newcommand{\sscodeidx}[3]{% + \index{#1@\texttt{#1}!#2@\texttt{#2}!#3@\texttt{#3}}} +\newcommand{\bfit}[1]{\textbf{\textit{\hyperpage{#1}}}} +\newcommand{\optionidxdef}[2]{\index{#2@\texttt{#1#2}|bfit}} +\newcommand{\codeidxdef}[1]{\index{#1@\texttt{#1}|bfit}} +\newcommand{\scodeidxdef}[2]{\index{#1@\texttt{#1}!#2@\texttt{#2}|bfit}} +\newcommand{\sscodeidxdef}[3]{% + \index{#1@\texttt{#1}!#2@\texttt{#2}!#3@\texttt{#3}|bfit}} + +\newcommand{\pragmadef}[1]{\texttt{#1}\index{Pragma!#1@\texttt{#1}}} +\newcommand{\optiondef}[2]{\texttt{#1#2}\optionidxdef{#1}{#2}} +\newcommand{\textttdef}[1]{\texttt{#1}\codeidxdef{#1}} + +\newcommand{\optionuse}[2]{\texttt{#1#2}\optionidx{#1}{#2}} +\newcommand{\textttuse}[1]{\texttt{#1}\codeidx{#1}} +\newcommand{\shortopt}[1]{\optionuse{-}{#1}} +\newcommand{\longopt}[1]{\optionuse{{-}{-}}{#1}} +% Shortcuts for truetype, italic and bold +\newcommand{\T}[1]{\texttt{#1}} +\newcommand{\I}[1]{\textit{#1}} +\newcommand{\B}[1]{\textbf{#1}} + +\definecolor{gris}{gray}{0.85} +\makeatletter +\newenvironment{important}% +{\hspace{5pt plus \linewidth minus \marginparsep}% + \begin{lrbox}{\@tempboxa}% + \begin{minipage}{\linewidth - 2\fboxsep}} +{\end{minipage}\end{lrbox}\colorbox{gris}{\usebox{\@tempboxa}}} diff --git a/doc/userman/main.tex b/doc/userman/main.tex new file mode 100644 index 00000000..5fe5621a --- /dev/null +++ b/doc/userman/main.tex @@ -0,0 +1,99 @@ +\documentclass[web]{frama-c-book} + +\usepackage{graphicx} +\usepackage{calc} +\usepackage{datetime} +\newdateformat{ddMyyyydate}{\THEDAY~\monthname[\THEMONTH]~\THEYEAR} + + + +\include{macros} +\newcommand{\fclang}{\textsc{Frama-Clang}\xspace} +\newcommand{\acslpp}{\textsc{ACSL++}\xspace} +\newcommand{\acslb}{\acsl/acslpp\xspace} +\include{fclangversion} + + +\makeindex + +\begin{document} + +\coverpage{\fclang User Manual} + +\begin{titlepage} +\begin{flushleft} +\includegraphics[height=14mm]{cealistlogo.jpg} +\end{flushleft} +\vfill +\title{\fclang Plug-in}{Release \fclangversion +%% \ifthenelse{\equal{\eacslversion}{\fcversion}}{}{% +%% \\[1em] compatible with \framac \fcversion} +} +\author{David R. Cok} +\begin{center} +CEA LIST\\ Software Reliability \& Security Laboratory +\end{center} +\begin{center} + Last modified \ddMyyyydate\today +\end{center} +\vfill +\begin{flushleft} + \textcopyright 2013-2018 CEA LIST +%% + %% This work has been supported by the VESSEDIA project). +\end{flushleft} +\end{titlepage} + +\tableofcontents + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\chapter*{Foreword} +\markright{} +\addcontentsline{toc}{chapter}{Foreword} + +This is the user manual of the \framac plug-in +\fclang\footnote{\url{https://frama-c.com/frama-clang.html}}. The contents of this +document correspond to its version \fclangversion compatible with +\fcversion version of \framac~\cite{userman,fac15}. The development of +the \fclang plug-in is still ongoing. Features described by this document may +evolve in the future. + +\section*{Acknowledgements} + +We gratefully thank the people who contributed to this document: +David R. Cok, Virgile Prevosto, Armand Pucetti, Franck Verdrine. + +TBD-VESSEDIA + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\include{introduction} +\include{description} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\appendix + +\include{changes} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\cleardoublepage +\addcontentsline{toc}{chapter}{\bibname} +\bibliographystyle{plain} +\bibliography{./biblio} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%% \cleardoublepage +%% \addcontentsline{toc}{chapter}{\listfigurename} +%% \listoffigures + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\cleardoublepage +\addcontentsline{toc}{chapter}{\indexname} +\printindex + +\end{document} -- GitLab