private static bool CheckForAllStates(Expr output, Func<Expr, bool> phi)
{
if (output.ASTKind != Z3_ast_kind.Z3_APP_AST)
throw new AutomataException(AutomataExceptionKind.TreeTransducer_UnexpectedOutputExpr);
var f = output.FuncDecl;
var args = output.Args;
if (TreeTheory.IsTrans(f))
{
//check the state condition for the first argument
bool res = phi(args[0]);
return res;
}
else //must be constructor
{
for (int i = 1; i < args.Length; i++)
if (!CheckForAllStates(args[i], phi))
return false;
return true;
}
}