spin 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  1. .TH SPIN 1
  2. .SH NAME
  3. spin \- verification tool for models of concurrent systems
  4. .SH SYNOPSIS
  5. .B spin
  6. .B -a
  7. [
  8. .B -m
  9. ]
  10. [
  11. .BI -P cpp
  12. ]
  13. .I file
  14. .PP
  15. .B spin
  16. [
  17. .B -bglmprsv
  18. ]
  19. [
  20. .BI -n N
  21. ]
  22. [
  23. .BI -P cpp
  24. ]
  25. .I file
  26. .PP
  27. .B spin
  28. .B -c
  29. [
  30. .B -t
  31. ]
  32. [
  33. .BI -P cpp
  34. ]
  35. .I file
  36. .PP
  37. .B spin
  38. .B -d
  39. [
  40. .BI -P cpp
  41. ]
  42. .I file
  43. .PP
  44. .B spin
  45. .B -f
  46. .I ltl
  47. .PP
  48. .B spin
  49. .B -F
  50. .I file
  51. .PP
  52. .B spin
  53. .B -i
  54. [
  55. .B -bglmprsv
  56. ]
  57. [
  58. .BI -n N
  59. ]
  60. [
  61. .BI -P cpp
  62. ]
  63. .I file
  64. .PP
  65. .B spin
  66. .B -M
  67. [
  68. .B -t
  69. ]
  70. [
  71. .BI -P cpp
  72. ]
  73. .I file
  74. .PP
  75. .B spin
  76. .BR -t [ \fIN ]
  77. [
  78. .B -bglmprsv
  79. ]
  80. [
  81. .BI -j N
  82. ]
  83. [
  84. .BI -P cpp
  85. ]
  86. .I file
  87. .PP
  88. .B spin
  89. .B -V
  90. .SH DESCRIPTION
  91. .I Spin
  92. is a tool for analyzing the logical consistency of
  93. asynchronous systems, specifically distributed software
  94. amd communication protocols.
  95. A verification model of the system is first specified
  96. in a guarded command language called Promela.
  97. This specification language, described in the reference,
  98. allows for the modeling of dynamic creation of
  99. asynchronous processes,
  100. nondeterministic case selection, loops, gotos, local and
  101. global variables.
  102. It also allows for a concise specification of logical
  103. correctness requirements, including, but not restricted
  104. to requirements expressed in linear temporal logic.
  105. .PP
  106. Given a Promela model
  107. stored in
  108. .I file ,
  109. .I spin
  110. can perform interactive, guided, or random simulations
  111. of the system's execution.
  112. It can also generate a C program that performs an exhaustive
  113. or approximate verification of the correctness requirements
  114. for the system.
  115. .PP
  116. The basic command options are:
  117. .\"----------------------a----------------
  118. .TP
  119. .B -a
  120. Generate a verifier (model checker) for the specification.
  121. The output is written into a set of C files, named
  122. .BR pan.[cbhmt] ,
  123. that can be compiled
  124. .RB ( "pcc pan.c" )
  125. to produce an executable verifier.
  126. The online
  127. .I spin
  128. manuals (see below) contain
  129. the details on compilation and use of the verifiers.
  130. .\"--------------------------c------------
  131. .TP
  132. .B -c
  133. Produce an ASCII approximation of a message sequence
  134. chart for a random or guided (when combined with
  135. .BR -t )
  136. simulation run.
  137. See also option
  138. .BR -M .
  139. .\"--------------------------d------------
  140. .TP
  141. .BI -d
  142. Produce symbol table information for the model specified in
  143. .I file .
  144. For each Promela object this information includes the type, name and
  145. number of elements (if declared as an array), the initial
  146. value (if a data object) or size (if a message channel), the
  147. scope (global or local), and whether the object is declared as
  148. a variable or as a parameter. For message channels, the data types
  149. of the message fields are listed.
  150. For structure variables, the third field defines the
  151. name of the structure declaration that contains the variable.
  152. .\"--------------------------f------------
  153. .TP
  154. .B "-f \f2ltl\f1"
  155. Translate the LTL formula
  156. .I ltl
  157. into a never claim.
  158. .br
  159. This option reads a formula in LTL syntax from the second argument
  160. and translates it into Promela syntax (a never claim, which is Promela's
  161. equivalent of a Büchi Automaton).
  162. The LTL operators are written:
  163. .B []
  164. (always),
  165. .B <>
  166. (eventually),
  167. and
  168. .B U
  169. (strong until). There is no
  170. .B X
  171. (next) operator, to secure
  172. compatibility with the partial order reduction rules that are
  173. applied during the verification process.
  174. If the formula contains spaces, it should be quoted to form a
  175. single argument to the
  176. .I spin
  177. command.
  178. .\"--------------------------F------------
  179. .TP
  180. .B "-F \f2file\f1"
  181. Translate the LTL formula stored in
  182. .I file
  183. into a never claim.
  184. .br
  185. This behaves identical to option
  186. .B -f
  187. but will read the formula from the
  188. .I file
  189. instead of from the command line.
  190. The file should contain the formula as the first line. Any text
  191. that follows this first line is ignored, so it can be used to
  192. store comments or annotation on the formula.
  193. (On some systems the quoting conventions of the shell complicate
  194. the use of option
  195. .BR -f .
  196. Option
  197. .B -F
  198. is meant to solve those problems.)
  199. .\"--------------------------i------------
  200. .TP
  201. .B -i
  202. Perform an interactive simulation, prompting the user at
  203. every execution step that requires a nondeterministic choice
  204. to be made. The simulation proceeds without user intervention
  205. when execution is deterministic.
  206. .\"--------------------------M------------
  207. .TP
  208. .B -M
  209. Produce a message sequence chart in Postscript form for a
  210. random simulation or a guided simulation
  211. (when combined with
  212. .BR -t ),
  213. for the model in
  214. .I file ,
  215. and write the result into
  216. .I file.ps .
  217. See also option
  218. .BR -c .
  219. .\"--------------------------m------------
  220. .TP
  221. .B -m
  222. Changes the semantics of send events.
  223. Ordinarily, a send action will be (blocked) if the
  224. target message buffer is full.
  225. With this option a message sent to a full buffer is lost.
  226. .\"--------------------------n------------
  227. .TP
  228. .B "-n\f2N"
  229. Set the seed for a random simulation to the integer value
  230. .I N .
  231. There is no space between the
  232. .B -n
  233. and the integer
  234. .IR N .
  235. .\"--------------------------t------------
  236. .TP
  237. .B -t
  238. Perform a guided simulation, following the error trail that
  239. was produces by an earlier verification run, see the online manuals
  240. for the details on verification.
  241. .\"--------------------------V------------
  242. .TP
  243. .B -V
  244. Prints the
  245. .I spin
  246. version number and exits.
  247. .\"--------------------------.------------
  248. .PD
  249. .PP
  250. With only a filename as an argument and no option flags,
  251. .I spin
  252. performs a random simulation of the model specified in
  253. the file (standard input is the default if the filename is omitted).
  254. If option
  255. .B -i
  256. is added, the simulation is
  257. .IR interactive ,
  258. or if option
  259. .B -t
  260. is added, the simulation is
  261. .IR guided .
  262. .PP
  263. The simulation normally does not generate output, except what is generated
  264. explicitly by the user within the model with
  265. .B printf
  266. statements, and some details about the final state that is
  267. reached after the simulation completes.
  268. The group of options
  269. .B -bglprsv
  270. sets the desired level of information that the user wants
  271. about a random, guided, or interactive simulation run.
  272. Every line of output normally contains a reference to the source
  273. line in the specification that generated it.
  274. The options are:
  275. .\"--------------------------bglprsv------------
  276. .TP
  277. .B -b
  278. Suppress the execution of
  279. .B printf
  280. statements within the model.
  281. .TP
  282. .B -g
  283. Show at each time step the current value of global variables.
  284. .TP
  285. .B -l
  286. In combination with option
  287. .BR -p ,
  288. show the current value of local variables of the process.
  289. .TP
  290. .B -p
  291. Show at each simulation step which process changed state,
  292. and what source statement was executed.
  293. .TP
  294. .B -r
  295. Show all message-receive events, giving
  296. the name and number of the receiving process
  297. and the corresponding the source line number.
  298. For each message parameter, show
  299. the message type and the message channel number and name.
  300. .TP
  301. .B -s
  302. Show all message-send events.
  303. .TP
  304. .B -v
  305. Verbose mode, add some more detail, and generat more
  306. hints and warnings about the model.
  307. .PD
  308. .SH SOURCE
  309. .B /sys/src/cmd/spin
  310. .SH SEE ALSO
  311. G.J. Holzmann,
  312. .IR "Design and Validation of Computer Protocols" ,
  313. Prentice Hall, 1991.
  314. .br
  315. \(em, ``Design and validation of protocols: a tutorial,''
  316. .I "Computer Networks and ISDN Systems" ,
  317. Vol. 25, No. 9, 1993, pp. 981-1017.
  318. .br
  319. \(em, ``The model checker
  320. .SM SPIN\c
  321. \&,''
  322. .I "IEEE Trans. on Software Engineering" ,
  323. Vol, 23, No. 5, May 1997.
  324. .br
  325. \(em, ``Using
  326. .SM SPIN\c
  327. \&,''
  328. this manual.
  329. .PP
  330. .B http://spinroot.com/