| 1 |
5 |
tbourke |
.\" $Id$
|
| 2 |
|
|
.\"
|
| 3 |
|
|
.Dd October 28, 2007
|
| 4 |
|
|
.Dt URPAL 1
|
| 5 |
|
|
.Sh NAME
|
| 6 |
|
|
.Nm urpal
|
| 7 |
|
|
.Nd manipulate Uppaal models from the command-line
|
| 8 |
|
|
.Sh SYNOPSIS
|
| 9 |
|
|
.Nm
|
| 10 |
|
|
.Op Fl h Fl v Fl t
|
| 11 |
|
|
.Op Fl i Ar file
|
| 12 |
|
|
.Op Fl o Ar file
|
| 13 |
|
|
.Op Fl e Ar commands
|
| 14 |
|
|
.Op Fl f Ar scriptfile
|
| 15 |
|
|
.Op Fl s Ar settings
|
| 16 |
|
|
.Op Fl c Ar configfile
|
| 17 |
|
|
.Nm
|
| 18 |
|
|
.Op Fl s Ar settings
|
| 19 |
|
|
.Op Fl c Ar configfile
|
| 20 |
|
|
.Op Fl -showconfig
|
| 21 |
|
|
.Nm
|
| 22 |
|
|
.Op Fl i Ar file
|
| 23 |
|
|
.Op Fl o Ar file
|
| 24 |
|
|
.Op Fl s Ar settings
|
| 25 |
|
|
.Op Fl c Ar configfile
|
| 26 |
|
|
.Op Fl -testflip
|
| 27 |
|
|
.\"
|
| 28 |
|
|
.Sh DESCRIPTION
|
| 29 |
|
|
Urpal is your pal for Uppaal.
|
| 30 |
|
|
It parses an XML file containing timed automaton templates, performs
|
| 31 |
|
|
requested manipulations using a simple command language, and finally
|
| 32 |
|
|
writes the results back to file.
|
| 33 |
|
|
The prime feature is the ability to construct a testing automaton for
|
| 34 |
|
|
determining trace inclusion for a restricted class of timed automata.
|
| 35 |
|
|
It is also able to: duplicate automata; create automata to ready to accept
|
| 36 |
|
|
all synchronisations on a set of channels; prune transitions based on
|
| 37 |
|
|
synchronising action; conflate, drop and rename locations; and scale
|
| 38 |
|
|
graphical representations.
|
| 39 |
|
|
.Pp
|
| 40 |
|
|
When constructing test automata, most, but not all, modelling features are
|
| 41 |
|
|
supported.
|
| 42 |
|
|
Automata must be deterministic, the tool does not check this assumption, and
|
| 43 |
|
|
every transition must be labelled.
|
| 44 |
|
|
Urgent locations are expanded by adding an additional clock and invariant
|
| 45 |
|
|
constraint.
|
| 46 |
|
|
Urgent channels and shared variables are addressed using the constructions of
|
| 47 |
|
|
Jensen, Larsen and Skou
|
| 48 |
|
|
.Pq refer Sx SEE ALSO .
|
| 49 |
|
|
Committed locations and broadcast channels are not handled (warnings are
|
| 50 |
|
|
displayed).
|
| 51 |
|
|
Certain combinations of universal quantifiers, selection bindings, and
|
| 52 |
|
|
channel arrays are rejected
|
| 53 |
|
|
.Pq refer Bourke and Sowmya, Sx SEE ALSO .
|
| 54 |
|
|
.\"
|
| 55 |
|
|
.Ss Settings
|
| 56 |
|
|
Several tool parameters can be specified via configuration files.
|
| 57 |
|
|
Urpal checks for configuration files in order:
|
| 58 |
|
|
.Pa INSTALLPREFIX/etc/urpalrc ,
|
| 59 |
|
|
.Pa $HOME/.urpalrc ,
|
| 60 |
|
|
and
|
| 61 |
|
|
.Pa $CWD/urpalrc .
|
| 62 |
|
|
Settings are specified as name=value pairs.
|
| 63 |
|
|
Named hierarchical sections are written in the form
|
| 64 |
|
|
.Dl section_name { ... }
|
| 65 |
|
|
Comments follow the conventions of C, except that they may be nested, that
|
| 66 |
|
|
is single line comments are written after a
|
| 67 |
|
|
.Li //
|
| 68 |
|
|
and multi-line comments between
|
| 69 |
|
|
.Li /*
|
| 70 |
|
|
and
|
| 71 |
|
|
.Li */ .
|
| 72 |
|
|
Paths and strings are written between double quotes.
|
| 73 |
|
|
The available settings are
|
| 74 |
|
|
.Bl -tag -compact
|
| 75 |
|
|
.It Sy dtd_path
|
| 76 |
|
|
Path to the
|
| 77 |
|
|
.Pa flat-1_1.dtd
|
| 78 |
|
|
file giving the Uppaal Document Type Definition.
|
| 79 |
|
|
If not given, Urpal attempts to fetch the necessary information from the
|
| 80 |
|
|
network at every run.
|
| 81 |
|
|
.It Sy max_label_width
|
| 82 |
|
|
The wrapping length, as a number of characters, for transition labels.
|
| 83 |
|
|
.It Sy max_declaration_width
|
| 84 |
|
|
The wrapping length, as a number of characters, for declarations.
|
| 85 |
|
|
.It Sy new_color
|
| 86 |
|
|
The color, in
|
| 87 |
|
|
.Li #RRGGBB
|
| 88 |
|
|
format, to use for new locations and transitions when there is not a more
|
| 89 |
|
|
specific setting.
|
| 90 |
|
|
.It Sy error_color
|
| 91 |
|
|
The color to use for the
|
| 92 |
|
|
.Li Err
|
| 93 |
|
|
location added by the
|
| 94 |
|
|
.Li maketest
|
| 95 |
|
|
operation, and for transitions to that location.
|
| 96 |
|
|
.It Sy urgent_chanloc_color
|
| 97 |
|
|
The color to use for locations and transitions added by the
|
| 98 |
|
|
.Li maketest
|
| 99 |
|
|
operation when handling urgent channels.
|
| 100 |
|
|
.It Sy split_shift_old, split_shift_new
|
| 101 |
|
|
sections containing
|
| 102 |
|
|
.Li x
|
| 103 |
|
|
and
|
| 104 |
|
|
.Li y
|
| 105 |
|
|
entries.
|
| 106 |
|
|
When a location is
|
| 107 |
|
|
.Sq split
|
| 108 |
|
|
as part of the
|
| 109 |
|
|
.Li maketest
|
| 110 |
|
|
urgent channel construction,
|
| 111 |
|
|
these parameters specify how far to shift the two components from the
|
| 112 |
|
|
original location.
|
| 113 |
|
|
By default, the original location is left in place and the urgency testing
|
| 114 |
|
|
location is positioned automatically, but often the result is not very
|
| 115 |
|
|
pleasing.
|
| 116 |
|
|
.It Sy tabulate_shift
|
| 117 |
|
|
A section containing
|
| 118 |
|
|
.Li x
|
| 119 |
|
|
and
|
| 120 |
|
|
.Li y
|
| 121 |
|
|
entries, specifying where to locate the results of
|
| 122 |
|
|
.Li tabulate ,
|
| 123 |
|
|
relative to the transition source location.
|
| 124 |
|
|
.It Sy graphviz
|
| 125 |
|
|
Contains two subentries
|
| 126 |
|
|
.Bl -tag -compact
|
| 127 |
|
|
.It Sy path
|
| 128 |
|
|
Locates the
|
| 129 |
|
|
.Xr graphviz 7
|
| 130 |
|
|
installation directory, which must contain a
|
| 131 |
|
|
.Pa bin
|
| 132 |
|
|
subdirectory.
|
| 133 |
|
|
.It Sy engine
|
| 134 |
|
|
Specifies which layout algorithm to use, either
|
| 135 |
|
|
.Xr fdp 1
|
| 136 |
|
|
or
|
| 137 |
|
|
.Xr neato 1 .
|
| 138 |
|
|
One will often give a better result than the other for a given automaton.
|
| 139 |
|
|
.El
|
| 140 |
|
|
.It Sy debug
|
| 141 |
|
|
Enable debugging output. 0=all, 1=very detailed, 2=detailed, 3=outline,
|
| 142 |
|
|
4=none.
|
| 143 |
|
|
.El
|
| 144 |
|
|
.\"
|
| 145 |
|
|
.Ss Command language
|
| 146 |
|
|
The environment is a set of name/value pairs.
|
| 147 |
|
|
It is initialized from the Uppaal model file, by creating an entry for each
|
| 148 |
|
|
template, a
|
| 149 |
|
|
.Ad channels
|
| 150 |
|
|
entry containing all of the global channel names, and a
|
| 151 |
|
|
.Ad variables
|
| 152 |
|
|
entry containing all of the (non-const, non-clock) global variable names.
|
| 153 |
|
|
When command evaluation is complete, all templates in the environment are
|
| 154 |
|
|
written to the output model file.
|
| 155 |
|
|
Command names cannot be used variable identifiers.
|
| 156 |
|
|
Each command must be terminated with a semi-colon.
|
| 157 |
|
|
.Pp
|
| 158 |
|
|
The basic commands are
|
| 159 |
|
|
.Bl -tag -compact
|
| 160 |
|
|
.It Sy help
|
| 161 |
|
|
Show a list of expression operators.
|
| 162 |
|
|
.It Sy list
|
| 163 |
|
|
Prints out all template names, one per line.
|
| 164 |
|
|
.It Sy show
|
| 165 |
|
|
Prints out all variable names and values.
|
| 166 |
|
|
.It Sy show Ar id
|
| 167 |
|
|
Prints out the value of the specified variable.
|
| 168 |
|
|
.It Sy id = Ar expr
|
| 169 |
|
|
Evaluates the expression and assigns the result to the given variable.
|
| 170 |
|
|
This command can be used to duplicate templates, by assigning them to a new
|
| 171 |
|
|
name.
|
| 172 |
|
|
.It Sy drop Ar expr
|
| 173 |
|
|
Removes the given identifier from the environment.
|
| 174 |
|
|
.It Sy writegraphics ( Ar expr , Ar path , Ar PS | Dot | SVG )
|
| 175 |
|
|
Rudimentary graphics output.
|
| 176 |
|
|
The expression must evaluate to a template, whose depiction will be written
|
| 177 |
|
|
to the given path in the specified format (Postscript, Graphviz dot, or
|
| 178 |
|
|
Scalable Vector Graphics format).
|
| 179 |
|
|
.It Sy quit
|
| 180 |
|
|
End an interactive terminal session.
|
| 181 |
|
|
.El
|
| 182 |
|
|
.Pp
|
| 183 |
|
|
All expressions have one of these types
|
| 184 |
|
|
.Bl -tag -compact
|
| 185 |
|
|
.It Sy template
|
| 186 |
|
|
Templates are read from, and written back into, Uppaal model files.
|
| 187 |
|
|
.It Sy name set
|
| 188 |
|
|
Names of locations or channels which are written between braces and
|
| 189 |
|
|
separated by commas, e.g.
|
| 190 |
|
|
.Li { a, b, c} .
|
| 191 |
|
|
It is not possible to specify individual elements of channel arrays,
|
| 192 |
|
|
also operators like
|
| 193 |
|
|
.Sy names
|
| 194 |
|
|
and
|
| 195 |
|
|
.Sy channels
|
| 196 |
|
|
over approximate by returning the array name whenever a single element is
|
| 197 |
|
|
referenced.
|
| 198 |
|
|
.It Sy action set
|
| 199 |
|
|
When naming channels, a limiting input or output direction may be
|
| 200 |
|
|
specified after a name if the set is enclosed in bar-braces, e.g.
|
| 201 |
|
|
.Li {| a!, b, c? |} .
|
| 202 |
|
|
Name sets are automatically coerced into action sets as required.
|
| 203 |
|
|
.It Sy name map
|
| 204 |
|
|
Specify functions from names to other names, e.g.
|
| 205 |
|
|
.Li { a -> b, c -> a, b <-> d } .
|
| 206 |
|
|
Any name not given is mapped to itself.
|
| 207 |
|
|
A double arrow indicates a swap, i.e.
|
| 208 |
|
|
.Li { b <-> d }
|
| 209 |
|
|
is shorthand for
|
| 210 |
|
|
.Li { b -> d, d -> b } .
|
| 211 |
|
|
.It Sy actionmap map
|
| 212 |
|
|
Specify functions from actions to other actions, e.g.
|
| 213 |
|
|
.Li {| a! -> b?, a? -> b!, c? <-> c! |} .
|
| 214 |
|
|
Name maps are automatically coerced into action maps as required.
|
| 215 |
|
|
.El
|
| 216 |
|
|
.Pp
|
| 217 |
|
|
Several operators are available for constructing expressions
|
| 218 |
|
|
.Bl -tag -compact
|
| 219 |
|
|
.It Fn acceptall actionset
|
| 220 |
|
|
Create an automaton that is always ready to synchronise on the given actions.
|
| 221 |
|
|
.It Fn channels template
|
| 222 |
|
|
Gives a nameset of all actions performed by the template.
|
| 223 |
|
|
.It Fn conflate template namemap
|
| 224 |
|
|
For each
|
| 225 |
|
|
.Li n -> n'
|
| 226 |
|
|
in the namemap, all transitions to or from
|
| 227 |
|
|
.Li n
|
| 228 |
|
|
are shifted to
|
| 229 |
|
|
.Li n' ,
|
| 230 |
|
|
and the former is removed.
|
| 231 |
|
|
.It Fn drop template nameset
|
| 232 |
|
|
Removes all the named locations.
|
| 233 |
|
|
.It Fn maketest template nameset nameset
|
| 234 |
|
|
Constructs an automaton for testing trace inclusion against the given set of
|
| 235 |
|
|
channel names and variable names respectively.
|
| 236 |
|
|
.It Fn maketest template
|
| 237 |
|
|
Defaults to the
|
| 238 |
|
|
.Li channels
|
| 239 |
|
|
and
|
| 240 |
|
|
.Li globals
|
| 241 |
|
|
variables, respectively.
|
| 242 |
|
|
.It Fn names template
|
| 243 |
|
|
Gives a nameset of all channels synchronized on by the template regardless
|
| 244 |
|
|
of direction.
|
| 245 |
|
|
.It Fn parameters template
|
| 246 |
|
|
Returns a nameset of non-const parameter names.
|
| 247 |
|
|
.It Fn renamelocs template namemap
|
| 248 |
|
|
Simultaneous renaming of locations.
|
| 249 |
|
|
.It Fn renametrans template actionmap
|
| 250 |
|
|
Simultaneous renaming of action labels.
|
| 251 |
|
|
.It Fn scale template float
|
| 252 |
|
|
Scale the graphical representation of a template by the given amount.
|
| 253 |
|
|
.It Fn setinitial template name
|
| 254 |
|
|
Set the initial state.
|
| 255 |
|
|
.It Fn split template actionmap
|
| 256 |
|
|
For each
|
| 257 |
|
|
.Li a -> a'
|
| 258 |
|
|
split transitions labelled with
|
| 259 |
|
|
.Li a
|
| 260 |
|
|
into two transitions connected via a committed location.
|
| 261 |
|
|
The second transition will synchronise on
|
| 262 |
|
|
.Li a' .
|
| 263 |
|
|
Channel arrays are not supported.
|
| 264 |
|
|
.It Fn tabulate template nameset
|
| 265 |
|
|
Make a table of labels for all transitions leaving or entering a location in the
|
| 266 |
|
|
given set.
|
| 267 |
|
|
.It Ar template Sy \[rs] Ar actionset
|
| 268 |
|
|
Automaton restriction: removes all transitions labelled by an action in the
|
| 269 |
|
|
set, and then any unconnected locations.
|
| 270 |
|
|
.It Ar set Sy \[rs] Ar set
|
| 271 |
|
|
Set difference.
|
| 272 |
|
|
.It Ar set Sy ++ Ar set
|
| 273 |
|
|
Set union.
|
| 274 |
|
|
.El
|
| 275 |
|
|
.\"
|
| 276 |
|
|
.Ss Testflip mode
|
| 277 |
|
|
The option
|
| 278 |
|
|
.Fl -testflip
|
| 279 |
|
|
exercises the flip function that underlines the maketest feature.
|
| 280 |
|
|
It reads an input file containing multiple sections
|
| 281 |
|
|
.Bl -enum -compact -offset indent
|
| 282 |
|
|
.It
|
| 283 |
|
|
A comment section describing the test.
|
| 284 |
|
|
.It
|
| 285 |
|
|
Declarations in the Uppaal description language.
|
| 286 |
|
|
.It
|
| 287 |
|
|
Zero or more transitions, each containing three lines:
|
| 288 |
|
|
.Bl -enum -compact
|
| 289 |
|
|
.It
|
| 290 |
|
|
selection bindings,
|
| 291 |
|
|
.It
|
| 292 |
|
|
synchronisation expression (all transitions must synchronise on the same
|
| 293 |
|
|
channel or array name),
|
| 294 |
|
|
.It
|
| 295 |
|
|
guard expression.
|
| 296 |
|
|
.El
|
| 297 |
|
|
Lines should be left blank when empty.
|
| 298 |
|
|
.El
|
| 299 |
|
|
Sections are separated by a line containing two hyphens
|
| 300 |
|
|
.Ql -- .
|
| 301 |
|
|
.Pp
|
| 302 |
|
|
e.g.,
|
| 303 |
|
|
.Bd -literal -compact -offset indent
|
| 304 |
|
|
Simple test with selects
|
| 305 |
|
|
--
|
| 306 |
|
|
clock c1;
|
| 307 |
|
|
chan c[5][int[2,10]];
|
| 308 |
|
|
--
|
| 309 |
|
|
i : int[0,4], j : int[2,10]
|
| 310 |
|
|
c[i][j]?
|
| 311 |
|
|
c1>4
|
| 312 |
|
|
--
|
| 313 |
|
|
i : int[0,4], j : int[2,10]
|
| 314 |
|
|
c[i][j]?
|
| 315 |
|
|
c1 <= 3
|
| 316 |
|
|
.Ed
|
| 317 |
|
|
.\"
|
| 318 |
|
|
.Sh OPTIONS
|
| 319 |
|
|
.Bl -tag -width indent
|
| 320 |
|
|
.It Fl h
|
| 321 |
|
|
Display help for command-line options.
|
| 322 |
|
|
.It Fl v
|
| 323 |
|
|
Show the version number.
|
| 324 |
|
|
.It Fl t
|
| 325 |
|
|
Start an interactive terminal.
|
| 326 |
|
|
This is the default if no other commands are given.
|
| 327 |
|
|
.It Fl i Ar file
|
| 328 |
|
|
Uppaal model file, in xml format, for input.
|
| 329 |
|
|
.It Fl o Ar file
|
| 330 |
|
|
Path to write the resultant Uppaal model file.
|
| 331 |
|
|
.It Fl e Ar commands
|
| 332 |
|
|
Given a sequence of commands directly.
|
| 333 |
|
|
.It Fl f Ar scriptfile
|
| 334 |
|
|
Execute a sequence of commands from a file.
|
| 335 |
|
|
.It Fl s Ar settings
|
| 336 |
|
|
Specify configuration settings directly.
|
| 337 |
|
|
.It Fl c Ar configfile
|
| 338 |
|
|
Apply the given configuration file.
|
| 339 |
|
|
.It Fl -showconfig
|
| 340 |
|
|
Show the current configuration options.
|
| 341 |
|
|
.It Fl -testflip
|
| 342 |
|
|
Enter a special mode for executing flip test scripts.
|
| 343 |
|
|
.El
|
| 344 |
|
|
Command and configuration options are executed in sequence from left to
|
| 345 |
|
|
right, multiple options may be given.
|
| 346 |
|
|
Only a single input and output file may be specified.
|
| 347 |
|
|
.\"
|
| 348 |
|
|
.Sh EXAMPLES
|
| 349 |
|
|
List templates:
|
| 350 |
|
|
.Dl urpal -i model.xml -e 'list'
|
| 351 |
|
|
.Pp
|
| 352 |
|
|
Construct the test automaton for a template
|
| 353 |
|
|
.Li P1 :
|
| 354 |
|
|
.Dl urpal -i model.xml -o result.xml -e 'maketest(P1)'
|
| 355 |
|
|
.Pp
|
| 356 |
|
|
Likewise, but exclude the
|
| 357 |
|
|
.Li a
|
| 358 |
|
|
channel and make the result larger:
|
| 359 |
|
|
.Dl urpal -i model.xml -o result.xml -e 'maketest(scale(P1, 2.0))'
|
| 360 |
|
|
.\"
|
| 361 |
|
|
.Sh SEE ALSO
|
| 362 |
|
|
.Rs
|
| 363 |
|
|
.%A Timothy Bourke
|
| 364 |
|
|
.%A Arcot Sowmya
|
| 365 |
|
|
.%T Tool support for verifying trace inclusion with Uppaal
|
| 366 |
|
|
.%R Technical Report
|
| 367 |
|
|
.%I NICTA/CSE UNSW
|
| 368 |
|
|
.%D November 2007
|
| 369 |
|
|
.Re
|
| 370 |
|
|
.Rs
|
| 371 |
|
|
.%A Mari\[:e]lle I.A. Stoelinga
|
| 372 |
|
|
.%B Alea Jacta est: Verification of probabilistic
|
| 373 |
|
|
.%B real-time and parametric systems
|
| 374 |
|
|
.%D April 2002
|
| 375 |
|
|
.%I PhD Thesis, Katholieke Universiteit, Nijmegen
|
| 376 |
|
|
.Re
|
| 377 |
|
|
.Rs
|
| 378 |
|
|
.%A Henrik Ejersbo Jensen
|
| 379 |
|
|
.%A Kim Guldstrand Larsen
|
| 380 |
|
|
.%A Arne Skou
|
| 381 |
|
|
.%T Scaling up Uppaal: Automatic verification of real-time systems
|
| 382 |
|
|
.%T using compositionality and abstraction
|
| 383 |
|
|
.%P 19\(en30
|
| 384 |
|
|
.%B Proc. 6th int. sym. Formal Techniques for Real-Time and
|
| 385 |
|
|
.%B Fault-Tolerance (FTRTFT)
|
| 386 |
|
|
.%D September 2000
|
| 387 |
|
|
.%I Springer-Verlag
|
| 388 |
|
|
.Re
|
| 389 |
|
|
.Pp
|
| 390 |
|
|
.Xr graphviz 7
|
| 391 |
|
|
.\"
|
| 392 |
|
|
.Sh AUTHORS
|
| 393 |
|
|
.An Timothy Bourke Aq timbob@bigpond.com
|
| 394 |
|
|
.\"
|
| 395 |
|
|
.Sh BUGS
|
| 396 |
|
|
The program has not yet undergone rigorous testing or review.
|
| 397 |
|
|
It is still very much an experimental prototype.
|