Skip to content

Commit 2a959aa

Browse files
Merge branch 'master' into list_properties
2 parents e61bfe2 + 69bbe51 commit 2a959aa

File tree

113 files changed

+790
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+790
-281
lines changed

CHANGELOG.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,19 @@ New modules
128128
Data.Container.Indexed.Relation.Binary.Equality.Setoid
129129
```
130130

131+
* `System.Random` bindings:
132+
```agda
133+
System.Random.Primitive
134+
System.Random
135+
```
136+
137+
* Show modules:
138+
```agda
139+
Data.List.Show
140+
Data.Vec.Show
141+
Data.Vec.Bounded.Show
142+
```
143+
131144
Additions to existing modules
132145
-----------------------------
133146

@@ -252,6 +265,12 @@ Additions to existing modules
252265
x \\ y = (x ⁻¹) ∙ y
253266
```
254267

268+
* In `Algebra.Structures.IsCancellativeCommutativeSemiring` add the
269+
extra property as an exposed definition:
270+
```agda
271+
*-cancelʳ-nonZero : AlmostRightCancellative 0# *
272+
```
273+
255274
* In `Data.Container.Indexed.Core`:
256275
```agda
257276
Subtrees o c = (r : Response c) → X (next c r)
@@ -262,6 +281,11 @@ Additions to existing modules
262281
nonZeroIndex : Fin n → ℕ.NonZero n
263282
```
264283

284+
* In `Data.Float.Base`:
285+
```agda
286+
_≤_ : Rel Float _
287+
```
288+
265289
* In `Data.Integer.Divisibility`: introduce `divides` as an explicit pattern synonym
266290
```agda
267291
pattern divides k eq = Data.Nat.Divisibility.divides k eq
@@ -276,6 +300,7 @@ Additions to existing modules
276300

277301
* In `Data.List.Properties`:
278302
```agda
303+
length-catMaybes : length (catMaybes xs) ≤ length xs
279304
applyUpTo-∷ʳ : applyUpTo f n ∷ʳ f n ≡ applyUpTo f (suc n)
280305
applyDownFrom-∷ʳ : applyDownFrom (f ∘ suc) n ∷ʳ f 0 ≡ applyDownFrom f (suc n)
281306
upTo-∷ʳ : upTo n ∷ʳ n ≡ upTo (suc n)
@@ -409,6 +434,13 @@ Additions to existing modules
409434
* Added new functions in `Data.String.Base`:
410435
```agda
411436
map : (Char → Char) → String → String
437+
between : String → String → String → String
438+
```
439+
440+
* In `Data.Word.Base`:
441+
```agda
442+
_≤_ : Rel Word64 zero
443+
```
412444

413445
* Added new definition in `Relation.Binary.Construct.Closure.Transitive`
414446
```
@@ -457,5 +489,7 @@ Additions to existing modules
457489
WeaklyDecidable : Pred A ℓ → Set _
458490
```
459491

460-
* `Tactic.Cong` now provides a marker function, `⌞_⌟`, for user-guided
461-
anti-unification. See README.Tactic.Cong for details.
492+
* Enhancements to `Tactic.Cong` - see `README.Tactic.Cong` for details.
493+
- Provide a marker function, `⌞_⌟`, for user-guided anti-unification.
494+
- Improved support for equalities between terms with instance arguments,
495+
such as terms that contain `_/_` or `_%_`.

CHANGELOG/v1.7.3.md

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
Version 1.7.3
2+
=============
3+
4+
The library has been tested using Agda 2.6.3 & 2.6.4.
5+
6+
* To avoid _large indices_ that are by default no longer allowed in Agda 2.6.4,
7+
universe levels have been increased in the following definitions:
8+
- `Data.Star.Decoration.DecoratedWith`
9+
- `Data.Star.Pointer.Pointer`
10+
- `Reflection.AnnotatedAST.Typeₐ`
11+
- `Reflection.AnnotatedAST.AnnotationFun`
12+
13+
* The following aliases have been added:
14+
- `IO.Primitive.pure` as alias for `IO.Primitive.return`
15+
- modules `Effect.*` as aliases for modules `Category.*`
16+
17+
These allow to address said objects with the new name they will have in v2.0 of the library,
18+
to ease the transition from v1.7.3 to v2.0.

