source: CIVL/doc/manual/part-tools.tex@ b863633

1.23 2.0 acw/focus-triggers main test-branch
Last change on this file since b863633 was b863633, checked in by Stephen Siegel <siegel@…>, 12 years ago

Working on manual.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@651 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 5.8 KB
Line 
1\part{Tools}
2\label{part:tools}
3
4\chapter{Introduction}
5
6\section{Symbolic execution}
7
8The tools currently in the CIVL tool kit all use \emph{symbolic
9 execution}. This is a technique in which variables are assigned
10symbolic rather than concrete values. In particular, input variables
11are assigned unique \emph{symbolic constants}, which are symbols such
12as $X$, $Y$, and so on. Operations produce symbolic expressions in
13those symbols, such as $(X+Y)/2$.
14
15\section{Tool overview}
16
17Current tools allow one to \emph{run} a CIVL program using random
18choice to resolve nondeterministic choices; \emph{verify} a program
19using model checking to explore all states of the program; and
20\emph{replay} a trace if an error is found. There are also commands
21to show the results just of preprocessing or parsing a file; as these
22are basically sub-tasks of the other tasks, they are used mainly for
23debugging.
24
25Each tool is launched from the command line by typing ``\texttt{civl}
26\textit{cmd} \ldots'', where \textit{cmd} is one of
27\begin{itemize}
28\item \ct{help} : print usage information
29\item \ct{run} : run the program using random simulation
30\item \ct{verify} : verify program
31\item \ct{replay} : replay trace for program
32\item \ct{parse} : show result of preprocessing and parsing file
33\item \ct{preprocess} : show result of preprocessing file only.
34\end{itemize}
35The additional arguments and options are described below and are also
36shown by the \ct{help} command.
37
38A number of properties are checked when running or verifying
39a CIVL program. These include the following:
40\begin{itemize}
41\item absence of deadlocks
42\item absence of assertion violations
43\item absence of division or modulus with denominator $0$
44\item absence of illegal pointer dereferences
45\item absence of out-of-bounds array indexes
46\item absence of invalid casts
47\item every object is defined (i.e., initialized) before
48 it is used.
49\end{itemize}
50
51
52\section{ Options}
53
54The following command line options are available:
55
56\newenvironment{optionlist}{\begin{flushleft}}{\end{flushleft}}
57\newcommand{\option}[2]{#1\\[0mm]\makebox[5mm]{}#2\\[3mm]}
58\newcommand{\booloption}[3]{\option{\ct{-#1} or \ct{-#1=}\textit{boolean}
59 (default: \ct{#2})}{#3}}
60\newcommand{\intoption}[3]{\option{\ct{-#1=}\textit{integer}
61 (default: \ct{#2})}{#3}}
62\newcommand{\mapoption}[2]{\option{\ct{-#1}\textit{key}\ct{=}\textit{value}}{#2}}
63\newcommand{\stringoption}[3]{\option{\ct{-#1=}\textit{string}
64 (default: \ct{#2})}{#3}}
65
66\begin{optionlist}
67 \booloption{debug}{false}{debug mode: print very detailed information}
68 \booloption{echo}{false}{print the command line}
69 \intoption{errorBound}{1}{stop after finding this many errors}
70 \booloption{guided}{false}{user guided simulation; applies only to
71 run, ignored for all other commands}
72 \intoption{id}{0}{ID number of trace to replay}
73 \mapoption{input}{initialize input variable \textit{key} to
74 \textit{value}}
75 \intoption{maxdepth}{2147483647}{bound on search depth}
76 \booloption{min}{false}{search for minimal counterexample}
77 \stringoption{por}{std}{partial order reduction (por) choices:
78 std (standard por) or scp (scoped por)}
79 \booloption{random}{varies}{select enabled transitions randomly;
80 default for \texttt{run}, ignored for all other commands}
81 \booloption{saveStates}{true}{save states during depth-first search}
82 \stringoption{seed}{none}{set the random seed; applies only to run}
83 \booloption{showModel}{false}{print the model}
84 \booloption{showProverQueries}{false}{print theorem prover queries
85 only}
86 \booloption{showQueries}{false}{print all queries}
87 \booloption{showSavedStates}{false}{print saved states only}
88 \booloption{showStates}{false}{print all states}
89 \booloption{showTransitions}{false}{print transitions}
90 \booloption{simplify}{true}{simplify states?}
91 \booloption{solve}{false}{try to solve for concrete counterexample}
92 \stringoption{sysIncludePath}{}{set the system include path}
93 \stringoption{trace}{}{filename of trace to replay}
94 \stringoption{userIncludePath}{}{set the user include path}
95 \booloption{verbose}{false}{verbose mode}
96\end{optionlist}
97
98\chapter{Running a CIVL-C program: \texttt{civl run}}
99
100The syntax for the \ct{run} command is:
101\begin{flushleft}
102\ \ \ct{civl\ run}\ \textit{options} \textit{filename}
103\end{flushleft}
104
105\chapter{Transitions}
106
107In CIVL, a transition stands for the execution of a number of
108statements of a certain process from one state, and the execution of
109each statement is considered as one step. A transition has the
110following form in the output, where sid and sid' are the identifiers
111for the source and the target states, pid is the identifier of the
112process that this transition belongs to, and step 0,1 ... are the
113steps contained in the transitions.
114
115\begin{verbatim}
116State sid, proc pid:
117 step 0;
118 step 1;
119 ...
120--> State sid'
121\end{verbatim}
122
123A step of a transition has the following form in the CIVL output,
124where src and dst is the source and destination location of the
125statement executed in the step, file is the file that contains the
126source code of the statement, location and text are the location and
127summary of text of the statement in the source file.
128
129\begin{verbatim}
130 src->dst: statement at file:location "text";
131\end{verbatim}
132
133For example, the following is a transition from state 0 to state 1,
134containing 6 steps. File names are renamed with short names and the
135mapping of short names and the original files is presented in output
136as well.
137
138\begin{verbatim}
139File name list:
140f0 : atomicBlockedResume.cvl
141
142State 0, proc 0:
143 0->1: x = 1 at f0:3.0-9 "int x = 1";
144 1->2: y = 0 at f0:4.0-9 "int y = 0";
145 2->3: z = 0 at f0:5.0-9 "int z = 0";
146 3->6: sum = 0 at f0:6.0-11 "int sum = 0";
147 6->8: $spawn foo(1) at f0:22.4-17 "$spawn foo(1)";
148 8->10: $spawn foo(2) at f0:23.4-17 "$spawn foo(2)";
149--> State 1
150\end{verbatim}
151
152To make use of this feature, one needs to specify the option
153\texttt{-showTransitions} when running CIVL.
154
Note: See TracBrowser for help on using the repository browser.