[Previous] [Next] [Contents]

Dom::BooleanSemiRing -- boolean semi-ring

Introduction

Dom::BooleanSemiRing creates a domain for the semi-ring of booleans.

Details

Creating Elements


Dom::BooleanSemiRing(n)

Parameters

n- integer.

Categories

Cat::SemiRing

Related Domains

Entries

zero

the boolean constant 0.

one

the boolean constant 1.

Method _plus: sum of booleans

Method _mult: product of booleans

Method _power: power of a boolean

Method convert: conversion of an object into a boolean

Method convert_to: conversion of a boolean into another type

Method expr: convert a boolean into an integer

Example 1

This example shows the idempotency of the boolean semi-ring:

>> B:=Dom::BooleanSemiRing:
     
>> B(0) + B(0);
   B(1) + B(1)
     
                                     0
      
                                     1
        

Example 2

We can change the domain of scalars:

>> B::convert_to(B(1), Dom::Integer) + B::convert_to(B(1), Dom::Integer)
     
                                     2
        

Super-Domain

Dom::BaseDomain

Axioms

Ax::canonicalRep, Ax::normalRep

Changes

[Previous] [Next] [Contents]


MuPAD Combinat, an open source algebraic combinatorics package