code: function validate(ast) {
      if (!ast || !ast.inParams || !ast.tasks || !ast.outTask) return [AST_IS_OBJECT];
      var errors = [];
      errors = errors.concat(validateInParams(ast.inParams));
      errors = errors.concat(validateTasks(ast.tasks));
      errors = errors.concat(validateTaskNamesUnique(ast.tasks));
      errors = errors.concat(taskUtil.validateOutTask(ast.outTask));
      errors = errors.concat(validateLocals(ast.locals));
      if (errors.length === 0) { // if no errors do additional validation
        if (ast.outTask.type !== 'finalcbFirst') errors = errors.concat(validateOuputsUnique(ast.tasks));
        errors = errors.concat(taskUtil.validateLocalFunctions(ast.inParams, ast.tasks, ast.locals));
        errors = errors.concat(validateNoMissingNames(ast));
      }
      return errors;
    }
docs: validate the AST return Errors
  @example
  var validate = require('./validate');
  var errors = validate(ast);
  @returns array of errors, could be empty