Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Data.List.Relation.Binary.Permutation.*, part I #2333

Merged
merged 42 commits into from
Sep 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7ab1da5
move `steps` towards deprecation in `Homogeneous`
jamesmckinna Mar 28, 2024
4ece6bb
deprecate `steps`; refactor `Setoid` proofs and equaiotnal reasoning …
jamesmckinna Mar 28, 2024
38f22e4
extensive refactoring
jamesmckinna Mar 28, 2024
9399636
tidy up
jamesmckinna Mar 28, 2024
c6f701f
add equivalence with `Setoid` representation
jamesmckinna Mar 28, 2024
b37ba6f
removed buggy `PermutationReasoning` syntax
jamesmckinna Mar 28, 2024
791baf9
refactored; removed buggy `PermutationReasoning` syntax
jamesmckinna Mar 28, 2024
ff7845a
`CHANGELOG`
jamesmckinna Mar 28, 2024
a3d0b8e
final fix-ups
jamesmckinna Mar 28, 2024
2950a39
tighten `import`s
jamesmckinna Mar 28, 2024
69ca8fd
tighten `import`s
jamesmckinna Mar 28, 2024
5f0051a
redundant constructor aliases
jamesmckinna Mar 28, 2024
5461356
fix-up `Reasoning` steps with the alias
jamesmckinna Mar 28, 2024
8b44fd8
use aliases
jamesmckinna Mar 28, 2024
7918a8d
more `import` tightening
jamesmckinna Mar 28, 2024
00a335a
refactor: encapsulate and tighten up
jamesmckinna Mar 28, 2024
91feb30
avoid `PermutationReasoning` custom combinators
jamesmckinna Mar 28, 2024
227043d
fix up `CHANGELOG`
jamesmckinna Mar 28, 2024
4df26ef
encapsulate helper function
jamesmckinna Mar 28, 2024
0bf8e38
revert changes
jamesmckinna Mar 28, 2024
60a1958
review comments
jamesmckinna Mar 28, 2024
fd80b0b
`fix-whitespace`
jamesmckinna Mar 28, 2024
1781ea3
toned down the comment on `steps`
jamesmckinna Mar 29, 2024
7c2bc35
remove use of infix `insert`
jamesmckinna Mar 29, 2024
2e032a5
revert other deprecation
jamesmckinna Mar 29, 2024
4ad9fef
no need for qualification
jamesmckinna Mar 29, 2024
83dc6c7
remove deprecation banner
jamesmckinna Mar 29, 2024
246bf5c
three paras of commentary on the new transitivity proofs
jamesmckinna Mar 29, 2024
39bb784
missing entry
jamesmckinna Mar 30, 2024
b7dff80
missing terminator
jamesmckinna Mar 30, 2024
ce4d72f
response to review comments
jamesmckinna Apr 6, 2024
c8bf0a6
`with` to `let`
jamesmckinna Apr 7, 2024
e5701d9
Merge branch 'master' into permutation-refactor
jamesmckinna Apr 16, 2024
a40a26f
Merge branch 'master' into permutation-refactor
jamesmckinna Apr 24, 2024
cbef1f8
fixed `BagAndSetEquality`
jamesmckinna Apr 24, 2024
9eb7000
Merge branch 'master' into permutation-refactor
jamesmckinna May 14, 2024
a5e2849
Merge branch 'master' into permutation-refactor
jamesmckinna May 15, 2024
26371ae
Merge branch 'master' into permutation-refactor
jamesmckinna Sep 3, 2024
dd296a6
fixed qualified `import` bug introduced during merge conflict resolution
jamesmckinna Sep 3, 2024
7f84607
Merge branch 'master' into permutation-refactor
jamesmckinna Sep 9, 2024
92c14a8
Update CHANGELOG.md
jamesmckinna Sep 9, 2024
901310f
Merge branch 'master' into permutation-refactor
MatthewDaggitt Sep 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
redundant constructor aliases
  • Loading branch information
jamesmckinna committed Mar 28, 2024
commit 5f0051af853dcf068dd3976c13f1d63d9296e90f
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,13 @@ Additions to existing modules
```

* In `Data.List.Relation.Binary.Permutation.Propositional`:
constructor aliases
```agda
↭-refl : Reflexive _↭_
↭-prep : ∀ x → xs ↭ ys → x ∷ xs ↭ x ∷ ys
↭-swap : ∀ x y → xs ↭ ys → x ∷ y ∷ xs ↭ y ∷ x ∷ ys
```
and properties
```agda
↭-pointwise : _≋_ ⇒ _↭_
↭⇒↭ₛ : _↭_ ⇒ _↭ₛ_
Expand Down
20 changes: 14 additions & 6 deletions src/Data/List/Relation/Binary/Permutation/Propositional.agda
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,27 @@ data _↭_ : Rel (List A) a where
swap : ∀ x y → xs ↭ ys → x ∷ y ∷ xs ↭ y ∷ x ∷ ys
trans : xs ↭ ys → ys ↭ zs → xs ↭ zs

------------------------------------------------------------------------
-- _↭_ is an equivalence
-- Constructor aliases

↭-refl : Reflexive _↭_
↭-refl = refl

↭-prep : ∀ x → xs ↭ ys → x ∷ xs ↭ x ∷ ys
↭-prep = prep

↭-swap : ∀ x y → xs ↭ ys → x ∷ y ∷ xs ↭ y ∷ x ∷ ys
↭-swap = swap

------------------------------------------------------------------------
-- _↭_ is an equivalence

↭-reflexive : _≡_ ⇒ _↭_
↭-reflexive refl = ↭-refl

↭-pointwise : _≋_ ⇒ _↭_
↭-pointwise xs≋ys = ↭-reflexive (≋⇒≡ xs≋ys)

↭-sym : ∀ {xs ys} → xs ↭ ys → ys ↭ xs
↭-sym : xs ↭ ys → ys ↭ xs
↭-sym refl = refl
↭-sym (prep x xs↭ys) = prep x (↭-sym xs↭ys)
↭-sym (swap x y xs↭ys) = swap y x (↭-sym xs↭ys)
Expand All @@ -69,7 +77,7 @@ data _↭_ : Rel (List A) a where

↭-isEquivalence : IsEquivalence _↭_
↭-isEquivalence = record
{ refl = refl
{ refl = ↭-refl
; sym = ↭-sym
; trans = ↭-trans
}
Expand All @@ -96,8 +104,8 @@ private

↭ₛ⇒↭ : _↭ₛ_ ⇒ _↭_
↭ₛ⇒↭ (↭ₛ.refl xs≋ys) = ↭-pointwise xs≋ys
↭ₛ⇒↭ (↭ₛ.prep refl p) = prep _ (↭ₛ⇒↭ p)
↭ₛ⇒↭ (↭ₛ.swap refl refl p) = swap _ _ (↭ₛ⇒↭ p)
↭ₛ⇒↭ (↭ₛ.prep refl p) = ↭-prep _ (↭ₛ⇒↭ p)
↭ₛ⇒↭ (↭ₛ.swap refl refl p) = ↭-swap _ _ (↭ₛ⇒↭ p)
↭ₛ⇒↭ (↭ₛ.trans p q) = ↭-trans (↭ₛ⇒↭ p) (↭ₛ⇒↭ q)


Expand Down