annotate paper/src/AgdaNPushNPop.agda @ 130:80a196c82a4c

Update todo
author atton <atton@cr.ie.u-ryukyu.ac.jp>
date Sat, 18 Feb 2017 15:43:09 +0900
parents ec6799ca9d42
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
67
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 n-push : {m : Meta} {{_ : M.DataSegment Meta}} (n : ℕ) -> M.CodeSegment Meta Meta
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 n-push {{mm}} (zero) = M.cs {{mm}} {{mm}} id
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 n-push {m} {{mm}} (suc n) = M.cs {{mm}} {{mm}} (\m -> M.exec {{mm}} {{mm}} (n-push {m} {{mm}} n) (pushOnce m))
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 n-pop : {m : Meta} {{_ : M.DataSegment Meta}} (n : ℕ) -> M.CodeSegment Meta Meta
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 n-pop {{mm}} (zero) = M.cs {{mm}} {{mm}} id
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 n-pop {m} {{mm}} (suc n) = M.cs {{mm}} {{mm}} (\m -> M.exec {{mm}} {{mm}} (n-pop {m} {{mm}} n) (popOnce m))
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 pop-n-push-type : ℕ -> ℕ -> ℕ -> SingleLinkedStack ℕ -> Set₁
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 pop-n-push-type n cn ce s = M.exec (M.csComp {meta} (M.cs popOnce) (n-push {meta} (suc n))) meta
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 ≡ M.exec (n-push {meta} n) meta
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 where
ec6799ca9d42 Add proof description
atton <atton@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 meta = id-meta cn ce s