Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
128a6cb
verify: Replay a Lean project into one kernel environment, importing …
SwayamInSync Oct 23, 2026
62cac8d
test: Add a program whose first goal sorts before the other function'…
SwayamInSync Oct 23, 2026
9d85f6e
test: Add a proof of the first goal that defines a goal of its own un…
SwayamInSync Oct 23, 2026
fe6fc92
test: Expect a proof file that redeclares its goal to be the module l…
SwayamInSync Oct 23, 2026
f716cd7
test: Add a wrapper that bounds the peak memory of the processes a co…
SwayamInSync Oct 23, 2026
a9098e0
test: Bound the Lean checker's memory where a proof imports Lean thro…
SwayamInSync Oct 23, 2026
f814f9f
docs: Say that certification imports the toolchain once and rejects a…
SwayamInSync Oct 23, 2026
ed50d74
docs: Say in the release notes that the checker replays into one envi…
SwayamInSync Oct 23, 2026
e918963
docs: Describe the checker's single kernel environment in the design.
SwayamInSync Oct 23, 2026
c55de5b
docs: Describe the checker's single kernel environment and its memory…
SwayamInSync Oct 23, 2026
51a9a6a
verify: Declare a Lean project's generated modules and the prelude's …
SwayamInSync Oct 23, 2026
34ef6d0
verify: Emit a project's spec declarations apart from its goals, and …
SwayamInSync Oct 23, 2026
cdcaec5
verify: Let the Lean backend write the modules of a project.
SwayamInSync Oct 23, 2026
505cf15
verify: Write each function's Lean goals to its module and the specs …
SwayamInSync Oct 23, 2026
86e4a9d
verify: Import only the prelude in the module of cppverify_auto.
SwayamInSync Oct 23, 2026
c23e58c
verify: Check each goal against its own module, and fail every goal w…
SwayamInSync Oct 23, 2026
2ef7e14
verify: Give each function's Lean goals a module, and compile a proof…
SwayamInSync Oct 23, 2026
da1845a
test: Add a helper that prints a Lean project's generated text in imp…
SwayamInSync Oct 23, 2026
548094c
test: Read a Lean project's goals from its modules in the fidelity gate.
SwayamInSync Oct 23, 2026
2c9de79
test: Add the five functions of the Lean modules test.
SwayamInSync Oct 23, 2026
28af37d
test: Add the proof of tri_zero's postcondition for the Lean modules …
SwayamInSync Oct 23, 2026
901c3ca
test: Add the proof of plus_tri_zero's postcondition for the Lean mod…
SwayamInSync Oct 23, 2026
adf19a3
test: Check the module of each function's Lean goals and incremental …
SwayamInSync Oct 23, 2026
0350c69
test: Expect the goal module among the imports of an automatic proof.
SwayamInSync Oct 23, 2026
56a9fb0
test: Expect the goal module in the message for a shadowed goal.
SwayamInSync Oct 23, 2026
9f9fbb2
test: Expect an admitted User lemma to fail every goal through the ch…
SwayamInSync Oct 23, 2026
e261a4d
test: Read the fallback project's generated text from its modules.
SwayamInSync Oct 23, 2026
4cbeefd
test: Find spec bodies in their goal module and the goal module in a …
SwayamInSync Oct 23, 2026
accb2c9
test: Read the Lean projects' generated text from their modules.
SwayamInSync Oct 23, 2026
66be53e
test: Read the Lean project's generated text from its modules.
SwayamInSync Oct 23, 2026
97f3776
test: Read and edit the readable goals in their function's module.
SwayamInSync Oct 23, 2026
6ae6209
test: Read the exported Lean semantics from the project's modules.
SwayamInSync Oct 23, 2026
7e119a1
test: Expect the trial of cppverify_auto to build the goal modules too.
SwayamInSync Oct 23, 2026
71ce0e1
docs: Explain the module of each function's Lean goals and incrementa…
SwayamInSync Oct 23, 2026
e406b75
docs: Describe the modules of a Lean project in the tooling reference.
SwayamInSync Oct 23, 2026
0c43c5c
docs: Note the Lean module per function in the release notes.
SwayamInSync Oct 23, 2026
f2558ec
docs: Describe a Lean project's modules in the design.
SwayamInSync Oct 23, 2026
a989960
docs: Describe a Lean project's modules and proof keys in the archite…
SwayamInSync Oct 23, 2026
f178db1
test: Import its function's goal module in the proof cppverify_fine_5…
SwayamInSync Oct 23, 2026
b138c4b
test: Import its function's goal module in the proof cppverify_fine_5…
SwayamInSync Oct 23, 2026
1bf5460
test: Import its function's goal module in the proof cppverify_one_99…
SwayamInSync Oct 23, 2026
77bdebb
test: Import its function's goal module in the proof cppverify_one_99…
SwayamInSync Oct 23, 2026
e0d4296
test: Import its function's goal module in the proof Lemmas.lean.
SwayamInSync Oct 23, 2026
98d82b0
test: Import its function's goal module in the proof cppverify_one_99…
SwayamInSync Oct 23, 2026
71886e0
test: Import its function's goal module in the proof cppverify_one_99…
SwayamInSync Oct 23, 2026
aaf0ec7
test: Import its function's goal module in the proof lean_dependencie…
SwayamInSync Oct 23, 2026
910acbe
test: Import its function's goal module in the proof lean_dependencie…
SwayamInSync Oct 23, 2026
69d1177
test: Import its function's goal module in the proof lean_dependencie…
SwayamInSync Oct 23, 2026
6ce1435
test: Import its function's goal module in the proof lean_dependencie…
SwayamInSync Oct 23, 2026
d69832d
test: Import its function's goal module in the proof lean_dependencie…
SwayamInSync Oct 23, 2026
1d6af47
test: Import its function's goal module in the proof lean_dependencie…
SwayamInSync Oct 23, 2026
fad7045
test: Import its function's goal module in the proof lean_dependencie…
SwayamInSync Oct 23, 2026
49a0e1f
test: Import its function's goal module in the proof lean_dependencie…
SwayamInSync Oct 23, 2026
23e010b
test: Import its function's goal module in the proof lean_fallback_go…
SwayamInSync Oct 23, 2026
64c6570
test: Import its function's goal module in the proof lean_fallback_go…
SwayamInSync Oct 23, 2026
cc18009
test: Import its function's goal module in the proof lean_fallback_go…
SwayamInSync Oct 23, 2026
ce46518
test: Import its function's goal module in the proof lean_fallback_go…
SwayamInSync Oct 23, 2026
8d1523b
test: Import its function's goal module in the proof lean_fallback_pa…
SwayamInSync Oct 23, 2026
df33419
test: Import its function's goal module in the proof lean_fallback_pa…
SwayamInSync Oct 23, 2026
2f1a006
test: Import its function's goal module in the proof cppverify_bump_c…
SwayamInSync Oct 23, 2026
5daf121
test: Import its function's goal module in the proof cppverify_one_99…
SwayamInSync Oct 23, 2026
16a8c93
test: Import its function's goal module in the proof cppverify_one_99…
SwayamInSync Oct 23, 2026
6be02b0
test: Import its function's goal module in the proof cppverify_one_99…
SwayamInSync Oct 23, 2026
ca6c465
test: Import its function's goal module in the proof cppverify_one_99…
SwayamInSync Oct 23, 2026
7b861cb
test: Import its function's goal module in the proof cppverify_six_6a…
SwayamInSync Oct 23, 2026
5eedfdf
test: Import its function's goal module in the proof cppverify_six_6a…
SwayamInSync Oct 23, 2026
c318e4c
test: Import its function's goal module in the proof cppverify_tri_de…
SwayamInSync Oct 23, 2026
201ea08
test: Import its function's goal module in the proof cppverify_twice_…
SwayamInSync Oct 23, 2026
9bacf87
test: Import its function's goal module in the proof cppverify_twice_…
SwayamInSync Oct 23, 2026
451f38f
test: Import its function's goal module in the proof cppverify_twice_…
SwayamInSync Oct 23, 2026
05003b5
test: Import its function's goal module in the proof cppverify_twice_…
SwayamInSync Oct 23, 2026
93b75ad
test: Import its function's goal module in the proof lean_semantics_c…
SwayamInSync Oct 23, 2026
d49e8f9
test: Import its function's goal module in the proof lean_semantics_m…
SwayamInSync Oct 23, 2026
1136d88
test: Import its function's goal module in the proof lean_semantics_n…
SwayamInSync Oct 23, 2026
9359c25
test: Import its function's goal module in the proof cppverify_readin…
SwayamInSync Oct 23, 2026
cf3fc2c
test: Import its function's goal module in the proof cppverify_readin…
SwayamInSync Oct 23, 2026
1e8a0a1
test: Import its function's goal module in the proof cppverify_readin…
SwayamInSync Oct 23, 2026
4eb310f
test: Import its function's goal module in the proof cppverify_readin…
SwayamInSync Oct 23, 2026
9b346cc
test: Import its function's goal module in the proof cppverify_readin…
SwayamInSync Oct 23, 2026
04706a9
test: Import its function's goal module in the proof cppverify_sensor…
SwayamInSync Oct 23, 2026
5683c25
verify: Let the Lean backend export goals over spec collections.
SwayamInSync Oct 23, 2026
d5c8a51
verify: State the spec collections in Lean with core types, prelude o…
SwayamInSync Oct 23, 2026
91bcccc
verify: Add machine equalities, collection extensionality, and spec u…
SwayamInSync Oct 23, 2026
dc6e821
test: Check that Lean evaluates every collection operation as the cer…
SwayamInSync Oct 23, 2026
e6287c9
test: Add the functions over each spec collection of the Lean collect…
SwayamInSync Oct 23, 2026
6dac71e
test: Add a proof by hand over a sequence for the Lean collections test.
SwayamInSync Oct 23, 2026
ce1c27c
test: Check the export, automation, and certification of goals over s…
SwayamInSync Oct 23, 2026
5a1bcfc
test: Expect revision 2 of cppverify_auto in the proof headers.
SwayamInSync Oct 23, 2026
fb9d7ee
test: Expect cppverify_auto to prove the goals over tri, and the proo…
SwayamInSync Oct 23, 2026
106cd5e
test: Say that the proofs over tri are also written by hand.
SwayamInSync Oct 23, 2026
511d17d
test: Expect cppverify_auto to certify fibo_step, and fibo_six to nee…
SwayamInSync Oct 23, 2026
1bbf954
docs: Explain collections in Lean and revision 2 of cppverify_auto in…
SwayamInSync Oct 23, 2026
98dfdd9
docs: Say in chapter 13 that a Lean project states the spec collections.
SwayamInSync Oct 23, 2026
20b4f96
docs: Drop the limitation that Lean lacks the spec collections.
SwayamInSync Oct 23, 2026
64bc948
docs: Show revision 2 of cppverify_auto in the tooling reference.
SwayamInSync Oct 23, 2026
5cc1e02
docs: Note collections in Lean and revision 2 of cppverify_auto in th…
SwayamInSync Oct 23, 2026
0d71ea4
docs: Describe the spec collections in Lean and the new automation st…
SwayamInSync Oct 23, 2026
a734035
docs: Describe the Lean collection prelude and revision 2 of cppverif…
SwayamInSync Oct 23, 2026
79094d8
verify: Declare a project's spec functions with their opaque declarat…
SwayamInSync Oct 23, 2026
f8701ea
verify: Print a spec's step definition for Lean, its conditions as hy…
SwayamInSync Oct 23, 2026
0f293cc
verify: Collect a project's spec functions by identity.
SwayamInSync Oct 23, 2026
842d4b1
verify: Define the spec functions that Lean proves terminating, and k…
SwayamInSync Oct 23, 2026
cc0fc2e
verify: Evaluate spec definitions by their equations and read C++ div…
SwayamInSync Oct 23, 2026
53c7ab5
test: Add the spec functions of the Lean spec definitions test.
SwayamInSync Oct 23, 2026
bc2d146
test: Add a proof by induction over tri for the Lean spec definitions…
SwayamInSync Oct 23, 2026
0a8d6e4
test: Check which spec functions become Lean definitions, and a proof…
SwayamInSync Oct 23, 2026
d690092
test: Add contracts that divide by constants for the Lean division test.
SwayamInSync Oct 23, 2026
30de5c8
test: Check that cppverify_auto proves contracts that divide by const…
SwayamInSync Oct 23, 2026
9f78611
test: Expect tri as a definition in the project's Specs module.
SwayamInSync Oct 23, 2026
5adb8f9
test: Expect total and members as definitions, and revision 3 of cppv…
SwayamInSync Oct 23, 2026
dc2f5d8
test: Expect revision 3 of cppverify_auto in the proof headers.
SwayamInSync Oct 23, 2026
b284bcc
test: Run the fallback test without cppverify_auto, so that its goals…
SwayamInSync Oct 23, 2026
2cdcfea
docs: Explain spec functions as Lean definitions in chapter 17.
SwayamInSync Oct 23, 2026
02d6e5b
docs: Say how a Lean project declares its spec functions.
SwayamInSync Oct 23, 2026
32486bc
docs: Note spec functions as Lean definitions in the release notes.
SwayamInSync Oct 23, 2026
8c79068
docs: Describe spec functions as Lean definitions in the design.
SwayamInSync Oct 23, 2026
50740fe
docs: Describe the spec definitions, their trial, and revision 3 of c…
SwayamInSync Oct 23, 2026
747ba38
verify: Say that archives keep a logical function's measures and wher…
SwayamInSync Oct 23, 2026
d4592ba
verify: Validate a logical function's termination measures like its d…
SwayamInSync Oct 23, 2026
2ce8c54
verify: Keep the functions a termination measure applies when canonic…
SwayamInSync Oct 23, 2026
6a7d0a6
verify: Make obligation archives schema 3.
SwayamInSync Oct 23, 2026
d67c76f
verify: Archive termination measures and where each assumption of a g…
SwayamInSync Oct 23, 2026
4196eef
verify: Mark the unwinding goals of a Lean project.
SwayamInSync Oct 23, 2026
760896f
verify: State the bound of a bounded module with its Lean goals.
SwayamInSync Oct 23, 2026
ee37f71
verify: Declare the replay of archived modules into a Lean project.
SwayamInSync Oct 23, 2026
818ce9a
verify: Write Lean projects through one LeanProject, from source or f…
SwayamInSync Oct 23, 2026
4c0bc6a
verify: Replay archives into Lean projects, and bounded archives into…
SwayamInSync Oct 23, 2026
93f2c2c
test: Read schema 3 archives, and write schema 2 ones, in the archive…
SwayamInSync Oct 23, 2026
c474886
test: Expect schema 3, read schema 2, and reject a measure with a fre…
SwayamInSync Oct 23, 2026
f799055
test: Expect schema 3 in the obligation IR dump.
SwayamInSync Oct 23, 2026
b6e2857
test: Add the program of the Lean replay test.
SwayamInSync Oct 23, 2026
b5b3b06
test: Add the loops of the Lean replay test.
SwayamInSync Oct 23, 2026
7df524a
test: Check that an archive replays into a Lean project as its source…
SwayamInSync Oct 23, 2026
b255c43
docs: Explain archives in Lean projects in chapter 17.
SwayamInSync Oct 23, 2026
8ce4ce2
docs: Say how an archive replays into a Lean project.
SwayamInSync Oct 23, 2026
cdeb7df
docs: Note Lean projects from archives and schema 3 in the release no…
SwayamInSync Oct 23, 2026
76270a9
docs: Describe Lean replay and schema 3 in the design.
SwayamInSync Oct 23, 2026
cb86df1
docs: Describe LeanProject, Lean replay, and schema 3 in the architec…
SwayamInSync Oct 23, 2026
87dc023
docs: Say that archives keep where each assumption of a goal comes fr…
SwayamInSync Oct 23, 2026
5f55b5a
verify: Let a certified counterexample carry the values of its goal's…
SwayamInSync Oct 23, 2026
742e6c7
verify: Declare the assignment of a certified counterexample.
SwayamInSync Oct 23, 2026
288e9a4
verify: Read the assignment of a certified counterexample from its ca…
SwayamInSync Oct 23, 2026
aeb2182
verify: Keep the assignment of each counterexample the Z3 adapter cer…
SwayamInSync Oct 23, 2026
ce3dc2b
verify: Declare the Lean refutation of a counterexample.
SwayamInSync Oct 23, 2026
34415e8
verify: Export a counterexample as a Lean refutation, and decide boun…
SwayamInSync Oct 23, 2026
0ce1031
verify: Add the cppverify_refute tactic.
SwayamInSync Oct 23, 2026
0a057ff
verify: Check refutation entries against the negation of their goals.
SwayamInSync Oct 23, 2026
e31d645
verify: Confirm the counterexamples of a fallback project in Lean.
SwayamInSync Oct 23, 2026
2706a6e
test: Add the program of the Lean refutation test.
SwayamInSync Oct 23, 2026
481b3c8
test: Add the refutations of the Lean refutation test that are bounde…
SwayamInSync Oct 23, 2026
8143117
test: Add the instances the refutation tactic must not refute.
SwayamInSync Oct 23, 2026
feac3c4
test: Check that counterexamples are confirmed in Lean, or left with …
SwayamInSync Oct 23, 2026
e6cc4da
test: Add the proof of the one fidelity matrix goal cppverify_auto le…
SwayamInSync Oct 23, 2026
97c7129
test: Require decisive Lean verdicts in the backend fidelity gate.
SwayamInSync Oct 23, 2026
bda0be4
test: Check the decisive Lean row of the backend fidelity gate.
SwayamInSync Oct 23, 2026
4e72ac8
docs: Lower a documentation example without its Lean output options.
SwayamInSync Oct 23, 2026
7ae3671
docs: Explain counterexamples in Lean in chapter 17.
SwayamInSync Oct 23, 2026
823ae1f
docs: Say that a fallback project refutes certified counterexamples.
SwayamInSync Oct 23, 2026
88cd63a
docs: Note counterexamples confirmed in Lean in the release notes.
SwayamInSync Oct 23, 2026
a957a73
docs: Describe Lean refutations in the design.
SwayamInSync Oct 23, 2026
90189a8
docs: Describe Lean refutations and the gate's Lean row in the archit…
SwayamInSync Oct 23, 2026
17b3c68
verify: Decide a quantifier over a range of integers in Lean only for…
SwayamInSync Oct 24, 2026
0776e1d
test: Add a refutation over a thousand integers to the budget input.
SwayamInSync Oct 24, 2026
9f63ff7
test: Check that a quantifier over a thousand integers is refuted in …
SwayamInSync Oct 24, 2026
d5d21db
test: Check that refuting a quantifier over a billion integers stays …
SwayamInSync Oct 24, 2026
824cbf9
docs: Describe the range bound of the Lean prelude's quantifiers in t…
SwayamInSync Oct 24, 2026
b8fec4f
docs: Bound the Lean prelude's quantifiers to 4096 integers in the de…
SwayamInSync Oct 24, 2026
30fae89
docs: Bound the Lean prelude's quantifiers to 4096 integers in chapte…
SwayamInSync Oct 24, 2026
c26a4ed
docs: Bound the Lean prelude's quantifiers to 4096 integers in the re…
SwayamInSync Oct 24, 2026
51cde57
verify: Test the result of Lean certification once, so a failure is a…
SwayamInSync Oct 24, 2026
a3fa00e
test: Check that replaying an archive reports a failed Lean certifica…
SwayamInSync Oct 24, 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
16 changes: 16 additions & 0 deletions clang/lib/Verify/Backend/Certify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4150,6 +4150,22 @@ void sourceVariables(const LogicExpr *Expr, std::set<std::string> &Bound,
}
} // namespace

