iCog-Labs-Dev / metta-moses

Meta Optimization Semantic Evolutionary Search
3 stars 14 forks source link

Modify getGuardSetExp #158

Closed Addika1630 closed 1 week ago

Addika1630 commented 1 week ago

Description

This pull request refactors the getGuardSetExp function, defined in rte-helpers.metta, to optimize its performance by eliminating the need for iterative checking of each atom. The previous implementation used car-atom and cdr-atom to iterate over expressions one at a time. The new version implements a non-deterministic approach, leveraging parallel processing through superpose to evaluate guard sets more efficiently.

Motivation and Context

This change is required to improve the performance of the getGuardSetExp function. The previous iteration method introduced unnecessary overhead, making the function less efficient when evaluating large expressions. By refactoring the function, we enhance its performance and reduce latency, ultimately leading to faster evaluations of guard sets.

How Has This Been Tested?

The refactored function has been tested using existing unit tests to ensure that its output matches expected results.

Types of changes

Checklist:

Yagth commented 1 week ago

@Addika1630 there is already another PR that is merged.

Yagth commented 1 week ago

PR #152 already fixes the issue.