Mercurial > hg > Papers > 2021 > soto-thesis
annotate prepaper/src/AgdaNPushNPop.agda.replaced @ 0:3dba680da508
init-test
author | soto |
---|---|
date | Tue, 08 Dec 2020 19:06:49 +0900 |
parents | |
children |
rev | line source |
---|---|
0 | 1 n-push : {m : Meta} {{_ : M.DataSegment Meta}} (n : @$\mathbb{N}$@) @$\rightarrow$@ M.CodeSegment Meta Meta |
2 n-push {{mm}} (zero) = M.cs {{mm}} {{mm}} id | |
3 n-push {m} {{mm}} (suc n) = M.cs {{mm}} {{mm}} (\m @$\rightarrow$@ M.exec {{mm}} {{mm}} (n-push {m} {{mm}} n) (pushOnce m)) | |
4 | |
5 n-pop : {m : Meta} {{_ : M.DataSegment Meta}} (n : @$\mathbb{N}$@) @$\rightarrow$@ M.CodeSegment Meta Meta | |
6 n-pop {{mm}} (zero) = M.cs {{mm}} {{mm}} id | |
7 n-pop {m} {{mm}} (suc n) = M.cs {{mm}} {{mm}} (\m @$\rightarrow$@ M.exec {{mm}} {{mm}} (n-pop {m} {{mm}} n) (popOnce m)) | |
8 | |
9 pop-n-push-type : @$\mathbb{N}$@ @$\rightarrow$@ @$\mathbb{N}$@ @$\rightarrow$@ @$\mathbb{N}$@ @$\rightarrow$@ SingleLinkedStack @$\mathbb{N}$@ @$\rightarrow$@ Set@$\_{1}$@ | |
10 pop-n-push-type n cn ce s = M.exec (M.csComp {meta} (M.cs popOnce) (n-push {meta} (suc n))) meta | |
11 @$\equiv$@ M.exec (n-push {meta} n) meta | |
12 where | |
13 meta = id-meta cn ce s |