Magma concept

Description

A magma is an algebraic structure on a finite or infinite set equipped with an operator where the set is closed under this operation.

Refinement of

Assignable and BinaryFunction, respectively. More precisely, the type of the element set must model Assignable and the type of the operation refines BinaryFunction.

Notation

S Type of a set
Op Type of an operation
{S,Op} Model of Magma
a, b Objects of type S
op Object of type Op

Definitions

The type S must be equal or convertible to the first and second argument type of Op. The result type of Op must be equal or convertible to S.

Valid expressions

In addition to those defined by BinaryFunction:
Name Expression Return type
Operation op(a,b) S or convertible to S

Expression semantics

Complexity guarantees

Invariants

Closure op(a,b) returns an element of the set S

Models

Notes