cuex/labelling.h: Association from Constants to Expressions
[cuex: Expressions]

Defines

#define cuex_labelling_meta()   cuoo_type_to_meta(cuexP_labelling_type)
#define cuex_labelling_type()   cuexP_labelling_type

Functions

cu_bool_t cuex_is_labelling (cuex_t e)
cuex_t cuex_labelling_empty (void)
cu_bool_t cuex_is_labelling_empty (cuex_t e)
cuex_t cuex_labelling_singleton (cuex_t l, cuex_t e)
cuex_t cuex_labelling_by_arglist (cuex_t l, cuex_t e,...)
cuex_t cuex_labelling_insert (cuex_t L, cuex_t l, cuex_t e)
cuex_t cuex_labelling_insert_valist (cuex_t L, va_list va)
cuex_t cuex_labelling_insert_arglist (cuex_t L,...)
cuex_t cuex_labelling_deep_insert (cu_clop(merge, cuex_t, cuex_t, cuex_t), cuex_t L, cuex_t l, cuex_t e)
cuex_t cuex_labelling_find (cuex_t L, cuex_t l)
size_t cuex_labelling_find_index (cuex_t L, cuex_t l)
cuex_t cuex_labelling_erase (cuex_t L, cuex_t l)
cuex_t cuex_labelling_find_erase (cuex_t *L, cuex_t l)
size_t cuex_labelling_card (cuex_t L)
cuex_t cuex_labelling_left_union (cuex_t L0, cuex_t L1)
cuex_t cuex_labelling_deep_union (cu_clop(merge, cuex_t, cuex_t e0, cuex_t e1), cuex_t L0, cuex_t L1)
cuex_t cuex_labelling_disjoint_union (cuex_t L0, cuex_t L1)
cuex_t cuex_labelling_left_isecn (cuex_t L0, cuex_t L1)
cuex_t cuex_labelling_deep_isecn (cu_clop(merge, cuex_t, cuex_t e0, cuex_t e1), cuex_t L0, cuex_t L1)
cu_bool_t cuex_labelling_conj_kv (cuex_t L, cu_clop(f, cu_bool_t, cuex_t l, cuex_t e))
cuex_t cuex_labelling_image (cuex_t L, cu_clop(f, cuex_t, cuex_t e))
cuex_t cuex_labelling_image_kv (cuex_t L, cu_clop(f, cuex_t, cuex_t l, cuex_t e))
cuex_t cuex_labelling_expand_all (cuex_t L)
cuex_t cuex_labelling_contract_all (cuex_t L)
cu_ptr_source_t cuex_labelling_comm_iter_source (cuex_t L)
cu_ptr_source_t cuex_labelling_ncomm_iter_source (cuex_t L)
cu_ptr_junctor_t cuex_labelling_ncomm_image_junctor (cuex_t L)
cu_ptr_sinktor_t cuex_labelling_comm_build_sinktor (void)
cu_ptr_sinktor_t cuex_labelling_comm_union_sinktor (cuex_t L)

Variables

cuoo_type_t cuexP_labelling_type
cuex_t cuexP_labelling_empty

Function Documentation

cu_bool_t cuex_is_labelling ( cuex_t  e  ) 

True iff e is a labelling.

cu_bool_t cuex_is_labelling_empty ( cuex_t  e  ) 

True iff e is the empty labelling.

cuex_t cuex_labelling_by_arglist ( cuex_t  l,
cuex_t  e,
  ... 
)

Given an altering sequence of labels and values terminated by NULL, returns the labelling of the corresponding mapping.

size_t cuex_labelling_card ( cuex_t  L  ) 

Returns the cardinality of L. Note that the complexity is linear.

cu_ptr_sinktor_t cuex_labelling_comm_build_sinktor ( void   ) 

A sinktor for construction a new labelling by unordered insertion of CUEX_O2_METAPAIR nodes and labellings.

cu_ptr_source_t cuex_labelling_comm_iter_source ( cuex_t  L  ) 

Returns an iteration source for the unordered sequence. The implied sequence are CUEX_O2_METAPAIR nodes.

Precondition:
L is a labelling; check with cuex_is_labelling
cu_ptr_sinktor_t cuex_labelling_comm_union_sinktor ( cuex_t  L  ) 

A sinktor for extending a labelling by unordered insertion of CUEX_O2_METAPAIR nodes and labellings.

