File tree 1 file changed +4
-31
lines changed
1 file changed +4
-31
lines changed Original file line number Diff line number Diff line change 1
1
// #[cfg(feature = "feature_no_std")]
2
2
#![ no_std]
3
3
pub use sea;
4
- use sea:: println;
5
4
6
5
// Entry point for the proof
7
6
#[ no_mangle]
8
7
pub extern "C" fn entrypt ( ) {
9
8
test_test1 ( ) ;
10
- test_test2 ( ) ;
11
9
}
12
10
13
11
#[ no_mangle]
14
12
fn test_test1 ( ) {
15
- println ! ( "Hello, test1!" ) ;
16
- let v = sea:: nd_i32 ( ) ;
17
- sea:: assume ( v >= 1 ) ;
18
- let res = add ( v, 7 ) ;
13
+ let mut x: i32 = sea:: nd_i32 ( ) ;
14
+ sea:: assume ( x < 10 ) ;
15
+ x += 4 ;
19
16
20
- if v > 0 {
21
- sea:: sassert!( res > 7 ) ;
22
- } else {
23
- sea:: sassert!( res <= 7 ) ;
24
- }
25
- }
26
-
27
- #[ no_mangle]
28
- fn test_test2 ( ) {
29
- println ! ( "Hello, test2!" ) ;
30
- let v = sea:: nd_i32 ( ) ;
31
- sea:: assume ( v >= 1 ) ;
32
- let res = add ( v, 8 ) ;
33
-
34
- if v > 0 {
35
- sea:: sassert!( res > 8 ) ;
36
- } else {
37
- sea:: sassert!( res <= 8 ) ;
38
- }
39
- }
40
-
41
- // Function being verified
42
- #[ no_mangle]
43
- fn add ( x : i32 , y : i32 ) -> i32 {
44
- x + y
17
+ sea:: sassert!( x < 14 ) ;
45
18
}
You can’t perform that action at this time.
0 commit comments