Questions tagged [boolean-computation]

Questions on the functionality of Mathematica for Boolean computation.

See Boolean Computation and Logic & Boolean Algebra for a list of Mathematica functions that are relevant to Boolean algebra and Boolean computation.

187 questions
10
votes
1 answer

Prenex and Skolem normal forms

In Mathematica version 7, there was a big advance in logic support ("Boolean computations" is the official name). This was not further developed in version 8.0. So now we have a fairly robust support for propositional calculus, but not too much for…
magma
  • 5,290
  • 24
  • 46
7
votes
2 answers

Bitwise operators - Hamlet for Mathematica

What is the best way to check this famous equation: 0x2b || ~0x2b == 0xff Mathematica doesn't seem to have a handy bitwise negation operator. The best thing I did come up was: FromDigits[IntegerDigits[16^^2B, 2, 8] ~BitOr~(IntegerDigits[16^^2B, 2,…
Stefan
  • 5,347
  • 25
  • 32
6
votes
2 answers

Simplify a Boolean Algebra expression with don't cares

I want to simplify this expression: BooleanMinimize[(A ∧ ¬ B ∧ C ∧ ¬ D) ∨ (A ∧ B ∧ ¬ C ∧ ¬ D) ∨ (A ∧ B ∧ C ∧ ¬ D)] And I get this: (A ∧ B ∧ ¬ D) ∨ (A ∧ C ∧ ¬ D) But using a Karnaugh Map and "don't cares" I get ¬ D. Is there anyway that I can get…
Bardulf
  • 63
  • 4
5
votes
3 answers

Is there an equivalent of Sum for And?

Is there an equivalent to Sum for And? That is, just like instead of Plus@@Table[f[i], {i,3,6}] (or Total@Table[f[i], {i,3,6}]) you can write Sum[f[i], {i,3,6}], is there a single pre-defined function that can replace And@@Table[f[i], {i,3,6}]? If…
celtschk
  • 19,133
  • 1
  • 51
  • 106
5
votes
1 answer

Boolean function from incomplete truth table

BooleanFunction in mathematica can convert an input truth table to a Boolean function. It can do so even if the truth table is incomplete. But the interpretation of truth table obtained from such an incomplete truth table is not clear. For example,…
prabhat
  • 95
  • 6
4
votes
3 answers

Importing an array from text file and convert it to truth table

I am new to Mathematica, and would like some help in the following operation. I have a truth table stored in a text file. I want to read this in Mathematica, and find its Boolean Rule. Suppose I have two Boolean variables. I am reading the text file…
prabhat
  • 95
  • 6
4
votes
1 answer

How to specify a Boolean Minterm expression using don't cares in Mathematica

The Mathematica Boolean Computation webpage specifies that Mathematica has full support for "don't care" arguments and values. However I don't see any examples demonstrating this functionality. Could someone provide an example, preferably using the…
3
votes
2 answers

How to negate a boolean vector?

The !True returns False but how can I negate a boolean vector such as {True, False, True}? The exclamanation mark does not work here like this !{True,False,True}.
hhh
  • 2,603
  • 2
  • 19
  • 30
3
votes
1 answer

Bit Operations -- Force Binary Bit Representation

How to force binary bit representation of a number, so BitNot does yield the 1s-complement? BitNot[n] turns ones into zeros and vice versa in the binary bit representation of n. I was unable so far to produce a number which Mathematica accepts as…
Stefan
  • 5,347
  • 25
  • 32
3
votes
2 answers

boolean casting

In Mathematica one can do something like the following: lst = {1, 2, 3}; If[Length[lst] != 0, Print["list is not empty"], Print["list is empty"]] (*list is not empty*) Is there something relevant to automatic Boolean casting? E.g., for L being a…
Dimitris
  • 4,794
  • 22
  • 50
3
votes
2 answers

How to evaluate Boolean expression and get an answer in bitwise form?

I am trying to evaluate the following expression: 11000 AND ( 01011 OR 11011 ) I am able to get the answer on paper. The answer is: 01011 OR 11011 = 11011 Then: 11000 AND 11011 = 11000 I'm new to Mathematica and unsure on how to evaluate…
wa7d
  • 45
  • 5
2
votes
2 answers

Boolean algebra does not simplify

I am doing some simple Boolean algebra and wanted to perform some calculations in Mathematica but found it doesn't work. Let us consider the expression: expr1 = ((b < 0 && A <= AA) || A < AA); expr2 = ((b < 0 && A == AA) || A < AA); From our point…
Philipp
  • 641
  • 3
  • 8
2
votes
1 answer

Square Root of a Boolean Matrix

I am trying to find the square roots of transitive Boolean matrices. Let $B$ be a transitive Boolean matrix, If $A^2= B$, then $A$ is the square root of $B$. Here is my try checkTrans[m1_] := Module[{m2}, m2 = m1 . m1; m1 m2 == m2] n = 3; (*martix…
Jonathan
  • 55
  • 5
2
votes
0 answers

Boole Simplifcation

If you submit this to WA https://www.wolframalpha.com/input/?i=%28a+and+b+and+c%29+or+%28not+a+and+not+b+and+not+c%29+or+%28not+a+and+b+and+not+c%29+or+%28a+and+not+b+and+not+c%29 and expand the Minimal Forms, it shows the Boole Normalform. How is…
booli100
  • 37
  • 1
2
votes
1 answer

Inconsistent results with booleanfunction and booleantable

Can someone please explain the inconsistent results I'm getting from BooleanTable and BooleanFunction? Using the following truth table: tt = {{1, 1, 1, 1} -> 1, {1, 1, 1, 0} -> 1, {1, 1, 0, 1} -> 1, {1, 1, 0, 0} -> 0, {1, 0, 1, 1} -> 1, {1, 0,…
BCott
  • 89
  • 5
1
2 3