Is there a library for .NET that does parenthesis or expression reduction and optimization?
Something that would take an expression such as (A & (((B) | (C)) | D))) and return
A & (B | C | D)
But also take (A & A) and return A
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is more in the domain of a standalone parser/lexical analyzer. But ANTLR has a rather nice C# binding, if that would suit your purposes.
It probably wouldn’t be very much work to write a simple parser for strings of this sort and do the reduction yourself.