Skip to content

Double equals (==) compares values; for logical equivalence use ↔

== compares two values in a program and returns a Boolean. Between two Boolean formulas it computes the biconditional; as a claim that two formulas are equivalent it is a different thing altogether. The parser rejects A == B and offers <->.

The diagnostic recorded below: == is not an expression operator; use <-> when both sides must have the same value, or the Compare workbench to compare two formulas. The distinction is the one that matters. A <-> B is a formula with a truth table, TRUE on the two rows where A and B agree. “F is equivalent to G” is a statement about two tables, true when they match on every row, and it is a verdict the equivalence checker gives, with a counterexample when it fails.

In code the two coincide only by accident: (a == b) on two Booleans is the biconditional of the two values at that moment, not a proof about the functions that produced them. A unit test that asserts f(x) == g(x) for one x checks one row; the equivalence checker checks all of them.

Python adds a precedence trap on top, not a == b, which the parser also rejects; the precedence pitfall covers it. The not-equal pitfall covers !=, which on Booleans is exclusive or.

What the parser says

You typedCodeWhy it is rejectedRepair offered
A == Bunsupported-operator`==` is not an expression operator. Use `<->` when both sides must have the same value, or the Compare workbench to compare two formulas.Replace with <->

The common slip

Entering NOT (A AND B) == NOT A OR NOT B to test De Morgan. The parser refuses; the right tool is the equivalence checker with one formula on each side, which proves the law on all four rows.

Questions

Is A <-> B always TRUE when A and B are equivalent formulas?

Yes: if two formulas have the same table, their biconditional is TRUE on every row, a tautology. That is the bridge between the operator and the verdict, and the tautology check on F <-> G is another way to ask the same question.

What about === from JavaScript?

The same: strict equality of two values. Translate it to <-> when both sides are Boolean formulas, and keep in mind that it compares values, not functions.

Related

Tools

See also

Pitfalls

Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.