iCog-Labs-Dev / metta-moses

Meta Optimization Semantic Evolutionary Search
3 stars 14 forks source link

Implement alternative `concatTuple` function #135

Closed Yagth closed 1 week ago

Yagth commented 3 weeks ago

Detailed Description

The current implementation of concatTuple defined in general-helpers.metta and used in several other places utilizes car-atom and cdr-atom to concatenate two tuples. We can however have a different implementation using the built in union function defined in MeTTa. (Documentation about this and other similar functions can be found here).

The current union function in MeTTa version 0.1.11 and 0.1.12 preserves the order of the input atom even after the operation which is the behavior we want. However, this feature might be removed in later versions and the order might as well be disturbed. But better to use it while it's still here. And we will still have our previous implementation and use it in the upcoming MeTTa version when the union function's feature gets removed.

After the implementation of this function, our code base should also be refactored so that the new function is used instead of the old concatTuple.

Context

The implementation of this function should:

Yagth commented 3 weeks ago

Implement alternative concatAtom function