@@ -26,23 +26,18 @@ import ring.BoolRing
2626import scala .{specialized => sp }
2727
2828/**
29- * Boolean algebras are Heyting algebras with the additional
30- * constraint that the law of the excluded middle is true
29+ * Boolean algebras are Heyting algebras with the additional constraint that the law of the excluded middle is true
3130 * (equivalently, double-negation is true).
3231 *
33- * This means that in addition to the laws Heyting algebras obey,
34- * boolean algebras also obey the following:
32+ * This means that in addition to the laws Heyting algebras obey, boolean algebras also obey the following:
3533 *
36- * - (a ∨ ¬a) = 1
37- * - ¬¬a = a
34+ * - (a ∨ ¬a) = 1
35+ * - ¬¬a = a
3836 *
39- * Boolean algebras generalize classical logic: one is equivalent to
40- * "true" and zero is equivalent to "false". Boolean algebras provide
41- * additional logical operators such as `xor`, `nand`, `nor`, and
42- * `nxor` which are commonly used.
37+ * Boolean algebras generalize classical logic: one is equivalent to "true" and zero is equivalent to "false". Boolean
38+ * algebras provide additional logical operators such as `xor`, `nand`, `nor`, and `nxor` which are commonly used.
4339 *
44- * Every boolean algebras has a dual algebra, which involves reversing
45- * true/false as well as and/or.
40+ * Every boolean algebras has a dual algebra, which involves reversing true/false as well as and/or.
4641 */
4742trait Bool [@ sp(Int , Long ) A ] extends Any with Heyting [A ] with GenBool [A ] { self =>
4843 def imp (a : A , b : A ): A = or(complement(a), b)
@@ -56,13 +51,12 @@ trait Bool[@sp(Int, Long) A] extends Any with Heyting[A] with GenBool[A] { self
5651 override def dual : Bool [A ] = new DualBool (this )
5752
5853 /**
59- * Every Boolean algebra is a BoolRing, with multiplication defined as
60- * `and` and addition defined as `xor`. Bool does not extend BoolRing
61- * because, e.g. we might want a Bool[Int] and CommutativeRing[Int] to
62- * refer to different structures, by default.
54+ * Every Boolean algebra is a BoolRing, with multiplication defined as `and` and addition defined as `xor`. Bool does
55+ * not extend BoolRing because, e.g. we might want a Bool[Int] and CommutativeRing[Int] to refer to different
56+ * structures, by default.
6357 *
64- * Note that the ring returned by this method is not an extension of
65- * the `Rig` returned from `BoundedDistributiveLattice.asCommutativeRig`.
58+ * Note that the ring returned by this method is not an extension of the `Rig` returned from
59+ * `BoundedDistributiveLattice.asCommutativeRig`.
6660 */
6761 override def asBoolRing : BoolRing [A ] = new BoolRingFromBool (self)
6862}
@@ -89,11 +83,11 @@ class BoolRingFromBool[A](orig: Bool[A]) extends BoolRngFromGenBool(orig) with B
8983
9084/**
9185 * Every Boolean ring gives rise to a Boolean algebra:
92- * - 0 and 1 are preserved;
93- * - ring multiplication (`times`) corresponds to `and`;
94- * - ring addition (`plus`) corresponds to `xor`;
95- * - `a or b` is then defined as `a xor b xor (a and b)`;
96- * - complement (`¬a`) is defined as `a xor 1`.
86+ * - 0 and 1 are preserved;
87+ * - ring multiplication (`times`) corresponds to `and`;
88+ * - ring addition (`plus`) corresponds to `xor`;
89+ * - `a or b` is then defined as `a xor b xor (a and b)`;
90+ * - complement (`¬a`) is defined as `a xor 1`.
9791 */
9892class BoolFromBoolRing [A ](orig : BoolRing [A ]) extends GenBoolFromBoolRng (orig) with Bool [A ] {
9993 def one : A = orig.one
0 commit comments