Whyãã¼ã«ã®ç¿å¾ã«ã¤ãã¦(
http://groups.google.co.jp/group/fm-forum/browse_thread/thread/6fbd1bc05aa8f999)
ã¨ãããã¨ã§ã
ç§ããã£ã¦ã¿ãã
Whyã¨ããã®ã¯ããã°ã©ã ã®æ¤è¨¼ç¨ãã¼ã«ãªã®ã ãã
ããã°ã©ã ã³ã¼ãã«ã¢ãµã¼ã·ã§ã³ã®ããã«æ¿å
¥ããWhyã®ã³ã¼ãã
ãã¨ã«ãããã°ã©ã ãèªåçã«æ¤è¨¼ãã¦ãããã¨ããã
ãªãã ãç´ æ´ãããä»çµã¿ãæã£ã¦ããã®ã ã
ç§ã®ç°å¢ã¯Ubuntuã
1.ã¤ã³ã¹ãã¼ã«
Coq(apt-getã§ã¤ã³ã¹ãã¼ã«ã§ãã)以å¤ã«å¿
è¦ãªãã®ã¯ã
why-2.24.tar.gz(http://why.lri.fr/)
ããã¤ã追å ã§ããã±ã¼ã¸ãå¿
è¦ã
å
¨é¨sudo apt-get installã§ã¤ã³ã¹ãã¼ã«ãã¦ããã
libocamlgraph-ocaml-dev(ããããªãã¨configureæã«æããã)
liblablgtk2-ocaml
liblablgtk2-ocaml-dev(gwhyã«å¿
è¦)
alt-ergo(gwhyã使ãæ¤è¨¼å¨ã®ä¸ã¤ï¼
ã³ã³ãã¤ã«ããã¤ã³ã¹ãã¼ã«ã¾ã§ã¯ãwhy-2.24.tar.gzãå±éãããã£ã¬ã¯ããªã§
./configure make sudo make install
ã§OKããã¨ä¸ã¤ãgwhyã使ããªãã以ä¸ããã£ã¦ããã
why-config
ããããããªãã¨gwhyã使ãæ¤è¨¼å¨ã®è¨å®ãã¡ã¤ã«(.gwhyrc)ãã§ãã¦ãªãã®ã§ãgwhyèµ·åæã«æãããã
1.試ãã¦ã¿ã
Lesson1.javaãªãã¦ãã¡ã¤ã«ãä½ã£ã¦ã¿ãã
ken@ubuntu:~/src/why$ cat Lesson1.java public class Lesson1 { /*@ ensures \result >= x && \result >= y && @ \forall integer z; z >= x && z >= y ==> z >= \result; @*/ public static int max(int x, int y) { if (x>y) return x; else return x; } }
以ä¸ã§èµ·åããã
> gwhy Lesson1.java
ã³ã¼ãã¨å¯¾å¿ä»ãã¦ãã§ãã¯ãã¦ãããã®ã¯ä¾¿å©ã ãªãã