--- /dev/null
+#ifndef ISL_MAYBE_H
+#define ISL_MAYBE_H
+
+#define ISL_xMAYBE(TYPE) isl_maybe_ ## TYPE
+#define ISL_MAYBE(TYPE) ISL_xMAYBE(TYPE)
+
+#endif
--- /dev/null
+#ifndef ISL_MAYBE_AST_EXPR_H
+#define ISL_MAYBE_AST_EXPR_H
+
+#define ISL_TYPE isl_ast_expr
+#include <isl/maybe_templ.h>
+#undef ISL_TYPE
+
+#endif
--- /dev/null
+#ifndef ISL_MAYBE_BASIC_SET_H
+#define ISL_MAYBE_BASIC_SET_H
+
+#define ISL_TYPE isl_basic_set
+#include <isl/maybe_templ.h>
+#undef ISL_TYPE
+
+#endif
--- /dev/null
+#ifndef ISL_MAYBE_ID_H
+#define ISL_MAYBE_ID_H
+
+#define ISL_TYPE isl_id
+#include <isl/maybe_templ.h>
+#undef ISL_TYPE
+
+#endif
--- /dev/null
+#ifndef ISL_MAYBE_PW_AFF_H
+#define ISL_MAYBE_PW_AFF_H
+
+#define ISL_TYPE isl_pw_aff
+#include <isl/maybe_templ.h>
+#undef ISL_TYPE
+
+#endif
--- /dev/null
+#include <isl/ctx.h>
+#include <isl/maybe.h>
+
+/* A structure that possibly contains a pointer to an object of type ISL_TYPE.
+ * The pointer in "value" is only valid if "valid" is isl_bool_true.
+ * Otherwise, "value" is set to NULL.
+ */
+struct ISL_MAYBE(ISL_TYPE) {
+ isl_bool valid;
+ ISL_TYPE *value;
+};
+typedef struct ISL_MAYBE(ISL_TYPE) ISL_MAYBE(ISL_TYPE);