-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boolean expression reduction (help wanted) #8
Comments
Binary-tree-balancing is for optimizing mainly 2 types of clauses: Your example is near the boolean algebra gather-rule. What are the types of your A and B and C? This project is initially for boolean algebra because database queries are often related to Which would be totally doable here, I just have not needed it. :-) One problem is also that we don't always know the best optimization for the target system, e.g. your original and reduction examples are totally two-way, so by constructing this kind of term-rewriting, the system has to be careful not to start to oscillate back and forth between these two states forever. |
A B and C are booleans, where the "*" is an "and" , "+" an "or" and the "!" a "not" The expression would be like: My main goal is to compare 2 boolean expressions and verify if they contain the same logic, to know if both are true given the same inputs, and I would like to apply a reduction first for that. And to know if by applying the reduce feature to similar expression I would get always the same output... I guess this might be outside your goal. But thanks anyway :) |
This is doable by this library already. This system optimizes LINQ Expressions for the abstract syntax trees. Which are good if you do C# Expression trees and want to actually execute the logic. |
Thanks for your help! I will try it. |
Hi,
I am trying to simplify boolean expressions, that I think it might be achieved with the "binary tree balancing" feature but I am not able to do it based in your examples...
I am looking for something like:
Original: X = AB + A!C
Reduction X = A*(B + !C)
Can you tell me if it is possible and how to do it?
Thanks
Renato Martins
The text was updated successfully, but these errors were encountered: