iCog-Labs-Dev / metta-moses

Meta Optimization Semantic Evolutionary Search
3 stars 14 forks source link

done with subtract redundant constraint transformation #144

Closed YeabsiraNigusse closed 1 week ago

YeabsiraNigusse commented 2 weeks ago

Description

I have added a function called setDifference and test functions for it. it is used for making a subtract redundant constraint transformation over a given expression. This function assumes it receives a set1 and the set2 expression as parameters. It then removes redundant elements from set1 expression that already exist in the set2. This function also can be used for lCCSUBTRACT transformation with command set and current expression given as a parameter. The function uses isMember from general helpers functions.

Motivation and Context

It is one of the main transformations applied to an expression, and it solves the problem of subtracting redundant constraints from the expression.

It does not fix any existing issues but creates this new issue.

How Has This Been Tested?

i have added functions inside general-helper-function-test file. the file contain a unit test with different test cases and checks the function output with assertEqual built-in metta function.

No Environment needed. running the the test file would be enough.

Types of changes

Checklist:

Yagth commented 2 weeks ago

@samwondim , Yab claims that this function can be beneficial for you, can you take a look?

YeabsiraNigusse commented 2 weeks ago

@samwondim , Yab claims that this function can be beneficial for you, can you take a look?

@Yagth @samwondim refer the RTE pseudocode for detail look. the two transformation do the same thing except their parameter.

YeabsiraNigusse commented 2 weeks ago

@Yagth i have finalized the function and added it as a utility function. you can check it out.

Yagth commented 2 weeks ago

@YeabsiraNigusse, so does the issue #143 still persists or it no longer needs to be addressed?

YeabsiraNigusse commented 2 weeks ago

@YeabsiraNigusse, so does the issue #143 still persists or it no longer needs to be addressed?

Yeah, I think we no longer need the issue since the transformation is now represented by a general helper function. For the getDominant function case, we could take another approach, such as updating the dominant set each time the expression changes, rather than recalculating it every time. This is more computationally efficient. However, if we can't do this due to the complexity of the function (RTE), we might need to reconsider it. We discussed this approach in the last meeting, so for now, we can consider the issue resolved.