Logic 如何使用Spin从命令行检查Promela代码
我正在研究如何在Windows10命令行上使用Spin分析输出Logic 如何使用Spin从命令行检查Promela代码,logic,model-checking,promela,spin,Logic,Model Checking,Promela,Spin,我正在研究如何在Windows10命令行上使用Spin分析输出 如果能帮助文件提供正确的输出,我们将不胜感激。先决条件:在Windows 10上获得一个带有gcc的工作环境(,例如参见),或者,获得一个带有一些GNU/Linux发行版的虚拟环境。另外,在目标系统中 只有两种可能的方法: 选项A.: ~$ spin -a train.pml ~$ gcc pan.c -o verifier ~$ ./verifier -a -N c1 ... ~$ ./verifier -a -N c8 ..
如果能帮助文件提供正确的输出,我们将不胜感激。先决条件:在Windows 10上获得一个带有gcc的工作环境(,例如参见),或者,获得一个带有一些GNU/Linux发行版的虚拟环境。另外,在目标系统中
只有两种可能的方法:
- 选项A.
~$ spin -a train.pml
~$ gcc pan.c -o verifier
~$ ./verifier -a -N c1
...
~$ ./verifier -a -N c8
...
~$ spin -search -ltl c1 train.pml
...
~$ spin -search -ltl c8 train.pml
...
~$ spin -a train.pml
~$ gcc pan.c -o verifier
~$ ./verifier -a -N c1
...
~$ ./verifier -a -N c8
...
~$ spin -search -ltl c1 train.pml
...
~$ spin -search -ltl c8 train.pml
...
目前,属性
c1、c5、c7、c8
已在您的模型上验证而c2、c3、c4、c6
未验证。还有一些关于未实现的终端状态的抱怨。请检查后一种情况是否违反您的系统规范(可能是问题,也可能不是问题),以及验证结果是否符合您的预期
作为参考,这是验证属性
c1
时应获得的正确输出示例:
~$ spin -search -a -ltl c1 trail.pml
...
pan: ltl formula c1
(Spin Version 6.4.6 -- 2 December 2016)
+ Partial Order Reduction
Full statespace search for:
never claim + (c1)
assertion violations + (if within scope of claim)
acceptance cycles + (fairness disabled)
invalid end states - (disabled by never claim)
State-vector 152 byte, depth reached 4508, errors: 0
67919 states, stored (97586 visited)
170919 states, matched
268505 transitions (= visited+matched)
0 atomic steps
hash conflicts: 184 (resolved)
Stats on memory usage (in Megabytes):
11.659 equivalent memory usage for states (stored*(State-vector + overhead))
5.455 actual memory usage for states (compression: 46.78%)
state-vector as stored = 56 byte + 28 byte overhead
128.000 memory used for hash table (-w24)
0.534 memory used for DFS stack (-m10000)
133.905 total actual memory usage
unreached in proctype train
trail.pml:31, state 14, "-end-"
(1 of 14 states)
unreached in proctype gate
trail.pml:52, state 17, "-end-"
(1 of 17 states)
unreached in proctype queue
trail.pml:74, state 17, "-end-"
(1 of 17 states)
unreached in claim c1
_spin_nvr.tmp:10, state 13, "-end-"
(1 of 13 states)
pan: elapsed time 0.12 seconds
pan: rate 813216.67 states/second
输出是什么?正确的输出是什么?请复习一些关于提问的内容@我不知道它应该是什么。除了错误之外,我似乎无法获得任何输出。我不知道如何正确运行该文件。谢谢。所以当你的源代码不起作用时,这是一个可以使用的地方。所以这不是一个介绍教程的地方。这对我的问题没有帮助。你是对的。这是没有帮助的,因为这不是解决这类问题的合适地方。你想有人帮你搜索
spin
和train.pml
吗?太棒了!非常感谢帕特里克。@PatrickTrentin你说的“虚拟环境”是什么意思?既然它只是C代码,Linux上的Spin不是本地的吗?@MaxvonHippel这个问题是针对windowsMy bad的,谢谢你的澄清。