annotate Paper/src/AgdaNPushNPop.agda.replaced @ 0:14a0e409d574

ADD fast commit
author soto <soto@cr.ie.u-ryukyu.ac.jp>
date Sun, 24 Apr 2022 23:13:44 +0900
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 n-push : {m : Meta} {{_ : M.DataSegment Meta}} (n : !$\mathbb{N}$!) !$\rightarrow$! M.CodeSegment Meta Meta
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2 n-push {{mm}} (zero) = M.cs {{mm}} {{mm}} id
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 n-push {m} {{mm}} (suc n) = M.cs {{mm}} {{mm}} (\m !$\rightarrow$! M.exec {{mm}} {{mm}} (n-push {m} {{mm}} n) (pushOnce m))
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 n-pop : {m : Meta} {{_ : M.DataSegment Meta}} (n : !$\mathbb{N}$!) !$\rightarrow$! M.CodeSegment Meta Meta
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 n-pop {{mm}} (zero) = M.cs {{mm}} {{mm}} id
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 n-pop {m} {{mm}} (suc n) = M.cs {{mm}} {{mm}} (\m !$\rightarrow$! M.exec {{mm}} {{mm}} (n-pop {m} {{mm}} n) (popOnce m))
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 pop-n-push-type : !$\mathbb{N}$! !$\rightarrow$! !$\mathbb{N}$! !$\rightarrow$! !$\mathbb{N}$! !$\rightarrow$! SingleLinkedStack !$\mathbb{N}$! !$\rightarrow$! Set!$\_{1}$!
14a0e409d574 ADD fast commit
soto <soto@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
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 !$\equiv$! M.exec (n-push {meta} n) meta
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 where
14a0e409d574 ADD fast commit
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 meta = id-meta cn ce s