llvm/polly/lib/External/isl/isl_space.c

/*
 * Copyright 2008-2009 Katholieke Universiteit Leuven
 * Copyright 2010      INRIA Saclay
 * Copyright 2013-2014 Ecole Normale Superieure
 * Copyright 2018-2019 Cerebras Systems
 *
 * Use of this software is governed by the MIT license
 *
 * Written by Sven Verdoolaege, K.U.Leuven, Departement
 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
 * and INRIA Saclay - Ile-de-France, Parc Club Orsay Universite,
 * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France 
 * and Ecole Normale Superieure, 45 rue d’Ulm, 75230 Paris, France
 * and Cerebras Systems, 175 S San Antonio Rd, Los Altos, CA, USA
 */

#include <stdlib.h>
#include <string.h>
#include <isl_space_private.h>
#include <isl_id_private.h>
#include <isl_reordering.h>

isl_ctx *isl_space_get_ctx(__isl_keep isl_space *space)
{}

__isl_give isl_space *isl_space_alloc(isl_ctx *ctx,
			unsigned nparam, unsigned n_in, unsigned n_out)
{}

/* Mark the space as being that of a set, by setting the domain tuple
 * to isl_id_none.
 */
static __isl_give isl_space *mark_as_set(__isl_take isl_space *space)
{}

/* Is the space that of a set?
 */
isl_bool isl_space_is_set(__isl_keep isl_space *space)
{}

/* Check that "space" is a set space.
 */
isl_stat isl_space_check_is_set(__isl_keep isl_space *space)
{}

/* Is the given space that of a map?
 */
isl_bool isl_space_is_map(__isl_keep isl_space *space)
{}

/* Check that "space" is the space of a map.
 */
static isl_stat isl_space_check_is_map(__isl_keep isl_space *space)
{}

/* Check that "space" is the space of a map
 * where the domain is a wrapped map space.
 */
isl_stat isl_space_check_domain_is_wrapping(__isl_keep isl_space *space)
{}

/* Check that "space" is the space of a map
 * where the range is a wrapped map space.
 */
isl_stat isl_space_check_range_is_wrapping(__isl_keep isl_space *space)
{}

__isl_give isl_space *isl_space_set_alloc(isl_ctx *ctx,
			unsigned nparam, unsigned dim)
{}

/* Mark the space as being that of a parameter domain, by setting
 * both tuples to isl_id_none.
 */
static __isl_give isl_space *mark_as_params(isl_space *space)
{}

/* Is the space that of a parameter domain?
 */
isl_bool isl_space_is_params(__isl_keep isl_space *space)
{}

/* Create a space for a parameter domain.
 */
__isl_give isl_space *isl_space_params_alloc(isl_ctx *ctx, unsigned nparam)
{}

/* Create a space for a parameter domain, without any parameters.
 */
__isl_give isl_space *isl_space_unit(isl_ctx *ctx)
{}

static isl_size global_pos(__isl_keep isl_space *space,
				 enum isl_dim_type type, unsigned pos)
{}

/* Extend length of ids array to the total number of dimensions.
 */
static __isl_give isl_space *extend_ids(__isl_take isl_space *space)
{}

static __isl_give isl_space *set_id(__isl_take isl_space *space,
	enum isl_dim_type type, unsigned pos, __isl_take isl_id *id)
{}

static __isl_keep isl_id *get_id(__isl_keep isl_space *space,
				 enum isl_dim_type type, unsigned pos)
{}

/* Return the nested space at the given position.
 */
static __isl_keep isl_space *isl_space_peek_nested(__isl_keep isl_space *space,
	int pos)
{}

static unsigned offset(__isl_keep isl_space *space, enum isl_dim_type type)
{}

static unsigned n(__isl_keep isl_space *space, enum isl_dim_type type)
{}

isl_size isl_space_dim(__isl_keep isl_space *space, enum isl_dim_type type)
{}

/* Return the dimensionality of tuple "inner" within the wrapped relation
 * inside tuple "outer".
 */
