opencog / atomspace

The OpenCog (hyper-)graph database and graph rewriting system
https://wiki.opencog.org/w/AtomSpace
Other
825 stars 234 forks source link

Allow (Not (Concept ...)) or Add ComplementLink? #1699

Closed rTreutlein closed 5 years ago

rTreutlein commented 6 years ago

check_evaluatable rejects (Not (Concept ...)), this means we couldn't have something like: A inherits from Not B This seems like something we want to be able to do. So either we allow this again. @linas could you explain why this was disallowed in the first place? Or as @ngeiswei suggested we add a ComplementLink for uses such as the above. And while we are at it probably also add an IntersectionLink and UnionLink corresponding to (AndLink and OrLink)

ngeiswei commented 6 years ago

test: @ngeiswei

ngeiswei commented 6 years ago

@rTreutlein It's annoying but it seems you need to write my id in full, github seems to be completely blind to it.

linas commented 6 years ago

first of all nielsgl is Niels van Galen, not Nil Geiswiller.

Until now, we have not treated concepts as things that can be thought of as "true" or "false". Thus, until now, we have restricted AndLink OrLink and NotLink to only apply to those things have binary truth values.

There is, of course, a famous concept called a "subobject classifier". For the case of naive set theory, it corresponds to the "membership function" or the "Dirac Delta function" : a function that is "true" when something belongs to a set, and false, otherwise. Thus, for (naive-set-theory) set membership, boolean operations on binary truth values is sufficient, so you can pretend that they are "the same thing".

Digging more deeply, there are multiple complications. a) not all subobject classifiers can be expressed by membership functions. b) proof-by-contradiction does not yield a set.

For opencog, b) is the more serious issue. There are famous mathematical theorems, that start with "assume that set X does not exist->inconsistency->set X exists" Great. Now show me a member of set X. Can't - no one knows how.

Thanks to the wonders of Curry-Howard and its manifold generalizations, it turns out that there are some very fast boolean-logic algorithms, (e.g. SAT solvers) but they can only solve certain classes of problems. They are fast exactly because they discard the law of the excluded middle, and use a three-valued logic: true, false, and unknown.

You can see this in practice: sit down with a SAT solver or an ASP solver, or a constraint satisfaction solver, and define a problem: X must be this, X must not be that, not X must be Y, Y must not be Z, etc. and it will solve the problem in an eyeblink. Add just one more axiom: not-X equals complement-of-X and whammo, the solver will take minutes, hours, or forever to solve the same problem, which it previously did in an eyeblink.

This, in fact, tends to be the #1 stumbling block for beginners using such systems: it seems so blatently obvious that not-X is the same thing as complement-of-X, that when you read the API documentation, its mildly confusing, and you get stuck because none of your programs work (or they take minutes to run to solve trivial problems). There's a certain intellectual leap that has to happen, an "a-ha" moment, and then its easy sailing.

In short, the concept of "not" and "complement" are tricky, dicey things, far trickier than meets the eye.

I want to keep open the door to the possibility that PLN could be approximated by (for example) hundreds or thousands of samples of crisp-logic deductions, solved by crisp-logic solvers (SAT,ASP, CSP). If we carelessly tie a Not-knot into the system, we'll get screwed. For this reason, I've tried to use the concept of "absent" instead of "not" in the pattern matcher, and "menu-choice" instead of "or", these avoid pitfalls.

As to whether we should erase any formal differences between PredicateNodes and ConceptNodes (which is what you seem to be asking for) -- that I need to delegate to Nil and Ben. However, at this time, erasing the differnce between Predicates and Concepts could be rather dicey and painful, I suspect.

--linas

On Mon, May 21, 2018 at 12:11 AM, Nil Geisweiller notifications@github.com wrote:

@rTreutlein https://github.com/rTreutlein It's annoying but it seems you need to write my id in full, github seems to be completely blind to it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/opencog/atomspace/issues/1699#issuecomment-390554784, or mute the thread https://github.com/notifications/unsubscribe-auth/AAFwoD_c_AHd-e3gjftpATqJIbbqXItgks5t0kx4gaJpZM4UGbaY .

-- cassette tapes - analog TV - film cameras - you

linas commented 6 years ago

The third issue, is, of course, the distinction between intensionality and extensionality.

Thus, for crisp binary logic applied to naive set theory, the set-membership function means that sets are in one-to-one correspondence with predicates. Again, this is the "subobject classifier." Works great in most areas of math.

