public Expr MkTree(FuncDecl f, Expr attribute, params Expr[] subtrees)
{
int r = ((int)f.Arity)-1;
if (subtrees.Length != r)
throw new AutomataException(AutomataExceptionKind.RankedAlphabet_IvalidNrOfSubtrees);
for (int i = 0; i < r; i++)
if (subtrees[i] == null || !tt.Z.GetSort(subtrees[i]).Equals(alphabetSort))
throw new AutomataException(AutomataExceptionKind.RankedAlphabet_InvalidSubtree);
Expr[] attribute_and_subtrees = new Expr[subtrees.Length + 1];
attribute_and_subtrees[0] = attribute;
Array.Copy(subtrees, 0, attribute_and_subtrees, 1, subtrees.Length);
var res = tt.Z.MkApp(f, attribute_and_subtrees);
return res;
}