Skip to content

Commit 07988c0

Browse files
jamesmckinnaandreasabel
authored andcommitted
Qualified import of Data.Nat fixing #2280 (#2281)
* `Algebra.Properties.Semiring.Binomial` * `Codata.Sized.Cowriter` * `Data.Char.Properties` * `Data.Difference*` * `Data.Fin.*` * `Data.Float.Properties` * `Data.Graph.Acyclic` * `Data.Integer.Divisibility`: still need to disambiguate `Divisibility`? * `Data.List.Extrema.Nat` * `Data.List.Relation.Binary.*` * `Data.Nat.Binary.*` * `Data.Rational.Base` * `Data.String` * `Data.Vec.*` * `Data.Word` * `Induction.Lexicographic` * `Reflection.AST` * `Tactic.*` * `Text.*`
1 parent 709da18 commit 07988c0

File tree

33 files changed

+286
-292
lines changed

33 files changed

+286
-292
lines changed

src/Algebra/Properties/Semiring/Binomial.agda

+5-5
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
open import Algebra.Bundles using (Semiring)
1212
open import Data.Bool.Base using (true)
13-
open import Data.Nat.Base as Nat hiding (_+_; _*_; _^_)
13+
open import Data.Nat.Base as hiding (_+_; _*_; _^_)
1414
open import Data.Nat.Combinatorics
1515
using (_C_; nCn≡1; nC1≡n; nCk+nC[k+1]≡[n+1]C[k+1])
16-
open import Data.Nat.Properties as Nat
16+
open import Data.Nat.Properties as
1717
using (<⇒<ᵇ; n<1+n; n∸n≡0; +-∸-assoc)
1818
open import Data.Fin.Base as Fin
1919
using (Fin; zero; suc; toℕ; fromℕ; inject₁)
@@ -154,8 +154,8 @@ y*lemma x*y≈y*x {n} j = begin
154154
-- Now, a lemma characterising the sum of the term₁ and term₂ expressions
155155

156156
private
157-
n<ᵇ1+n : n (n Nat.<ᵇ suc n) ≡ true
158-
n<ᵇ1+n n with true n Nat.<ᵇ suc n | _ <⇒<ᵇ (n<1+n n) = ≡.refl
157+
n<ᵇ1+n : n (n .<ᵇ suc n) ≡ true
158+
n<ᵇ1+n n with true n .<ᵇ suc n | _ <⇒<ᵇ (n<1+n n) = ≡.refl
159159

160160
term₁+term₂≈term : x * y ≈ y * x n i term₁ n i + term₂ n i ≈ binomialTerm (suc n) i
161161

@@ -193,7 +193,7 @@ term₁+term₂≈term x*y≈y*x n (suc i) with view i
193193
≈⟨ +-congˡ (×-congˡ nC[k+1]≡nC[j+1]) ⟨
194194
(nCk × [x^k+1]*[y^n-k]) + (nC[k+1] × [x^k+1]*[y^n-k])
195195
≈⟨ ×-homo-+ [x^k+1]*[y^n-k] nCk nC[k+1] ⟨
196-
(nCk Nat.+ nC[k+1]) × [x^k+1]*[y^n-k]
196+
(nCk .+ nC[k+1]) × [x^k+1]*[y^n-k]
197197
≡⟨ cong (_× [x^k+1]*[y^n-k]) (nCk+nC[k+1]≡[n+1]C[k+1] n k) ⟩
198198
((suc n) C (suc k)) × [x^k+1]*[y^n-k]
199199
≡⟨⟩

src/Codata/Sized/Cowriter.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ open import Codata.Sized.Stream as Stream using (Stream; _∷_)
1717
open import Data.Unit.Base
1818
open import Data.List.Base using (List; []; _∷_)
1919
open import Data.List.NonEmpty.Base using (List⁺; _∷_)
20-
open import Data.Nat.Base as Nat using (ℕ; zero; suc)
20+
open import Data.Nat.Base as using (ℕ; zero; suc)
2121
open import Data.Product.Base as Prod using (_×_; _,_)
2222
open import Data.Sum.Base as Sum using (_⊎_; inj₁; inj₂)
2323
open import Data.Vec.Base using (Vec; []; _∷_)

src/Data/Char/Properties.agda

+13-13
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Data.Char.Properties where
1111
open import Data.Bool.Base using (Bool)
1212
open import Data.Char.Base
1313
import Data.Nat.Base as ℕ
14-
import Data.Nat.Properties as ℕₚ
14+
import Data.Nat.Properties as
1515
open import Data.Product.Base using (_,_)
1616

1717
open import Function.Base
@@ -56,7 +56,7 @@ open import Agda.Builtin.Char.Properties
5656

5757
infix 4 _≟_
5858
_≟_ : Decidable {A = Char} _≡_
59-
x ≟ y = map′ ≈⇒≡ ≈-reflexive (toℕ x ℕₚ.≟ toℕ y)
59+
x ≟ y = map′ ≈⇒≡ ≈-reflexive (toℕ x .≟ toℕ y)
6060

6161
setoid : Setoid _ _
6262
setoid = PropEq.setoid Char
@@ -95,22 +95,22 @@ private
9595

