cuex_ivar, cuex_rvar: Indexed Variables
[cuex/var.h: Variables]

Defines

#define cuex_ivarmeta(qcode, index)   cuex_varmeta_kqi(cuex_varkind_ivar, qcode, index)
#define cuex_is_ivarmeta(meta)   cuex_is_varmeta_k(meta, cuex_varkind_ivar)
#define cuex_is_ivarmeta_q(meta, qcode)   cuex_is_varmeta_kq(meta, cuex_varkind_ivar, qcode)
#define cuex_ivar_e(i)   cuex_ivar(cuex_qcode_e, i)
#define cuex_ivar_u(i)   cuex_ivar(cuex_qcode_u, i)
#define cuex_ivar_w(i)   cuex_ivar(cuex_qcode_w, i)
#define cuex_ivar_n(i)   cuex_ivar(cuex_qcode_n, i)
#define cuex_rvarmeta(index)   cuex_varmeta_kqi(cuex_varkind_rvar, cuex_qcode_n, index)
#define cuex_is_rvarmeta(meta)   cuex_is_varmeta_k(meta, cuex_varkind_rvar)
#define cuex_rvar_index(var)   cuex_ivar_index(var)

Functions

cuex_var_t cuex_ivar (cuex_qcode_t qcode, unsigned int index)
unsigned int cuex_ivar_index (cuex_var_t var)
cuex_var_t cuex_rvar (unsigned int index)

Detailed Description

The indexed variables are hash-consed on their meta, which means that two variables of the same kind, quantisation and index are equal. The cuex_rvar variant is used to refer back to components of CUEX_OR_TUPLE on the LHS of a CUEX_O2_RBIND. nodes in recursive expressions. The cuex_ivar variant is useful for de Bruijn indexing of lambda variables.


Define Documentation

#define cuex_is_ivarmeta ( meta   )     cuex_is_varmeta_k(meta, cuex_varkind_ivar)

True iff meta is of an indexed variable of any quantisation.

#define cuex_is_ivarmeta_q ( meta,
qcode   )     cuex_is_varmeta_kq(meta, cuex_varkind_ivar, qcode)

True iff meta is of an indexed variable of quantisation qcode.

#define cuex_is_rvarmeta ( meta   )     cuex_is_varmeta_k(meta, cuex_varkind_rvar)

True iff meta is cuex_rvarmeta(index) for some index.

#define cuex_ivarmeta ( qcode,
index   )     cuex_varmeta_kqi(cuex_varkind_ivar, qcode, index)

The meta of an variable quantified as qcode and indexed with index.

#define cuex_rvar_index ( var   )     cuex_ivar_index(var)

Gives the index of the meta of var. .

#define cuex_rvarmeta ( index   )     cuex_varmeta_kqi(cuex_varkind_rvar, cuex_qcode_n, index)

The meta of a variable used to refer to an operand of CUEX_OR_TUPLE on the LHS of a CUEX_O2_RBIND.


Function Documentation

cuex_var_t cuex_ivar ( cuex_qcode_t  qcode,
unsigned int  index 
)

Create a variable with quantisation quant and an associated integer index.

unsigned int cuex_ivar_index ( cuex_var_t  var  ) 

Gives the index of the meta of var.

cuex_var_t cuex_rvar ( unsigned int  index  ) 

A variable which refers to component index of the LHS CUEX_OR_TUPLE of the closest surrounding CUEX_O2_RBIND node.

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