Reference: Abstract Syntax Trees

Added in version 2014.1.

Symbolic Constants

class islpy.ast_expr_op_type(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
access = 23
add = 7
address_of = 25
and_ = 0
and_then = 1
call = 22
cond = 15
div = 10
eq = 17
error = -1
fdiv_q = 11
ge = 20
gt = 21
le = 18
lt = 19
max = 4
member = 24
min = 5
minus = 6
mul = 9
or_ = 2
or_else = 3
pdiv_q = 12
pdiv_r = 13
select = 16
sub = 8
zdiv_r = 14
class islpy.ast_expr_type(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
error = -1
id = 1
int = 2
op = 0
class islpy.ast_node_type(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
block = 3
error = -1
for_ = 1
if_ = 2
mark = 4
user = 5
class islpy.ast_loop_type(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
atomic = 1
default = 0
error = -1
separate = 3
unroll = 2

AST Expression

class islpy.AstExpr
__eq__(other)

Return self==value.

__hash__()

Return hash(self).

__ne__(other)

Return self!=value.

access(self, indices)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

add(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

address_of(self)
Parameters:

selfAstExpr

Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

and_(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

and_then(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

call(self, arguments)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

copy(self)
Parameters:

selfAstExpr

Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

div(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

dump(self)
Parameters:

selfAstExpr

Returns:

None

Warning

This function is not part of the officially public isl API. Use at your own risk.

eq(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

from_id = <nanobind.nb_func object>
from_val = <nanobind.nb_func object>
ge(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_ctx(self)
Parameters:

selfAstExpr

Returns:

Context

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_id(self)
Parameters:

selfAstExpr

Returns:

Id

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_op_arg(self, pos)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_op_n_arg(self)
Parameters:

selfAstExpr

Returns:

isl_size

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_op_type(self)
Parameters:

selfAstExpr

Returns:

isl_ast_expr_op_type

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_type(self)
Parameters:

selfAstExpr

Returns:

isl_ast_expr_type

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_val(self)
Parameters:

selfAstExpr

Returns:

Val

Warning

This function is not part of the officially public isl API. Use at your own risk.

gt(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

id_get_id(self)
Parameters:

selfAstExpr

Returns:

Id

int_get_val(self)
Parameters:

selfAstExpr

Returns:

Val

is_equal(self, expr2)
Parameters:
Returns:

bool

Warning

This function is not part of the officially public isl API. Use at your own risk.

le(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

lt(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

mul(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

neg(self)
Parameters:

selfAstExpr

Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

op_get_arg(self, pos)
Parameters:
Returns:

AstExpr

op_get_n_arg(self)
Parameters:

selfAstExpr

Returns:

isl_size

op_get_type(self)
Parameters:

selfAstExpr

Returns:

isl_ast_expr_op_type

Warning

This function is not part of the officially public isl API. Use at your own risk.

op_type_print_macro(self, p)
Parameters:
Returns:

Printer

Warning

This function is not part of the officially public isl API. Use at your own risk.

op_type_set_print_name = <nanobind.nb_func object>
or_(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

or_else(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

pdiv_q(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

pdiv_r(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

print_macros(self, p)
Parameters:
Returns:

Printer

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_op_arg(self, pos, arg)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

sub(self, expr2)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

substitute_ids(self, id2expr)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

to_C_str(self)
Parameters:

selfAstExpr

Returns:

string

to_list(self)
Parameters:

selfAstExpr

Returns:

AstExprList

Warning

This function is not part of the officially public isl API. Use at your own risk.

to_str(self)
Parameters:

selfAstExpr

Returns:

string

Warning

This function is not part of the officially public isl API. Use at your own risk.

AST Node

class islpy.AstNode
__eq__(value, /)

Return self==value.

__hash__()

Return hash(self).

__ne__(value, /)

Return self!=value.

alloc_user = <nanobind.nb_func object>
block_from_children(self)
Parameters:

selfAstNodeList

Returns:

AstNode

Warning

This function is not part of the officially public isl API. Use at your own risk.

block_get_children(self)
Parameters:

selfAstNode

Returns:

AstNodeList

copy(self)
Parameters:

selfAstNode

Returns:

AstNode

Warning

This function is not part of the officially public isl API. Use at your own risk.

dump(self)
Parameters:

selfAstNode

Returns:

None

Warning

This function is not part of the officially public isl API. Use at your own risk.

for_get_body(self)
Parameters:

selfAstNode

Returns:

AstNode

for_get_cond(self)
Parameters:

selfAstNode

Returns:

AstExpr

for_get_inc(self)
Parameters:

selfAstNode

Returns:

AstExpr

for_get_init(self)
Parameters:

selfAstNode

Returns:

AstExpr

for_get_iterator(self)
Parameters:

selfAstNode

Returns:

AstExpr

for_is_degenerate(self)
Parameters:

selfAstNode

Returns:

bool

for_print(self, p, options)
Parameters:
Returns:

Printer

Warning

This function is not part of the officially public isl API. Use at your own risk.

foreach_descendant_top_down(self, fn)
Parameters:
  • selfAstNode

  • fn – callback(node)

Returns:

isl_stat

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_annotation(self)
Parameters:

selfAstNode

Returns:

Id

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_ctx(self)
Parameters:

selfAstNode

Returns:

Context

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_type(self)
Parameters:

selfAstNode

Returns:

isl_ast_node_type

Warning

This function is not part of the officially public isl API. Use at your own risk.

if_get_cond(self)
Parameters:

selfAstNode

Returns:

AstExpr

if_get_else(self)
Parameters:

selfAstNode

Returns:

AstNode

Warning

This function is not part of the officially public isl API. Use at your own risk.

if_get_else_node(self)
Parameters:

selfAstNode

Returns:

AstNode

if_get_then(self)
Parameters:

selfAstNode

Returns:

AstNode

Warning

This function is not part of the officially public isl API. Use at your own risk.

if_get_then_node(self)
Parameters:

selfAstNode

Returns:

AstNode

if_has_else(self)
Parameters:

selfAstNode

Returns:

bool

Warning

This function is not part of the officially public isl API. Use at your own risk.

if_has_else_node(self)
Parameters:

selfAstNode

Returns:

bool

if_print(self, p, options)
Parameters:
Returns:

Printer

Warning

This function is not part of the officially public isl API. Use at your own risk.

map_descendant_bottom_up(self, fn)
Parameters:
  • selfAstNode

  • fn – callback(node)

Returns:

AstNode

mark_get_id(self)
Parameters:

selfAstNode

Returns:

Id

mark_get_node(self)
Parameters:

selfAstNode

Returns:

AstNode

print_(self, p, options)
Parameters:
Returns:

Printer

Warning

This function is not part of the officially public isl API. Use at your own risk.

print_macros(self, p)
Parameters:
Returns:

Printer

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_annotation(self, annotation)
Parameters:
Returns:

AstNode

Warning

This function is not part of the officially public isl API. Use at your own risk.

to_C_str(self)
Parameters:

selfAstNode

Returns:

string

to_list(self)
Parameters:

selfAstNode

Returns:

AstNodeList

to_str(self)
Parameters:

selfAstNode

Returns:

string

Warning

This function is not part of the officially public isl API. Use at your own risk.

user_from_expr = <nanobind.nb_func object>
user_get_expr(self)
Parameters:

selfAstNode

Returns:

AstExpr

AST Build

class islpy.AstBuild
__eq__(value, /)

Return self==value.

__hash__()

Return hash(self).

__ne__(value, /)

Return self!=value.

access_from_multi_pw_aff(self, mpa)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

access_from_pw_multi_aff(self, pma)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

alloc = <nanobind.nb_func object>
ast_from_schedule(self, schedule)
Parameters:
Returns:

AstNode

Warning

This function is not part of the officially public isl API. Use at your own risk.

call_from_multi_pw_aff(self, mpa)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

call_from_pw_multi_aff(self, pma)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

copy(self)
Parameters:

selfAstBuild

Returns:

AstBuild

Warning

This function is not part of the officially public isl API. Use at your own risk.

expr_from_pw_aff(self, pa)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

expr_from_set(self, set)
Parameters:
Returns:

AstExpr

Warning

This function is not part of the officially public isl API. Use at your own risk.

from_context = <nanobind.nb_func object>
get_ctx(self)
Parameters:

selfAstBuild

Returns:

Context

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_schedule(self)
Parameters:

selfAstBuild

Returns:

UnionMap

get_schedule_space(self)
Parameters:

selfAstBuild

Returns:

Space

Warning

This function is not part of the officially public isl API. Use at your own risk.

node_from_schedule(self, schedule)
Parameters:
Returns:

AstNode

Warning

This function is not part of the officially public isl API. Use at your own risk.

node_from_schedule_map(self, schedule)
Parameters:
Returns:

AstNode

restrict(self, set)
Parameters:
Returns:

AstBuild

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_after_each_for(self, fn)
Parameters:
  • selfAstBuild

  • fn – callback(node, build)

Returns:

tuple: (AstBuild, (opaque handle to manage callback lifetime))

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_after_each_mark(self, fn)
Parameters:
  • selfAstBuild

  • fn – callback(node, build)

Returns:

tuple: (AstBuild, (opaque handle to manage callback lifetime))

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_at_each_domain(self, fn)
Parameters:
  • selfAstBuild

  • fn – callback(node, build)

Returns:

tuple: (AstBuild, (opaque handle to manage callback lifetime))

set_before_each_for(self, fn)
Parameters:
  • selfAstBuild

  • fn – callback(build)

Returns:

tuple: (AstBuild, (opaque handle to manage callback lifetime))

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_before_each_mark(self, fn)
Parameters:
  • selfAstBuild

  • fn – callback(mark, build)

Returns:

tuple: (AstBuild, (opaque handle to manage callback lifetime))

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_create_leaf(self, fn)
Parameters:
  • selfAstBuild

  • fn – callback(build)

Returns:

tuple: (AstBuild, (opaque handle to manage callback lifetime))

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_iterators(self, iterators)
Parameters:
Returns:

AstBuild

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_options(self, options)
Parameters:
Returns:

AstBuild

Warning

This function is not part of the officially public isl API. Use at your own risk.

AST Print Options

class islpy.AstPrintOptions
__eq__(value, /)

Return self==value.

__hash__()

Return hash(self).

__ne__(value, /)

Return self!=value.

alloc = <nanobind.nb_func object>
copy(self)
Parameters:

selfAstPrintOptions

Returns:

AstPrintOptions

Warning

This function is not part of the officially public isl API. Use at your own risk.

get_ctx(self)
Parameters:

selfAstPrintOptions

Returns:

Context

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_print_for(self, print_for)
Parameters:
Returns:

tuple: (AstPrintOptions, (opaque handle to manage callback lifetime))

Warning

This function is not part of the officially public isl API. Use at your own risk.

set_print_user(self, print_user)
Parameters:
Returns:

tuple: (AstPrintOptions, (opaque handle to manage callback lifetime))

Warning

This function is not part of the officially public isl API. Use at your own risk.

Canonical Names for Internal Module

class islpy._isl.ast_expr_op_type

See islpy.ast_expr_op_type.

class islpy._isl.ast_expr_type

See islpy.ast_expr_type.

class islpy._isl.ast_node_type

See islpy.ast_node_type.

class islpy._isl.ast_loop_type

See islpy.ast_loop_type.

class islpy._isl.AstExpr

See islpy.AstExpr.

class islpy._isl.AstNode

See islpy.AstNode.

class islpy._isl.AstBuild

See islpy.AstBuild.

class islpy._isl.AstPrintOptions

See islpy.AstPrintOptions.