cu_bool_t cuex_labelling_conj_kv ( cuex_t  L,
cu_clop(f, cu_bool_t, cuex_t l, cuex_t e)   
)

Call f with each label and value of L as long as it returns true, and return false iff an invocation of f returned false.

cuex_t cuex_labelling_deep_insert ( cu_clop(merge, cuex_t, cuex_t, cuex_t ,
cuex_t  L,
cuex_t  l,
cuex_t  e 
)

Returns L with an extra mapping from l to e. If l is already present in L, the existing value v is replaced with merge(v, e).

cuex_t cuex_labelling_deep_isecn ( cu_clop(merge, cuex_t, cuex_t e0, cuex_t e1)  ,
cuex_t  L0,
cuex_t  L1 
)

Forms the intersection of L0 and L1, merging the value part of the elements with merge.

cuex_t cuex_labelling_deep_union ( cu_clop(merge, cuex_t, cuex_t e0, cuex_t e1)  ,
cuex_t  L0,
cuex_t  L1 
)

Forms the union of L0 and L1, merging the value part of common elements with merge.

cuex_t cuex_labelling_disjoint_union ( cuex_t  L0,
cuex_t  L1 
)

Returns the union of L0 and L1 if the labellings are disjoint, NULL otherwise.

cuex_t cuex_labelling_empty ( void   ) 

The empty labelling.

cuex_t cuex_labelling_erase ( cuex_t  L,
cuex_t  l 
)

Returns the result of erasing the mapping from l in L if present, otherwise returns L.

cuex_t cuex_labelling_find ( cuex_t  L,
cuex_t  l 
)

Returns the mapping of l in L, or NULL if none.

cuex_t cuex_labelling_find_erase ( cuex_t L,
cuex_t  l 
)

If l has a mapping if *L, updates *L by erasing it, and returns the value of the mapping, otherwise returns NULL.

size_t cuex_labelling_find_index ( cuex_t  L,
cuex_t  l 
)

Returns the index of l in L, or (size_t)-1 if not found. Note that the complexity of this call is linear in the cardinality of L.

cuex_t cuex_labelling_image ( cuex_t  L,
cu_clop(f, cuex_t, cuex_t e)   
)

Return the labelling where each value of L is transformed by f, which receives the old value and should return the new value. If the label is needed for the transform, see cuex_labelling_image_kv.

cuex_t cuex_labelling_image_kv ( cuex_t  L,
cu_clop(f, cuex_t, cuex_t l, cuex_t e)   
)

Return the labelling where each value of L is transformed by f, which receives the label and the old value and should return the new value.

cuex_t cuex_labelling_insert ( cuex_t  L,
cuex_t  l,
cuex_t  e 
)

The labelling L with the additional mapping from l to e. If L already contains the key l, then L is returned.

cuex_t cuex_labelling_insert_arglist ( cuex_t  L,
  ... 
)

The variable arguments shall be an altering sequence of labels and values terminated by NULL, and this function returns the result of inserting a mapping for each (label, value) pair into L.

cuex_t cuex_labelling_insert_valist ( cuex_t  L,
va_list  va 
)

Assuming va refers to an argument list which contains a altering sequence of pairs of labels and values terminated by NULL, returns the result of inserting a mapping for each pair into L.

cuex_t cuex_labelling_left_isecn ( cuex_t  L0,
cuex_t  L1 
)

Forms the intersection of L0 and L1 considering elements equal if they have the same label. The elements of L0 are used in the result.

cuex_t cuex_labelling_left_union ( cuex_t  L0,
cuex_t  L1 
)

Forms the union of L0 and L1 considering elements equal if they have the same label. For elements present in both labellings, those from L0 are used in the result.

cu_ptr_junctor_t cuex_labelling_ncomm_image_junctor ( cuex_t  L  ) 

A junctor for constructing the image of L, using the ordered view corresponding to cuex_labelling_comm_iter_source. For each element popped from the junctor, at most one must be put back. The labels of the resulting labelling is taken from the original.

cu_ptr_source_t cuex_labelling_ncomm_iter_source ( cuex_t  L  ) 

Returns an iteration source for an ordered sequence of all values mapped by L. The ordering is given by arbitrary fixing the ordering of the labels. The labels are not exposed.

Precondition:
L is a labelling; check with cuex_is_labelling
See also:
cuex_labelling_comm_iter_source
cuex_t cuex_labelling_singleton ( cuex_t  l,
cuex_t  e 
)

A labelling with a single mapping from l to e.

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