20 lines
375 B
Plaintext
20 lines
375 B
Plaintext
|
function counter (var n : nat) : nat is block {
|
||
|
var i : nat := 0n ;
|
||
|
while (i < n) block {
|
||
|
i := i + 1n ;
|
||
|
}
|
||
|
} with i
|
||
|
|
||
|
function sum (var n : nat) : nat is block {
|
||
|
var i : nat := 0n ;
|
||
|
var r : nat := 0n ;
|
||
|
while (i < n) block {
|
||
|
i := i + 1n ;
|
||
|
r := r + i ;
|
||
|
}
|
||
|
} with r
|
||
|
|
||
|
function dummy (const n : nat) : nat is block {
|
||
|
while (False) block { skip }
|
||
|
} with n
|