AFAIK,沒有這樣的選擇。
替代方法
在LINUX + bash中,你可以選擇以下的,殘酷的,方法。
定義set_trail_name
功能:
~$ function set_trail_name() { sed -i "s/^\\(char \\*TrailFile =\\)\\(.*\\)$/\\1 \"${1}\";/" "${2}"; }
~$ export -f set_trail_name
它有兩個參數:您的首選trail_file_nime
和的pan.c
位置。
然後使用它,如下所示:
~$ spin -a test.pml
ltl p1: [] (<> (! (q0)))
ltl p2: [] (<> (q1))
the model contains 2 never claims: p2, p1
...
~$ set_trail_name my_p1_name pan.c
~$ gcc -o pan pan.c
~$ ./pan -a -N p1
pan: ltl formula p1
pan:1: acceptance cycle (at depth 4)
pan: wrote my_p1_name.trail
...
~$ ls *.trail
my_p1_name.trail
~$ set_trail_name my_p2_name pan.c
~$ gcc -o pan pan.c
~$ pan -a -N p2
pan: ltl formula p2
pan:1: acceptance cycle (at depth 2)
pan: wrote my_p2_name.trail
...
~$ ls *.trail
my_p1_name.trail my_p2_name.trail
替代方法改進#1
你可以走得更遠一步,例如
#!/bin/bash
function set_trail_name() {
sed -i "s/^\\(char \\*TrailFile =\\)\\(.*\\)$/\\1 \"${1}\";/" "${2}";
}
function check_property() {
set -e
spin -a "${1}" 1>/dev/null
set_trail_name "${2}" pan.c
gcc -o pan pan.c
./pan -a -N "${2}"
set +e
}
check_property "${@}"
這使得它更容易地運行它:
~$ ./run_spin.sh test.pml p1
pan: ltl formula p1
pan:1: acceptance cycle (at depth 4)
pan: wrote p1.trail
...
~$ ~$ ./run_spin.sh test.pml p2
pan: ltl formula p2
pan:1: acceptance cycle (at depth 2)
pan: wrote p2.trail
替代方法改進#2
你甚至可以去幾個步驟進一步,例如
#!/bin/bash
function set_trail_name()
{
sed -i "s/^\\(char \\*TrailFile =\\)\\(.*\\)$/\\1 \"${1}\";/" "${2}";
}
function check_property()
{
echo -e "\\n>>> Testing property ${1} ...\\n"
set_trail_name "${1}" pan.c
gcc -o pan pan.c
./pan -a -N "${1}"
}
function check_properties()
{
set -e
spin -a "${1}" 1>/dev/null
mapfile -t properties < <(gawk 'match($0, /^ltl ([^{]+) .*$/, a) { print a[1] }' "${1}")
for prop in "${properties[@]}"
do
check_property "${prop}"
done
set +e
}
check_properties "${@}"
這使得它瑣碎運行它:
~$ ./run_spin.sh test.pml
>>> Testing property p1 ...
pan: ltl formula p1
pan:1: acceptance cycle (at depth 4)
pan: wrote p1.trail
...
>>> Testing property p2 ...
pan: ltl formula p2
pan:1: acceptance cycle (at depth 2)
pan: wrote p2.trail
...
注意
你可能想用
- 清理臨時文件,以豐富的腳本,例如
pan, pan.*, _spin_nvr.tmp
- 財產狀況分析(真/假)和印刷
- ...
另一個完全合法的解決辦法是每次調用旋轉模型檢查後,只需重命名現有跟蹤文件。