cuex/iteration.h: Iteration over Subterms
[cuex: Expressions]

Enumerations

enum  cuex_opview_t { CUEX_PREF_VIEW, CUEX_SCOMM_VIEW, CUEX_FCOMM_VIEW }

Functions

cu_bool_t cuex_A_operands (cu_clop(f, cu_bool_t, cuex_t), cuex_t e)
cu_bool_t cuex_A_operands_view (cuex_opview_t view, cu_clop(f, cu_bool_t, cuex_t), cuex_t e)
cu_bool_t cuex_Ak_operands (cu_clop(f, cu_bool_t, int, cuex_t), cuex_t e)
cu_bool_t cuex_Ak_operands_view (cuex_opview_t view, cu_clop(f, cu_bool_t, int, cuex_t), cuex_t e)
cu_bool_t cuex_E_operand (cu_clop(f, cu_bool_t, cuex_t), cuex_t e)
cu_bool_t cuex_bareA_operands (cu_bool_t(*f)(cuex_t), cuex_t e)
cu_bool_t cuex_bareE_operand (cu_bool_t(*f)(cuex_t), cuex_t e)
void cuex_iter_operands (cu_clop(f, void, cuex_t), cuex_t e)
cu_bool_t cuex_iterA_operands (cu_clop(f, cu_bool_t, cuex_t), cuex_t e)
cu_bool_t cuex_iterA_operands_view (cuex_opview_t view, cu_clop(f, cu_bool_t, cuex_t), cuex_t e)
cu_bool_t cuex_iterAk_operands (cu_clop(f, cu_bool_t, int, cuex_t), cuex_t e)
cu_bool_t cuex_iterAk_operands_view (cuex_opview_t view, cu_clop(f, cu_bool_t, int, cuex_t), cuex_t e)
cu_bool_t cuex_iterE_operand (cu_clop(f, cu_bool_t, cuex_t), cuex_t e)
cuex_t cuex_img_operands (cu_clop(f, cuex_t, cuex_t), cuex_t e)
cuex_t cuex_img_operands_view (cuex_opview_t view, cu_clop(f, cuex_t, cuex_t), cuex_t e)
cuex_t cuex_imgk_operands (cu_clop(f, cuex_t, int, cuex_t), cuex_t e)
cuex_t cuex_imgk_operands_view (cuex_opview_t view, cu_clop(f, cuex_t, int, cuex_t), cuex_t e)
cuex_t cuex_bareimg_operands (cuex_t(*f)(cuex_t), cuex_t e)
cuex_t cuex_iterimg_operands (cu_clop(f, cuex_t, cuex_t), cuex_t e)
cuex_t cuex_iterimg_operands_view (cuex_opview_t view, cu_clop(f, cuex_t, cuex_t), cuex_t e)
cuex_t cuex_iterimgk_operands (cu_clop(f, cuex_t, int, cuex_t), cuex_t e)
cuex_t cuex_iterimgk_operands_view (cuex_opview_t view, cu_clop(f, cuex_t, int, cuex_t), cuex_t e)

Detailed Description

The following implements various basic forms of iteration and imaging of expressions, taking into account both plain operations and compounds. Some hints to remember the function names:

Functions ending with _view take a first argument cuex_opview_t, which specifies how the operands are passed to the callback. In particular, operations and non-commutative containers can be given a commutative view. Each operand will then be replaced on the fly by cuex_o2_metapair(ei, eo) where ei is a cudyn_int of the operand number and eo is the original operand. Callbacks to image functions are expected to return the result in the same format.


Enumeration Type Documentation

The compound view specifies how to iterate over or reconstruct operations and compounds.

Enumerator:
CUEX_PREF_VIEW 

Non-commutative view for plain operations, preferred view according to their implementation for compounds.

CUEX_SCOMM_VIEW 

Semi-commutative view, meaning non-commutative for plain operations and commutative for all kinds of compounds.

CUEX_FCOMM_VIEW 

Fully commutative view, meaning commutative for operations as well as compounds.


Function Documentation