9696
infix 4 _<?_
9797
_<?_ : Decidable _<_
98-
_<?_ = On.decidable toℕ ℕ._<_ ℕₚ._<?_
98+
_<?_ = On.decidable toℕ ℕ._<_ ._<?_
9999

100100
<-cmp : Trichotomous _≡_ _<_
101-
<-cmp c d with ℕₚ.<-cmp (toℕ c) (toℕ d)
101+
<-cmp c d with .<-cmp (toℕ c) (toℕ d)
102102
... | tri< lt ¬eq ¬gt = tri< lt (≉⇒≢ ¬eq) ¬gt
103103
... | tri≈ ¬lt eq ¬gt = tri≈ ¬lt (≈⇒≡ eq) ¬gt
104104
... | tri> ¬lt ¬eq gt = tri> ¬lt (≉⇒≢ ¬eq) gt
105105

106106
<-irrefl : Irreflexive _≡_ _<_
107-
<-irrefl = ℕₚ.<-irrefl ∘′ cong toℕ
107+
<-irrefl = .<-irrefl ∘′ cong toℕ
108108

109109
<-trans : Transitive _<_
110-
<-trans {c} {d} {e} = On.transitive toℕ ℕ._<_ ℕₚ.<-trans {c} {d} {e}
110+
<-trans {c} {d} {e} = On.transitive toℕ ℕ._<_ .<-trans {c} {d} {e}
111111

112112
<-asym : Asymmetric _<_
113-
<-asym {c} {d} = On.asymmetric toℕ ℕ._<_ ℕₚ.<-asym {c} {d}
113+
<-asym {c} {d} = On.asymmetric toℕ ℕ._<_ .<-asym {c} {d}
114114

115115
<-isStrictPartialOrder : IsStrictPartialOrder _≡_ _<_
116116
<-isStrictPartialOrder = record
@@ -151,7 +151,7 @@ _≤?_ = Reflₚ.decidable <-cmp
151151
≤-trans = Reflₚ.trans (λ {a} {b} {c} <-trans {a} {b} {c})
152152

153153
≤-antisym : Antisymmetric _≡_ _≤_
154-
≤-antisym = Reflₚ.antisym _≡_ refl ℕₚ.<-asym
154+
≤-antisym = Reflₚ.antisym _≡_ refl .<-asym
155155

156156
≤-isPreorder : IsPreorder _≡_ _≤_
157157
≤-isPreorder = record
@@ -220,7 +220,7 @@ Please use Propositional Equality's subst instead."
220220

221221
infix 4 _≈?_
222222
_≈?_ : Decidable _≈_
223-
x ≈? y = toℕ x ℕₚ.≟ toℕ y
223+
x ≈? y = toℕ x .≟ toℕ y
224224

225225
≈-isEquivalence : IsEquivalence _≈_
226226
≈-isEquivalence = record
@@ -277,28 +277,28 @@ Please use decSetoid instead."
277277
#-}
278278

