Dom::BooleanSemiRing
--
boolean semi-ring
Dom::BooleanSemiRing
creates a domain for the semi-ring of booleans.
Dom::BooleanSemiRing
(n)
represents the boolean constant 0
for FALSE if n=0, or 1 for TRUE otherwise.
Dom::BooleanSemiRing
(n)
n | - | integer. |
Cat::SemiRing
the boolean constant 0.
the boolean constant 1.
_plus(dom a1...)
a1+a2+...+ak
of booleans is defined to be the boolean
value 0 if a1=a2=...=ak=0
, the boolean value 1 otherwise._plus
.
_mult(dom a1...)
a1*a2*...*ak
of booleans is defined to be the boolean
value 1 if a1=a2=...=ak=1
, the boolean value 0 otherwise._mult
.
_power(dom a,Dom::Integer n)
a^n
of the boolean a
._power
.
convert(any x)
x
into a boolean. This is
only possible if x
is an integer.
convert_to(dom a, any T)
a
into type T
. Currently, only a
conversion into a type of scalars.
expr(dom a)
a
.This example shows the idempotency of the boolean semi-ring:
>> B:=Dom::BooleanSemiRing:
>> B(0) + B(0);
B(1) + B(1)
0 1
We can change the domain of scalars:
>> B::convert_to(B(1), Dom::Integer) + B::convert_to(B(1), Dom::Integer)
2
Ax::canonicalRep, Ax::normalRep
Dom::BooleanSemiRing
is a new function
MuPAD Combinat, an open source algebraic combinatorics package