isl_size isl_space_wrapped_dim(__isl_keep isl_space *space,
	enum isl_dim_type outer, enum isl_dim_type inner)
{}

unsigned isl_space_offset(__isl_keep isl_space *space, enum isl_dim_type type)
{}

static __isl_give isl_space *copy_ids(__isl_take isl_space *dst,
	enum isl_dim_type dst_type, unsigned offset, __isl_keep isl_space *src,
	enum isl_dim_type src_type)
{}

__isl_give isl_space *isl_space_dup(__isl_keep isl_space *space)
{}

__isl_give isl_space *isl_space_cow(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_copy(__isl_keep isl_space *space)
{}

__isl_null isl_space *isl_space_free(__isl_take isl_space *space)
{}

/* Check if "s" is a valid dimension or tuple name.
 * We currently only forbid names that look like a number.
 *
 * s is assumed to be non-NULL.
 */
static int name_ok(isl_ctx *ctx, const char *s)
{}

/* Return a copy of the nested space at the given position.
 */
static __isl_keep isl_space *isl_space_get_nested(__isl_keep isl_space *space,
	int pos)
{}

/* Return the nested space at the given position.
 * This may be either a copy or the nested space itself
 * if there is only one reference to "space".
 * This allows the nested space to be modified inplace
 * if both "space" and the nested space have only a single reference.
 * The caller is not allowed to modify "space" between this call and
 * a subsequent call to isl_space_restore_nested.
 * The only exception is that isl_space_free can be called instead.
 */
static __isl_give isl_space *isl_space_take_nested(__isl_keep isl_space *space,
	int pos)
{}

/* Replace the nested space at the given position by "nested",
 * where this nested space of "space" may be missing
 * due to a preceding call to isl_space_take_nested.
 * However, in this case, "space" only has a single reference and
 * then the call to isl_space_cow has no effect.
 */
static __isl_give isl_space *isl_space_restore_nested(
	__isl_take isl_space *space, int pos, __isl_take isl_space *nested)
{}

/* Is it possible for the given dimension type to have a tuple id?
 */
static int space_can_have_id(__isl_keep isl_space *space,
	enum isl_dim_type type)
{}

/* Does the tuple have an id?
 */
isl_bool isl_space_has_tuple_id(__isl_keep isl_space *space,
	enum isl_dim_type type)
{}

/* Does the domain tuple of the map space "space" have an identifier?
 */
isl_bool isl_space_has_domain_tuple_id(__isl_keep isl_space *space)
{}

/* Does the range tuple of the map space "space" have an identifier?
 */
isl_bool isl_space_has_range_tuple_id(__isl_keep isl_space *space)
{}

__isl_give isl_id *isl_space_get_tuple_id(__isl_keep isl_space *space,
	enum isl_dim_type type)
{}

/* Return the identifier of the domain tuple of the map space "space",
 * assuming it has one.
 */
__isl_give isl_id *isl_space_get_domain_tuple_id(
	__isl_keep isl_space *space)
{}

/* Return the identifier of the range tuple of the map space "space",
 * assuming it has one.
 */
__isl_give isl_id *isl_space_get_range_tuple_id(
	__isl_keep isl_space *space)
{}

__isl_give isl_space *isl_space_set_tuple_id(__isl_take isl_space *space,
	enum isl_dim_type type, __isl_take isl_id *id)
{}

/* Replace the identifier of the domain tuple of the map space "space"
 * by "id".
 */
__isl_give isl_space *isl_space_set_domain_tuple_id(
	__isl_take isl_space *space, __isl_take isl_id *id)
{}

/* Replace the identifier of the range tuple of the map space "space"
 * by "id".
 */
__isl_give isl_space *isl_space_set_range_tuple_id(
	__isl_take isl_space *space, __isl_take isl_id *id)
{}

__isl_give isl_space *isl_space_reset_tuple_id(__isl_take isl_space *space,
	enum isl_dim_type type)
{}

/* Set the id of the given dimension of "space" to "id".
 * If the dimension already has an id, then it is replaced.
 * If the dimension is a parameter, then we need to change it
 * in the nested spaces (if any) as well.
 */
__isl_give isl_space *isl_space_set_dim_id(__isl_take isl_space *space,
	enum isl_dim_type type, unsigned pos, __isl_take isl_id *id)
{}

/* Reset the id of the given dimension of "space".
 * If the dimension already has an id, then it is removed.
 * If the dimension is a parameter, then we need to reset it
 * in the nested spaces (if any) as well.
 */
__isl_give isl_space *isl_space_reset_dim_id(__isl_take isl_space *space,
	enum isl_dim_type type, unsigned pos)
{}

isl_bool isl_space_has_dim_id(__isl_keep isl_space *space,
	enum isl_dim_type type, unsigned pos)
{}

__isl_give isl_id *isl_space_get_dim_id(__isl_keep isl_space *space,
	enum isl_dim_type type, unsigned pos)
{}

__isl_give isl_space *isl_space_set_tuple_name(__isl_take isl_space *space,
	enum isl_dim_type type, const char *s)
{}

/* Does the tuple have a name?
 */
isl_bool isl_space_has_tuple_name(__isl_keep isl_space *space,
	enum isl_dim_type type)
{}

__isl_keep const char *isl_space_get_tuple_name(__isl_keep isl_space *space,
	 enum isl_dim_type type)
{}

__isl_give isl_space *isl_space_set_dim_name(__isl_take isl_space *space,
				 enum isl_dim_type type, unsigned pos,
				 const char *s)
{}

/* Does the given dimension have a name?
 */
isl_bool isl_space_has_dim_name(__isl_keep isl_space *space,
	enum isl_dim_type type, unsigned pos)
{}

__isl_keep const char *isl_space_get_dim_name(__isl_keep isl_space *space,
				 enum isl_dim_type type, unsigned pos)
{}

int isl_space_find_dim_by_id(__isl_keep isl_space *space,
	enum isl_dim_type type, __isl_keep isl_id *id)
{}

int isl_space_find_dim_by_name(__isl_keep isl_space *space,
	enum isl_dim_type type, const char *name)
{}

/* Reset the user pointer on all identifiers of parameters and tuples
 * of "space".
 */
__isl_give isl_space *isl_space_reset_user(__isl_take isl_space *space)
{}

static __isl_keep isl_id *tuple_id(__isl_keep isl_space *space,
	enum isl_dim_type type)
{}

static __isl_keep isl_space *nested(__isl_keep isl_space *space,
	enum isl_dim_type type)
{}

/* Are the two spaces the same, apart from positions and names of parameters?
 */
isl_bool isl_space_has_equal_tuples(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Check that a match involving "space" was successful.
 * That is, check that "match" is equal to isl_bool_true.
 */
static isl_stat check_match(__isl_keep isl_space *space, isl_bool match)
{}

/* Check that the two spaces are the same,
 * apart from positions and names of parameters.
 */
isl_stat isl_space_check_equal_tuples(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Check if the tuple of type "type1" of "space1" is the same as
 * the tuple of type "type2" of "space2".
 *
 * That is, check if the tuples have the same identifier, the same dimension
 * and the same internal structure.
 * The identifiers of the dimensions inside the tuples do not affect the result.
 *
 * Note that this function only checks the tuples themselves.
 * If nested tuples are involved, then we need to be careful not
 * to have result affected by possibly differing parameters
 * in those nested tuples.
 */
isl_bool isl_space_tuple_is_equal(__isl_keep isl_space *space1,
	enum isl_dim_type type1, __isl_keep isl_space *space2,
	enum isl_dim_type type2)
{}

/* Is the tuple "inner" within the wrapped relation inside tuple "outer"
 * of "space1" equal to tuple "type2" of "space2"?
 */
isl_bool isl_space_wrapped_tuple_is_equal(__isl_keep isl_space *space1,
	enum isl_dim_type outer, enum isl_dim_type inner,
	__isl_keep isl_space *space2, enum isl_dim_type type2)
{}

/* Check that the tuple "inner" within the wrapped relation inside tuple "outer"
 * of "space1" is equal to tuple "type2" of "space2".
 */
isl_stat isl_space_check_wrapped_tuple_is_equal(__isl_keep isl_space *space1,
	enum isl_dim_type outer, enum isl_dim_type inner,
	__isl_keep isl_space *space2, enum isl_dim_type type2)
{}

static isl_bool match(__isl_keep isl_space *space1, enum isl_dim_type type1,
	__isl_keep isl_space *space2, enum isl_dim_type type2)
{}

/* Do "space1" and "space2" have the same parameters?
 */
isl_bool isl_space_has_equal_params(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Do "space1" and "space2" have the same identifiers for all
 * the tuple variables?
 */
isl_bool isl_space_has_equal_ids(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

isl_bool isl_space_match(__isl_keep isl_space *space1, enum isl_dim_type type1,
	__isl_keep isl_space *space2, enum isl_dim_type type2)
{}

static void get_ids(__isl_keep isl_space *space, enum isl_dim_type type,
	unsigned first, unsigned n, __isl_keep isl_id **ids)
{}

static __isl_give isl_space *space_extend(__isl_take isl_space *space,
			unsigned nparam, unsigned n_in, unsigned n_out)
{}

__isl_give isl_space *isl_space_extend(__isl_take isl_space *space,
	unsigned nparam, unsigned n_in, unsigned n_out)
{}

__isl_give isl_space *isl_space_add_dims(__isl_take isl_space *space,
	enum isl_dim_type type, unsigned n)
{}

/* Add a parameter with identifier "id" to "space", provided
 * it does not already appear in "space".
 */
__isl_give isl_space *isl_space_add_param_id(__isl_take isl_space *space,
	__isl_take isl_id *id)
{}

static int valid_dim_type(enum isl_dim_type type)
{}

#undef TYPE
#define TYPE
#include "check_type_range_templ.c"

/* Insert "n" dimensions of type "type" at position "pos".
 * If we are inserting parameters, then they are also inserted in
 * any nested spaces.
 */
__isl_give isl_space *isl_space_insert_dims(__isl_take isl_space *space,
	enum isl_dim_type type, unsigned pos, unsigned n)
{}

__isl_give isl_space *isl_space_move_dims(__isl_take isl_space *space,
	enum isl_dim_type dst_type, unsigned dst_pos,
	enum isl_dim_type src_type, unsigned src_pos, unsigned n)
{}

/* Check that "space1" and "space2" have the same parameters,
 * reporting an error if they do not.
 */
isl_stat isl_space_check_equal_params(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

__isl_give isl_space *isl_space_join(__isl_take isl_space *left,
	__isl_take isl_space *right)
{}

/* Given two map spaces { A -> C } and { B -> D }, construct the space
 * { [A -> B] -> [C -> D] }.
 * Given two set spaces { A } and { B }, construct the space { [A -> B] }.
 */
__isl_give isl_space *isl_space_product(__isl_take isl_space *left,
	__isl_take isl_space *right)
{}

/* Given two spaces { A -> C } and { B -> C }, construct the space
 * { [A -> B] -> C }
 */
__isl_give isl_space *isl_space_domain_product(__isl_take isl_space *left,
	__isl_take isl_space *right)
{}

__isl_give isl_space *isl_space_range_product(__isl_take isl_space *left,
	__isl_take isl_space *right)
{}

/* Given a space of the form [A -> B] -> C, return the space A -> C.
 */
__isl_give isl_space *isl_space_domain_factor_domain(
	__isl_take isl_space *space)
{}

/* Given a space of the form [A -> B] -> C, return the space B -> C.
 */
__isl_give isl_space *isl_space_domain_factor_range(
	__isl_take isl_space *space)
{}

/* Internal function that selects the domain of the map that is
 * embedded in either a set space or the range of a map space.
 * In particular, given a space of the form [A -> B], return the space A.
 * Given a space of the form A -> [B -> C], return the space A -> B.
 */
static __isl_give isl_space *range_factor_domain(__isl_take isl_space *space)
{}

/* Given a space of the form A -> [B -> C], return the space A -> B.
 */
__isl_give isl_space *isl_space_range_factor_domain(
	__isl_take isl_space *space)
{}

/* Given a space of the form [A -> B], return the space A.
 */
static __isl_give isl_space *set_factor_domain(__isl_take isl_space *space)
{}

/* Given a space of the form [A -> B] -> [C -> D], return the space A -> C.
 * Given a space of the form [A -> B], return the space A.
 */
__isl_give isl_space *isl_space_factor_domain(__isl_take isl_space *space)
{}

/* Internal function that selects the range of the map that is
 * embedded in either a set space or the range of a map space.
 * In particular, given a space of the form [A -> B], return the space B.
 * Given a space of the form A -> [B -> C], return the space A -> C.
 */
static __isl_give isl_space *range_factor_range(__isl_take isl_space *space)
{}

/* Given a space of the form A -> [B -> C], return the space A -> C.
 */
__isl_give isl_space *isl_space_range_factor_range(
	__isl_take isl_space *space)
{}

/* Given a space of the form [A -> B], return the space B.
 */
static __isl_give isl_space *set_factor_range(__isl_take isl_space *space)
{}

/* Given a space of the form [A -> B] -> [C -> D], return the space B -> D.
 * Given a space of the form [A -> B], return the space B.
 */
__isl_give isl_space *isl_space_factor_range(__isl_take isl_space *space)
{}

/* Given a space of the form [A -> B] -> C, return the space A.
 */
__isl_give isl_space *isl_space_domain_wrapped_domain(
	__isl_take isl_space *space)
{}

/* Given a space of the form [A -> B] -> C, return the space B.
 */
__isl_give isl_space *isl_space_domain_wrapped_range(
	__isl_take isl_space *space)
{}

/* Given a space of the form A -> [B -> C], return the space B.
 */
__isl_give isl_space *isl_space_range_wrapped_domain(
	__isl_take isl_space *space)
{}

/* Given a space of the form A -> [B -> C], return the space C.
 */
__isl_give isl_space *isl_space_range_wrapped_range(
	__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_map_from_set(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_map_from_domain_and_range(
	__isl_take isl_space *domain, __isl_take isl_space *range)
{}

static __isl_give isl_space *set_ids(__isl_take isl_space *space,
	enum isl_dim_type type,
	unsigned first, unsigned n, __isl_take isl_id **ids)
{}

__isl_give isl_space *isl_space_reverse(__isl_take isl_space *space)
{}

/* Given a space A -> (B -> C), return the corresponding space
 * A -> (C -> B).
 *
 * If the range tuple is named, then the name is only preserved
 * if B and C are equal tuples, in which case the output
 * of this function is identical to the input.
 */
__isl_give isl_space *isl_space_range_reverse(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_drop_dims(__isl_take isl_space *space,
	enum isl_dim_type type, unsigned first, unsigned num)
{}

__isl_give isl_space *isl_space_drop_inputs(__isl_take isl_space *space,
		unsigned first, unsigned n)
{}

__isl_give isl_space *isl_space_drop_outputs(__isl_take isl_space *space,
		unsigned first, unsigned n)
{}

/* Remove all parameters from "space".
 */
__isl_give isl_space *isl_space_drop_all_params(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_domain(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_from_domain(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_range(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_from_range(__isl_take isl_space *space)
{}

/* Given a map space A -> B, return the map space [A -> B] -> A.
 */
__isl_give isl_space *isl_space_domain_map(__isl_take isl_space *space)
{}

/* Given a map space A -> B, return the map space [A -> B] -> B.
 */
__isl_give isl_space *isl_space_range_map(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_params(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_set_from_params(__isl_take isl_space *space)
{}

/* Add an unnamed tuple of dimension "dim" to "space".
 * This requires "space" to be a parameter or set space.
 *
 * In particular, if "space" is a parameter space, then return
 * a set space with the given dimension.
 * If "space" is a set space, then return a map space
 * with "space" as domain and a range of the given dimension.
 */
__isl_give isl_space *isl_space_add_unnamed_tuple_ui(
	__isl_take isl_space *space, unsigned dim)
{}

/* Add a tuple of dimension "dim" and with tuple identifier "tuple_id"
 * to "space".
 * This requires "space" to be a parameter or set space.
 */
__isl_give isl_space *isl_space_add_named_tuple_id_ui(
	__isl_take isl_space *space, __isl_take isl_id *tuple_id, unsigned dim)
{}

/* Check that the identifiers in "tuple" do not appear as parameters
 * in "space".
 */
static isl_stat check_fresh_params(__isl_keep isl_space *space,
	__isl_keep isl_multi_id *tuple)
{}

/* Add the identifiers in "tuple" as parameters of "space"
 * that are known to be fresh.
 */
static __isl_give isl_space *add_bind_params(__isl_take isl_space *space,
	__isl_keep isl_multi_id *tuple)
{}

/* Internal function that removes the set tuple of "space",
 * which is assumed to correspond to the range space of "tuple", and
 * adds the identifiers in "tuple" as fresh parameters.
 * In other words, the set dimensions of "space" are reinterpreted
 * as parameters, but stay in the same global positions.
 */
__isl_give isl_space *isl_space_bind_set(__isl_take isl_space *space,
	__isl_keep isl_multi_id *tuple)
{}

/* Internal function that removes the domain tuple of the map space "space",
 * which is assumed to correspond to the range space of "tuple", and
 * adds the identifiers in "tuple" as fresh parameters.
 * In other words, the domain dimensions of "space" are reinterpreted
 * as parameters, but stay in the same global positions.
 */
__isl_give isl_space *isl_space_bind_map_domain(__isl_take isl_space *space,
	__isl_keep isl_multi_id *tuple)
{}

/* Internal function that, given a space of the form [A -> B] -> C and
 * a tuple of identifiers in A, returns a space B -> C with
 * the identifiers in "tuple" added as fresh parameters.
 * In other words, the domain dimensions of the wrapped relation
 * in the domain of "space" are reinterpreted
 * as parameters, but stay in the same global positions.
 */
__isl_give isl_space *isl_space_bind_domain_wrapped_domain(
	__isl_take isl_space *space, __isl_keep isl_multi_id *tuple)
{}

/* Insert a domain tuple in "space" corresponding to the set space "domain".
 * In particular, if "space" is a parameter space, then the result
 * is the set space "domain" combined with the parameters of "space".
 * If "space" is a set space, then the result
 * is a map space with "domain" as domain and the original space as range.
 */
static __isl_give isl_space *isl_space_insert_domain(
	__isl_take isl_space *space, __isl_take isl_space *domain)
{}

/* Internal function that introduces a domain in "space"
 * corresponding to the range space of "tuple".
 * In particular, if "space" is a parameter space, then the result
 * is a set space.  If "space" is a set space, then the result
 * is a map space with the original space as range.
 * Parameters that correspond to the identifiers in "tuple" are removed.
 *
 * The parameters are removed in reverse order (under the assumption
 * that they appear in the same order in "multi") because
 * it is slightly more efficient to remove parameters at the end.
 *
 * For pretty-printing purposes, the identifiers of the set dimensions
 * of the introduced domain are set to the identifiers in "tuple".
 */
__isl_give isl_space *isl_space_unbind_params_insert_domain(
	__isl_take isl_space *space, __isl_keep isl_multi_id *tuple)
{}

__isl_give isl_space *isl_space_underlying(__isl_take isl_space *space,
	unsigned n_div)
{}

/* Are the two spaces the same, including positions and names of parameters?
 */
isl_bool isl_space_is_equal(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Do the tuples of "space1" correspond to those of the domain of "space2"?
 * That is, is "space1" equal to the domain of "space2", ignoring parameters.
 *
 * "space2" is allowed to be a set space, in which case "space1"
 * should be a parameter space.
 */
isl_bool isl_space_has_domain_tuples(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Do the tuples of "space1" correspond to those of the range of "space2"?
 * That is, is "space1" equal to the range of "space2", ignoring parameters.
 *
 * "space2" is allowed to be the space of a set,
 * in which case it should be equal to "space1", ignoring parameters.
 */
isl_bool isl_space_has_range_tuples(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Check that the tuples of "space1" correspond to those
 * of the domain of "space2".
 * That is, check that "space1" is equal to the domain of "space2",
 * ignoring parameters.
 */
isl_stat isl_space_check_domain_tuples(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Check that the tuples of "space1" correspond to those
 * of the domain of the wrapped relation in the domain of "space2".
 * That is, check that "space1" is equal to this domain,
 * ignoring parameters.
 */
isl_stat isl_space_check_domain_wrapped_domain_tuples(
	__isl_keep isl_space *space1, __isl_keep isl_space *space2)
{}

/* Is space1 equal to the domain of space2?
 *
 * In the internal version we also allow space2 to be the space of a set,
 * provided space1 is a parameter space.
 */
isl_bool isl_space_is_domain_internal(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Is space1 equal to the domain of space2?
 */
isl_bool isl_space_is_domain(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Is space1 equal to the range of space2?
 *
 * In the internal version, space2 is allowed to be the space of a set,
 * in which case it should be equal to space1.
 */
isl_bool isl_space_is_range_internal(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Is space1 equal to the range of space2?
 */
isl_bool isl_space_is_range(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2)
{}

/* Update "hash" by hashing in the parameters of "space".
 */
static uint32_t isl_hash_params(uint32_t hash, __isl_keep isl_space *space)
{}

/* Update "hash" by hashing in the tuples of "space".
 * Changes in this function should be reflected in isl_hash_tuples_domain.
 */
static uint32_t isl_hash_tuples(uint32_t hash, __isl_keep isl_space *space)
{}

/* Update "hash" by hashing in the domain tuple of "space".
 * The result of this function is equal to the result of applying
 * isl_hash_tuples to the domain of "space".
 */
static uint32_t isl_hash_tuples_domain(uint32_t hash,
	__isl_keep isl_space *space)
{}

/* Return a hash value that digests the tuples of "space",
 * i.e., that ignores the parameters.
 * Changes in this function should be reflected
 * in isl_space_get_tuple_domain_hash.
 */
uint32_t isl_space_get_tuple_hash(__isl_keep isl_space *space)
{}

/* Return the hash value of "space".
 */
uint32_t isl_space_get_full_hash(__isl_keep isl_space *space)
{}

/* Return the hash value of the domain tuple of "space".
 * That is, isl_space_get_tuple_domain_hash(space) is equal to
 * isl_space_get_tuple_hash(isl_space_domain(space)).
 */
uint32_t isl_space_get_tuple_domain_hash(__isl_keep isl_space *space)
{}

/* Is "space" the space of a set wrapping a map space?
 */
isl_bool isl_space_is_wrapping(__isl_keep isl_space *space)
{}

/* Is "space" the space of a map where the domain is a wrapped map space?
 */
isl_bool isl_space_domain_is_wrapping(__isl_keep isl_space *space)
{}

/* Is "space" the space of a map where the range is a wrapped map space?
 */
isl_bool isl_space_range_is_wrapping(__isl_keep isl_space *space)
{}

/* Is "space" a product of two spaces?
 * That is, is it a wrapping set space or a map space
 * with wrapping domain and range?
 */
isl_bool isl_space_is_product(__isl_keep isl_space *space)
{}

__isl_give isl_space *isl_space_wrap(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_unwrap(__isl_take isl_space *space)
{}

isl_bool isl_space_is_named_or_nested(__isl_keep isl_space *space,
	enum isl_dim_type type)
{}

isl_bool isl_space_may_be_set(__isl_keep isl_space *space)
{}

__isl_give isl_space *isl_space_reset(__isl_take isl_space *space,
	enum isl_dim_type type)
{}

__isl_give isl_space *isl_space_flatten(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_flatten_domain(__isl_take isl_space *space)
{}

__isl_give isl_space *isl_space_flatten_range(__isl_take isl_space *space)
{}

/* Replace the parameters of dst by those of src.
 */
__isl_give isl_space *isl_space_replace_params(__isl_take isl_space *dst,
	__isl_keep isl_space *src)
{}

/* Given two tuples ("dst_type" in "dst" and "src_type" in "src")
 * of the same size, check if any of the dimensions in the "dst" tuple
 * have no identifier, while the corresponding dimensions in "src"
 * does have an identifier,
 * If so, copy the identifier over to "dst".
 */
__isl_give isl_space *isl_space_copy_ids_if_unset(__isl_take isl_space *dst,
	enum isl_dim_type dst_type, __isl_keep isl_space *src,
	enum isl_dim_type src_type)
{}

/* Given a space "space" of a set, create a space
 * for the lift of the set.  In particular, the result
 * is of the form lifted[space -> local[..]], with n_local variables in the
 * range of the wrapped map.
 */
__isl_give isl_space *isl_space_lift(__isl_take isl_space *space,
	unsigned n_local)
{}

isl_bool isl_space_can_zip(__isl_keep isl_space *space)
{}

__isl_give isl_space *isl_space_zip(__isl_take isl_space *space)
{}

/* Can we apply isl_space_curry to "space"?
 * That is, does is it have a map space with a nested relation in its domain?
 */
isl_bool isl_space_can_curry(__isl_keep isl_space *space)
{}

/* Given a space (A -> B) -> C, return the corresponding space
 * A -> (B -> C).
 */
__isl_give isl_space *isl_space_curry(__isl_take isl_space *space)
{}

/* Can isl_space_range_curry be applied to "space"?
 * That is, does it have a nested relation in its range,
 * the domain of which is itself a nested relation?
 */
isl_bool isl_space_can_range_curry(__isl_keep isl_space *space)
{}

/* Given a space A -> ((B -> C) -> D), return the corresponding space
 * A -> (B -> (C -> D)).
 */
__isl_give isl_space *isl_space_range_curry(__isl_take isl_space *space)
{}

/* Can we apply isl_space_uncurry to "space"?
 * That is, does it have a map space with a nested relation in its range?
 */
isl_bool isl_space_can_uncurry(__isl_keep isl_space *space)
{}

/* Given a space A -> (B -> C), return the corresponding space
 * (A -> B) -> C.
 */
__isl_give isl_space *isl_space_uncurry(__isl_take isl_space *space)
{}

isl_bool isl_space_has_named_params(__isl_keep isl_space *space)
{}

/* Check that "space" has only named parameters, reporting an error
 * if it does not.
 */
isl_stat isl_space_check_named_params(__isl_keep isl_space *space)
{}

/* Align the initial parameters of space1 to match the order in space2.
 */
__isl_give isl_space *isl_space_align_params(__isl_take isl_space *space1,
	__isl_take isl_space *space2)
{}

/* Given the space of set (domain), construct a space for a map
 * with as domain the given space and as range the range of "model".
 */
__isl_give isl_space *isl_space_extend_domain_with_range(
	__isl_take isl_space *space, __isl_take isl_space *model)
{}

/* Compare the "type" dimensions of two isl_spaces.
 *
 * The order is fairly arbitrary.
 */
static int isl_space_cmp_type(__isl_keep isl_space *space1,
	__isl_keep isl_space *space2, enum isl_dim_type type)
{}

/* Compare two isl_spaces.
 *
 * The order is fairly arbitrary.
 */
int isl_space_cmp(__isl_keep isl_space *space1, __isl_keep isl_space *space2)
{}