trueagi-io / hyperon-experimental

MeTTa programming language implementation
https://metta-lang.dev
MIT License
153 stars 50 forks source link

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

Closed vsbogd closed 5 months ago

vsbogd commented 5 months 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).