6

I'm looking for a tool to refactor boolean expression. I've got expressions like

a1 => (b1 <=> c or d) AND 
a2 => (b2 <=> c or d) AND
a2 => (b2 <=> c or d) 

The tool should be able to simplify expressions, e.g. extract the sub expression "c or d" in the example above. Is there a free computer algebra system which can do this?

Currently I think of refactoring the expressions manually an prove the equivalence with a little haskell quickcheck script.

Toon Krijthe
  • 52,876
  • 38
  • 145
  • 202
ordnungswidrig
  • 3,140
  • 1
  • 18
  • 29
  • Look at [this question and answers](http://stackoverflow.com/q/14902141/57477) - Basically, use [Wolfram Alpha](http://www.wolframalpha.com/) – CraigTP Dec 19 '13 at 10:47

3 Answers3

1

The DMS Software Reengineering Tookit could do this.

It is generalized compiler technology for parsing languages (including Java) to ASTs and symbol tables. DMS also provides source-to-source transformations, and associative and commutative law rewriting.

Your boolean expressions would show up as Java AST expression trees. By providing a set of rules about boolean algebra, you can manipulate those expression trees.

We have done this in the past to carry out boolean expression simplification and transformation for C, RLL and a system of diagnostic equations, both on large scale expressions, and on lots of medium scale expressions (scale much like your example).

EDIT 5/19/2010: See an example of conventional algebra transformations using DMS. Its trivial to construct a variant that does Boolean algebra instead.

Ira Baxter
  • 93,541
  • 22
  • 172
  • 341
1

Boolean Refactor and Simplification

This tool worked great for optimising complex boolean expressions.

Aditya Raj
  • 11
  • 1
1

I'm not sure about a tool but take a look at Boolean Algebra

you can draw a grid of all the inputs and output to try and find a minimal boolean expression

Scott Cowan
  • 2,652
  • 7
  • 29
  • 45