I have described a group in Magma by specifying a presentation:
F<x000_0,x000_1,x000_2,x001_0,x001_1,x001_2,x010_0,x010_1,x010_2,x011_0,x011_1,x011_2,x100_0,x100_1,x100_2,x101_0,x101_1,x101_2,x110_0,x110_1,x110_2,x111_0,x111_1,x111_2> := FreeGroup(24);
G<x000_0,x000_1,x000_2,x001_0,x001_1,x001_2,x010_0,x010_1,x010_2,x011_0,x011_1,x011_2,x100_0,x100_1,x100_2,x101_0,x101_1,x101_2,x110_0,x110_1,x110_2,x111_0,x111_1,x111_2>, phi := quo<F | x000_0,x000_0=x100_0,x000_0 * x000_1 = x000_1,x000_0 * x000_2 = x000_2,x000_1=x010_1,x000_1 * x000_1 = x000_2,x000_1 * x000_2 = x000_0,x000_2=x001_2,x000_2 * x000_1 = x000_0,x000_2 * x000_2 = x000_1,x001_0=x101_0,x001_0 * x100_1 = x001_1,x001_0 * x100_2 = x001_2,x001_1=x011_1,x001_1 * x100_1 = x001_2,x001_1 * x100_2 = x001_0,x001_2=x000_2,x001_2 * x100_1 = x001_0,x001_2 * x100_2 = x001_1,x010_0=x110_0,x010_0 * x100_1 = x010_1,x010_0 * x100_2 = x010_2,x010_1=x000_1,x010_1 * x100_1 = x010_2,x010_1 * x100_2 = x010_0,x010_2=x011_2,x010_2 * x100_1 = x010_0,x010_2 * x100_2 = x010_1,x011_0=x111_0,x011_0 * x000_1 = x011_1,x011_0 * x000_2 = x011_2,x011_1=x001_1,x011_1 * x000_1 = x011_2,x011_1 * x000_2 = x011_0,x011_2=x010_2,x011_2 * x000_1 = x011_0,x011_2 * x000_2 = x011_1,x100_0=x000_0,x100_0 * x100_1 = x100_1,x100_0 * x100_2 = x100_2,x100_1=x110_1,x100_1 * x100_1 = x100_2,x100_1 * x100_2 = x100_0,x100_2=x101_2,x100_2 * x100_1 = x100_0,x100_2 * x100_2 = x100_1,x101_0=x001_0,x101_0 * x000_1 = x101_1,x101_0 * x000_2 = x101_2,x101_1=x111_1,x101_1 * x000_1 = x101_2,x101_1 * x000_2 = x101_0,x101_2=x100_2,x101_2 * x000_1 = x101_0,x101_2 * x000_2 = x101_1,x110_0=x010_0,x110_0 * x000_1 = x110_1,x110_0 * x000_2 = x110_2,x110_1=x100_1,x110_1 * x000_1 = x110_2,x110_1 * x000_2 = x110_0,x110_2=x111_2,x110_2 * x000_1 = x110_0,x110_2 * x000_2 = x110_1,x111_0=x011_0,x111_0 * x100_1 = x111_1,x111_0 * x100_2 = x111_2,x111_1=x101_1,x111_1 * x100_1 = x111_2,x111_1 * x100_2 = x111_0,x111_2=x110_2,x111_2 * x100_1 = x111_0,x111_2 * x100_2 = x111_1>;
I am getting a group of order $12$. The function IdentifyGroup recognizes it as <12,3>. I hope this means $A_4$.
Anyway, now I would like to know the product of each pair of generators. In this case, if I am not mistaken, the product of any two generators is a generator itself.
Therefore, it would suffice to be able to check, for each triple of generators $a,b,c$, whether or not $ab=c$. How can this be done?
To do what you ask, you could turn the group into a rewriting system. But note that you have more generators than group elements, so some of them will be equal.
For other types of calculations it might be more useful to turn it into a permutation group. The geenrators of $P$ will still correspond to those of $G$.