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

CollectionLink as base class of SetLink #2846

Merged
merged 5 commits into from
Sep 21, 2021
Merged

Conversation

linas
Copy link
Member

@linas linas commented Sep 11, 2021

This satsifies issue #2845

@linas linas requested a review from ngeiswei September 11, 2021 16:50
Fix this once and for all. I hit this just a few days earlier!
@ngeiswei
Copy link
Member

CollectionLink is nice, but do you mean as in https://en.wikipedia.org/wiki/Collection_(abstract_data_type) which typically includes list as well? Or as in https://en.wikipedia.org/wiki/Set_(mathematics)?

Additionally I'm concerned that CollectionLink inheriting from UnorderedLink would not permit to introduce SetDifferenceLink which should be ordered even though it does represent an unordered collection. Thus I think CollectionLink should rather inherits from Link, and have SetLink, UnionLink, etc, doubly inherit from UnorderedLink and CollectionLink. I don't think such double inheritance would be problematic w.r.t. to factories since CollectionLink have no factory. This also opens the possibility to have ListLink inheriting from CollectionLink, if we want to (I'm neutral about it, but I see it as feasible because a list can be seen as a set of indexed elements, and thus union, etc, between lists and sets is actually definable).

@linas
Copy link
Member Author

linas commented Sep 14, 2021

do you mean as in https://en.wikipedia.org/wiki/Collection_(abstract_data_type)

Not what I was originally thinking of, no. It was just an English word I could think of that was neutral. Could also try GroupingLink but that feels awkward in English. I can't think of any other names right now.

doubly inherit from UnorderedLink and CollectionLink

Good idea. I'll make that change right now.

SetDifferenceLink

What the heck. May as well add that now. clear the decks.

opens the possibility to have ListLink inheriting from CollectionLink

Interesting idea. That means that all data-like things inherit from Collection .. interesting idea. I'll make that change too, and see if it harms anything. We can revert later if it looks bad.

@linas
Copy link
Member Author

linas commented Sep 14, 2021

Currently SubsetLink inherits from InheritanceLink which might make sense for PLN, but sounds weird if we are sticking to plain-old venn-diagram set-theory concepts. I'd like to change it to

SUBSET_LINK <- ORDERED_LINK

and as a side effect, you might want to add back in

EXTENSIONAL_INHERITANCE_LINK. <- INHERITANCE_LINK

This is not a burning issue, but seems like "the right thing to do" from a set-theory-notation point of view. Let me know what you think @ngeiswei

@linas
Copy link
Member Author

linas commented Sep 18, 2021

@ngeiswei any further comments, or should I merge this?

Copy link
Member

@ngeiswei ngeiswei left a comment

Choose a reason for hiding this comment

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

It all looks good, @linas.

Regarding whether Subset should or not inherit from Inheritance, I'm somewhat confused by it at the moment, I would say probably not (in PLN Inheritance is the disjunction of extensional a.k.a.Subset and intensional inheritance, but constructing that disjunction supposes proper casting from these inheritance links to high order predicates, and I'm not sure that entirely well defined yet). Anyway, it's not a pressing issue as you say.

@linas linas merged commit a2f11eb into opencog:master Sep 21, 2021
@linas linas deleted the set-collection branch September 21, 2021 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants