// IsSplit.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.
IsSplit := 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;
if #X eq #Gs
then return false;
else return true;
end if;
end function;