Detecting decidable classes of finitely ground logic programs with function symbols