graph representation of terms and create product out of the singlet graph