{"id":25777088,"url":"https://github.com/sosy-lab/cpachecker","last_synced_at":"2026-01-12T08:05:26.537Z","repository":{"id":17335991,"uuid":"20107238","full_name":"sosy-lab/cpachecker","owner":"sosy-lab","description":"CPAchecker, the Configurable Software-Verification Platform (read-only mirror)","archived":false,"fork":false,"pushed_at":"2024-10-29T11:40:33.000Z","size":827098,"stargazers_count":226,"open_issues_count":0,"forks_count":90,"subscribers_count":23,"default_branch":"main","last_synced_at":"2024-10-29T12:06:49.162Z","etag":null,"topics":["c","java","software-verification","static-analysis","verification"],"latest_commit_sha":null,"homepage":"https://cpachecker.sosy-lab.org","language":"SWIG","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sosy-lab.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"Authors.md","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-05-23T16:57:37.000Z","updated_at":"2024-10-28T15:52:41.000Z","dependencies_parsed_at":"2023-09-23T11:41:39.160Z","dependency_job_id":"4be8fec0-49e5-471b-ac77-1faae7c56207","html_url":"https://github.com/sosy-lab/cpachecker","commit_stats":{"total_commits":33044,"total_committers":131,"mean_commits":"252.24427480916032","dds":0.7304200459992737,"last_synced_commit":"9ce8a62b6d59f5b2d4d71586979f09b03c665320"},"previous_names":[],"tags_count":54,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sosy-lab%2Fcpachecker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sosy-lab%2Fcpachecker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sosy-lab%2Fcpachecker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sosy-lab%2Fcpachecker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sosy-lab","download_url":"https://codeload.github.com/sosy-lab/cpachecker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240987435,"owners_count":19889335,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","java","software-verification","static-analysis","verification"],"created_at":"2025-02-27T06:01:36.245Z","updated_at":"2026-01-12T08:05:26.510Z","avatar_url":"https://github.com/sosy-lab.png","language":"SWIG","funding_links":[],"categories":["静态分析"],"sub_categories":[],"readme":"\u003c!--\nThis file is part of CPAchecker,\na tool for configurable software verification:\nhttps://cpachecker.sosy-lab.org\n\nSPDX-FileCopyrightText: 2007-2020 Dirk Beyer \u003chttps://www.sosy-lab.org\u003e\n\nSPDX-License-Identifier: Apache-2.0\n--\u003e\n\nGetting Started with CPAchecker\n===============================\n\n- [Installation Instructions](INSTALL.md)\n- [Contribution Guidelines](CONTRIBUTING.md)\n- [Development Instructions](doc/Developing.md)\n\nMore documentation can be found in the [`doc/`](doc/) directory.\n\nLicense and Copyright\n---------------------\nCPAchecker is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0)\nwith copyright by [Dirk Beyer](https://www.sosy-lab.org/people/beyer/) and others\n(cf. [Authors.md](Authors.md) for full list of all contributors).\nThird-party libraries are under various other licenses and copyrights,\ncf. the files in the directory `LICENSES` for the full license texts.\nIn particular, MathSAT is available for research and evaluation purposes only\n(cf. `LICENSES/LicenseRef-MathSAT-CPAchecker.txt`),\nso make sure to use a different SMT solver if necessary.\nNote that although a GPL program is distributed together with CPAchecker,\nCPAchecker is separate from that program and thus not under the terms of the GPL.\n\nPrepare Programs for Verification by CPAchecker\n-----------------------------------------------\n\nBy default CPAchecker pre-processes C programs \nusing an external C pre-processor (like `cpp` or `gcc -E`).\nHowever, you can also pre-process programs yourself\nand provide the pre-processed C code to CPAchecker directly.\nThis is especially useful if your program\ncontains non-standard constructs that the external pre-processor cannot handle,\nor if the macros defined change the column numbers in\nthe code (which CPAchecker cannot currently match back \nto the locations in the original source code).\nYou can enable pre-processing explicitly inside CPAchecker\nby specifying `--preprocess` on the command line.\nMultiple C files can be given and will be linked together\nand verified as a single program (experimental feature).\n\nCPAchecker is able to parse and analyze a large subset of (GNU)C.\nIf parsing fails for your program, please send a report to\ncpachecker-users@googlegroups.com.\n\nVerifying a Program with CPAchecker\n-----------------------------------\n\n1. Choose a source code file that you want to be checked.\n   If you use your own program, remember to either pre-process \n   it as mentioned above or let CPAchecker preprocess it internally.\n   Example: `doc/examples/example.c` or `doc/examples/example_bug.c`\n   A good source for more example programs is the\n   [SV-Benchmarks](https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks) repository\n   that is for example used by the\n   [International Competition on Software Verification](http://sv-comp.sosy-lab.org/).\n\n2. Optionally: If you want to choose certain analyses like predicate analysis,\n   specify a configuration file. This file defines for example which CPAs are used.\n   Standard configuration files can be found in the directory [`config/`](config/).\n   If you do not want a specific analysis,\n   we recommend the default configuration of CPAchecker.\n   However, note that if you are on MacOS\n   you need to provide specifically-compiled MathSAT binaries\n   for the default configuration to work\n   (or use Docker in order to run the Linux version of CPAchecker).\n   The configuration of CPAchecker is explained in [`doc/Configuration.md`](doc/Configuration.md).\n\n3. Choose a specification file (you may not need this for some configurations).\n   The standard configurations use `config/specification/default.spc`\n   as the default specification. With this one, CPAchecker will look for labels\n   named `ERROR` (case insensitive) and assertions in the source code file.\n   Other examples for specifications can be found in [`config/specification/`](config/specification/)\n   in the CPAchecker directory.\n\n4. Execute `bin/cpachecker [ --config \u003cCONFIG_FILE\u003e ] [ --spec \u003cSPEC_FILE\u003e ] \u003cSOURCE_FILE\u003e`\n   Additional command-line arguments are described in [`doc/Configuration.md`](doc/Configuration.md).\n   To use the default configuration of CPAchecker,\n   pass only the source file: `bin/cpachecker doc/examples/example.c`.\n   A specific analysis (like k-induction) can be chosen\n   for example with `bin/cpachecker --config/kInduction.properties doc/examples/example.c`\n   or the equivalent abbreviation `bin/cpachecker --kInduction doc/examples/example.c`.\n   Java 21 or later is necessary. If it is not in your PATH,\n   you need to specify it in the environment variable JAVA.\n   Example: `export JAVA=/usr/lib/jvm/java-21-openjdk-amd64/bin/java`\n   for 64bit OpenJDK 21 on Ubuntu.\n\n   Please note that not all analysis configurations are available for MacOS\n   because we do not ship binaries for SMT solvers for this platform.\n   You either need to build the appropriate binaries yourself\n   or use less powerful analyses that work with Java-based solvers,\n   for example this one instead of CPAchecker's default configuration:\n   `--predicateAnalysis-linear --option solver.solver=SMTInterpol`\n   Of course you can also use solutions like Docker\n   for executing the Linux version of CPAchecker.\n\n   If you installed CPAchecker using Docker, the above example command line would look like this:\n   `docker run -v $(pwd):/workdir -u $UID:$GID sosylab/cpachecker /cpachecker/doc/examples/example.c`\n   This command makes the current directory available in the container,\n   so to verify a program in the current directory just provide its file name\n   instead of the example that is bundled with CPAchecker.\n   Output files of CPAchecker will be placed in `./output/`.\n\n5. Additionally to the console output,\n   an interactive HTML report is generated in the directory `output/`,\n   either named `Report.html` (for result TRUE) or `Counterexample.*.html` (for result FALSE).\n   Open these files in a browser to view the CPAchecker analysis result\n   (cf. [`doc/Report.md`](doc/Report.md))\n\nThere are also additional output files in the directory `output/`:\n\n - `ARG.dot`: Visualization of abstract reachability tree (Graphviz format)\n - `cfa*.dot`: Visualization of control flow automaton (Graphviz format)\n - `reached.dot`: Visualization of control flow automaton with the abstract\n    states visualized on top (Graphviz format)\n - `coverage.info`: Coverage information (similar to those of testing tools) in `Gcov` format\n       Use the following command line to generate an HTML report as `output/index.html`:\n       `genhtml output/coverage.info --output-directory output --legend`\n - `Counterexample.*.txt`: A path through the program that leads to an error\n - `Counterexample.*.assignment.txt`: Assignments for all variables on the error path.\n - `Counterexample.*.harness.c`: A test harness that can reproduce the error path through test execution.\n       See [doc/tutorials/test-harness.md](doc/tutorials/test-harness.md) for an example use.\n - `predmap.txt`: Predicates used by predicate analysis to prove program safety\n - `reached.txt`: Dump of all reached abstract states\n - `Statistics.txt`: Time statistics (can also be printed to console with `--stats`)\n \nNote that not all of these files will be available for all configurations.\nAlso, some of these files are only produced if an error is found (or vice-versa).\nCPAchecker will overwrite files in this directory!\n\n\nValidating a Program with CPA-witness2test\n------------------------------------------\n\nYou can validate violation witnesses with CPA-witness2test, which is part of CPAchecker.\n\n1. To do so, you need a violation witness, a specification file that fits the violation witness,\n   and the source code file that fits the violation witness.\n2. To validate the witness, execute the following command:\n   ```\n   bin/cpa-witness2test --witness \u003cWITNESS_FILE\u003e --spec \u003cSPEC_FILE\u003e \u003cSOURCE_FILE\u003e`\n   ```\n   Addtional command-line arguments are viewed with `bin/cpa-witness2test -h`.\n\n3. When finished, and if the violation witness is successfully validated, the console output shows `Verification result: FALSE`.\n   Additionally to the console output, CPA-witness2test also creates a file `output/*.harness.c`.\n   This file can be compiled against the source file to create an executable test\n   that reflects the violation witness.\n\nNote that if the violation witness does not contain enough information to create an executable test,\nthe validation result will be `ERROR` and the console output will contain the following line:\n`Could not export a test harness, some test-vector values are missing.`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsosy-lab%2Fcpachecker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsosy-lab%2Fcpachecker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsosy-lab%2Fcpachecker/lists"}