algebraixlib.extension module

Facilities for extending operations from one algebra to another.

algebraixlib.extension.binary_extend()[source]

Return the binary extension of op from one algebra to another algebra.

For this extension, the elements of the extended algebra must be sets of the elements of the original algebra.

Parameters:
  • set1 – A set with elements on which op operates.
  • set2 – A set with elements on which op operates.
  • op – A binary operation that operates on the elements of set1 and set2.
Returns:

A set that consists of the defined results of op when executed on all combinations of the elements of set1 and set2, or Undef() if either set is not a Set.

algebraixlib.extension.binary_multi_extend()[source]

Return the binary extension of op from one algebra to another algebra.

For this extension, the elements of the extended algebra must be multisets of the elements of the original algebra.

Parameters:
  • multiset1 – A multiset with elements on which op operates.
  • multiset2 – A multiset with elements on which op operates.
  • op – A binary operation that operates on the elements of multiset1 and multiset2.
Returns:

A multiset that consists of the defined results of op when executed on all combinations of the elements of multiset1 and multiset2, or Undef() if either set is not a Multiset.

algebraixlib.extension.unary_extend()[source]

Return the unary extension of op from one algebra to another algebra.

For this extension, the elements of the extended algebra must be sets of the elements of the original algebra.

Parameters:
  • set – A set with elements on which op operates.
  • op – A unary operation that operates on the elements of set_.
Returns:

A set that consists of the defined results of op when executed on the elements of set_, or Undef() if set_ is not a Set.

algebraixlib.extension.unary_multi_extend()[source]

Return the unary extension of op from one algebra to another algebra.

For this extension, the elements of the extended algebra must be multisets of the elements of the original algebra.

Parameters:
  • set_or_mset – A set or a multiset with elements on which op operates.
  • op – A unary operation that operates on the elements of set_or_mset.
Returns:

A set that consists of the defined results of op when executed on the elements of set_or_mset, or Undef() if set_or_mset is neither a set nor a multiset.