版博士V2.0程序
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Semiring.js 1.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.getFunctionSemiring = void 0;
  4. /**
  5. * The `Semiring` class is for types that support an addition and multiplication operation.
  6. *
  7. * Instances must satisfy the following laws:
  8. *
  9. * - Commutative monoid under addition:
  10. * - Associativity: `(a + b) + c <-> a + (b + c)`
  11. * - Identity: `zero + a = a + zero <-> a`
  12. * - Commutative: `a + b <-> b + a`
  13. * - Monoid under multiplication:
  14. * - Associativity: `(a * b) * c <-> a * (b * c)`
  15. * - Identity: `one * a <-> a * one <-> a`
  16. * - Multiplication distributes over addition:
  17. * - Left distributivity: `a * (b + c) <-> (a * b) + (a * c)`
  18. * - Right distributivity: `(a + b) * c <-> (a * c) + (b * c)`
  19. * - Annihilation: `zero * a <-> a * zero <-> zero`
  20. *
  21. * **Note:** The `number` type is not fully law abiding members of this class hierarchy due to the potential
  22. * for arithmetic overflows, and the presence of `NaN` and `Infinity` values. The behaviour is
  23. * unspecified in these cases.
  24. *
  25. * @since 2.0.0
  26. */
  27. var function_1 = require("./function");
  28. // -------------------------------------------------------------------------------------
  29. // deprecated
  30. // -------------------------------------------------------------------------------------
  31. /**
  32. * Use [`getSemiring`](./function.ts.html#getsemiring) instead.
  33. *
  34. * @category zone of death
  35. * @since 2.0.0
  36. * @deprecated
  37. */
  38. exports.getFunctionSemiring = function_1.getSemiring;