-
Notifications
You must be signed in to change notification settings - Fork 242
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
Refactoring StrictToNonStrict
and Closure.Reflexive
?
#1344
Comments
StrictToNonStrict
in terms of Closure.Reflexive
?StrictToNonStrict
and Closure.Reflexive
?
Hmm intuitively it seems to me that The problem with making I have no objection to making |
Can you explain what order you have in mind that makes |
Sorry for the long reply @JacquesCarette. To make data ReflClosure {A : Set a} (_≈_ : Rel A ℓ) (_∼_ : Rel A ℓ) : Rel A (a ⊔ ℓ) where
refl : ∀ {x y} (x≈y : x ≈ y) → ReflClosure _≈_ _∼_ x y
[_] : ∀ {x y} (x∼y : x ∼ y) → ReflClosure _≈_ _∼_ x y so that you can specify the equality relation that you are reflexive in respect to. The current definition of I'm in favour of making this change in v2.0. |
This still seems different to me. With |
I'm afraid I don't quite understand what you mean here?
No, |
As @Taneb points out this is really just an instance of |
The conclusion is to change to use |
Having done part of this rewrite, I'd say we should either not use The synonym for ≤-reflexive : _≡_ ⇒ _≤_
- ≤-reflexive = Refl.reflexive
+ ≤-reflexive = Refl.reflexive {R = _<_} @jamesmckinna The data ReflClosure {A : Set a} (_∼_ : Rel A ℓ) : Rel A (a ⊔ ℓ) where
refl : Reflexive (ReflClosure _∼_)
[_] : ∀ {x y} (x∼y : x ∼ y) → ReflClosure _∼_ x y
data TransClosure {A : Set a} (_∼_ : Rel A ℓ) : Rel A (a ⊔ ℓ) where
[_] : ∀ {x y} (x∼y : x ∼ y) → TransClosure _∼_ x y
_∷_ : ∀ {x y z} (x∼y : x ∼ y) (y∼⁺z : TransClosure _∼_ y z) → TransClosure _∼_ x z Unfortunately, it is immediately abandoned in data Star {i t} {I : Set i} (T : Rel I t) : Rel I (i ⊔ t) where
ε : Reflexive (Star T)
_◅_ : ∀ {i j k} (x : T i j) (xs : Star T j k) → Star T i k And the analogue breaks down in There are also an alternative definition for data Plus {A : Set a} (_∼_ : Rel A ℓ) : Rel A (a ⊔ ℓ) where
[_] : ∀ {x y} (x∼y : x ∼ y) → x [ _∼_ ]⁺ y
_∼⁺⟨_⟩_ : ∀ x {y z} (x∼⁺y : x [ _∼_ ]⁺ y) (y∼⁺z : y [ _∼_ ]⁺ z) →
x [ _∼_ ]⁺ z And an extra definition called data Plus⇔ : Rel A (a ⊔ ℓ) where
forth : ∀ {x y} → x ≤ y → Plus⇔ x y
back : ∀ {x y} → y ≤ x → Plus⇔ x y
forth⁺ : ∀ {x y z} → x ≤ y → Plus⇔ y z → Plus⇔ x z
back⁺ : ∀ {x y z} → y ≤ x → Plus⇔ y z → Plus⇔ x z So I think redefining |
None of these seem generic in the equality relation, so I do think @MatthewDaggitt's suggestion to generalise |
As an alternative, why not redefine in the opposite direction, by defining Part of my reasoning comes precisely from looking at @JacquesCarette 's #1489 where the properties of And FWIW, I'm not wedded to whether ... but I suppose the discussion of unifying the UPDATED: D'oh: @gallais 's original suggestion! Minus the separate inductive definition... |
We should almost have a new label entirely for being "blocked on typed pattern synonyms" 😅 |
At the moment we have:
and
Should we merge the two definitions by introducing a separate inductive type for
_≤_
and implementingReflClosure
in terms of it?This would make
ReflClosure
more lazy by changing the type ofrefl
fromReflexive _
tox ≡ y → ReflClosure _∼_ x y
.The text was updated successfully, but these errors were encountered: