Reference: Abstract Syntax Trees

New in version 2014.1.

AST Expression

class islpy.AstExpr
access(self: islpy._isl.AstExpr, indices: islpy._isl.AstExprList)object

access(self, indices)

Parameters
Returns

AstExpr

add(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

add(self, expr2)

Parameters
Returns

AstExpr

address_of(self: islpy._isl.AstExpr)object

address_of(self)

Parameters

selfAstExpr

Returns

AstExpr

and_(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

and_(self, expr2)

Parameters
Returns

AstExpr

and_then(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

and_then(self, expr2)

Parameters
Returns

AstExpr

call(self: islpy._isl.AstExpr, arguments: islpy._isl.AstExprList)object

call(self, arguments)

Parameters
Returns

AstExpr

copy(self: islpy._isl.AstExpr)object

copy(self)

Parameters

selfAstExpr

Returns

AstExpr

div(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

div(self, expr2)

Parameters
Returns

AstExpr

dump(self: islpy._isl.AstExpr)None

dump(self)

Parameters

selfAstExpr

Returns

None

eq(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

eq(self, expr2)

Parameters
Returns

AstExpr

static from_id(id: islpy._isl.Id)object

from_id(id)

Parameters

idId

Returns

AstExpr

static from_val(v: islpy._isl.Val)object

from_val(v)

Parameters

vVal

Returns

AstExpr

ge(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

ge(self, expr2)

Parameters
Returns

AstExpr

get_ctx(self: islpy._isl.AstExpr)object

get_ctx(self)

Parameters

selfAstExpr

Returns

Context

get_id(self: islpy._isl.AstExpr)object

get_id(self)

Parameters

selfAstExpr

Returns

Id

get_op_arg(self: islpy._isl.AstExpr, pos: int)object

get_op_arg(self, pos)

Parameters
Returns

AstExpr

get_op_n_arg(self: islpy._isl.AstExpr)int

get_op_n_arg(self)

Parameters

selfAstExpr

Returns

isl_size

get_op_type(self: islpy._isl.AstExpr) → islpy._isl.ast_expr_op_type

get_op_type(self)

Parameters

selfAstExpr

Returns

isl_ast_expr_op_type

get_type(self: islpy._isl.AstExpr) → islpy._isl.ast_expr_type

get_type(self)

Parameters

selfAstExpr

Returns

isl_ast_expr_type

get_val(self: islpy._isl.AstExpr)object

get_val(self)

Parameters

selfAstExpr

Returns

Val

gt(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

gt(self, expr2)

Parameters
Returns

AstExpr

id_get_id(self: islpy._isl.AstExpr)object

id_get_id(self)

Parameters

selfAstExpr

Returns

Id

int_get_val(self: islpy._isl.AstExpr)object

int_get_val(self)

Parameters

selfAstExpr

Returns

Val

is_equal(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)bool

is_equal(self, expr2)

Parameters
Returns

bool

le(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

le(self, expr2)

Parameters
Returns

AstExpr

lt(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

lt(self, expr2)

Parameters
Returns

AstExpr

mul(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

mul(self, expr2)

Parameters
Returns

AstExpr

neg(self: islpy._isl.AstExpr)object

neg(self)

Parameters

selfAstExpr

Returns

AstExpr

op_get_arg(self: islpy._isl.AstExpr, pos: int)object

op_get_arg(self, pos)

Parameters
Returns

AstExpr

op_get_n_arg(self: islpy._isl.AstExpr)int

op_get_n_arg(self)

Parameters

selfAstExpr

Returns

isl_size

op_get_type(self: islpy._isl.AstExpr) → islpy._isl.ast_expr_op_type

op_get_type(self)

Parameters

selfAstExpr

Returns

isl_ast_expr_op_type

op_type_print_macro(self: islpy._isl.ast_expr_op_type, p: islpy._isl.Printer)object

op_type_print_macro(self, p)

Parameters
Returns

Printer

static op_type_set_print_name(p: islpy._isl.Printer, type: islpy._isl.ast_expr_op_type, name: str)object

op_type_set_print_name(p, type, name)

Parameters
Returns

Printer

or_(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

or_(self, expr2)

Parameters
Returns

AstExpr

or_else(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

or_else(self, expr2)

Parameters
Returns

AstExpr

pdiv_q(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

pdiv_q(self, expr2)

Parameters
Returns

AstExpr

pdiv_r(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

pdiv_r(self, expr2)

Parameters
Returns

AstExpr

print_macros(self: islpy._isl.AstExpr, p: islpy._isl.Printer)object

print_macros(self, p)

Parameters
Returns

Printer

set_op_arg(self: islpy._isl.AstExpr, pos: int, arg: islpy._isl.AstExpr)object

set_op_arg(self, pos, arg)

Parameters
Returns

AstExpr

sub(self: islpy._isl.AstExpr, expr2: islpy._isl.AstExpr)object

sub(self, expr2)

Parameters
Returns

AstExpr

substitute_ids(self: islpy._isl.AstExpr, id2expr: islpy._isl.IdToAstExpr)object

substitute_ids(self, id2expr)

Parameters
Returns

AstExpr

to_C_str(self: islpy._isl.AstExpr)object

to_C_str(self)

Parameters

selfAstExpr

Returns

string

to_str(self: islpy._isl.AstExpr)object

to_str(self)

Parameters

selfAstExpr

Returns

string

AST Node

class islpy.AstNode
static alloc_user(expr: islpy._isl.AstExpr)object

alloc_user(expr)

Parameters

exprAstExpr

Returns

AstNode

block_get_children(self: islpy._isl.AstNode)object

block_get_children(self)

Parameters

selfAstNode

Returns

AstNodeList

copy(self: islpy._isl.AstNode)object

copy(self)

Parameters

selfAstNode

Returns

AstNode

dump(self: islpy._isl.AstNode)None

dump(self)

Parameters

selfAstNode

Returns

None

for_get_body(self: islpy._isl.AstNode)object

for_get_body(self)

Parameters

selfAstNode

Returns

AstNode

for_get_cond(self: islpy._isl.AstNode)object

for_get_cond(self)

Parameters

selfAstNode

Returns

AstExpr

for_get_inc(self: islpy._isl.AstNode)object

for_get_inc(self)

Parameters

selfAstNode

Returns

AstExpr

for_get_init(self: islpy._isl.AstNode)object

for_get_init(self)

Parameters

selfAstNode

Returns

AstExpr

for_get_iterator(self: islpy._isl.AstNode)object

for_get_iterator(self)

Parameters

selfAstNode

Returns

AstExpr

for_is_degenerate(self: islpy._isl.AstNode)bool

for_is_degenerate(self)

Parameters

selfAstNode

Returns

bool

for_print(self: islpy._isl.AstNode, p: islpy._isl.Printer, options: islpy._isl.AstPrintOptions)object

for_print(self, p, options)

Parameters
Returns

Printer

foreach_descendant_top_down(self: islpy._isl.AstNode, fn: object) → islpy._isl.stat

foreach_descendant_top_down(self, fn)

Parameters
  • selfAstNode

  • fn – callback(node)

Returns

isl_stat

get_annotation(self: islpy._isl.AstNode)object

get_annotation(self)

Parameters

selfAstNode

Returns

Id

get_ctx(self: islpy._isl.AstNode)object

get_ctx(self)

Parameters

selfAstNode

Returns

Context

get_type(self: islpy._isl.AstNode) → islpy._isl.ast_node_type

get_type(self)

Parameters

selfAstNode

Returns

isl_ast_node_type

if_get_cond(self: islpy._isl.AstNode)object

if_get_cond(self)

Parameters

selfAstNode

Returns

AstExpr

if_get_else(self: islpy._isl.AstNode)object

if_get_else(self)

Parameters

selfAstNode

Returns

AstNode

if_get_else_node(self: islpy._isl.AstNode)object

if_get_else_node(self)

Parameters

selfAstNode

Returns

AstNode

if_get_then(self: islpy._isl.AstNode)object

if_get_then(self)

Parameters

selfAstNode

Returns

AstNode

if_get_then_node(self: islpy._isl.AstNode)object

if_get_then_node(self)

Parameters

selfAstNode

Returns

AstNode

if_has_else(self: islpy._isl.AstNode)bool

if_has_else(self)

Parameters

selfAstNode

Returns

bool

if_has_else_node(self: islpy._isl.AstNode)bool

if_has_else_node(self)

Parameters

selfAstNode

Returns

bool

if_print(self: islpy._isl.AstNode, p: islpy._isl.Printer, options: islpy._isl.AstPrintOptions)object

if_print(self, p, options)

Parameters
Returns

Printer

mark_get_id(self: islpy._isl.AstNode)object

mark_get_id(self)

Parameters

selfAstNode

Returns

Id

mark_get_node(self: islpy._isl.AstNode)object

mark_get_node(self)

Parameters

selfAstNode

Returns

AstNode

print_(self: islpy._isl.AstNode, p: islpy._isl.Printer, options: islpy._isl.AstPrintOptions)object

print_(self, p, options)

Parameters
Returns

Printer

print_macros(self: islpy._isl.AstNode, p: islpy._isl.Printer)object

print_macros(self, p)

Parameters
Returns

Printer

set_annotation(self: islpy._isl.AstNode, annotation: islpy._isl.Id)object

set_annotation(self, annotation)

Parameters
Returns

AstNode

to_C_str(self: islpy._isl.AstNode)object

to_C_str(self)

Parameters

selfAstNode

Returns

string

to_str(self: islpy._isl.AstNode)object

to_str(self)

Parameters

selfAstNode

Returns

string

user_get_expr(self: islpy._isl.AstNode)object

user_get_expr(self)

Parameters

selfAstNode

Returns

AstExpr

AST Build

class islpy.AstBuild
access_from_multi_pw_aff(self: islpy._isl.AstBuild, mpa: islpy._isl.MultiPwAff)object

access_from_multi_pw_aff(self, mpa)

Parameters
Returns

AstExpr

access_from_pw_multi_aff(self: islpy._isl.AstBuild, pma: islpy._isl.PwMultiAff)object

access_from_pw_multi_aff(self, pma)

Parameters
Returns

AstExpr

static alloc(ctx: islpy._isl.Context)object

alloc(ctx)

Parameters

ctxContext

Returns

AstBuild

ast_from_schedule(self: islpy._isl.AstBuild, schedule: islpy._isl.UnionMap)object

ast_from_schedule(self, schedule)

Parameters
Returns

AstNode

call_from_multi_pw_aff(self: islpy._isl.AstBuild, mpa: islpy._isl.MultiPwAff)object

call_from_multi_pw_aff(self, mpa)

Parameters
Returns

AstExpr

call_from_pw_multi_aff(self: islpy._isl.AstBuild, pma: islpy._isl.PwMultiAff)object

call_from_pw_multi_aff(self, pma)

Parameters
Returns

AstExpr

copy(self: islpy._isl.AstBuild)object

copy(self)

Parameters

selfAstBuild

Returns

AstBuild

expr_from_pw_aff(self: islpy._isl.AstBuild, pa: islpy._isl.PwAff)object

expr_from_pw_aff(self, pa)

Parameters
Returns

AstExpr

expr_from_set(self: islpy._isl.AstBuild, set: islpy._isl.Set)object

expr_from_set(self, set)

Parameters
Returns

AstExpr

static from_context(set: islpy._isl.Set)object

from_context(set)

Parameters

setSet

Returns

AstBuild

get_ctx(self: islpy._isl.AstBuild)object

get_ctx(self)

Parameters

selfAstBuild

Returns

Context

get_schedule(self: islpy._isl.AstBuild)object

get_schedule(self)

Parameters

selfAstBuild

Returns

UnionMap

get_schedule_space(self: islpy._isl.AstBuild)object

get_schedule_space(self)

Parameters

selfAstBuild

Returns

Space

node_from_schedule(self: islpy._isl.AstBuild, schedule: islpy._isl.Schedule)object

node_from_schedule(self, schedule)

Parameters
Returns

AstNode

node_from_schedule_map(self: islpy._isl.AstBuild, schedule: islpy._isl.UnionMap)object

node_from_schedule_map(self, schedule)

Parameters
Returns

AstNode

restrict(self: islpy._isl.AstBuild, set: islpy._isl.Set)object

restrict(self, set)

Parameters
Returns

AstBuild

set_after_each_for(self: islpy._isl.AstBuild, fn: object)object

set_after_each_for(self, fn)

Parameters
  • selfAstBuild

  • fn – callback(node, build)

Returns

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

set_after_each_mark(self: islpy._isl.AstBuild, fn: object)object

set_after_each_mark(self, fn)

Parameters
  • selfAstBuild

  • fn – callback(node, build)

Returns

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

set_at_each_domain(self: islpy._isl.AstBuild, fn: object)object

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: islpy._isl.AstBuild, fn: object)object

set_before_each_for(self, fn)

Parameters
  • selfAstBuild

  • fn – callback(build)

Returns

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

set_before_each_mark(self: islpy._isl.AstBuild, fn: object)object

set_before_each_mark(self, fn)

Parameters
  • selfAstBuild

  • fn – callback(mark, build)

Returns

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

set_create_leaf(self: islpy._isl.AstBuild, fn: object)object

set_create_leaf(self, fn)

Parameters
  • selfAstBuild

  • fn – callback(build)

Returns

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

set_iterators(self: islpy._isl.AstBuild, iterators: islpy._isl.IdList)object

set_iterators(self, iterators)

Parameters
Returns

AstBuild

set_options(self: islpy._isl.AstBuild, options: islpy._isl.UnionMap)object

set_options(self, options)

Parameters
Returns

AstBuild

AST Print Options

class islpy.AstPrintOptions
  • __eq__()

  • __hash__()

  • __ne__()

static alloc(ctx: islpy._isl.Context)object

alloc(ctx)

Parameters

ctxContext

Returns

AstPrintOptions

copy(self: islpy._isl.AstPrintOptions)object

copy(self)

Parameters

selfAstPrintOptions

Returns

AstPrintOptions

get_ctx(self: islpy._isl.AstPrintOptions)object

get_ctx(self)

Parameters

selfAstPrintOptions

Returns

Context

set_print_for(self: islpy._isl.AstPrintOptions, print_for: object)object

set_print_for(self, print_for)

Parameters
Returns

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

set_print_user(self: islpy._isl.AstPrintOptions, print_user: object)object

set_print_user(self, print_user)

Parameters
Returns

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