Dom::BooleanSemiRing --
boolean semi-ring
IntroductionDom::BooleanSemiRing creates a domain for the semi-ring of booleans.
DetailsDom::BooleanSemiRing(n) represents the boolean constant 0
for FALSE if n=0, or 1 for TRUE otherwise.
Creating Elements
Dom::BooleanSemiRing(n)
Parametersn | - | integer. |
Cat::SemiRing
Related Domainsthe 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.
Example 1This example shows the idempotency of the boolean semi-ring:
>> B:=Dom::BooleanSemiRing:
>> B(0) + B(0);
B(1) + B(1)
0
1
Example 2We can change the domain of scalars:
>> B::convert_to(B(1), Dom::Integer) + B::convert_to(B(1), Dom::Integer)
2
Super-DomainAx::canonicalRep, Ax::normalRep
Dom::BooleanSemiRing is a new function
MuPAD Combinat, an open source algebraic combinatorics package