_Connective
Marker trait for the six logical connectives: And, Or, Not, Implies, Xor and Iff.
Operands are untyped core._Expressions so equations and other domains compose without cross-domain imports. eval runs the shared Kleene/Zadeh min–max rule table (kleeneAnd, kleeneOr, kleeneNot, kleeneImplies, kleeneXor) over operands widened by asTruth, so core._Bool and core._Truth operands mix freely and the boolean behaviour is a special case of the graded table rather than a separate branch. The result is rebuilt through _Truth.of, which collapses a crisp degree back to _Bool. Any other concrete operand (a _Number, a matrix) leaves the node symbolic.
A known operand decides what it can on either side (F_0326, LT L_0082). The annihilators were always folded on the left (false and X, true or X, false implies X, each without evaluating X) and nowhere else, so with p := true the prompt answered p and q as (true and q) while simplify gave q. Now the identity and the annihilator fold on both sides: true and q is q, q and false is false, true implies q is q, q implies true is true, q implies false is not q, true xor q is not q, false xor q is q. Sound under all three semantics: every t-norm has unit 1 and annihilator 0, every t-conorm unit 0 and annihilator 1, the S-implication is tconorm(1 - a, b), and xor is the lattice reading of (a and not b) or (not a and b), in which one crisp operand leaves the other or its negation under each kernel. Only a truth-valued or symbolic other side is folded: a number beside a truth value stays as written.
eval consults its Environment for two knobs, neither of which is a second node hierarchy: the truth-value encoding (symmetricLogic, which additionally admits the digits {-1, 0, 1} as truth values -- a change of digits, never a change of meaning) and the semantics (LogicSemantics, selecting the t-norm / t-conorm pair: min-max, product, or Lukasiewicz). All three semantics agree with classical logic on the crisp values, so the boolean and three-valued tiers are unaffected by the default.
Deliberately NOT marked core._ElementWise: that marker means derive/simplify/ expand/integrate distribute over children (linear containers only), and the connectives are not linear -- derive(a and b, x) must stay symbolic.
Attributes
- Graph
-
- Supertypes
- Known subtypes