Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
306 commits
Select commit Hold shift + click to select a range
1213b5f
test: Expect failures as Clang diagnostics in certified_counterexampl…
SwayamInSync Oct 27, 2026
f7e5de8
test: Expect failures as Clang diagnostics in certified_failure_attri…
SwayamInSync Oct 27, 2026
27de023
test: Expect failures as Clang diagnostics in certified_quantifier_ra…
SwayamInSync Oct 27, 2026
6c71778
test: Expect failures as Clang diagnostics in choose.cpp.
SwayamInSync Oct 27, 2026
fc2200b
test: Expect failures as Clang diagnostics in choose_axioms.cpp.
SwayamInSync Oct 27, 2026
74f8693
test: Expect failures as Clang diagnostics in choose_identity.cpp.
SwayamInSync Oct 27, 2026
990222d
test: Expect failures as Clang diagnostics in choose_reads.cpp.
SwayamInSync Oct 27, 2026
1828477
test: Expect failures as Clang diagnostics in choose_recursion.cpp.
SwayamInSync Oct 27, 2026
47b90b1
test: Expect failures as Clang diagnostics in class_invariants.cpp.
SwayamInSync Oct 27, 2026
7992fd2
test: Expect failures as Clang diagnostics in class_templates.cpp.
SwayamInSync Oct 27, 2026
6613f1c
test: Expect failures as Clang diagnostics in collections.cpp.
SwayamInSync Oct 27, 2026
41ba7d1
test: Expect failures as Clang diagnostics in command_line.cpp.
SwayamInSync Oct 27, 2026
5b909ee
test: Expect failures as Clang diagnostics in constant_expressions.cpp.
SwayamInSync Oct 27, 2026
a01794d
test: Expect failures as Clang diagnostics in constructors.cpp.
SwayamInSync Oct 27, 2026
4812a6a
test: Expect failures as Clang diagnostics in contract_math.cpp.
SwayamInSync Oct 27, 2026
67e66cb
test: Expect failures as Clang diagnostics in contract_wellformedness…
SwayamInSync Oct 27, 2026
88355da
test: Expect failures as Clang diagnostics in contracts_across_files.…
SwayamInSync Oct 27, 2026
73c4b89
test: Expect failures as Clang diagnostics in counterexample_confirma…
SwayamInSync Oct 27, 2026
6f60405
test: Expect failures as Clang diagnostics in demoted_vacuity.cpp.
SwayamInSync Oct 27, 2026
ed5a84e
test: Expect failures as Clang diagnostics in dynamic_storage_fail.cpp.
SwayamInSync Oct 27, 2026
ced3098
test: Expect failures as Clang diagnostics in enum_ranges.cpp.
SwayamInSync Oct 27, 2026
2fb7027
test: Expect failures as Clang diagnostics in extent_separation.cpp.
SwayamInSync Oct 27, 2026
0b83f21
test: Expect failures as Clang diagnostics in forall_introduction.cpp.
SwayamInSync Oct 27, 2026
e0f25b3
test: Expect failures as Clang diagnostics in frame_call_objects.cpp.
SwayamInSync Oct 27, 2026
c392eb9
test: Expect failures as Clang diagnostics in frontend_gaps.cpp.
SwayamInSync Oct 27, 2026
c3d2137
test: Expect failures as Clang diagnostics in function_filter.cpp.
SwayamInSync Oct 27, 2026
eaa3c24
test: Expect failures as Clang diagnostics in function_templates.cpp.
SwayamInSync Oct 27, 2026
71014a2
test: Expect failures as Clang diagnostics in ghost_locals.cpp.
SwayamInSync Oct 27, 2026
d0d1825
test: Expect failures as Clang diagnostics in ghost_math_values.cpp.
SwayamInSync Oct 27, 2026
06026d0
test: Expect failures as Clang diagnostics in globals.cpp.
SwayamInSync Oct 27, 2026
d24ca40
test: Expect failures as Clang diagnostics in inductive_counterexampl…
SwayamInSync Oct 27, 2026
88e03be
test: Expect failures as Clang diagnostics in inductive_lemmas.cpp.
SwayamInSync Oct 27, 2026
e742613
test: Expect failures as Clang diagnostics in inductive_predicates.cpp.
SwayamInSync Oct 27, 2026
1929493
test: Expect failures as Clang diagnostics in inductive_unfolding.cpp.
SwayamInSync Oct 27, 2026
415932f
test: Expect failures as Clang diagnostics in integer_encoding.cpp.
SwayamInSync Oct 27, 2026
1fd1007
test: Expect failures as Clang diagnostics in lean_refutation.test.
SwayamInSync Oct 27, 2026
26e766d
test: Expect failures as Clang diagnostics in llvm_uleb128_mutation.cpp.
SwayamInSync Oct 27, 2026
b97f401
test: Expect failures as Clang diagnostics in llvm_uleb128_shift_ub.cpp.
SwayamInSync Oct 27, 2026
736df0e
test: Expect failures as Clang diagnostics in local_names.cpp.
SwayamInSync Oct 27, 2026
8810d5a
test: Expect failures as Clang diagnostics in local_object_unsupporte…
SwayamInSync Oct 27, 2026
b2487a2
test: Expect failures as Clang diagnostics in local_record_arguments.…
SwayamInSync Oct 27, 2026
6d6ee0b
test: Expect failures as Clang diagnostics in lookup_tables.cpp.
SwayamInSync Oct 27, 2026
abd4290
test: Expect failures as Clang diagnostics in loop_forms.cpp.
SwayamInSync Oct 27, 2026
cad8ba3
test: Expect failures as Clang diagnostics in loop_frames.cpp.
SwayamInSync Oct 27, 2026
04d651e
test: Expect failures as Clang diagnostics in loop_initialization.cpp.
SwayamInSync Oct 27, 2026
0742050
test: Expect failures as Clang diagnostics in loop_local_frames.cpp.
SwayamInSync Oct 27, 2026
81f6a91
test: Expect failures as Clang diagnostics in loop_termination.cpp.
SwayamInSync Oct 27, 2026
26dd41c
test: Expect failures as Clang diagnostics in max_failures.cpp.
SwayamInSync Oct 27, 2026
06d7388
test: Expect failures as Clang diagnostics in member_functions.cpp.
SwayamInSync Oct 27, 2026
ef7b278
test: Expect failures as Clang diagnostics in member_operators.cpp.
SwayamInSync Oct 27, 2026
5f8f267
test: Expect failures as Clang diagnostics in memory_objects.cpp.
SwayamInSync Oct 27, 2026
e07257f
test: Expect failures as Clang diagnostics in mutual_recursion.cpp.
SwayamInSync Oct 27, 2026
82d0a51
test: Expect failures as Clang diagnostics in nested_quantifier_count…
SwayamInSync Oct 27, 2026
ec47f44
test: Expect failures as Clang diagnostics in old_loop_invariant_defi…
SwayamInSync Oct 27, 2026
583bad8
test: Expect failures as Clang diagnostics in out_parameters.cpp.
SwayamInSync Oct 27, 2026
5772e2e
test: Expect failures as Clang diagnostics in parallel_functions.test.
SwayamInSync Oct 27, 2026
be95090
test: Expect failures as Clang diagnostics in pointer_difference_null…
SwayamInSync Oct 27, 2026
f8c4bc0
test: Expect failures as Clang diagnostics in pointer_field_extents.cpp.
SwayamInSync Oct 27, 2026
03c88f7
test: Expect failures as Clang diagnostics in pointer_origins.cpp.
SwayamInSync Oct 27, 2026
5bab400
test: Expect failures as Clang diagnostics in pointer_steps.cpp.
SwayamInSync Oct 27, 2026
025310d
test: Expect failures as Clang diagnostics in pointer_subobjects.cpp.
SwayamInSync Oct 27, 2026
75e0ed9
test: Expect failures as Clang diagnostics in proof_clusters.cpp.
SwayamInSync Oct 27, 2026
80c5338
test: Expect failures as Clang diagnostics in proof_steps.cpp.
SwayamInSync Oct 27, 2026
9006035
test: Expect failures as Clang diagnostics in range_for.cpp.
SwayamInSync Oct 27, 2026
7451a86
test: Expect failures as Clang diagnostics in read_instances.cpp.
SwayamInSync Oct 27, 2026
7e1ea19
test: Expect failures as Clang diagnostics in record_references.cpp.
SwayamInSync Oct 27, 2026
8b72a5a
test: Expect failures as Clang diagnostics in record_values_in_memory…
SwayamInSync Oct 27, 2026
0223e73
test: Expect failures as Clang diagnostics in region_frames.cpp.
SwayamInSync Oct 27, 2026
d52b4b6
test: Expect failures as Clang diagnostics in sequence_encoding_race.…
SwayamInSync Oct 27, 2026
429a679
test: Expect failures as Clang diagnostics in sequence_induction.cpp.
SwayamInSync Oct 27, 2026
9f96dc4
test: Expect failures as Clang diagnostics in sequences.cpp.
SwayamInSync Oct 27, 2026
419f0de
test: Expect failures as Clang diagnostics in sequences_cvc5.test.
SwayamInSync Oct 27, 2026
186ba35
test: Expect failures as Clang diagnostics in shift_language_mode.cpp.
SwayamInSync Oct 27, 2026
7851e20
test: Expect failures as Clang diagnostics in slice_argument_objects.…
SwayamInSync Oct 27, 2026
530eef8
test: Expect failures as Clang diagnostics in sound_modular_region_fr…
SwayamInSync Oct 27, 2026
93688bf
test: Expect failures as Clang diagnostics in sound_pointer_stride_fa…
SwayamInSync Oct 27, 2026
e60a94f
test: Expect failures as Clang diagnostics in spec_argument_modes.cpp.
SwayamInSync Oct 27, 2026
94cd598
test: Expect failures as Clang diagnostics in spec_automation.cpp.
SwayamInSync Oct 27, 2026
1695fe3
test: Expect failures as Clang diagnostics in spec_fuel_counterexampl…
SwayamInSync Oct 27, 2026
2a8476c
test: Expect failures as Clang diagnostics in spec_induction.cpp.
SwayamInSync Oct 27, 2026
2ceecd8
test: Expect failures as Clang diagnostics in spec_machine_conversion…
SwayamInSync Oct 27, 2026
5a10f92
test: Expect failures as Clang diagnostics in spec_mutual_recursion.cpp.
SwayamInSync Oct 27, 2026
10c7d76
test: Expect failures as Clang diagnostics in spec_post.cpp.
SwayamInSync Oct 27, 2026
9a97aaf
test: Expect failures as Clang diagnostics in spec_reads.cpp.
SwayamInSync Oct 27, 2026
e38d61c
test: Expect failures as Clang diagnostics in spec_reads_exact.cpp.
SwayamInSync Oct 27, 2026
8475527
test: Expect failures as Clang diagnostics in spec_termination.cpp.
SwayamInSync Oct 27, 2026
2ccfccf
test: Expect failures as Clang diagnostics in spec_when.cpp.
SwayamInSync Oct 27, 2026
9c710c6
test: Expect failures as Clang diagnostics in std_min_max.cpp.
SwayamInSync Oct 27, 2026
1ceffdf
test: Expect failures as Clang diagnostics in subobject_pointers.cpp.
SwayamInSync Oct 27, 2026
180609e
test: Expect failures as Clang diagnostics in switch_statements.cpp.
SwayamInSync Oct 27, 2026
2b047e3
test: Expect failures as Clang diagnostics in trusted_declarations.cpp.
SwayamInSync Oct 27, 2026
5062fec
test: Expect failures as Clang diagnostics in unbounded_quantifiers.cpp.
SwayamInSync Oct 27, 2026
93159eb
test: Expect failures as Clang diagnostics in uncontracted_assertions…
SwayamInSync Oct 27, 2026
92004e8
test: Expect failures as Clang diagnostics in valid_builtin.cpp.
SwayamInSync Oct 27, 2026
5269354
test: Expect failures as Clang diagnostics in z3_exec_recursion.cpp.
SwayamInSync Oct 27, 2026
fde22f5
test: Expect failures as Clang diagnostics in z3_parameter_rebinding.…
SwayamInSync Oct 27, 2026
3e5f1b7
test: Expect failures as Clang diagnostics in z3_references_fail.cpp.
SwayamInSync Oct 27, 2026
fe8dda5
test: Expect failures as Clang diagnostics in z3_spec_decreases_sound…
SwayamInSync Oct 27, 2026
475ccf3
test: Expect failures as Clang diagnostics in z3_undefined_behavior.cpp.
SwayamInSync Oct 27, 2026
d7fb413
docs: Show failures as Clang diagnostics in chapter 7.
SwayamInSync Oct 27, 2026
c395c69
docs: Show failures as Clang diagnostics in chapter 13.
SwayamInSync Oct 27, 2026
7bce66f
docs: Show failures as Clang diagnostics in chapter 14.
SwayamInSync Oct 27, 2026
a3c3169
docs: Show failures as Clang diagnostics in chapter 18.
SwayamInSync Oct 27, 2026
980703c
docs: Show failures as Clang diagnostics in chapter 20.
SwayamInSync Oct 27, 2026
bbc567c
docs: Show failures as Clang diagnostics in the binary search case st…
SwayamInSync Oct 27, 2026
0145657
docs: Show failures as Clang diagnostics in the ghost, spec, and proo…
SwayamInSync Oct 27, 2026
52f9e5c
docs: Show failures as Clang diagnostics in the integers reference.
SwayamInSync Oct 27, 2026
8fef279
docs: Show failures as Clang diagnostics in the pointers reference.
SwayamInSync Oct 27, 2026
a9a64ad
docs: Show failures as Clang diagnostics in the structs reference.
SwayamInSync Oct 27, 2026
90ba369
test: Check undecided steps and a check failing in an arbitrary loop …
SwayamInSync Oct 27, 2026
45f04ec
Merge branch 'fix/contract-link-check' into fix/clang-diagnostics
SwayamInSync Oct 27, 2026
fcaa641
verify: Record where a source range begins, apart from its anchor.
SwayamInSync Oct 27, 2026
ec625f5
verify: Reject a source range that begins after its anchor.
SwayamInSync Oct 27, 2026
235adfe
verify: Move obligation archives to schema v5.
SwayamInSync Oct 27, 2026
b7cab52
verify: Archive where each source range begins, from schema v5.
SwayamInSync Oct 27, 2026
67eea9b
verify: Carry the function of a conversion error with its location.
SwayamInSync Oct 27, 2026
e39f73a
verify: Record the location of the function a conversion error belong…
SwayamInSync Oct 27, 2026
9b6d70c
verify: Declare the JSON, SARIF, and GitHub output helpers.
SwayamInSync Oct 27, 2026
0268240
verify: Build SARIF logs and GitHub workflow commands from diagnostic…
SwayamInSync Oct 27, 2026
109f607
verify: Build the structured output helpers.
SwayamInSync Oct 27, 2026
4deccbd
verify: Declare the release version for structured output.
SwayamInSync Oct 27, 2026
08a2992
verify: Return the release version as --version names it.
SwayamInSync Oct 27, 2026
4daacbf
verify: Add the GitHub diagnostics format.
SwayamInSync Oct 27, 2026
4e99d16
verify: Print cppverify.diagnostic/2 records with exact ranges, and G…
SwayamInSync Oct 27, 2026
47a7e0c
verify: Add SARIF and GitHub output, compiler diagnostics as records,…
SwayamInSync Oct 27, 2026
3c9081d
test: Add the input of the structured output test.
SwayamInSync Oct 27, 2026
8f8970c
test: Add an input with a compiler error for the structured output test.
SwayamInSync Oct 27, 2026
7b70742
test: Check JSON v2, SARIF, and GitHub output.
SwayamInSync Oct 27, 2026
37219ef
test: Read archive schema v5 and write records of schema v4.
SwayamInSync Oct 27, 2026
4e122bb
test: Read cppverify.diagnostic/2 records and the summary record in t…
SwayamInSync Oct 27, 2026
cb789e2
test: Replay archive schema v4 and reject a range that begins after i…
SwayamInSync Oct 27, 2026
8fb55d5
test: Expect archive schema v5 in obligation dumps.
SwayamInSync Oct 27, 2026
83f4b03
docs: Name SARIF output in the README.
SwayamInSync Oct 27, 2026
43b5bdf
docs: Describe JSON v2, SARIF, GitHub output, and archive schema v5.
SwayamInSync Oct 27, 2026
9acc1d1
docs: Note JSON v2, SARIF, and archive schema v5.
SwayamInSync Oct 27, 2026
2dfc81c
docs: Document JSON v2, SARIF, and GitHub annotations.
SwayamInSync Oct 27, 2026
1b60e49
docs: Note JSON v2, SARIF, GitHub annotations, and archive schema v5.
SwayamInSync Oct 27, 2026
d166f2e
docs: Count SARIF and GitHub annotations among the shipped diagnostics.
SwayamInSync Oct 27, 2026
f87ba7e
docs: Name the JSON, SARIF, and GitHub formats in chapter 15.
SwayamInSync Oct 27, 2026
4694472
docs: Describe JSON v2 records and CI output in chapter 16.
SwayamInSync Oct 27, 2026
a9de50d
docs: Name archive schema v5 in chapter 17.
SwayamInSync Oct 27, 2026
6fa7efd
test: Expect cppverify.diagnostic/2 records in located_errors.cpp.
SwayamInSync Oct 27, 2026
13babaa
test: Expect cppverify.diagnostic/2 records in backend_model_names.cpp.
SwayamInSync Oct 27, 2026
8e92435
test: Expect cppverify.diagnostic/2 records in backend_model_truth.cpp.
SwayamInSync Oct 27, 2026
a5361c8
test: Expect cppverify.diagnostic/2 records in backend_stable_id.test.
SwayamInSync Oct 27, 2026
26f9faf
test: Expect cppverify.diagnostic/2 records in bmc_incremental.cpp.
SwayamInSync Oct 27, 2026
76c1466
test: Expect cppverify.diagnostic/2 records in contracts_across_files…
SwayamInSync Oct 27, 2026
e93f084
test: Expect cppverify.diagnostic/2 records in counterexample_confirm…
SwayamInSync Oct 27, 2026
9f60444
test: Expect cppverify.diagnostic/2 records in function_templates.cpp.
SwayamInSync Oct 27, 2026
dfa1e23
test: Expect cppverify.diagnostic/2 records in inductive_rules.cpp.
SwayamInSync Oct 27, 2026
4d3c787
test: Expect cppverify.diagnostic/2 records in interrupt.cpp.
SwayamInSync Oct 27, 2026
778881d
test: Expect cppverify.diagnostic/2 records in lean_automation.test.
SwayamInSync Oct 27, 2026
a95c5ee
test: Expect cppverify.diagnostic/2 records in lean_refutation.test.
SwayamInSync Oct 27, 2026
35258ff
test: Expect cppverify.diagnostic/2 records in lean_replay.test.
SwayamInSync Oct 27, 2026
f8fcb15
test: Expect cppverify.diagnostic/2 records in per_function_errors.test.
SwayamInSync Oct 27, 2026
4d09972
test: Expect cppverify.diagnostic/2 records in replay_dependencies.cpp.
SwayamInSync Oct 27, 2026
47fb08a
verify: Describe a certified counterexample in source terms with its …
SwayamInSync Oct 27, 2026
7a1a151
verify: Declare describeCounterexample in Certify.h.
SwayamInSync Oct 27, 2026
52782fe
verify: Describe each counterexample cvc5 finds as Z3's are.
SwayamInSync Oct 27, 2026
147c075
verify: Place a replayed counterexample note at its check.
SwayamInSync Oct 27, 2026
29e43c5
test: Check describeCounterexample in CertifyTest.
SwayamInSync Oct 27, 2026
804ce4f
test: Check cvc5 failure notes in failure_notes_cvc5.test.
SwayamInSync Oct 27, 2026
ac030be
test: Add a failure cvc5 answers unknown for failure_notes_cvc5.test.
SwayamInSync Oct 27, 2026
c9daecc
test: Expect the replayed counterexample note at its check in failure…
SwayamInSync Oct 27, 2026
60262f9
test: Expect the counterexample of either solver in solver_race.cpp.
SwayamInSync Oct 27, 2026
86fde3c
docs: Show a cvc5 failure with its counterexample in chapter 17.
SwayamInSync Oct 27, 2026
bc6cc49
docs: Say any solver's undetermined values stay unknown in chapter 16.
SwayamInSync Oct 27, 2026
88eebc8
docs: Drop the cvc5 counterexample limitation.
SwayamInSync Oct 27, 2026
c56b1bc
docs: Say cvc5 models are shown as Z3's in tooling.
SwayamInSync Oct 27, 2026
34bb2c7
docs: Note cvc5 counterexamples in the 0.2.0 release notes.
SwayamInSync Oct 27, 2026
ddf9a17
docs: Describe describeCounterexample in ARCHITECTURE.
SwayamInSync Oct 27, 2026
2d740ba
docs: Say cvc5 failures read like Z3 ones in DESIGN.
SwayamInSync Oct 27, 2026
3120dff
Merge fix/contract-link-check into fix/clang-diagnostics.
SwayamInSync Oct 27, 2026
5bc252f
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 27, 2026
f419620
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 27, 2026
7c3cb1a
verify: Declare the SMT-LIB query dump in QueryDump.h.
SwayamInSync Oct 27, 2026
8cd8212
verify: Write each solver query as a standalone SMT-LIB script.
SwayamInSync Oct 27, 2026
a2144bd
verify: Build QueryDump.cpp.
SwayamInSync Oct 27, 2026
8e47bdb
verify: Record what a Z3 check solves for its dump.
SwayamInSync Oct 27, 2026
6a3bc76
verify: Dump each Z3 check with its solver options and answer.
SwayamInSync Oct 27, 2026
12156e1
verify: Dump each cvc5 run with its options as commands.
SwayamInSync Oct 27, 2026
167efb4
verify: Add --dump-smt2 to cpp-verify.
SwayamInSync Oct 27, 2026
ae748ca
cmake: Build the vendored Z3's shell for replaying dumped queries.
SwayamInSync Oct 27, 2026
7af363b
test: Pass the Z3 shell to lit.
SwayamInSync Oct 27, 2026
3257013
test: Record the Z3 shell in the lit site config.
SwayamInSync Oct 27, 2026
38ef2f5
test: Add the z3-shell feature and the %cppverify-z3 substitution.
SwayamInSync Oct 27, 2026
c2c1ed6
test: Add replay_smt2.py, which replays dumped queries.
SwayamInSync Oct 27, 2026
cec1a66
test: Add the input of smt2_dumps.test.
SwayamInSync Oct 27, 2026
c1e2be3
test: Check --dump-smt2 in smt2_dumps.test.
SwayamInSync Oct 27, 2026
0e5d7cd
docs: Document --dump-smt2 in tooling.
SwayamInSync Oct 27, 2026
cebeeba
docs: Point solver bug reports to --dump-smt2 in chapter 16.
SwayamInSync Oct 27, 2026
5dd9fb3
docs: List --dump-smt2 in chapter 15.
SwayamInSync Oct 27, 2026
4e34ff6
docs: Note --dump-smt2 in the 0.2.0 release notes.
SwayamInSync Oct 27, 2026
357adee
docs: Describe the query dump in ARCHITECTURE.
SwayamInSync Oct 27, 2026
8ac9bb2
docs: Mention --dump-smt2 in DESIGN.
SwayamInSync Oct 27, 2026
92f6074
docs: Show --dump-smt2 in the README.
SwayamInSync Oct 27, 2026
74cac50
test: Expect cppverify.diagnostic/2 records in obligation_size_limit.…
SwayamInSync Oct 27, 2026
48f0ce1
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 27, 2026
c4a803a
Merge fix/cvc5-counterexamples into fix/smt2-dumps.
SwayamInSync Oct 27, 2026
7d4958f
test: Add overloads to the input of smt2_dumps.test.
SwayamInSync Oct 28, 2026
7fe2cf0
test: Check that overloads' queries are apart in smt2_dumps.test.
SwayamInSync Oct 28, 2026
664e5bc
test: Only read, without their checks, the dumped scripts cpp-verify …
SwayamInSync Oct 28, 2026
6d937eb
verify: Dump a solver of the checked assertions alone, without the mo…
SwayamInSync Oct 28, 2026
31150f5
verify: Let dumpScript build a solver.
SwayamInSync Oct 28, 2026
7736262
docs: Say why the dump prints a solver of the assertions in ARCHITECT…
SwayamInSync Oct 28, 2026
ff9cd53
test: Add a query checked again on its solver for smt2_dumps.test.
SwayamInSync Oct 28, 2026
6bef7eb
test: Check that a dump leaves out the model converter in smt2_dumps.…
SwayamInSync Oct 28, 2026
9b3563f
Merge fix/contract-link-check into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
f854745
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
6878c63
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
9a8ab5d
Merge fix/cvc5-counterexamples into fix/smt2-dumps.
SwayamInSync Oct 28, 2026
eb99147
verify: Name the function being converted and declare appendObjectInv…
SwayamInSync Oct 28, 2026
792b369
verify: Keep class invariants at loops and take a local's address in …
SwayamInSync Oct 28, 2026
08b6432
parse: Resolve a spec template specialization named by hide or reveal.
SwayamInSync Oct 28, 2026
3e5a87e
test: Check class invariants at loops in class_invariants_in_loops.cpp.
SwayamInSync Oct 28, 2026
ba6667a
test: Check hide and reveal of spec template specializations.
SwayamInSync Oct 28, 2026
4721cef
test: Add the ring buffer case study.
SwayamInSync Oct 28, 2026
91dd205
docs: Add the ring buffer case study.
SwayamInSync Oct 28, 2026
15debf6
docs: List the ring buffer case study.
SwayamInSync Oct 28, 2026
e46e748
docs: Describe class invariants at loops and a local's address in con…
SwayamInSync Oct 28, 2026
2689ac1
docs: Say hide and reveal name template specializations.
SwayamInSync Oct 28, 2026
5274767
docs: List the view functions not supported yet.
SwayamInSync Oct 28, 2026
14a4bd0
docs: Note the ring buffer case study and its changes in the release …
SwayamInSync Oct 28, 2026
db98cf6
docs: Describe class invariants at loops in ARCHITECTURE.
SwayamInSync Oct 28, 2026
643184a
docs: Describe class invariants at loops and template hides in DESIGN.
SwayamInSync Oct 28, 2026
ec4a51f
Merge fix/smt2-dumps into fix/case-study-ring.
SwayamInSync Oct 28, 2026
77d4156
docs: Mark the ring buffer page's one-line bug as a fragment.
SwayamInSync Oct 28, 2026
284bd49
test: Check that a member's loop over another object of its class kee…
SwayamInSync Oct 28, 2026
227c60b
Merge fix/contract-link-check into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
bbe92e9
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
a547916
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
22ad036
Merge fix/cvc5-counterexamples into fix/smt2-dumps.
SwayamInSync Oct 28, 2026
66041c4
Merge fix/smt2-dumps into fix/case-study-ring.
SwayamInSync Oct 28, 2026
adc5508
Merge fix/contract-link-check into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
3addd3e
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
e6e609b
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
c6c2ac2
Merge fix/cvc5-counterexamples into fix/smt2-dumps.
SwayamInSync Oct 28, 2026
5451a63
Merge fix/smt2-dumps into fix/case-study-ring.
SwayamInSync Oct 28, 2026
ba4923e
Merge main into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
98ff074
test: Give confirmation_invariants.cpp's failure a budget a slow macO…
SwayamInSync Oct 28, 2026
338f595
test: Give extent_separation.cpp's decided run a budget a slow macOS …
SwayamInSync Oct 28, 2026
5abc81f
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
6b42f1b
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
8844efb
Merge fix/cvc5-counterexamples into fix/smt2-dumps.
SwayamInSync Oct 28, 2026
3cc6bff
Merge fix/smt2-dumps into fix/case-study-ring.
SwayamInSync Oct 28, 2026
4091430
Merge main into fix/clang-diagnostics.
SwayamInSync Oct 28, 2026
4177231
Merge fix/clang-diagnostics into fix/json-sarif.
SwayamInSync Oct 28, 2026
1a7a6ce
Merge fix/json-sarif into fix/cvc5-counterexamples.
SwayamInSync Oct 28, 2026
dde5bd6
Merge fix/cvc5-counterexamples into fix/smt2-dumps.
SwayamInSync Oct 28, 2026
d15c14e
Merge fix/smt2-dumps into fix/case-study-ring.
SwayamInSync Oct 28, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,17 +157,26 @@ and `docs/UB-CHECKING.md`.
./build/bin/cpp-verify --timeout=10000 --solver-rlimit=2000000 file.cpp
./build/bin/cpp-verify --int-encoding=bitvector file.cpp # auto (default) | integer | bitvector
./build/bin/cpp-verify --diagnostics-format=json file.cpp # JSON Lines, for editors/CI
./build/bin/cpp-verify --diagnostics-format=sarif file.cpp # SARIF 2.1.0, for code scanning
./build/bin/cpp-verify --obligation-out=goals.cpv file.cpp # backend-neutral archive
./build/bin/cpp-verify --dump-ir=1,2,3,4 file.cpp # VCR, passive, Obligation IR, Z3
./build/bin/cpp-verify --dump-smt2=queries file.cpp # each solver query as an SMT-LIB script
```

Z3 runs support deterministic isolated solving (`--jobs`) and positive-proof reuse
(`--proof-cache`). A query past `--timeout` or `--solver-rlimit` is reported as
*unresolved* rather than hanging — never as verified. `--int-encoding` only chooses
how machine integers reach the solver; every choice is exact, so it can change speed
but never a verdict. A failure names the function and the obligation that failed,
`<function identity>::<kind>@line:column`, e.g.
`verification failed: abs [fn_5f5a3361627369::overflow@5:3]`.
but never a verdict. A failure is a compiler error at the failing source, naming
the function and the kind of check, with its counterexample and path as notes;
without its precondition, `abs` gives:

```text
abs.cpp:4:3: error: verification failed: abs [overflow] [backend=z3] [reason=counterexample]
4 | return x < 0 ? -x : x;
| ^
abs.cpp:4:3: note: counterexample: x = -2147483648
```

Chained modular calls (e.g. `return inc(inc(x))`) are lowered to temporaries automatically.
See [Chapter 17](https://swayaminsync.github.io/cpp-verify/book/part-ii/ch17-backends-modular-calls.html).
Expand Down
10 changes: 9 additions & 1 deletion clang/cmake/modules/CppVerifyZ3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function(cppverify_z3_build_external)
-DCMAKE_INSTALL_PREFIX:PATH=${_install}
-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON
-DZ3_BUILD_LIBZ3_SHARED:BOOL=OFF
-DZ3_BUILD_EXECUTABLE:BOOL=OFF
-DZ3_BUILD_EXECUTABLE:BOOL=ON
-DZ3_BUILD_TEST_EXECUTABLES:BOOL=OFF
-DZ3_BUILD_DOCUMENTATION:BOOL=OFF
-DZ3_ENABLE_EXAMPLE_TARGETS:BOOL=OFF
Expand All @@ -107,6 +107,9 @@ function(cppverify_z3_build_external)
# sources include the headers must depend on this target as well.
set_property(GLOBAL PROPERTY CPPVERIFY_Z3_EP_TARGET cppverify_z3_ep)
set_property(GLOBAL PROPERTY CPPVERIFY_Z3_ORIGIN vendored)
# Z3's own shell, which replays the scripts --dump-smt2 writes in tests.
set_property(GLOBAL PROPERTY CPPVERIFY_Z3_SHELL
"${_install}/bin/z3${CMAKE_EXECUTABLE_SUFFIX}")
endfunction()

function(cppverify_z3_try_system out_var)
Expand Down Expand Up @@ -143,6 +146,11 @@ function(cppverify_z3_try_system out_var)
if(_target)
message(STATUS "CppVerify: using system Z3 (${_target})")
set_property(GLOBAL PROPERTY CPPVERIFY_Z3_ORIGIN system)
find_program(CPPVERIFY_SYSTEM_Z3_SHELL z3)
if(CPPVERIFY_SYSTEM_Z3_SHELL)
set_property(GLOBAL PROPERTY CPPVERIFY_Z3_SHELL
"${CPPVERIFY_SYSTEM_Z3_SHELL}")
endif()
endif()
set(${out_var} "${_target}" PARENT_SCOPE)
endfunction()
Expand Down
4 changes: 4 additions & 0 deletions clang/include/clang/Basic/DiagnosticFrontendKinds.td
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ def err_fe_invalid_plugin_name : Error<
"unable to find plugin '%0'">;
def err_fe_cppverify_failed : Error<
"cppverify: %0">;
def err_cppverify_result : Error<"%0">;
def warn_cppverify_result : Warning<"%0">, InGroup<CppVerify>;
def remark_cppverify_result : Remark<"%0">, InGroup<CppVerify>;
def note_cppverify_result : Note<"%0">;
def err_fe_expected_compiler_job : Error<
"unable to handle compilation, expected exactly one compiler job in '%0'">;
def err_fe_expected_clang_command : Error<
Expand Down
3 changes: 3 additions & 0 deletions clang/include/clang/Basic/DiagnosticGroups.td
Original file line number Diff line number Diff line change
Expand Up @@ -1798,6 +1798,9 @@ Results can be filtered by function name by passing
def : DiagGroup<"frame-larger-than=", [BackendFrameLargerThan]>;
def BackendPlugin : DiagGroup<"backend-plugin">;
def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
// cpp-verify's results in a compilation: its warnings, and its proofs as
// remarks.
def CppVerify : DiagGroup<"cppverify">;
def BackendOptimizationRemark : DiagGroup<"pass">;
def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
Expand Down
2 changes: 1 addition & 1 deletion clang/include/clang/Basic/DiagnosticIDs.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ enum class Group;
enum {
DIAG_SIZE_COMMON = 300,
DIAG_SIZE_DRIVER = 400,
DIAG_SIZE_FRONTEND = 200,
DIAG_SIZE_FRONTEND = 250,
DIAG_SIZE_SERIALIZATION = 120,
DIAG_SIZE_LEX = 500,
DIAG_SIZE_PARSE = 800,
Expand Down
19 changes: 16 additions & 3 deletions clang/lib/Parse/ParseCppVerify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,16 @@ StmtResult Parser::ParseContractAssert() {
ContractAssertStmt(CALoc, LParenLoc, RParenLoc, Cond.get(), By);
}

/// \p Fn, the function a hide, reveal, or reveal_with_fuel names: a spec
/// template specialization such as `at<4>` is an overload set until it is
/// resolved to the one specialization it names.
static ExprResult resolveNamedFunction(Sema &Actions, ExprResult Fn) {
if (Fn.isUsable() &&
Fn.get()->getType() == Actions.getASTContext().OverloadTy)
return Actions.CheckPlaceholderExpr(Fn.get());
return Fn;
}

/// Parse cppverify::reveal_with_fuel(fn, depth);
StmtResult Parser::ParseRevealWithFuel() {
SourceLocation Loc = ConsumeCppVerify();
Expand All @@ -1157,7 +1167,8 @@ StmtResult Parser::ParseRevealWithFuel() {
}
SourceLocation LParenLoc = ConsumeParen();

ExprResult Fn = finishCppVerifyExpression(ParseAssignmentExpression());
ExprResult Fn = resolveNamedFunction(
Actions, finishCppVerifyExpression(ParseAssignmentExpression()));
if (Fn.isInvalid() || Tok.isNot(tok::comma)) {
if (!Fn.isInvalid())
Diag(Tok, diag::err_contract_expected_comma)
Expand Down Expand Up @@ -1193,7 +1204,8 @@ StmtResult Parser::ParseHideSpec() {
return StmtError();
}
SourceLocation LParenLoc = ConsumeParen();
ExprResult Fn = finishCppVerifyExpression(ParseAssignmentExpression());
ExprResult Fn = resolveNamedFunction(
Actions, finishCppVerifyExpression(ParseAssignmentExpression()));
if (Fn.isInvalid()) {
SkipUntil(tok::r_paren, StopAtSemi);
return StmtError();
Expand All @@ -1216,7 +1228,8 @@ StmtResult Parser::ParseRevealSpec() {
return StmtError();
}
SourceLocation LParenLoc = ConsumeParen();
ExprResult Fn = finishCppVerifyExpression(ParseAssignmentExpression());
ExprResult Fn = resolveNamedFunction(
Actions, finishCppVerifyExpression(ParseAssignmentExpression()));
if (Fn.isInvalid()) {
SkipUntil(tok::r_paren, StopAtSemi);
return StmtError();
Expand Down
41 changes: 35 additions & 6 deletions clang/lib/Verify/Backend/CVC5Backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ChildProcess.h"
#include "ObligationSerialization.h"
#include "ObligationSimplify.h"
#include "QueryDump.h"
#include "TaskGroup.h"
#include "llvm/ADT/APInt.h"
#include "llvm/ADT/STLFunctionalExtras.h"
Expand Down Expand Up @@ -2406,6 +2407,18 @@ static bool printsSequencesReversed(const std::string &SolverPath) {
return Reversed;
}

/// The options cvc5 runs with, as names and values; a flag has no value.
static std::vector<std::pair<std::string, std::string>>
cvc5Options(unsigned TimeoutMs, unsigned ResourceLimit) {
std::vector<std::pair<std::string, std::string>> Options = {
{"seed", "0"}, {"sat-random-seed", "0"}, {"dump-models", ""}};
if (TimeoutMs != 0)
Options.push_back({"tlimit-per", std::to_string(TimeoutMs)});
if (ResourceLimit != 0)
Options.push_back({"rlimit-per", std::to_string(ResourceLimit)});
return Options;
}

static SolverRun runCVC5(const std::string &SolverPath, llvm::StringRef Script,
unsigned TimeoutMs, unsigned ResourceLimit,
uint64_t MemoryLimitMB,
Expand Down Expand Up @@ -2452,12 +2465,9 @@ static SolverRun runCVC5(const std::string &SolverPath, llvm::StringRef Script,
}
llvm::FileRemover RemoveError(ErrorPath);

std::vector<std::string> OwnedArgs = {SolverPath, "--lang=smt2", "--seed=0",
"--sat-random-seed=0", "--dump-models"};
if (TimeoutMs != 0)
OwnedArgs.push_back("--tlimit-per=" + std::to_string(TimeoutMs));
if (ResourceLimit != 0)
OwnedArgs.push_back("--rlimit-per=" + std::to_string(ResourceLimit));
std::vector<std::string> OwnedArgs = {SolverPath, "--lang=smt2"};
for (const auto &[Name, Value] : cvc5Options(TimeoutMs, ResourceLimit))
OwnedArgs.push_back("--" + Name + (Value.empty() ? "" : "=" + Value));
OwnedArgs.push_back(InputPath.str().str());
llvm::SmallVector<llvm::StringRef, 8> Args;
for (const std::string &Argument : OwnedArgs)
Expand Down Expand Up @@ -2777,8 +2787,21 @@ CVC5VerifyBackend::verifyQuery(const ObligationModule &Module,
}
Budget = static_cast<unsigned>(Remaining);
}
QueryDump Dump;
if (queryDumpEnabled()) {
// The command line's options as commands, so that `cvc5 FILE` runs
// the query as cpp-verify did.
std::string Options;
for (const auto &[Name, Value] : cvc5Options(Budget, ResourceLimit))
Options += "(set-option :" + Name + " " +
(Value.empty() ? "true" : Value) + ")\n";
Dump.start(&Module, Query, "cvc5", "at " + SolverPath, Options, *Script);
}
SolverRun Run = runCVC5(SolverPath, *Script, Budget, ResourceLimit,
MemoryLimitMB, &Cancelled);
Dump.finish(
Run.Output ? llvm::StringRef(*Run.Output).split('\n').first.trim().str()
: "no answer (" + Run.Failure.Message + ")");
auto giveUp = [&](llvm::StringRef Outcome) {
RefinementDecision Exhausted = Refinement.exhausted(Outcome);
Result.Reason = Exhausted.Reason;
Expand Down Expand Up @@ -2809,6 +2832,8 @@ CVC5VerifyBackend::verifyQuery(const ObligationModule &Module,
Result.Status = VerifyStatus::Failed;
Result.Reason = VerifyReason::Counterexample;
Result.CertifiedWith = std::move(Certified.Evidence);
describeCounterexample(Module, *Query, Candidate, Result,
checkLimits());
return Result;
}
} else {
Expand Down Expand Up @@ -2876,6 +2901,8 @@ CVC5VerifyBackend::verifyQuery(const ObligationModule &Module,
Result.Status = VerifyStatus::Failed;
Result.Reason = VerifyReason::Counterexample;
Result.CertifiedWith = Certified.Evidence;
describeCounterexample(Module, *Query, Candidate, Result,
checkLimits());
return Result;
}
if (Decision.Next == RefinementDecision::Action::Stop) {
Expand All @@ -2897,6 +2924,8 @@ VerifyResult CVC5VerifyBackend::verifyObligation(const ObligationModule &Module,
Result.ObligationId = Item.StableId.empty() ? Item.Id : Item.StableId;
Result.ObligationType = Item.Kind;
Result.Location = Item.Loc;
Result.BeginLocation = Item.BeginLoc;
Result.EndLocation = Item.EndLoc;
Result.Source = Item.Source;
if (Result.Status == VerifyStatus::Unresolved)
Result.Message = "proof obligation " + Result.ObligationId +
Expand Down
66 changes: 65 additions & 1 deletion clang/lib/Verify/Backend/Certify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4187,15 +4187,79 @@ verify::candidateValues(const ObligationModule &Module, const LogicExpr &Query,
It != Module.DiagnosticVariables.end() ? It->second.DisplayName : Name;
Value.InternalName = Name;
Value.Sort = Sort;
if (It != Module.DiagnosticVariables.end())
if (It != Module.DiagnosticVariables.end()) {
Value.Source = It->second.Source;
Value.Reference = It->second.Reference;
}
if (std::optional<LogicValue> Given = Model.constant(Name, Sort))
Value.Value = formatLogicValue(*Given);
Values.push_back(std::move(Value));
}
return Values;
}

void verify::describeCounterexample(const ObligationModule &Module,
const LogicExpr &Query,
CandidateModel &Model, VerifyResult &Result,
const CertifyLimits &Limits) {
auto evaluated = [&](const LogicExpr *Term) -> std::optional<LogicValue> {
if (!Term)
return std::nullopt;
return evaluateTerm(Module, *Term, Model, Limits);
};
auto truth = [&](const LogicExpr *Term) -> std::optional<bool> {
std::optional<LogicValue> Value = evaluated(Term);
if (!Value || Value->K != LogicValue::Kind::Bool)
return std::nullopt;
return Value->Truth;
};
const Obligation *Failing = nullptr;
for (const Obligation &Item : Module.Obligations)
if (Item.CounterexampleQuery.get() == &Query) {
Failing = &Item;
break;
}
if (Failing)
Result.Assignment = counterexampleAssignment(*Failing, Model);

// In the order Z3's models list them, by internal name.
Result.Model = candidateValues(Module, Query, Model);
llvm::sort(Result.Model,
[](const VerifyModelValue &A, const VerifyModelValue &B) {
return A.InternalName < B.InternalName;
});
for (VerifyModelValue &Value : Result.Model)
if (auto It = Module.DiagnosticVariables.find(Value.InternalName);
It != Module.DiagnosticVariables.end() && It->second.Guard)
Value.OnPath = truth(It->second.Guard.get());

Result.Trace.clear();
const uint64_t Count =
Failing ? std::min<uint64_t>(Failing->TraceEventCount,
Module.TraceEvents.size())
: 0;
for (uint64_t I = 0; I != Count; ++I) {
const DiagnosticTraceEvent &Event = Module.TraceEvents[I];
std::optional<bool> Active = truth(Event.Guard.get());
if (Active == false)
continue;
VerifyTraceEvent Step;
Step.Kind = Event.Kind;
Step.Message = Event.Message;
Step.Loc = Event.Loc;
Step.Source = Event.Source;
Step.Active = Active;
for (const DiagnosticTraceValue &Value : Event.Values) {
std::optional<LogicValue> Given = evaluated(Value.Value.get());
Step.Values.push_back(
{Value.Label, Value.Value->Sort,
Given ? std::optional<std::string>(formatLogicValue(*Given))
: std::nullopt});
}
Result.Trace.push_back(std::move(Step));
}
}

std::string verify::shownApplication(const ObligationModule &Module,
const LogicExpr &Application,
CandidateModel &Model,
Expand Down
10 changes: 10 additions & 0 deletions clang/lib/Verify/Backend/Certify.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,16 @@ std::vector<VerifyModelValue> candidateValues(const ObligationModule &Module,
const LogicExpr &Query,
CandidateModel &Model);

/// Describes in \p Result the counterexample \p Model gives \p Query, an
/// obligation's counterexample query, as a failure shows it: the source
/// variables' values, each version marked on the path or off it, and the
/// steps of the obligation's path, each with its values. What the model
/// leaves open stays undetermined.
void describeCounterexample(const ObligationModule &Module,
const LogicExpr &Query, CandidateModel &Model,
VerifyResult &Result,
const CertifyLimits &Limits = {});

/// \p Application with its arguments' values under \p Model, as
/// "fibo(1000000000)".
std::string shownApplication(const ObligationModule &Module,
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Verify/Backend/Induction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ std::unique_ptr<LogicExpr> node(LogicExpr::Kind K, LogicSort Sort,
Node->Sort = Sort;
if (At) {
Node->Loc = At->Loc;
Node->BeginLoc = At->BeginLoc;
Node->EndLoc = At->EndLoc;
Node->Source = At->Source;
}
Expand Down Expand Up @@ -722,6 +723,7 @@ ObligationModule copyObligationModule(const ObligationModule &Module) {
Same.StableId = Item.StableId;
Same.Kind = Item.Kind;
Same.Loc = Item.Loc;
Same.BeginLoc = Item.BeginLoc;
Same.EndLoc = Item.EndLoc;
Same.Source = Item.Source;
Same.TraceEventCount = Item.TraceEventCount;
Expand Down
Loading
Loading