annotate final_main/src/AgdaTree.agda.replaced @ 5:eafc166804f3

fix Capter4.2,5,1
author ryokka
date Mon, 19 Feb 2018 18:44:59 +0900
parents 12204a2c2eda
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
1 record TreeMethods {n m : Level } {a : Set n } {t : Set m } (treeImpl : Set n ) : Set (m Level.@$\sqcup$@ n) where
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
2 field
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
3 putImpl : treeImpl @$\rightarrow$@ a @$\rightarrow$@ (treeImpl @$\rightarrow$@ t) @$\rightarrow$@ t
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
4 getImpl : treeImpl @$\rightarrow$@ (treeImpl @$\rightarrow$@ Maybe a @$\rightarrow$@ t) @$\rightarrow$@ t
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
5 open TreeMethods
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
6
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
7 record Tree {n m : Level } {a : Set n } {t : Set m } (treeImpl : Set n ) : Set (m Level.@$\sqcup$@ n) where
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
8 field
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
9 tree : treeImpl
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
10 treeMethods : TreeMethods {n} {m} {a} {t} treeImpl
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
11 putTree : a @$\rightarrow$@ (Tree treeImpl @$\rightarrow$@ t) @$\rightarrow$@ t
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
12 putTree d next = putImpl (treeMethods ) tree d (\t1 @$\rightarrow$@ next (record {tree = t1 ; treeMethods = treeMethods} ))
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
13 getTree : (Tree treeImpl @$\rightarrow$@ Maybe a @$\rightarrow$@ t) @$\rightarrow$@ t
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
14 getTree next = getImpl (treeMethods ) tree (\t1 d @$\rightarrow$@ next (record {tree = t1 ; treeMethods = treeMethods} ) d )
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
15
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
16 open Tree
12204a2c2eda add .pdf and some section.
ryokka
parents:
diff changeset
17