MrSlippery

Running KLEE to Solve 8-Queens

Feb 18th, 2016
325
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.68 KB | None | 0 0
  1. user@host:~/queens$ clang -emit-llvm -c queens.c -I ../include -I ../klee/include
  2. queens.c:32:3: warning: implicit declaration of function '__assert_fail' is invalid in C99
  3.       [-Wimplicit-function-declaration]
  4.   klee_assert(attack());  
  5.   ^
  6. ../klee/include/klee/klee.h:96:6: note: expanded from macro 'klee_assert'
  7.    : __assert_fail (#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__))    \
  8.      ^
  9. 1 warning generated.
  10. user@host:~/queens$ time klee --libc=uclibc --posix-runtime queens.bc
  11. KLEE: NOTE: Using klee-uclibc : /home/user/klee/Release+Asserts/lib/klee-uclibc.bca
  12. KLEE: NOTE: Using model: /home/user/klee/Release+Asserts/lib/libkleeRuntimePOSIX.bca
  13. KLEE: output directory is "/home/user/queens/klee-out-1"
  14. KLEE: WARNING: undefined reference to function: klee_posix_prefer_cex
  15. KLEE: WARNING ONCE: calling external: syscall(16, 0, 21505, 62278464)
  16. KLEE: WARNING ONCE: calling __user_main with extra arguments.
  17. KLEE: ERROR: (location information missing) ASSERTION FAIL: attack()
  18. KLEE: NOTE: now ignoring this error at this location
  19.  
  20. KLEE: done: total instructions = 7307
  21. KLEE: done: completed paths = 57
  22. KLEE: done: generated tests = 57
  23.  
  24. real    0m4.042s
  25. user    0m3.811s
  26. sys 0m0.226s
  27. user@host:~/queens$ ls klee-last/*.err
  28. klee-last/test000057.assert.err
  29. user@host:~/queens$ ktest-tool klee-last/test000057.ktest
  30. ktest file : 'klee-last/test000057.ktest'
  31. args       : ['queens.bc']
  32. num objects: 2
  33. object    0: name: 'model_version'
  34. object    0: size: 4
  35. object    0: data: '\x01\x00\x00\x00'
  36. object    1: name: 'queens'
  37. object    1: size: 8
  38. object    1: data: '\x04\x06\x03\x00\x02\x07\x05\x01'
  39.  
  40. Note that the coordinates are 0-based and check it: http://spaz.ca/aaron/SCS/queens/
Advertisement
Add Comment
Please, Sign In to add comment