mikkelbreum
mikkelbreum

Reputation: 3081

tool for testing logic expressions

can anyone recommend software (preferably for mac) or a web based tool, that can be used to evaluate logic expressions?

For example I would like to be able to quickly test whether two expressions like:

$a = 'foo';
$b = 'bar';
$c = 'foo';

( !(($a == $c) && ($b == $c)) )

// and

( ($a != $c) || ($b != c$) )

are interchangeable or not.

And also, is there generally an agreed upon best practice in relation to how to construct such expressions? For example to try to minimize the use of the negation, the order of the elements or something like that?

Sometimes I find myself struggling a bit with these things :)

Upvotes: 4

Views: 12407

Answers (3)

Amith Kumar
Amith Kumar

Reputation: 4882

I like this site which does exactly what you are looking for, but it only supports limited logical operators: https://electronics-course.com/boolean-algebra

Upvotes: 0

Paweł Obrok
Paweł Obrok

Reputation: 23174

You can use something like http://www-cs-students.stanford.edu/~silver/truth/ and compare the generated truth tables.

Upvotes: 1

Related Questions