Add preconditions for AST templates.