Java中布尔表达式的简化 [英] Simplification of Boolean Expression in java

查看:92
本文介绍了Java中布尔表达式的简化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

java中是否有任何工具或库可以简化布尔表达式公式并给出结果.

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

当输入是这样时,

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

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

表达式可以比上面更大或更复杂.

Expressions can be larger or more complex than above.

推荐答案

IntelliJ支持意图",可让您在编辑器中简化布尔表达式.另外, PMD 可以为您报告这些类型的错误(请参见

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)

这篇关于Java中布尔表达式的简化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