atomspace icon indicating copy to clipboard operation
atomspace copied to clipboard

Abelian Merkle tree hash in scope link is incorrect

Open linas opened this issue 6 years ago • 2 comments
trafficstars

As per discussion in issue #2329, the following code is suspect, and may be unnecessarily weak. The comment in the hash code: https://github.com/opencog/atomspace/blob/26f73776dd689f6b6db0c7642a29c0f9f2374189/opencog/atoms/core/ScopeLink.cc#L230-L234 is suspect: unordered links do maintain a specific order. Although conceptually "abelian", they are not actually so in the representation. This means that the plus sign in

https://github.com/opencog/atomspace/blob/26f73776dd689f6b6db0c7642a29c0f9f2374189/opencog/atoms/core/ScopeLink.cc#L248 https://github.com/opencog/atomspace/blob/26f73776dd689f6b6db0c7642a29c0f9f2374189/opencog/atoms/core/ScopeLink.cc#L254 https://github.com/opencog/atomspace/blob/26f73776dd689f6b6db0c7642a29c0f9f2374189/opencog/atoms/core/ScopeLink.cc#L259

is probably wrong, or at least is unnecessarily weak: it could be/should be replaced by an order-dependent hash.

linas avatar Oct 17 '19 16:10 linas

I'd have to look carefully at the code but the following comment makes me think it does need to be abelian https://github.com/opencog/atomspace/blob/26f73776dd689f6b6db0c7642a29c0f9f2374189/opencog/atoms/core/ScopeLink.cc#L242-L244

ngeiswei avatar Oct 18 '19 03:10 ngeiswei

yeah, it all made sense when I wrote it. Now I'm less sure. Clearly I'm confused about something.

linas avatar Oct 18 '19 05:10 linas

Closing. I think this was opened by mistake, due to confusion.

linas avatar Dec 11 '22 23:12 linas