ANSI-C形式验证工具:Bounded Model Checker

需积分: 10 2 下载量 92 浏览量 更新于2024-07-23 收藏 147KB PDF 举报
"ANSI-C_Bounded_Model_Checker UserManual EdmundClarke DanielKroening August2,2006 SchoolofComputerScience CarnegieMellonUniversity Pittsburgh,PA15213" ANSI-C Bounded Model Checker (ANSI-C BMC) 是一个用于正式验证ANSI-C程序的工具。该工具的核心技术是Bounded Model Checking(BMC),它是一种在形式验证中的方法,特别适用于检查程序的正确性。在BMC中,复杂的状态机及其规范被联合展开成一个布尔公式,然后通过 SAT(Satisfiability modulo Theories)求解器来判断该公式是否可满足,即程序是否存在错误。 ANSI-C BMC 支持完整的ANSI-C整数运算符,包括所有的指针构造,如动态内存分配、指针算术和指针类型转换。这意味着它可以处理那些涉及到内存管理和复杂指针操作的程序,这些往往是引发错误的常见源头。 形式验证是一种确保软件在执行前无错误的技术,它不同于传统的测试方法,因为形式验证提供的是数学上的保证,而不仅仅是通过特定输入测试。通过BMC,工具能够检查程序在某个预设的步数(或“界限”)内是否遵循其预定的行为。如果在有限的步数内发现错误,那么该错误在实际运行中也一定会出现。如果在界限内没有找到错误,这并不意味着程序完全无误,而是意味着在当前的界限内未发现错误,可能需要增加界限以进一步检查。 这个研究由多个机构赞助,包括半导体研究公司(SRC)、国家科学基金会(NSF)、海军研究办公室(ONR)、海军研究实验室(NRL)以及国防高级研究计划局和陆军研究办公室(ARO)。这反映了该领域的重要性以及各组织对确保软件安全性和可靠性的投入。 文档中的观点和结论代表了作者的研究成果,并不直接反映资助机构的立场。ANSI-C BMC 的使用可以帮助开发者在编码阶段就发现潜在的错误,从而提高软件质量和可靠性,减少因程序缺陷导致的问题。这对于关键领域的软件开发,如军事、航空航天和嵌入式系统等,尤为重要。
2015-09-20 上传
========= Cppcheck ========= About The original name of this program is "C++check" but it was later changed to "cppcheck". Manual A manual is available online: http://cppcheck.sourceforge.net/manual.pdf Compiling Any C++11 compiler should work. For compilers with partial C++11 support it may work. If your compiler has the C++11 features that are available in Visual Studio 2010 then it will work. If nullptr is not supported by your compiler then this can be emulated using the header lib/cxx11emu.h. To build the GUI, you need Qt. When building the command line tool, PCRE is optional. It is used if you build with rules. There are multiple compilation choices: * qmake - cross platform build tool * cmake - cross platform build tool * Windows: Visual Studio * Windows: Qt Creator + mingw * gnu make * g++ 4.6 (or later) * clang++ qmake ===== You can use the gui/gui.pro file to build the GUI. cd gui qmake make Visual Studio ============= Use the cppcheck.sln file. The file is configured for Visual Studio 2013, but the platform toolset can be changed easily to older or newer versions. The solution contains platform targets for both x86 and x64. To compile with rules, select "Release-PCRE" or "Debug-PCRE" configuration. pcre.lib (pcre64.lib for x64 builds) and pcre.h are expected to be in /extlibs then. Qt Creator + mingw ================== The PCRE dll is needed to build the CLI. It can be downloaded here: http://software-download.name/pcre-library-windows/ gnu make ======== Simple build (no dependencies): make The recommended release build is: make SRCDIR=build CFGDIR=cfg HAVE_RULES=yes Flags: SRCDIR=build : Python is used to optimise cppcheck CFGDIR=cfg : Specify folder where .cfg files are found HAVE_RULES=yes : Enable rules (pcre is required if this is used) g++ (for experts) ================= If you just want to build Cppcheck without dependencies then you can use this command: g++ -o cppcheck -std=c++0x -include lib/cxx11emu.h -Iexternals/tinyxml -Ilib cli/*.cpp lib/*.cpp externals/tinyxml/*.cpp If you want to use --rule and --rule-file then dependencies are needed: g++ -o cppcheck -std=c++0x -include lib/cxx11emu.h -lpcre -DHAVE_RULES -Ilib -Iexternals/tinyxml cli/*.cpp lib/*.cpp externals/tinyxml/*.cpp mingw ===== The "LDFLAGS=-lshlwapi" is needed when building with mingw mingw32-make LDFLAGS=-lshlwapi other compilers/ide =================== 1. Create a empty project file / makefile. 2. Add all cpp files in the cppcheck cli and lib folders to the project file / makefile. 3. Compile. Cross compiling Win32 (CLI) version of Cppcheck in Linux sudo apt-get install mingw32 make CXX=i586-mingw32msvc-g++ LDFLAGS="-lshlwapi" mv cppcheck cppcheck.exe Webpage http://cppcheck.sourceforge.net/

Failed cleaning build dir for numpy Failed to build numpy Installing collected packages: numpy Running setup.py install for numpy ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-h5_vrlht/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-3koy23ws-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: Running from numpy source directory. Note: if you need reliable uninstall behavior, then install with pip instead of using `setup.py install`: - `pip install .` (from a git repo or downloaded source release) - `pip install numpy` (last NumPy release on PyPi) Cythonizing sources Error compiling Cython file: ------------------------------------------------------------ ... cdef sfc64_state rng_state def __init__(self, seed=None): BitGenerator.__init__(self, seed) self._bitgen.state = <void *>&self.rng_state self._bitgen.next_uint64 = &sfc64_uint64 ^ ------------------------------------------------------------ _sfc64.pyx:90:35: Cannot assign type 'uint64_t (*)(void *) except? -1 nogil' to 'uint64_t (*)(void *) noexcept nogil' numpy/random/_bounded_integers.pxd.in has not changed Processing numpy/random/_sfc64.pyx Traceback (most recent call last): File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 235, in <module> main() File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 231, in main find_process_files(root_dir) File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 222, in find_process_files process(root_dir, fromfile, tofile, function, hash_db) File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 188, in process processor_function(fromfile, tofile) File "/tmp/pip-build-h5_vrlht/numpy/tools/cythonize.py", line 78, in process_pyx [sys.executable, '-m', 'cython'] + flags + ["-o", tofile, fromfile]) File "/usr/lib/python3.6/subprocess.py", line 311, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'cython', '-3', '--fast-fail', '-o', '_sfc64.c', '_sfc64.pyx']' returned non-zero exit status 1. Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-build-h5_vrlht/numpy/setup.py", line 508, in <module> setup_package() File "/tmp/pip-build-h5_vrlht/numpy/setup.py", line 488, in setup_package generate_cython() File "/tmp/pip-build-h5_vrlht/numpy/setup.py", line 285, in generate_cython raise RuntimeError("Running cythonize failed!") RuntimeError: Running cythonize failed! ---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-h5_vrlht/numpy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-3koy23ws-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-h5_vrlht/numpy/

2023-07-25 上传