Logical operation nodes

Logical nodes encode hard Boolean constraints between discrete binary variables. Each node represents a standard logic gate and enforces the corresponding truth table exactly — no approximation is needed for discrete variables.

These nodes are Deterministic: they do not contribute probability mass directly, but constrain the joint distribution by making the outcome of the logic gate a deterministic function of its inputs.

Available operations

NodeOperationOutput
ANDLogical conjunctionout = in1 ∧ in2
ORLogical disjunctionout = in1 ∨ in2
IMPLYLogical implicationout = in1 ⇒ in2
NOTLogical negationout = ¬in

All inputs and outputs are binary (Bernoulli-distributed) variables. The truth tables are:

AND

in1in2out
000
010
100
111

OR

in1in2out
000
011
101
111

IMPLY (in1 ⇒ in2, equivalent to ¬in1 ∨ in2)

in1in2out
001
011
100
111

NOT

inout
01
10

When to use logical nodes

Logical nodes are useful whenever your model contains prior structural knowledge that relates binary events. Common use cases include:

  • Encoding that "event A occurring implies event B also occurs": b ~ IMPLY(a, b_evidence).
  • Building fault-tree or diagnostic models where system failures are logical combinations of component failures.
  • Expressing hard constraints in discrete Bayesian networks.

Because the constraints are exact, the resulting messages are also exact for binary inputs — no Monte Carlo or variational approximation is required.

ReactiveMP.ANDType

AND node implements logic AND function (conjuction) that can be desribed by the followsing table: | in1 in2 | out | | 0 0 | 0 | | 0 1 | 0 | | 1 0 | 0 | | 1 1 | 1 |

source
ReactiveMP.ORType

OR node implements logic OR function (disjunction) that can be desribed by the followsing table: | in1 in2 | out | | 0 0 | 0 | | 0 1 | 1 | | 1 0 | 1 | | 1 1 | 1 |

source
ReactiveMP.IMPLYType

IMPY node implements implication function that can be desribed by the followsing table: | in1 in2 | out | | 0 0 | 1 | | 0 1 | 1 | | 1 0 | 0 | | 1 1 | 1 |

source
ReactiveMP.NOTType

NOT node implements negation function that can be desribed by the followsing table: | in | out | | 0 | 1 | | 1 | 0 |

source