Mercurial > hg > Papers > 2021 > soto-thesis
view prepaper/src/cbc-hoare-loop.agda @ 14:a63df15c9afc default tip
DONE
author | soto <soto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 15 Feb 2021 23:36:39 +0900 |
parents | 3dba680da508 |
children |
line wrap: on
line source
whileLoopPwP' : {l : Level} {t : Set l} → (n : ℕ) → (env : Envc ) → (n ≡ varn env) → whileTestStateP s2 env → (next : (env : Envc ) → (pred n ≡ varn env) → whileTestStateP s2 env → t) → (exit : (env : Envc ) → whileTestStateP sf env → t) → t whileLoopPwP' zero env refl refl _ exit = exit env refl whileLoopPwP' (suc n) env refl refl next _ = next (record env {varn = pred (varn env) ; vari = suc (vari env) }) refl (+-suc n (vari env)) loopPwP' : {l : Level} {t : Set l} → (n : ℕ) → (env : Envc ) → (n ≡ varn env) → whileTestStateP s2 env → (exit : (env : Envc ) → whileTestStateP sf env → t) → t loopPwP' zero env refl refl exit = exit env refl loopPwP' (suc n) env refl refl exit = whileLoopPwP' (suc n) env refl refl (λ env x y → loopPwP' n env x y exit) exit