关键字:uppaal命令行,命令行验证 :::success 本文基于uppaal-4.1.25版本,Win10 20H2。 ::: 利用命令行来运行UPPAAL的验证过程,设置相关参数(结果返回最短、最快,搜索模式深度、广度优先等),并输出相应结果。
一、基本语法
Win10利用power shell跑UPPAAL:
首先进入\uppaal\bin-Windows目录,把要验证的.xml模型拷贝到该目录,然后按下shift+鼠标右键打开power shell(或者其他命令行),然后运行.\verifyta.exe [OPTION]... MODEL QUERY, where MODEL is a model file and QUERY is a query file.
其中QUERY会验证写在xml文件中的所有验证语句。具体查看本文末的help文档。
二、Example
这里提供最常用的两个例子,批量运行可以使用python调用系统命令行,并且可以利用多线程来加快运行速度。文档链接:python 多线程。 :::success 注意,在命令行中,UPPAAL会对所有语句进行验证,无法指定某个语句。 :::
1. 保存xtr格式的Trace
跑一个验证并返回结果(-t),并保存xtr格式的trace(-f)。
.\verifyta.exe -t 1 -f traceFileName .\xmlModelFile.xml#############################################################################-t [ --diagnostic ] arg <0|1|2> Generate diagnostic information on stderr.0: Some trace1: Shortest trace (disables reuse)2: Fastest trace (disables reuse)-f [ --prefix ] arg Write symbolic traces to files 'prefix-n.xtr'rather than to stderr.
traceFileName是保存的反例文件,不需要加.xtr;- 注意,必须有
-t,不然不能输出结果;2. 保存xml格式的Trace
跑一个验证并返回验证结果(-t),并保存xml格式的trace(-X)。 ```powershell .\verifyta.exe -t 1 -X readableTraceFileName .\xmlModelFile.xml
#
-t [ —diagnostic ] arg <0|1|2> Generate diagnostic information on stderr. 0: Some trace 1: Shortest trace (disables reuse) 2: Fastest trace (disables reuse)
-X [ —save-trace ] arg Save the symbolic trace in file ‘
- `readableTraceFileName`是保存的反例文件,不需要加`.xml`;- 注意,必须有`-t`,不然不能输出结果;- 注意,`-X`和`-f`好像不能同时使用;- 为了方便阅读xml,可以使用:[xml在线格式化 | 菜鸟工具](https://c.runoob.com/front-end/710)。<a name="QGvkh"></a># 三、官方Help文档双击打开`verifyta.exe`会告诉如何查看help。```powershellUsage: D:\uppaal64-4.1.25-5\bin-Windows\verifyta.exe [OPTION]... MODEL QUERYwhere MODEL is a model file and QUERY is a query file.If QUERY is missing it will be guessed.Options:-h [ --help ] produce help messageGeneral:-H [ --hashtable-size ] arg Set hash table size for bit statehashing to 2**n bits(default = 27)-n [ --extrapolation ] arg <0|1|2|3|4>Select extrapolation operator.0: Automatic1: No extrapolation (use with care)2: Difference extrapolation3: Location based extrapolation4: Lower/upper extrapolation-t [ --diagnostic ] arg <0|1|2>Generate diagnostic information onstderr.0: Some trace1: Shortest trace (disables reuse)2: Fastest trace (disables reuse)-o [ --search-order ] arg <0|1|2|3|4>Select search order. Only 0 and 1 forTIGA properties.0: Breadth first (short-hand -b)1: Depth first (short-hand -d)2: Random depth first3: Optimal first (requires -t1 or -t2)4: Random optimal depth first(requires -t1 or -t2)--state-representation arg <0|1|2|3>Choose how discrete states should berepresented. (default 1)0: Difference Bound Matrix. Hasshort-hand -C1: Compact DBM. Uses less space butmore time compared to pure DBM.2: Bit-state hashing.Under-approximates states. Hasshort-hand -Z.3: Convex-hull approximation.Over-approximates states. Hasshort-hand -A.-S [ --statespace-consumption ] arg <0|1|2|3>Optimize space consumption (0 = none,1 = default, 2 = aggressive, 3 =extreme)-T [ --reuse-statespace ] Reuse state space when severalproperties are examined.-N [ --polyhedra ] Use polyhedra verification ofstopwatches over-approximation-M [ --modest ] activate Modest semantics for updates.Output:-f [ --prefix ] arg Write symbolic traces to files'prefix-n.xtr' rather than to stderr.-W Disable warnings-y [ --post-symbolic ] Display traces symbolically(post-stable).-Y [ --pre-symbolic ] Display traces symbolically (pre- andpost-stable).-q [ --nosummary ] Do not display the option summary.-x [ --save-system ] arg Save the (modified) system in XMLformat, in specified file.If the system has been modified, anassociated query file is created.-X [ --save-trace ] arg Save the symbolic trace in file'<arg>Propertynumber.xml'-O [ --simulation-format ] arg write the filtered simulationtrajectories to:std: one trajectory per line intostandard output (default)csv: one trajectory per file incomma-separated-values format.Miscellaneous:-s [ --silence-progress ] Do not display the progress indicator.-u [ --summary ] Show verification summary at the end(incorrect for liveness properties).-v [ --version ] Show version number.SMC:-r [ --seed ] arg Set seed for random number generator(default is current time).-p [ --lower-delta ] arg lower (delta) probabilistic uncertainty.-P [ --upper-delta ] arg upper (delta) probabilistic uncertainty.-a [ --alpha ] arg probability of false negatives (alpha).-B [ --beta ] arg probability of false positives (beta).-E [ --epsilon ] arg probability uncertainty (epsilon).-i [ --u0 ] arg threshold u0 for comparingprobabilities.-j [ --u1 ] arg threshold u1 for comparingprobabilities.-w [ --histogram-bar-width ] arg width of buckets in histogram. Shouldnot be set in conjunction with--histogram-bar-count--histogram-bar-count arg number of buckets in histogram. Shouldnot be set in conjunction with--histogram-bar-width-c [ --parametric-comp ] arg <0|1>activate (1) or not (0) the SMCparametric comparison.-V [ --smc-coverage ] activate SMC coverage.-R [ --resolution ] arg simulation resolution (pixels).-D [ --discretization ] arg discretization step size (time) forhybrid systems.-L [ --probability-log ] arg SMC-Log file.-F [ --sampling-time ] arg outputs to a file a sampling ofsimulations (when simulate is used).The ordering of options is significant.Environment variables:UPPAAL_DUMP_STATE output a state satisfying the property.UPPAAL_DISABLE_SWEEPLINE disable sweepline methodUPPAAL_DISABLE_OPTIMISER disable peephole optimiserUPPAAL_DISABLE_SYMMETRY disable symmetry reductionUPPAAL_COMPILE_ONLY write compiled model to stdout and stopUPPAAL_OLD_SYNTAX use UPPAAL 3.4 syntaxThe value of these variables does not matter. Defining them isenough to activate the feature in question.
