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
| Node | Operation | Output |
|---|---|---|
AND | Logical conjunction | out = in1 ∧ in2 |
OR | Logical disjunction | out = in1 ∨ in2 |
IMPLY | Logical implication | out = in1 ⇒ in2 |
NOT | Logical negation | out = ¬in |
All inputs and outputs are binary (Bernoulli-distributed) variables. The truth tables are:
AND
in1 | in2 | out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
OR
in1 | in2 | out |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
IMPLY (in1 ⇒ in2, equivalent to ¬in1 ∨ in2)
in1 | in2 | out |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
NOT
in | out |
|---|---|
| 0 | 1 |
| 1 | 0 |
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.AND — Type
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 |
ReactiveMP.OR — Type
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 |
ReactiveMP.IMPLY — Type
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 |
ReactiveMP.NOT — Type
NOT node implements negation function that can be desribed by the followsing table: | in | out | | 0 | 1 | | 1 | 0 |