|
1 | 1 | module _ where |
2 | 2 |
|
| 3 | +{- |
3 | 4 | -- - decision procedure (barebones) |
4 | 5 | module BAREBONES where |
5 | 6 | open import Agda.Primitive using (Level) |
@@ -36,48 +37,56 @@ module BAREBONES where |
36 | 37 | instance |
37 | 38 | HasDecEq-Nat : HasDec (x ≡ y) |
38 | 39 | HasDecEq-Nat {x}{y} .dec with x | y |
39 | | - ... | zero | zero = yes refl |
40 | | - ... | zero | suc n = no λ () |
| 40 | + ... | zero | zero = yes refl |
| 41 | + ... | zero | suc n = no λ () |
41 | 42 | ... | suc m | zero = no λ () |
42 | 43 | ... | suc m | suc n with dec |
43 | | - ... | yes eq = yes (cong suc eq) |
| 44 | + ... | yes eq = yes (cong suc eq) |
44 | 45 | ... | no m≢n = no λ where refl → m≢n refl |
45 | 46 |
|
46 | 47 | test : Bool |
47 | | - test = isYes (dec {A = 42 ≡ 42}) |
48 | | - -- {-# COMPILE AGDA2LAMBOX test #-} |
| 48 | + test = isYes (dec {A = 4 ≡ 4}) |
| 49 | + {-# COMPILE AGDA2LAMBOX test #-} |
| 50 | +-- -} |
49 | 51 |
|
| 52 | +{- |
50 | 53 | -- - decision procedure (importing stdlib) |
51 | 54 | module STDLIB where |
52 | 55 | open import Relation.Nullary using (isYes) |
53 | 56 |
|
54 | 57 | open import Data.Bool using (Bool; true; false) |
55 | 58 | open import Data.Bool.Properties using (_≟_) |
56 | 59 | test : Bool |
57 | | - test = isYes (true ≟ false) |
58 | | - -- {-# COMPILE AGDA2LAMBOX test #-} |
| 60 | + test = isYes (false ≟ true) |
| 61 | + {-# COMPILE AGDA2LAMBOX test #-} |
59 | 62 |
|
60 | 63 | -- open import Data.Bool using (Bool) |
61 | 64 | -- open import Data.Nat.Properties using (_≟_) |
62 | 65 | -- test : Bool |
63 | 66 | -- test = isYes (42 ≟ 42) |
64 | 67 | -- {-# COMPILE AGDA2LAMBOX test #-} |
65 | 68 |
|
| 69 | +-- -} |
| 70 | + |
| 71 | +-- {- |
66 | 72 | -- - sort |
67 | 73 | module SORT where |
68 | | - open import Data.List.Base using (List; _∷_; []) |
69 | | - |
70 | | - open import Data.Bool.Properties using (≤-decTotalOrder) |
71 | | - open import Data.Bool using (Bool; true; false) |
72 | | - open import Data.List.Sort ≤-decTotalOrder using (sort) |
73 | | - test : List Bool |
74 | | - test = sort (true ∷ false ∷ true ∷ false ∷ []) |
75 | | - {-# COMPILE AGDA2LAMBOX test #-} |
76 | | - |
77 | | - -- open import Data.Nat.Properties using (≤-decTotalOrder) |
78 | | - -- open import Data.Bool using (Bool; true; false) |
79 | 74 | -- open import Data.List.Base using (List; _∷_; []) |
| 75 | + -- open import Data.Bool.Properties using (≤-decTotalOrder) |
| 76 | + -- open import Data.Bool using (Bool; true; false) |
80 | 77 | -- open import Data.List.Sort ≤-decTotalOrder using (sort) |
| 78 | + |
81 | 79 | -- test : List Bool |
82 | | - -- test = sort (42 ∷ 0 ∷ 5 ∷ 3 ∷ []) |
| 80 | + -- test = sort (true ∷ false ∷ true ∷ false ∷ []) |
83 | 81 | -- {-# COMPILE AGDA2LAMBOX test #-} |
| 82 | + |
| 83 | + open import Data.Nat.Base |
| 84 | + open import Data.Nat.Properties using (≤-decTotalOrder) |
| 85 | + open import Data.List.Base using (List; _∷_; []) |
| 86 | + open import Data.List.Sort ≤-decTotalOrder using (sort) |
| 87 | + |
| 88 | + test : List ℕ |
| 89 | + test = sort (42 ∷ 0 ∷ 5 ∷ 3 ∷ []) |
| 90 | + {-# COMPILE AGDA2LAMBOX test #-} |
| 91 | + |
| 92 | +-- -} |
0 commit comments