-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTabulation.agda
57 lines (44 loc) · 1.16 KB
/
Tabulation.agda
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
module Examples.Tabulation where
open import Relation.Binary.PropositionalEquality hiding (inspect)
open import Data.Product
open import Data.List hiding (product)
open import Finiteness
open import Function
open import Tabulation
hiding (_↦_)
open import Examples.Pauli
-- Tabulation is convenient to use for small sets like Pauli
shiftPauli : Pauli → Pauli
shiftPauli = fromTbl $ createTbl
(X ↦ Y ∷
Y ↦ Z ∷
Z ↦ I ∷
I ↦ X ∷ [])
(listPauli , allPauli)
where
_↦_ = _,_
-- On the other hand, the following is not going to typecheck, because
-- the list is not complete (case for I is missing)
{-
shiftPauliBad1 : Pauli → Pauli
shiftPauliBad1 = fromTbl $ createTbl
(X ↦ Y ∷
Y ↦ Z ∷
Z ↦ I ∷ [])
(listPauli , allPauli) {{!!}}
where
_↦_ = _,_
-}
-- The following is also not going to typecheck, because the list
-- is ambiguous (X is mapped to Y and to Z)
{-
shiftPauliBad2 : Pauli → Pauli
shiftPauliBad2 = fromTbl $ createTbl
(X ↦ Y ∷
Y ↦ Z ∷
Z ↦ I ∷
X ↦ Z ∷ [])
(listPauli , allPauli) {{!!}}
where
_↦_ = _,_
-}