Skip to content

Commit 809337c

Browse files
committed
Add dummy theorems to all remaining empty spec blocks
gherrit-pr-id: Gclxv3wmgsi7kr7oyevehdtxvcv5vjvg5
1 parent 2040141 commit 809337c

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

anneal/tests/fixtures/success_allow_sorry_is_valid/source/src/framework.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ pub mod is_valid {
1717
/// Triggers allow_sorry on the complex isValid autoParam.
1818
/// Should emit a single "declaration uses sorry" warning.
1919
/// ```lean, anneal, spec
20+
/// theorem spec :
21+
/// Aeneas.Std.WP.spec (unprovable_is_valid) (fun ret_ => True) := by
22+
/// sorry
2023
/// ```
2124
pub fn unprovable_is_valid() -> InvalidStruct {
2225
InvalidStruct { x: 1, y: 2 }
@@ -104,6 +107,9 @@ pub mod signatures {
104107

105108
/// Verifying that padded signatures (due to `cfg`) don't break Anneal specs.
106109
/// ```lean, anneal, spec
110+
/// theorem spec :
111+
/// Aeneas.Std.WP.spec (padded_signature_spec) (fun ret_ => True) := by
112+
/// sorry
107113
/// ```
108114
pub fn padded_signature_spec() {}
109115
}
@@ -129,6 +135,9 @@ fn clean() {}
129135
fn _anneal_dummy_1() {}
130136

131137
/// ```lean, anneal, spec
138+
/// theorem spec :
139+
/// Aeneas.Std.WP.spec (dummy_anneal_padding_9) (fun ret_ => True) := by
140+
/// sorry
132141
/// ```
133142
pub fn dummy_anneal_padding_9() {}
134143

anneal/tests/fixtures/success_allow_sorry_is_valid/source/src/logic_and_control.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,18 @@ pub mod shadowing {
4949

5050
/// Tests for the never type and panics.
5151
/// ```lean, anneal, spec
52+
/// theorem spec :
53+
/// Aeneas.Std.WP.spec (crash) (fun ret_ => True) := by
54+
/// sorry
5255
/// ```
5356
pub fn crash() -> ! {
5457
panic!("crash")
5558
}
5659

5760
/// ```lean, anneal, spec
61+
/// theorem spec (x : Std.U32) :
62+
/// Aeneas.Std.WP.spec (shadow x) (fun ret_ => True) := by
63+
/// sorry
5864
/// ```
5965
pub fn shadow(x: u32) -> u32 {
6066
let x = x + 1;
@@ -68,10 +74,16 @@ pub struct S {
6874
}
6975

7076
/// ```lean, anneal, spec
77+
/// theorem spec :
78+
/// Aeneas.Std.WP.spec (dummy_anneal_padding_6) (fun ret_ => True) := by
79+
/// sorry
7180
/// ```
7281
pub fn dummy_anneal_padding_6() {}
7382

7483
/// ```lean, anneal, spec
84+
/// theorem spec :
85+
/// Aeneas.Std.WP.spec (dummy_anneal_padding_7) (fun ret_ => True) := by
86+
/// sorry
7587
/// ```
7688
pub fn dummy_anneal_padding_7() {}
7789

@@ -106,5 +118,8 @@ pub fn unknown_decrease(n: u32) -> u32 {
106118
}
107119

108120
/// ```lean, anneal, spec
121+
/// theorem spec {T : Type} (x : T) :
122+
/// Aeneas.Std.WP.spec (old x) (fun ret_ => True) := by
123+
/// sorry
109124
/// ```
110125
pub fn old<T>(x: T) -> T { x }

anneal/tests/fixtures/success_allow_sorry_is_valid/source/src/types_and_data.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ pub struct Widths {
77
}
88

99
/// ```lean, anneal, spec
10+
/// theorem spec (x : _) (y : _) :
11+
/// Aeneas.Std.WP.spec (check_widths x y) (fun ret_ => True) := by
12+
/// sorry
1013
/// ```
1114
pub fn check_widths(x: isize, y: usize) -> (isize, usize) {
1215
(x, y)
@@ -39,6 +42,9 @@ pub struct Foo<T> {
3942

4043
/// Tests for tuple types.
4144
/// ```lean, anneal, spec
45+
/// theorem spec (x : _) :
46+
/// Aeneas.Std.WP.spec (one_tuple x) (fun ret_ => True) := by
47+
/// sorry
4248
/// ```
4349
pub fn one_tuple(x: (u32,)) -> (u32,) {
4450
x
@@ -77,6 +83,9 @@ pub mod enums {
7783
}
7884

7985
/// ```lean, anneal, spec
86+
/// theorem spec :
87+
/// Aeneas.Std.WP.spec (dummy_anneal_padding_1) (fun ret_ => True) := by
88+
/// sorry
8089
/// ```
8190
pub fn dummy_anneal_padding_1() {}
8291

@@ -86,18 +95,30 @@ pub struct ContainerValid<T> {
8695
}
8796

8897
/// ```lean, anneal, spec
98+
/// theorem spec :
99+
/// Aeneas.Std.WP.spec (dummy_anneal_padding_2) (fun ret_ => True) := by
100+
/// sorry
89101
/// ```
90102
pub fn dummy_anneal_padding_2() {}
91103

92104
/// ```lean, anneal, spec
105+
/// theorem spec :
106+
/// Aeneas.Std.WP.spec (dummy_anneal_padding_3) (fun ret_ => True) := by
107+
/// sorry
93108
/// ```
94109
pub fn dummy_anneal_padding_3() {}
95110

96111
/// ```lean, anneal, spec
112+
/// theorem spec :
113+
/// Aeneas.Std.WP.spec (dummy_anneal_padding_4) (fun ret_ => True) := by
114+
/// sorry
97115
/// ```
98116
pub fn dummy_anneal_padding_4() {}
99117

100118
/// ```lean, anneal, spec
119+
/// theorem spec :
120+
/// Aeneas.Std.WP.spec (dummy_anneal_padding_5) (fun ret_ => True) := by
121+
/// sorry
101122
/// ```
102123
pub fn dummy_anneal_padding_5() {}
103124

0 commit comments

Comments
 (0)