In real life (anything with fractal shapes, any hyperbolic space) it fails, and fails badly: the set of all dogs (a ConceptNode) is not the same thing as the set of things with four feet, fur, a tail and a cold nose (a PredicateNode) There are two "obvious" reasons for this: its impossible to list all of the dogs (here have been many billions, some not yet born), and not everything with fur and a cold nose is a dog. Naive set theory turns out to be a shitty tool for working with real-life physical objects having intensional properties and extensional membership. Ergo, all the complex, convoluted formulas in the PLN book .... and I am far from convinced that PLN got it right, but for the present conversation, lets assume it does. Slinging around And,Or,Not is a very dangerous game, when dealing with non-crisp, evidence-based knowledge representation.

-- cassette tapes - analog TV - film cameras - you

rTreutlein commented 6 years ago

Well, I didn't have that "a ha" moment yet. But I kinda get that having Not for Concepts would be problematic. I assume having a ComplementLink would have the same issue.

Either way, I can rework the Lojban parser to not require this.

But I just noticed that I already think about Concepts and Predicates as pretty much the same. So far I would have said having a Predicate that's true for all dogs is reasonable. But you seem to be saying that the evaluating a predicate for a given concept can only use fixed set of properties (four feet, fur, a tail and a cold nose) combined with boolean operators.

linas commented 6 years ago

You wouldn't get the "a ha" moment from using opencog. For that, you'd have to spend some time with modern-day smt/csp/asp solvers, which maintain distinct reasoning chains for P and inverted-P, thus allowing tri-value assignments of true/false/unknown. So, one might have that P is true but inverted-P is unknown. Then, if later on, inverted-P is shown to also be true, and one then forces that inverted-P==not-P, we know that P is not satisfiable. Its a proof-technique, but it's subtle, until you grok it, and then its obvious. If you want to play with this, I strongly recommend the Potsdam ASP solver as being the easiest to use, the best documented.

The current split between Concept and Predicate is anchored in 10+ years of Goertzel -thinking and publishing. But its not unreasonable, it corresponds fairly well to other systems of knowledge representation, as well as to a decent variety of mathematical textbooks. Crudely, a Concept is a class or collection of things, a Predicate is a function that can be evaluated, returning a true/false value. Given the accumulated cruft, erasing the difference between Concepts and Predicates at this time would be a dangerous and ill-advised game. Its possible, but we would have to boil the ocean, realizing half-way-through that its a bad idea.

For example, crawl through the MechanicalPartOf / ElectricalPartOf example in https://wiki.opencog.org/w/EquivalenceLink

What you may want to do is to invent a new type that has the properties that you want it to have. Call it, I dunno -- pick a good name: IdeaNode or MeaningNode, AssumptionNode, SuppositionNode, ThoughtNode or whatever. I had used a SemeNode (short for SemanticNode) in an early version of the chatbot, because it provided a much better connection to the linguistic syntactic/semantic structure than ConceptNode did.

One problem was that Concepts tend to be Nouns, or noun-like, whereas many linguistic expressions are verb-like, or relationship-like (next-to, above, behind...) There is a huge risk of fail, if one abandons the classic commonly-agreed-on linguistic categories (nouns verbs, adjectives, prepositions, etc.), and tries to replace them with some other overly-simplified system. This certainly was the root cause of failure for "semantic triples" aka "web 2.0".

ngeiswei commented 6 years ago

From a PLN viewpoint concepts and predicates are completely isomorphic. In NLP however verbs tend to be represented by predicates and nouns by concepts.

Personally I don't see much problem using (Not (Concept "A")), I understand that the interpretation of it is an infinite set, but certainly that shouldn't be a reason not to be able to build it, in practice most negations are confined to a certain context anyway.

The question is: do we fix the validator code to support (Not (Concept ... or do we introduce another link type for concept negation? That's all. I'm personally fine either way.

linas commented 6 years ago

From a PLN viewpoint concepts and predicates are completely isomorphic.

So why do we make a distinction between them?

rTreutlein commented 6 years ago

Well, it seems I can only avoid this with proper statements in Lojban but not with fragments. So if concepts and predicates are really isomorphic in PLN which is also my understanding, then we should allow the use of NotLinks and OrLinks with Concepts maybe under a different name. If that isn't possible I guess I'll have to replace them with predicates. @bgoertzel How do you see this?

linas commented 5 years ago

FYI, The wiki page https://wiki.opencog.org/w/EquivalenceLink gives an explicit worked example of how Predicates and Concepts are different, and how to explicitly convert from one to the other.

I'm going to close this; I don't see anything particularly actionable, here. If the conversation needs to be re-heated, its probably best to start a new thread in a new issue.