std::shared_ptr<const CounterexampleAssignment>
verify::counterexampleAssignment(const Obligation &Item,
CandidateModel &Model) {
std::vector<std::pair<std::string, LogicSort>> Variables;
std::set<std::string> Bound;
sourceVariables(Item.Goal.get(), Bound, Variables);
auto Assignment = std::make_shared<CounterexampleAssignment>();
for (const auto &[Name, Sort] : Variables) {
std::optional<LogicValue> Given = Model.constant(Name, Sort);
if (!Given)
return nullptr;
Assignment->Values.emplace(Name, std::move(*Given));
}
return Assignment;
}

std::vector<VerifyModelValue>
verify::candidateValues(const ObligationModule &Module, const LogicExpr &Query,
CandidateModel &Model) {
Expand Down
12 changes: 12 additions & 0 deletions clang/lib/Verify/Backend/Certify.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,18 @@ std::optional<LogicValue> evaluateTerm(const ObligationModule &Module,
const CertifyLimits &Limits = {},
std::string *Failure = nullptr);

/// The values a certified counterexample gives the free variables of the goal
/// of the obligation it fails, by name: what a refutation of that goal
/// applies it to.
struct CounterexampleAssignment {
std::map<std::string, LogicValue> Values;
};

/// The assignment \p Model gives the free variables of \p Item's goal, or
/// null when it gives one no value.
std::shared_ptr<const CounterexampleAssignment>
counterexampleAssignment(const Obligation &Item, CandidateModel &Model);

/// The source variables of \p Query with the values \p Model gives them, as
/// a counterexample shows them; no value where the model gives none.
std::vector<VerifyModelValue> candidateValues(const ObligationModule &Module,
Expand Down
Loading
Loading