// IsSplitS.mgm is a modification of the script IsSplitS.mgm
// originally developed by J.M. Belk - RHIT REU 1997
// the script determines whether a tiling splits at a reflection R
// the full tiling group Gs and its generators p,q, and r must be supplied
// R is the reflection we are testing for separability, it is uusally one of p,q, or r.
IsSplitS := function(Gs,p,q,r,R)
Xold := {};
X := {Id(Gs)};
repeat
bX := X diff Xold;
Xold := X;
Xnew := {{x*p,x*q,x*r} diff {R*x} : x in bX}; // in triples and doubles
Xnew := {xn : xn in yn,yn in Xnew}; // as single elements
X := Xold join Xnew;
until (#Xold eq #X) or (R in Xnew);
if (#X eq #Gs) or (R in Xnew)
then return false;
else return true;
end if;
end function;