279279
<-isStrictPartialOrder-≈ : IsStrictPartialOrder _≈_ _<_
280-
<-isStrictPartialOrder-≈ = On.isStrictPartialOrder toℕ ℕₚ.<-isStrictPartialOrder
280+
<-isStrictPartialOrder-≈ = On.isStrictPartialOrder toℕ .<-isStrictPartialOrder
281281
{-# WARNING_ON_USAGE <-isStrictPartialOrder-≈
282282
"Warning: <-isStrictPartialOrder-≈ was deprecated in v1.5.
283283
Please use <-isStrictPartialOrder instead."
284284
#-}
285285

286286
<-isStrictTotalOrder-≈ : IsStrictTotalOrder _≈_ _<_
287-
<-isStrictTotalOrder-≈ = On.isStrictTotalOrder toℕ ℕₚ.<-isStrictTotalOrder
287+
<-isStrictTotalOrder-≈ = On.isStrictTotalOrder toℕ .<-isStrictTotalOrder
288288
{-# WARNING_ON_USAGE <-isStrictTotalOrder-≈
289289
"Warning: <-isStrictTotalOrder-≈ was deprecated in v1.5.
290290
Please use <-isStrictTotalOrder instead."
291291
#-}
292292

293293
<-strictPartialOrder-≈ : StrictPartialOrder _ _ _
294-
<-strictPartialOrder-≈ = On.strictPartialOrder ℕₚ.<-strictPartialOrder toℕ
294+
<-strictPartialOrder-≈ = On.strictPartialOrder .<-strictPartialOrder toℕ
295295
{-# WARNING_ON_USAGE <-strictPartialOrder-≈
296296
"Warning: <-strictPartialOrder-≈ was deprecated in v1.5.
297297
Please use <-strictPartialOrder instead."
298298
#-}
299299

300300
<-strictTotalOrder-≈ : StrictTotalOrder _ _ _
301-
<-strictTotalOrder-≈ = On.strictTotalOrder ℕₚ.<-strictTotalOrder toℕ
301+
<-strictTotalOrder-≈ = On.strictTotalOrder .<-strictTotalOrder toℕ
302302
{-# WARNING_ON_USAGE <-strictTotalOrder-≈
303303
"Warning: <-strictTotalOrder-≈ was deprecated in v1.5.
304304
Please use <-strictTotalOrder instead."

src/Data/DifferenceNat.agda

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
module Data.DifferenceNat where
1111

12-
open import Data.Nat.Base as N using (ℕ)
12+
open import Data.Nat.Base as using (ℕ)
1313
open import Function.Base using (_⟨_⟩_)
1414

1515
infixl 6 _+_
@@ -21,7 +21,7 @@ Diffℕ = ℕ → ℕ
2121
0# = λ k k
2222

2323
suc : Diffℕ Diffℕ
24-
suc n = λ k N.suc (n k)
24+
suc n = λ k .suc (n k)
2525

2626
1# : Diffℕ
2727
1# = suc 0#
@@ -35,4 +35,4 @@ toℕ n = n 0
3535
-- fromℕ n is linear in the size of n.
3636

3737
fromℕ : Diffℕ
38-
fromℕ n = λ k n ⟨ N._+_ ⟩ k
38+
fromℕ n = λ k n ⟨ ._+_ ⟩ k

src/Data/DifferenceVec.agda

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
module Data.DifferenceVec where
1010

1111
open import Data.DifferenceNat
12-
open import Data.Vec.Base as V using (Vec)
12+
open import Data.Vec.Base as Vec using (Vec)
1313
open import Function.Base using (_⟨_⟩_)
14-
import Data.Nat.Base as N
14+
import Data.Nat.Base as
1515

1616
infixr 5 _∷_ _++_
1717

@@ -22,7 +22,7 @@ DiffVec A m = ∀ {n} → Vec A n → Vec A (m n)
2222
[] = λ k k
2323

2424
_∷_ : {a} {A : Set a} {n} A DiffVec A n DiffVec A (suc n)
25-
x ∷ xs = λ k V._∷_ x (xs k)
25+
x ∷ xs = λ k Vec._∷_ x (xs k)
2626

2727
[_] : {a} {A : Set a} A DiffVec A 1#
2828
[ x ] = x ∷ []
@@ -32,25 +32,25 @@ _++_ : ∀ {a} {A : Set a} {m n} →
3232
xs ++ ys = λ k xs (ys k)
3333

3434
toVec : {a} {A : Set a} {n} DiffVec A n Vec A (toℕ n)
35-
toVec xs = xs V.[]
35+
toVec xs = xs Vec.[]
3636

3737
-- fromVec xs is linear in the length of xs.
3838

3939
fromVec : {a} {A : Set a} {n} Vec A n DiffVec A (fromℕ n)
40-
fromVec xs = λ k xs ⟨ V._++_ ⟩ k
40+
fromVec xs = λ k xs ⟨ Vec._++_ ⟩ k
4141

4242
head : {a} {A : Set a} {n} DiffVec A (suc n) A
43-
head xs = V.head (toVec xs)
43+
head xs = Vec.head (toVec xs)
4444

4545
tail : {a} {A : Set a} {n} DiffVec A (suc n) DiffVec A n
46-
tail xs = λ k V.tail (xs k)
46+
tail xs = λ k Vec.tail (xs k)
4747

4848
take : {a} {A : Set a} m {n}
4949
DiffVec A (fromℕ m + n) DiffVec A (fromℕ m)
50-
take N.zero xs = []
51-
take (N.suc m) xs = head xs ∷ take m (tail xs)
50+
take .zero xs = []
51+
take (.suc m) xs = head xs ∷ take m (tail xs)
5252

5353
drop : {a} {A : Set a} m {n}
5454
DiffVec A (fromℕ m + n) DiffVec A n
55-
drop N.zero xs = xs
56-
drop (N.suc m) xs = drop m (tail xs)
55+
drop .zero xs = xs
56+
drop (.suc m) xs = drop m (tail xs)

src/Data/Fin.agda

+2-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
module Data.Fin where
1010

1111
open import Relation.Nullary.Decidable.Core
12-
open import Data.Nat.Base using (suc)
13-
import Data.Nat.Properties as ℕₚ
12+
import Data.Nat.Properties as ℕ
1413

1514
------------------------------------------------------------------------
1615
-- Publicly re-export the contents of the base module
@@ -27,5 +26,5 @@ open import Data.Fin.Properties public
2726

2827
infix 10 #_
2928

30-
#_ : m {n} {m<n : True (suc m ℕₚ.≤? n)} Fin n
29+
#_ : m {n} {m<n : True (m ℕ.<? n)} Fin n
3130
#_ _ {m<n = m<n} = fromℕ< (toWitness m<n)

src/Data/Fin/Permutation/Components.agda

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ open import Data.Bool.Base using (Bool; true; false)
1212
open import Data.Fin.Base
1313
open import Data.Fin.Properties
1414
open import Data.Nat.Base as ℕ using (zero; suc; _∸_)
15-
import Data.Nat.Properties as ℕₚ
1615
open import Data.Product.Base using (proj₂)
1716
open import Function.Base using (_∘_)
1817
open import Relation.Nullary.Reflects using (invert)

0 commit comments

Comments
 (0)