½éSPIN¥Í¥¿ £¡¡Ê佸¹ç¤Ç¤¹¤«¡£¡£´À¡Ë
|
SPIN¤ò¶È̳¤Ø»ÈÍѤ·¤Æ¤ß¤¿¤¯¤Ê¤Ã¤¿¤Î¤Ç¡¢SPIN½é¥Í¥¿¤ò¸«Ä¾¤·¤¿¡£ |
¥³¥á¥ó¥È¡Ê0¡Ë
¤³¤Îµ»ö¤ÎURL: http://blogs.yahoo.co.jp/sawaragikun/23205471.html
[ ¥ê¥¹¥È | ¾ÜºÙ ]
Á´1¥Ú¡¼¥¸
[1]
|
SPIN¤ò¶È̳¤Ø»ÈÍѤ·¤Æ¤ß¤¿¤¯¤Ê¤Ã¤¿¤Î¤Ç¡¢SPIN½é¥Í¥¿¤ò¸«Ä¾¤·¤¿¡£ |
¤³¤Îµ»ö¤ÎURL: http://blogs.yahoo.co.jp/sawaragikun/23205471.html
|
½éSPIN¥Í¥¿¤Î³¤¤Ç¤¹¡£ Á°²ó¤Ï ./pan -e¤È¤·¤Æ¤¤¤Þ¤·¤¿¤¬¡£¡£¥ª¥×¥·¥ç¥ó¤¬Â¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£¡£´À¡Ë ./pan -e -c0¤Ç¤¹¡£ ¡¡-e¤Ï¥Õ¥¡¥¤¥ë¤Ë½ñ¤½Ð¤¹¤Ç-c0¤¬Á´¤Æ¤ÎÈ¿Îã¤ò½ÐÎÏ-c¤Î¸å¤í¤Ë¿ôÃͤòÆþ¤ì¤ë¤È¿ôÃÍʬ¤ÎÈ¿Îã¤ò½ÐÎÏ ¡¡¡¡¡¡"0"¤ÏÁ´¤Æ¤Ç¤¹¡£ ¤Ç¤â¤³¤ì¤Ç¼Â¹Ô¤¹¤ë¤È¥Õ¥¡¥¤¥ë¤¬Åú¤¨¤Î274¤òͤ¨¤Æ¤¿¤¯¤µ¤ó½ÐÎÏ¡£¡£´À¡Ë Ãæ¿È¤ò¸«¤ë¤È¡£¡£½ÅÊ£¤·¤Æ¤¤¤ëʪ¤¬¤¤¤Ã¤Ñ¤¤¡£ ¤À¤±¤ÉÈ¿Îã¤ò£±¤Ä½ÐÎϤʤéÀµ¤·¤¯½Ð¤·¤Æ¤¯¤ì¤ë¡£ Î㢪ºÇû·ÐÏ©¤ÎÈ¿Îã¤ò½ÐÎÏ ./pan -i¤Ç¼Â¹Ô¤¹¤ë¤È $ spin -t -p goal5.p
Starting Shot with pid 0
Starting :never: with pid 1
Never claim moves to line 40 [(1)]
2: proc 0 (Shot) line 10 "goal5.p" (state 1) [score = (score+3)]
4: proc 0 (Shot) line 10 "goal5.p" (state 2) [ss = score]
6: proc 0 (Shot) line 15 "goal5.p" (state 9) [((score<10))]
Starting Shot with pid 2
8: proc 0 (Shot) line 15 "goal5.p" (state 10) [(run Shot(score))]
10: proc 1 (Shot) line 10 "goal5.p" (state 1) [score = (score+3)]
12: proc 1 (Shot) line 10 "goal5.p" (state 2) [ss = score]
14: proc 1 (Shot) line 15 "goal5.p" (state 9) [((score<10))]
Starting Shot with pid 3
16: proc 1 (Shot) line 15 "goal5.p" (state 10) [(run Shot(score))]
18: proc 2 (Shot) line 10 "goal5.p" (state 1) [score = (score+3)]
20: proc 2 (Shot) line 10 "goal5.p" (state 2) [ss = score]
22: proc 2 (Shot) line 15 "goal5.p" (state 9) [((score<10))]
Starting Shot with pid 4
24: proc 2 (Shot) line 15 "goal5.p" (state 10) [(run Shot(score))]
26: proc 3 (Shot) line 12 "goal5.p" (state 5) [score = (score+1)]
28: proc 3 (Shot) line 12 "goal5.p" (state 6) [ss = score]
Never claim moves to line 39 [((ss==10))]
Never claim moves to line 43 [(1)]
spin: trail ends after 30 steps
#processes: 4
ss = 10
30: proc 3 (Shot) line 15 "goal5.p" (state 9)
30: proc 2 (Shot) line 28 "goal5.p" (state 11) <valid end state>
30: proc 1 (Shot) line 28 "goal5.p" (state 11) <valid end state>
30: proc 0 (Shot) line 28 "goal5.p" (state 11) <valid end state>
30: proc - (:never:) line 44 "goal5.p" (state 8) <valid end state>
4 processes created
OK¤Ç¤¹ÁÛÄêÄ̤ê¤Ç¤¹¡ª¡ª¤â¤Ã¤È¤âÈ¿Îã¤ò¤Ä¤Ö¤·¤ÆÌµ¤¯¤¹¤Î¤¬ÌÜŪ¤Î¥×¥í¥°¥é¥à¤Ç¤¹¤«¤é¡£¡£ È¿Îã¤ò²áÉÔÂ̵¤¯½ÐÎϤˤ³¤À¤ï¤Ã¤Æ¤Ê¤¤¤Î¤«¤â¡£¡£ ¤½¤ì¤È¤âÌäÂ꤬spin-LTL¸þ¤¤Ç¤Ê¤¤¤Î¤«¤â¡©¡© SMV-CTL¤Ê¤éÀµ¤·¤¯Åú¤¨¤ò½Ð¤·¤Æ¤¯¤ì¤ë¡©¡© º£Æü¤Ï¤Ä¤«¤ì¤¿¡£¡£¤ª¤·¤Þ¤¤¡£¡£CTL¤âÊÙ¶¯¤·¤Æ¤ß¤Þ¤¹¡£ spin promela ¥â¥Ç¥ë¸¡¾Ú
|
¤³¤Îµ»ö¤ÎURL: http://blogs.yahoo.co.jp/sawaragikun/12164472.html
|
SPIN¥Í¥¿¤ÇÎɤ¤¤Î¤¬Ìµ¤¤¤«Ãµ¤·¤Æ¤¤¤¿¤é¡£¡£ ¡Ö¥Ó¡¼¥È¤¿¤±¤·¤Î¥³¥ÞÂç¿ô³Ø²Ê¡×¤ò°·¤Ã¤¿web ¡¡¡¡http://gascon.cocolog-nifty.com/blog/2009/01/index.html ¤¬¤¢¤ê¡¢£±£±£¹¹Ö¡§¥Ð¥¹¥±¥Ã¥È¥Ü¡¼¥ë¤ò²ò¤¤¤Æ¤ß¤ë¤³¤È¤Ë¤·¤¿¡£ ÌäÂê¡§¥Ð¥¹¥±¥Ã¥È¥Ü¡¼¥ë¤ÎÆÀÅÀ¤Ï¡¢¥Õ¥ê¡¼¥¹¥í¡¼¤¬1ÅÀ¡¢¥¹¥ê¡¼¥Ý¥¤¥ó¥È¥é¥¤¥ó¤ÎÆâ¦¤«¤é¤À¤È2ÅÀ¡¢³°Â¦¤«¤é¤À¤È3ÅÀÆþ¤ë¡£¤Á¤ç¤¦¤ÉÆÀÅÀ¤¬10ÅÀ¤Ë¤Ê¤ë¤Þ¤Ç¤ÎÆÀÅÀ·Ð²á¤Ï²¿Ä̤ꤢ¤ë¤«¡© ¡¡¡Ê¾åµweb¤è¤ê°úÍÑ¡Ë SPIN¤Ç¤Î²ò¤Êý¤Ï¡£¡£ promela¤Ç¥·¥å¡¼¥È¤òÂǤIJáÄø¤ò¥×¥í¥°¥é¥à¤· £±£°ÅÀ¤Ë¤Ê¤é¤Ê¤¤»ö¤ò¾ÚÌÀ¤µ¤»¤ë¡£ ¤³¤Î»þ¡¢¾ÚÌÀ¤Ï¼ºÇÔ¤·¡ÉÈ¿Îã¡É¤ò½Ð¤·¤Æ¤¯¤ë¤Î¡¢¤½¤ì¤ò¿ô¤¨¤ë¡£ promela¤Î¥³¡¼¥É¤Ï¤³¤ì¤À byte ss = 0 ;
init {run Shot(0);}
proctype Shot(byte score)
{
if
¡¡¡¡:: score = score +1 -> ss = score
¡¡¡¡:: score = score +2 -> ss = score
¡¡¡¡:: score = score +3 -> ss = score
fi;
if
¡¡¡¡::(score < 10) -> run Shot(score)
¡¡¡¡:: else goto end
fi;
end:
printf("score_total = %d", ss) -> skip
}
#define p (ss==10)
never { /* <>p */
T0_init:
if
:: ((p)) -> goto accept_all
:: (1) -> goto T0_init
fi;
accept_all:
skip
}
ºÇ½é¤Îifʸ¤Ç¥·¥å¡¼¥È¤¬Æþ¤Ã¤¿¤È¤¤ÎÆÀÅÀ(1-3)¤¬Èó·èÄêŪ¤ËÁªÂò¤µ¤ì score¤Ë¤·¹þ¤Þ¤ì¤ë¡£ ¼¡¤Îifʸ¤Ç10ÅÀ̤Ëþ¤Ê¤é¡¢ºÆ¤Ó¥·¥å¡¼¥È¤òÂǤÄ(run Shot(score)¡Ë¡£ 10ÅÀ°Ê¾å¤Ê¤é½ªÎ»(goto end)¡£ ¾ÚÌÀʸ¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¤è¤ê²¼µ¤Î¥³¡¼¥É¤òÂǤÁ¹þ¤ß[RET] spin -f '<>p'¤Ç¥³¡¼¥É¤ò½ÐÎϤ· #define p (ss==10)¤òÄɲ乤롣 ¡¡¢ªÃí°Õ¡£¡£promelaÊ¸Ãæ¤Îscore¤Ïrun Shot(score)¤ÈºÆµ¢¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¤Î¤Ç¡¢score¤ÇͤäÆscore ¤Ç¤Ê¤¤¡ª¡ªÌ¾Á°¤ÏƱ¤¸¤À¤¬¼ÂÂÖ¤ÏÊÌÊÑ¿ô¤À¤è¡£ ½¾¤Ã¤Æ¡¢¥°¥í¡¼¥Ð¥ëÊÑ¿ôbyte ss¤òºî¤Ã¤ÆscoreÃͤòÃ༡ÂåÆþ¤·¾ÚÌÀ¤Ë»ÈÍѤ¹¤ë¡£ ¤³¤ì¤¬#define p (ss==10)¤À¡£ ºî¤Ã¤¿promelaʸ¤òshot.p¤È¤·¤Æ¥»¡¼¥Ö¡£¡£¥³¥ó¥Ñ¥¤¥ë¡£¡£¼Â¹Ô¡£ spin -a shot.p gcc -o pan pan.c ./pan ·ë²Ì $ ./pan
warning: never claim + accept labels requires -a flag to fully verify
hint: this search is more efficient if pan.c is compiled -DSAFETY
warning: for p.o. reduction to be valid the never claim must be stutter-invariant
(never claims generated from LTL formulae are stutter-invariant)
pan: claim violated! (at depth 81)
pan: wrote Shot.p.trail
(Spin Version 5.1.6 -- 9 May 2008)
Warning: Search not completed
+ Partial Order Reduction
Full statespace search for:
never claim +
assertion violations + (if within scope of claim)
acceptance cycles - (not selected)
invalid end states - (disabled by never claim)
State-vector 60 byte, depth reached 81, errors: 1
41 states, stored
0 states, matched
41 transitions (= stored+matched)
0 atomic steps
hash conflicts: 0 (resolved)
2.501 memory usage (Mbyte)
pan: elapsed time 0.046 seconds
pan: rate 891.30435 states/second
State-vector 60 byte, depth reached 81, errors: 1¤ÈÈ¿Î㤬½Ð¤Æ¤¤¿¤Î¤Ç spin -t -p shot.p¤È¤·¤ÆÈ¿Îã¤ò¸«¤Æ¤ß¤ë¡£ ---- ά ----
78: proc 10 (Shot) line 10 "Shot.p" (state 2) [ss = score]
Never claim moves to line 33 [((ss==10))]
80: proc 10 (Shot) line 17 "Shot.p" (state 11) [else]
Never claim moves to line 37 [(1)]
spin: trail ends after 81 steps
#processes: 11
ss = 10
----¡¡Î¬ ------
ss=10¤¬½Ð¤Æ¤¤¿¡£¼¡¤Ëpan¤Ø¥ª¥×¥·¥ç¥ó-e¤òÉÕ¤±¤Æ¼Â¹Ô¡£ ¡¡¢ª¥ª¥×¥·¥ç¥ó¡É-e¡É¤ÏÁ´¤Æ¤ÎÉÔ¶ñ¹ç¤òtrail¥Õ¥¡¥¤¥ë¤Ë½ÐÎϤ¹¤ë¡£ ./pan -e·ë²Ì¤Ï State-vector 60 byte, depth reached 81, errors: 1¥ª¥×¥·¥ç¥ó -e¤òÉÕ¤±¤Ê¤¤¤È¤¤ÈƱ¤¸¡£¡£¤Ê¤ó¤Ç¡©¡© ¾ÚÌÀʸ¤òÉÕ¤±¤Ê¤¤¤Ç¼Â¹Ô¤¹¤ë¤È¡£¡£ unreached in proctype Shot
(0 of 17 states)
¤Ê¤ó¤Æ½Ð¤Æ¤¤¿¡£¡£¤É¤¦¤ä¤é̵¸Â¤Ëõº÷¶õ´Ö¤¬¤¢¤Ã¤ÆÅÓÃæ½ªÎ»¤È¤Ê¤Ã¤Æ¤¤¤ë¸«¤¿¤¤¡£byte score byte ss¤Ç¾õÂÖ¶õ´Ö¤ò8+8=16bit¤ËÀ©¸Â¤·¤¿¤Ä¤â¤ê¤À¤±¤É¡£¡£ 16bitÈϰϤòõº÷¤·¤Æ½ªÎ»¡£¡£ ÊÑ¿ô¤Ï²Ä»»Ìµ¸Â¤È¤·¤Æ°·¤ï¤ì¤ë¸«¤¿¤¤¡£ ÊÑ¿ô¤ÎÉý¤Ïõº÷ÉýÀ©¸Â¤Ç»ÈÍѤµ¤ì¤ë¤Î¤«¡£¡£ ¤Ä¤«¤ì¤¿¡£¡£º£Æü¤Ï¤ª¤·¤Þ¤¤¡£ SPIN ²óÏ©¸¡¾Ú¡¡¥·¥¹¥Æ¥à¸¡¾Ú
|
¤³¤Îµ»ö¤ÎURL: http://blogs.yahoo.co.jp/sawaragikun/10645800.html
Á´1¥Ú¡¼¥¸
[1]
| º£Æü | Á´ÂÎ | |
|---|---|---|
| ˬÌä¼Ô | 2 | 19543 |
| ¥Ö¥í¥°¥ê¥ó¥¯ | 0 | 6 |
| ¥³¥á¥ó¥È | 0 | 176 |
| ¥È¥é¥Ã¥¯¥Ð¥Ã¥¯ | 0 | 2 |
³«À߯ü: 2008/8/7(ÌÚ)