cu_bool_t cuex_A_operands ( cu_clop(f, cu_bool_t, cuex_t ,
cuex_t  e 
)

True iff f takes every immediate subexpression of e to true. This is the same as cuex_iterA_operands, but with unordered invocation, and the additional requirement that f is safe for parallel invocation.

cu_bool_t cuex_A_operands_view ( cuex_opview_t  view,
cu_clop(f, cu_bool_t, cuex_t ,
cuex_t  e 
)

Like cuex_A_operands but with a specified view of operands.

cu_bool_t cuex_Ak_operands ( cu_clop(f, cu_bool_t, int, cuex_t ,
cuex_t  e 
)

Like cuex_A_operands but also pass the operand number to f.

cu_bool_t cuex_Ak_operands_view ( cuex_opview_t  view,
cu_clop(f, cu_bool_t, int, cuex_t ,
cuex_t  e 
)

Like cuex_A_operands but also pass the operand number to f and use the specified view of the operands.

cu_bool_t cuex_bareA_operands ( cu_bool_t(*)(cuex_t f,
cuex_t  e 
)

A variant of cuex_A_operands specialised for context-free callbacks.

cu_bool_t cuex_bareE_operand ( cu_bool_t(*)(cuex_t f,
cuex_t  e 
)

A variant of cuex_E_operand specialised for context-free callbacks.

cuex_t cuex_bareimg_operands ( cuex_t(*)(cuex_t f,
cuex_t  e 
)

A variant of cuex_img_operands specialised for context-free callbacks.

cu_bool_t cuex_E_operand ( cu_clop(f, cu_bool_t, cuex_t ,
cuex_t  e 
)

True iff f takes some immediate subexpression of e to true. This is the same as cuex_iterE_operand, but with unordered invocation, and the additional requirement that f is safe for parallel invocation.

cuex_t cuex_img_operands ( cu_clop(f, cuex_t, cuex_t ,
cuex_t  e 
)

Returns the result of replacing each immediate subexpression of e with its mapping under f. This is the same as cuex_iterimg_operands, but with unordered invocation, and the additional requirement that f is safe for parallel invocation.

cuex_t cuex_img_operands_view ( cuex_opview_t  view,
cu_clop(f, cuex_t, cuex_t ,
cuex_t  e 
)

A variant of cuex_img_operands with a specified view of operands.

cuex_t cuex_imgk_operands ( cu_clop(f, cuex_t, int, cuex_t ,
cuex_t  e 
)

As cuex_img_operands but also pass the operand number as the first argument to f.

cuex_t cuex_imgk_operands_view ( cuex_opview_t  view,
cu_clop(f, cuex_t, int, cuex_t ,
cuex_t  e 
)

A variant of cuex_imgk_operands with a specified view of operands.

void cuex_iter_operands ( cu_clop(f, void, cuex_t ,
cuex_t  e 
)

Calls f on each immediate subexpression of e in operand order.

cu_bool_t cuex_iterA_operands ( cu_clop(f, cu_bool_t, cuex_t ,
cuex_t  e 
)

Calls f on each subexpression of e in operand order and builds the conjunction of the results, exiting as soon as f returns false.

cu_bool_t cuex_iterA_operands_view ( cuex_opview_t  view,
cu_clop(f, cu_bool_t, cuex_t ,
cuex_t  e 
)

Like cuex_iterA_operands but using specified view of operands.

cu_bool_t cuex_iterAk_operands ( cu_clop(f, cu_bool_t, int, cuex_t ,
cuex_t  e 
)

Like ref cuex_iterA_operands but also pass the operand number to f.

cu_bool_t cuex_iterAk_operands_view ( cuex_opview_t  view,
cu_clop(f, cu_bool_t, int, cuex_t ,
cuex_t  e 
)

Like cuex_iterA_operands but also pass the operand number to f and use the specified view.

cu_bool_t cuex_iterE_operand ( cu_clop(f, cu_bool_t, cuex_t ,
cuex_t  e 
)

Calls f on each subexpression of e in operand order and builds the disjunction of the results, exiting as soon as f returns true.

cuex_t cuex_iterimg_operands ( cu_clop(f, cuex_t, cuex_t ,
cuex_t  e 
)

Returns the result of replacing each immediate subexpression of e with its mapping under f, where f is called in operand order. If f returns NULL, this function immediately returns NULL, as well.

cuex_t cuex_iterimg_operands_view ( cuex_opview_t  view,
cu_clop(f, cuex_t, cuex_t ,
cuex_t  e 
)

As cuex_iterimg_operands but using a specified of operands.

cuex_t cuex_iterimgk_operands ( cu_clop(f, cuex_t, int, cuex_t ,
cuex_t  e 
)

Like cuex_iterimg_operands but also pass the operand number as the first argument to f.

cuex_t cuex_iterimgk_operands_view ( cuex_opview_t  view,
cu_clop(f, cuex_t, int, cuex_t ,
cuex_t  e 
)

As cuex_iterimgk_operands but using a specified of operands.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.