Skip to content

Conversation

@gallais
Copy link
Member

@gallais gallais commented Dec 9, 2018

The design of First, Prefix, etc. has now informed the way I see Sublist.
So I have bitten the bullet and decided to build this heterogeneous version.
In the end, this will actually make #460 irrelevant (so I'm closing that one).

Still missing:

  • Solver (including for all the special cases)
  • Setoid special case
  • DecSetoid special case
  • Propositional special case
  • DecPropositional special case

@gallais
Copy link
Member Author

gallais commented Feb 17, 2019

This last stretch is so boring I seem to only make progress when I'm stuck on a train.

@gallais gallais changed the title [ re #432 #460 ] Heterogeneous version of Sublist [ fix #432 #460 ] Heterogeneous version of Sublist Feb 19, 2019

module _ {a b r} {A : Set a} {B : Set b} {R : REL A B r} where

tail-Sublist : ∀ {as bs} → Pointwise R as bs →
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties should all use the +/- notation rather than having Sublist in the name.

Copy link
Member Author

@gallais gallais Feb 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think they should: Sublist (drop n xs) xs is not the same as Sublist xs ys -> Sublist (drop n xs) (drop n ys).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay tail is special because it's in that first form. The rest are all in the second form though right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other ones are in the shape Sublist as bs -> Sublist (f as) bs. The function is only
applied to the first one (it's a generalisation of Sublist (f xs) xs which is useful when
the R relation Sublist is built upon is not transitive.

I guess I forgot to generalise tail-Sublist too! :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, makes sense now. This is probably one of the cases mentioned in #595 where the notation is too compact to be readable. It's not like they need to be compatible somewhere else and writing out the full types would definitely help!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll inline the notations & add comments to the section header to explain
the distinction.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would your thoughts be on calling them tail-sublist or tail-isSublist rather than tail-Sublist? Nitpicky I know.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was reusing these names: take-⊆ et al..

Whatever we pick, we should also apply the same convention to things like
≤⇒pred≤ : ∀ {m n} → m ≤ n → pred m ≤ n
(and document it).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm maybe you're right and tail-Sublist is fine...

@MatthewDaggitt MatthewDaggitt modified the milestones: v0.18, v1.0 Feb 22, 2019
@MatthewDaggitt
Copy link
Collaborator

I'm happy to have a go at this @gallais?

@gallais
Copy link
Member Author

gallais commented Mar 16, 2019

I didn't switch it to ready because we have the ongoing discussion about names.
I'm personally happy with the current state of affairs.

@MatthewDaggitt
Copy link
Collaborator

Ah sorry I'd missed your commit fixing the length property naming. Okay, thanks I'll merge it in!

@MatthewDaggitt MatthewDaggitt merged commit 6972c12 into master Mar 16, 2019
@MatthewDaggitt MatthewDaggitt deleted the ope-generalised branch March 16, 2019 14:11
@andreasabel
Copy link
Member

andreasabel commented Apr 2, 2019

I am now getting errors on

open import Data.List.Relation.Binary.Sublist.Propositional.Properties public using (⊆-refl; ⊆-trans)
The module Data.List.Relation.Binary.Sublist.Propositional.Properties doesn't
export the following: ⊆-refl, ⊆-trans

Where to find these functions now? (Answer: they are now named refl and trans, but I could only figure this out using C-c C-o.)
Shouldn't they be reexported suitably by Data.List.Relation.Binary.Sublist.Propositional.Properties from wherever they reside now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants