annotate Paper/src/AgdaStackTest.agda @ 32:4915eaa51ee0 default tip

Add front
author soto <soto@cr.ie.u-ryukyu.ac.jp>
date Thu, 23 Feb 2023 18:39:56 +0900
parents a72446879486
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 -- after push 1 and 2, pop2 get 1 and 2
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
2
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 testStack02 : {m : Level } -> ( Stack ℕ (SingleLinkedStack ℕ) -> Bool {m} ) -> Bool {m}
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 testStack02 cs = pushStack createSingleLinkedStack 1 (\s -> pushStack s 2 cs)
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 testStack031 : (d1 d2 : ℕ ) -> Bool {Zero}
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 testStack031 2 1 = True
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 testStack031 _ _ = False
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 testStack032 : (d1 d2 : Maybe ℕ) -> Bool {Zero}
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 testStack032 (Just d1) (Just d2) = testStack031 d1 d2
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 testStack032 _ _ = False
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 testStack03 : {m : Level } -> Stack ℕ (SingleLinkedStack ℕ) -> ((Maybe ℕ) -> (Maybe ℕ) -> Bool {m} ) -> Bool {m}
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 testStack03 s cs = pop2Stack s (\s d1 d2 -> cs d1 d2 )
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 testStack04 : Bool
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19 testStack04 = testStack02 (\s -> testStack03 s testStack032)
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
20
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
21 testStack05 : testStack04 ≡ True
a72446879486 Init paper
soto <soto@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
22 testStack05 = refl