File size: 674 Bytes
c62beea
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
use vstd::prelude::*;
fn main() {}
verus!{



spec fn f1_is_digit_sepc(c: u8) -> bool {
    c >= 48 && c <= 57
}

fn f1_is_digit(c: u8) -> (res: bool)
{
    c >= 48 && c <= 57
}

fn f1_is_integer(text: &[u8]) -> (result: bool)
{
    let mut index = 0;
    while index < text.len()
    {
        if (!f1_is_digit(text[index])) {
            return false;
        }
        index += 1;
    }
    true
}



spec fn step1(__hp0: u8, outp: bool) -> bool {
    (outp == f1_is_digit_sepc(__hp0))
}

fn chain_driver(c: u8) -> (r_final: bool)
    ensures
        step1(c, r_final),
{
    let x1 = f1_is_digit(c);
    proof {
        assert(step1(c, x1));
    }
    x1
}

} // verus!