Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplification of Boolean Expression in java

Is there any tool or library in java which simplifies a boolean expression formula and gives result.

when inputs are like that,

exp = (a || a' ) result = 1

exp = ( a || b ) && ( a' || b )  result = b (after simplification)

Expressions can be larger or more complex than above.

like image 214
sctn Avatar asked Mar 09 '26 10:03

sctn


1 Answers

IntelliJ supports "intentions" which allow you to simplify boolean expressions within the editor. Alternatively, PMD can report these kind of errors for you (see the boolean rules)

like image 149
Jeff Foster Avatar answered Mar 10 '26 23:03

Jeff Foster