GenerateEverything.hs

+2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ unsafeModules = map modToFile
7676
, "System.FilePath.Posix.Primitive"
7777
, "System.Process"
7878
, "System.Process.Primitive"
79+
, "System.Random"
80+
, "System.Random.Primitive"
7981
, "Test.Golden"
8082
, "Text.Pretty.Core"
8183
, "Text.Pretty"

doc/README/Tactic/Cong.agda

+33
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
module README.Tactic.Cong where
44

55
open import Data.Nat
6+
open import Data.Nat.DivMod
67
open import Data.Nat.Properties
78

89
open import Relation.Binary.PropositionalEquality
@@ -161,3 +162,35 @@ module EquationalReasoningTests where
161162
≤⟨ n≤1+n _ ⟩
162163
suc (suc (n + n))
163164
165+
166+
module MetaTests where
167+
168+
test₁ : ∀ m n o → .⦃ _ : NonZero o ⦄ (m + n) / o ≡ (n + m) / o
169+
test₁ m n o =
170+
let open ≤-Reasoning in
171+
begin-equality
172+
⌞ m + n ⌟ / o
173+
≡⟨ cong! (+-comm m n) ⟩
174+
(n + m) / o
175+
176+
177+
test₂ : ∀ m n o p q r → .⦃ _ : NonZero o ⦄ → .⦃ _ : NonZero p ⦄
178+
.⦃ _ : NonZero q ⦄ p ≡ q ^ r (m + n) % o % p ≡ (n + m) % o % p
179+
test₂ m n o p q r eq =
180+
let
181+
open ≤-Reasoning
182+
instance q^r≢0 = m^n≢0 q r
183+
in
184+
begin-equality
185+
(m + n) % o % p
186+
≡⟨ %-congʳ eq ⟩
187+
⌞ m + n ⌟ % o % q ^ r
188+
≡⟨ cong! (+-comm m n) ⟩
189+
⌞ n + m ⌟ % o % q ^ r
190+
≡⟨ cong! (+-comm m n) ⟨
191+
⌞ m + n ⌟ % o % q ^ r
192+
≡⟨ cong! (+-comm m n) ⟩
193+
(n + m) % o % q ^ r
194+
≡⟨ %-congʳ eq ⟨
195+
(n + m) % o % p
196+

src/Algebra/Construct/LexProduct.agda

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@
66

