trueagi-io / hyperon-experimental

OpenCog Hyperon experimental version
https://wiki.opencog.org/w/Hyperon
MIT License
122 stars 43 forks source link

Separate custom matched grounded atoms and grounded atoms matched by equality #706

Closed vsbogd closed 1 month ago

vsbogd commented 1 month ago

Separate custom matched grounded atoms and grounded atoms matched by equality to address https://github.com/trueagi-io/hyperon-experimental/pull/698/files#r1623809472

We cannot understand whether custom matching is implemented on a grounded atom because of lack of the specialization feature in stable Rust, so I compared two approaches:

I chosen last one because:

I like this approach finally and I think we could reuse it to implement Hash on value-like grounded atoms and to move execute into a separate trait.

Despite change is big most interesting files are:

Other files contains removed default match_by_equality logic and rearranging custom matching logic to match new API.

@Adam-Vandervorst FYI (cannot add you as a reviewer).