navid/haze / cb1bac46fbd9fca0f0e2a401590740b0840b47821983a25743fc29c1572577d9 / 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))
}