cuex/ex.h: Expressions
[cuex: Expressions]

Defines

#define cuex_opr(index, arity)
#define cuex_opr_with_ctor(index, arity)   (cuex_opr(index, arity) | CUEX_OPRFLAG_CTOR)
#define cuex_opr_index(opr)   (((opr) & CUEX_OPR_SELECT_MASK) >> CUEX_OPR_SELECT_SHIFT)
#define cuex_opr_sans_arity(opr)   ((opr) & ~CUEX_OPR_ARITY_MASK)
#define cuex_opr_flags(opr)   ((opr) & CUEX_OPR_FLAGS_MASK)
#define cuex_opr_sans_flags(opr)   ((opr) & ~CUEX_OPR_FLAGS_MASK)
#define cuex_opr_has_ctor(opr)   ((opr) & CUEX_OPRFLAG_CTOR)
#define cuex_opr_null   cuex_opr(0, 0)
#define cuex_opn_to_ex(opn)   ((cuex_t)(opn))
#define cuex_opn_from_ex(ex)   ((cuex_opn_t)(ex))

Functions

cu_bool_t cuex_is_opn (cuex_t ex)
cu_bool_t cuex_is_obj (cuex_t ex)
cu_rank_t cuex_opn_r (cuex_opn_t opn)
cuex_t cuex_null ()
cu_bool_t cuex_is_null (cuex_t ex)
cuex_t cuex_unknown ()
cu_bool_t cuex_is_unknown (cuex_t ex)
cu_bool_t cuex_eq (cuex_t ex0, cuex_t ex1)
int cuex_cmp (cuex_t lhs, cuex_t rhs)
cu_bool_t cuex_leq (cuex_t lhs, cuex_t rhs)
cu_bool_t cuex_lt (cuex_t lhs, cuex_t rhs)
cu_bool_t cuex_geq (cuex_t lhs, cuex_t rhs)
cu_bool_t cuex_gt (cuex_t lhs, cuex_t rhs)
cuex_t cuex_min (cuex_t lhs, cuex_t rhs)
cuex_t cuex_max (cuex_t lhs, cuex_t rhs)
cuex_t cuex_uniq (cuex_t ex)

Variables

cuex_t cuexP_null
cuex_t cuexP_unknown

Define Documentation

#define cuex_opr ( index,
arity   ) 
Value:
(((cuex_meta_t)(index) << CUEX_OPR_SELECT_SHIFT) |                      \
     ((cuex_meta_t)(arity) << CUEX_OPR_ARITY_SHIFT) | 1)

Create an operator for cuex_opn_t with arity arity and identified by (index, arity).

#define cuex_opr_null   cuex_opr(0, 0)

Placement for unspecified operator, e.g. as return value. The unique cuex_opn_t expression of this operator can be used as a placement expression. As opposed to NULL, this null-expression can be handled gracefully by expression-traversing functions without special attention, and shall therefore be used instead of NULL in sub-expressions.


Function Documentation

int cuex_cmp ( cuex_t  lhs,
cuex_t  rhs 
)

An ordering classification for expressions used as keys e.g. in ACI expressons, which returns negative for ‘<’, 0 for ‘=’ and positive for ‘>’. Note that the range may not by constrained to {-1, 0, 1}. The ordering is not persistent accross processes. In the future, persistent ordering may be implemented for identifiers.

cu_bool_t cuex_eq ( cuex_t  ex0,
cuex_t  ex1 
)

True iff ex0 and ex1 are structurally equal. This is trivial for hash-consed expressions. (Non-hash-consed expressions are not implemented.)

cu_bool_t cuex_geq ( cuex_t  lhs,
cuex_t  rhs 
)

True iff lhsrhs acconding to cuex_cmp.

cu_bool_t cuex_gt ( cuex_t  lhs,
cuex_t  rhs 
)

True iff lhs > rhs according to cuex_cmp.

cu_bool_t cuex_is_null ( cuex_t  ex  ) 

True iff ex is the null expression.

cu_bool_t cuex_is_obj ( cuex_t  ex  ) 

True iff ex is a dynamic object.

cu_bool_t cuex_is_opn ( cuex_t  ex  ) 

True iff ex is an operation.

cu_bool_t cuex_is_unknown ( cuex_t  ex  ) 

True iff ex is unknown.

cu_bool_t cuex_leq ( cuex_t  lhs,
cuex_t  rhs 
)

True iff lhsrhs according to cuex_cmp.

cu_bool_t cuex_lt ( cuex_t  lhs,
cuex_t  rhs 
)

True iff lhs < rhs according to cuex_cmp.

cuex_t cuex_max ( cuex_t  lhs,
cuex_t  rhs 
)

The maximum of lhs and rhs according to cuex_cmp.

cuex_t cuex_min ( cuex_t  lhs,
cuex_t  rhs 
)

The minimum of lhs and rhs according to cuex_cmp.

cuex_t cuex_null (  ) 

Returns the designated null expression.

cu_rank_t cuex_opn_r ( cuex_opn_t  opn  ) 

The arity of opn.

cuex_t cuex_uniq ( cuex_t  ex  ) 

Turns ex into a hash-consed representation. This is trivial for already hash-consed expressions. (Non-hash-consed expressions are not implemented.)

cuex_t cuex_unknown (  ) 

Returns the designated placement for unknown expressions.

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