The Magma package in Maple 15 includes the command IsSubMagma. This tests whether a specified subset of a magma is closed under the binary operation that defines the magma. For example, consider the following Cayley table for a group of order four.
> with( Magma ):
> m := << 1, 2, 3, 4 |