singnet / pln

Probabilistic Logic Network (PLN) implemented on top of the Unified Rule Engine (URE). https://wiki.opencog.org/w/Probabilistic_logic_networks
Other
1 stars 4 forks source link

get-members-of function doesn't include the input node #20

Closed Habush closed 4 years ago

Habush commented 4 years ago

In the get-members-of function defined in extensional-utils.scm, it returns an empty list if the input has no atoms that have MemberLink connection to it. But from basic set theory, any set is considered to be a subset of itself. Hence, the input atom should be included in the result.

This becomes more important when trying to create SubsetLinks from MemberLinks using pln. For example, in the bio-atomspace we have the following relationship between Genes & Pathways:

(Member (stv 1 1) (Gene "A") (Reactome "R1"))

(Member (stv 1 1) (Gene "B") (Reactome "R1"))

(Member (stv 1 1) (Gene "A") (Reactome "R2"))

(Member (stv 1 1) (Gene "C") (Reactome "R3"))

The subset-direct-introduction rule doesn't generate a SubsetLink between the genes and pathways because get-members-of function returns an empty list for the genes which results in the confidence of the stv to be 0.

ngeiswei commented 4 years ago

The subset-direct-introduction rule doesn't generate a SubsetLink between the genes and pathways

But my understanding is that genes and pathways do not have members in common, right? If so it shouldn't create subset links indeed (or it could but the tv strength should be null).

from basic set theory, any set is considered to be a subset of itself

Good point, so if you need you could generate that knowledge

(Subset (stv 1 1)
  A
  A)

from a different rule (cause subset-direct-introduction is based on direct evidence, but such a rule is more abstract and can by-pass direct evidence). So if needed you can introduce a rule for it (I don't think there is one, though perhaps check in the wip folder just in case. I didn't write most of the rules in that folder, BTW, which is why I don't even know it that well). I think a good place would be rules/proposition, a good name would be subset-reflexivity-introduction, and its semi-formal definition would be

A
|-
(Subset (stv 1 1)
  A
  A)
Habush commented 4 years ago

But my understanding is that genes and pathways do not have members in common, right?

If a gene G is a member of a pathways P then the common member between the two is gene G itself. (i.e G ∩ P = G) and if G is not member of P then they don't have common members. Here, I'm considering all genes as a sets with cardinality of 1 and the pathways as sets of n genes (n > 1). Hence, it should create a subset links between the genes and the pathways.

ngeiswei commented 4 years ago

Hence, it should create a subset links between the genes and the pathways.

Strictly speaking it should be subset links between gene singletons and pathways.