77
{-# OPTIONS --cubical-compatible --safe #-}
88

9-
open import Algebra
10-
open import Data.Bool using (true; false)
9+
open import Algebra.Bundles using (Magma)
10+
open import Algebra.Definitions
11+
open import Data.Bool.Base using (true; false)
1112
open import Data.Product.Base using (_×_; _,_)
1213
open import Data.Product.Relation.Binary.Pointwise.NonDependent using (Pointwise)
1314
open import Data.Sum.Base using (inj₁; inj₂)
1415
open import Function.Base using (_∘_)
1516
open import Relation.Binary.Core using (Rel)
1617
open import Relation.Binary.Definitions using (Decidable)
17-
open import Relation.Nullary using (¬_; does; yes; no)
18-
open import Relation.Nullary.Negation using (contradiction; contradiction₂)
18+
open import Relation.Nullary.Decidable.Core using (does; yes; no)
19+
open import Relation.Nullary.Negation.Core using (¬_; contradiction; contradiction₂)
1920
import Relation.Binary.Reasoning.Setoid as ≈-Reasoning
2021

2122
module Algebra.Construct.LexProduct

src/Algebra/Properties/Monoid/Sum.agda

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@
77
{-# OPTIONS --cubical-compatible --safe #-}
88

99
open import Algebra.Bundles using (Monoid)
10+
11+
module Algebra.Properties.Monoid.Sum {a ℓ} (M : Monoid a ℓ) where
12+
1013
open import Data.Nat.Base as ℕ using (ℕ; zero; suc; NonZero)
11-
open import Data.Vec.Functional as Vector
14+
open import Data.Vec.Functional as Vector using (Vector; replicate; init;
15+
last; head; tail)
1216
open import Data.Fin.Base using (zero; suc)
13-
open import Data.Unit using (tt)
1417
open import Function.Base using (_∘_)
1518
open import Relation.Binary.Core using (_Preserves_⟶_)
1619
open import Relation.Binary.PropositionalEquality.Core as ≡ using (_≗_; _≡_)
1720

18-
module Algebra.Properties.Monoid.Sum {a ℓ} (M : Monoid a ℓ) where
19-
2021
open Monoid M
2122
renaming
2223
( _∙_ to _+_

src/Algebra/Solver/IdempotentCommutativeMonoid.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
{-# OPTIONS --cubical-compatible --safe #-}
1010

11-
open import Algebra
11+
open import Algebra.Bundles using (IdempotentCommutativeMonoid)
1212

1313
open import Data.Bool as Bool using (Bool; true; false; if_then_else_; _∨_)
1414
open import Data.Fin.Base using (Fin; zero; suc)

src/Algebra/Solver/Monoid.agda

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ open import Data.Nat.Base using (ℕ)
2020
open import Data.Product.Base using (_×_; uncurry)
2121
open import Data.Vec.Base using (Vec; lookup)
2222
open import Function.Base using (_∘_; _$_)
23-
open import Relation.Binary.Definitions using (Decidable)
23+
open import Relation.Binary.Definitions using (DecidableEquality)
2424

2525
open import Relation.Binary.PropositionalEquality.Core using (_≡_; cong)
2626
import Relation.Binary.Reflection
@@ -114,7 +114,7 @@ open module R = Relation.Binary.Reflection
114114

115115
infix 5 _≟_
116116

117-
_≟_ : {n} Decidable {A = Normal n} _≡_
117+
_≟_ : {n} DecidableEquality (Normal n)
118118
nf₁ ≟ nf₂ = Dec.map′ ≋⇒≡ ≡⇒≋ (nf₁ ≋? nf₂)
119119
where open ListEq Fin._≟_
120120

src/Algebra/Structures.agda

+4
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ record IsCancellativeCommutativeSemiring (+ * : Op₂ A) (0# 1# : A) : Set (a
573573

574574
open IsCommutativeSemiring isCommutativeSemiring public
575575

576+
*-cancelʳ-nonZero : AlmostRightCancellative 0# *
577+
*-cancelʳ-nonZero = Consequences.comm∧almostCancelˡ⇒almostCancelʳ setoid
578+
*-comm *-cancelˡ-nonZero
579+
576580
record IsIdempotentSemiring (+ * : Op₂ A) (0# 1# : A) : Set (a ⊔ ℓ) where
577581
field
578582
isSemiring : IsSemiring + * 0# 1#

src/Axiom/UniquenessOfIdentityProofs.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module Constant⇒UIP
6060
-- proof produced by the decision procedure.
6161

6262
module Decidable⇒UIP
63-
{a} {A : Set a} (_≟_ : Decidable {A = A} _≡_)
63+
{a} {A : Set a} (_≟_ : DecidableEquality A)
6464
where
6565

6666
≡-normalise : _≡_ {A = A} ⇒ _≡_

src/Codata/Sized/Conat/Literals.agda

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
module Codata.Sized.Conat.Literals where
1010

11-
open import Agda.Builtin.FromNat
12-
open import Data.Unit
13-
open import Codata.Sized.Conat
11+
open import Agda.Builtin.FromNat using (Number)
12+
open import Data.Unit.Base using (⊤)
13+
open import Codata.Sized.Conat using (Conat; fromℕ)
1414

1515
number : {i} Number (Conat i)
1616
number = record

src/Codata/Sized/Delay/Properties.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module Codata.Sized.Delay.Properties where
1010

1111
open import Size
1212
import Data.Sum.Base as Sum
13-
import Data.Nat as ℕ
13+
import Data.Nat.Base as ℕ
1414
open import Codata.Sized.Thunk using (Thunk; force)
1515
open import Codata.Sized.Conat
1616
open import Codata.Sized.Conat.Bisimilarity as Coℕ using (zero ; suc)

src/Data/Bool/Properties.agda

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ open import Relation.Binary.Structures
2525
open import Relation.Binary.Bundles
2626
using (Setoid; DecSetoid; Poset; Preorder; TotalOrder; DecTotalOrder; StrictPartialOrder; StrictTotalOrder)
2727
open import Relation.Binary.Definitions
28-
using (Decidable; Reflexive; Transitive; Antisymmetric; Minimum; Maximum; Total; Irrelevant; Irreflexive; Asymmetric; Trans; Trichotomous; tri≈; tri<; tri>; _Respects₂_)
28+
using (Decidable; DecidableEquality; Reflexive; Transitive; Antisymmetric; Minimum; Maximum; Total; Irrelevant; Irreflexive; Asymmetric; Trans; Trichotomous; tri≈; tri<; tri>; _Respects₂_)
2929
open import Relation.Binary.PropositionalEquality.Core
3030
open import Relation.Binary.PropositionalEquality.Properties
3131
open import Relation.Nullary.Decidable.Core using (True; yes; no; fromWitness)
@@ -48,7 +48,7 @@ private
4848

4949
infix 4 _≟_
5050

51-
_≟_ : Decidable {A = Bool} _≡_
51+
_≟_ : DecidableEquality Bool
5252
true ≟ true = yes refl
5353
false ≟ false = yes refl
5454
true ≟ false = no λ()

src/Data/Char/Properties.agda

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ open import Relation.Binary.Bundles
2323
open import Relation.Binary.Structures
2424
using (IsDecEquivalence; IsStrictPartialOrder; IsStrictTotalOrder; IsPreorder; IsPartialOrder; IsDecPartialOrder; IsEquivalence)
2525
open import Relation.Binary.Definitions
26-
using (Decidable; Trichotomous; Irreflexive; Transitive; Asymmetric; Antisymmetric; Symmetric; Substitutive; Reflexive; tri<; tri≈; tri>)
26+
using (Decidable; DecidableEquality; Trichotomous; Irreflexive; Transitive; Asymmetric; Antisymmetric; Symmetric; Substitutive; Reflexive; tri<; tri≈; tri>)
2727
import Relation.Binary.Construct.On as On
2828
import Relation.Binary.Construct.Subst.Equality as Subst
2929
import Relation.Binary.Construct.Closure.Reflexive as Refl
@@ -55,7 +55,7 @@ open import Agda.Builtin.Char.Properties
5555
-- Properties of _≡_
5656

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

6161
setoid : Setoid _ _

src/Data/Container/Fixpoints/Sized.agda

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88

99
module Data.Container.Fixpoints.Sized where
1010

11-
open import Level
12-
open import Size
13-
open import Codata.Sized.M
14-
open import Data.W.Sized
11+
open import Level using (Level; _⊔_)
12+
open import Size using (Size)
13+
open import Codata.Sized.M using (M)
14+
open import Data.W.Sized using (W)
1515
open import Data.Container hiding (μ) public
1616

1717
private

src/Data/Container/Indexed/Relation/Binary/Pointwise/Properties.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Data.Container.Indexed.Relation.Binary.Pointwise.Properties where
1111
open import Axiom.Extensionality.Propositional
1212
open import Data.Container.Indexed.Core
1313
open import Data.Container.Indexed.Relation.Binary.Pointwise
14-
open import Data.Product using (_,_; Σ-syntax; -,_)
14+
open import Data.Product.Base using (_,_; Σ-syntax; -,_)
1515
open import Level using (Level; _⊔_)
1616
open import Relation.Binary
1717
open import Relation.Binary.PropositionalEquality as P

src/Data/Fin/Permutation.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
module Data.Fin.Permutation where
1010

11-
open import Data.Bool using (true; false)
11+
open import Data.Bool.Base using (true; false)
1212
open import Data.Empty using (⊥-elim)
1313
open import Data.Fin.Base
1414
open import Data.Fin.Patterns

src/Data/Fin/Properties.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ open import Data.Nat.Base as ℕ
2222
using (ℕ; zero; suc; s≤s; z≤n; z<s; s<s; s<s⁻¹; _∸_; _^_)
2323
import Data.Nat.Properties as ℕ
2424
open import Data.Nat.Solver
25-
open import Data.Unit using (⊤; tt)
25+
open import Data.Unit.Base using (⊤; tt)
2626
open import Data.Product.Base as Product
2727
using (∃; ∃₂; _×_; _,_; map; proj₁; proj₂; uncurry; <_,_>)
2828
open import Data.Product.Properties using (,-injective)

src/Data/Fin/Substitution/Lemmas.agda

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@
99
module Data.Fin.Substitution.Lemmas where
1010

1111
open import Data.Fin.Substitution
12-
open import Data.Nat hiding (_⊔_; _/_)
12+
open import Data.Nat.Base using (ℕ; zero; suc; _+_)
1313
open import Data.Fin.Base using (Fin; zero; suc; lift)
14-
open import Data.Vec.Base
14+
open import Data.Vec.Base using (lookup; []; _∷_; map)
1515
import Data.Vec.Properties as Vec
1616
open import Function.Base as Fun using (_∘_; _$_; flip)
17+
open import Level using (Level; _⊔_)
1718
open import Relation.Binary.PropositionalEquality.Core as ≡
1819
using (_≡_; refl; sym; cong; cong₂)
1920
open import Relation.Binary.PropositionalEquality.Properties
2021
using (module ≡-Reasoning)
2122
open import Relation.Binary.Construct.Closure.ReflexiveTransitive
2223
using (Star; ε; _◅_; _▻_)
2324
open ≡-Reasoning
24-
open import Level using (Level; _⊔_)
2525
open import Relation.Unary using (Pred)
2626

2727
private

src/Data/Float/Base.agda

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88

99
module Data.Float.Base where
1010

11-
open import Relation.Binary.Core using (Rel)
11+
open import Data.Bool.Base using (T)
1212
import Data.Word.Base as Word
1313
import Data.Maybe.Base as Maybe
1414
open import Function.Base using (_on_; _∘_)
1515
open import Agda.Builtin.Equality
16+
open import Relation.Binary.Core using (Rel)
1617

1718
------------------------------------------------------------------------
1819
-- Re-export built-ins publically
@@ -69,3 +70,8 @@ infix 4 _≈_
6970

7071
_≈_ : Rel Float _
7172
_≈_ = _≡_ on Maybe.map Word.toℕ ∘ toWord
73+
74+
75+
infix 4 _≤_
76+
_≤_ : Rel Float _
77+
x ≤ y = T (x ≤ᵇ y)

src/Data/Integer.agda

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ open import Data.Integer.Properties public
3131
-- Show
3232

3333
import Data.Nat.Show as ℕ using (show)
34-
open import Data.Sign as Sign using (Sign)
34+
open import Data.Sign.Base as Sign using (Sign)
3535
open import Data.String.Base using (String; _++_)
3636

3737
show : String

0 commit comments

Comments
 (0)