Closed nasser closed 1 week ago
Currently MeTTa doesn't specify this behavior, and it is implementation specific. Other implementation of the space can have different behaviour. As far as I know nobody relies on the current behavior of the default in-memory atomspace in hyperon-experimental. I agree it doesn't look very uniform, but on the other hand it allows doing manual deduplication easily.
I raised #799 to change it to more uniform. If @Necr0x0Der agree we can change this behavior. But I would like to emphasize one more time - you cannot rely on this.
understood -- thank you!
Allowing duplicated atoms was supposed as a feature, because there were some use cases for PLN, when one needs to count the number of observed atoms to infer truth values. However, since MeTTa started to be used in more ways, it seems that absence of deduplication became more frequently a nuisance rather than a feature (and when one wants to count the same atoms, it can be done manually). OTOH, duplication can also be useful for probabilistic programming to control probabilities of sampling... Thus, I agree with @vsbogd that we still don't have a firm opinion and specification of this behavior, and it may change. In any case, it is indeed space-specific. I also agree that with duplication, it would be more convenient for remove-atom
to remove only one atom.
Closing it, @nasser please feel free to reopen if you have further questions on this.
What are the semantics of "duplicate" assertions? If I assert e.g.
(is ball red)
multiple times I get multiple results when Imatch
on it, which indicates that the individual atoms are not "interned" or deduplicated in any way -- they are fully distinct. But when Iremove-atom
just once, they all disappear, which would indicate a kind of interning/deduplication.Can you clarify what is happening?