navid/haze / c0b95f8eeae4f6db6308cd4c9942340bde71175d389cc031539ebe88ded804fc / samples/baseline_2.2/invariant_boundary_success.hz
invariant_boundary_success.hz
← samples/baseline_2.2 · 177 bytes · raw · download
pure fn sum_to(n i32) i32 {
var total = 0
for i in 0..n
: invariant i <= n
{
total += i
}
return total
}
fn main() {
print(sum_to(5))
}