Crate kure2_sys

Crate kure2_sys 

Source

Re-exports§

pub use self::_KureDirection as KureDirection;
pub use self::_KureErrorCode as KureErrorCode;

Structs§

_KureContext
_KureDom
_KureError
_KureParserObserver
_KureRel
__va_list_tag
kure_fun_map_t

Constants§

KURE_DOLLAR_SUBST
KURE_MAJOR_VERSION
KURE_MICRO_VERSION
KURE_MINOR_VERSION
_KureDirection_KURE_DIR_DOWN_LEFT
_KureDirection_KURE_DIR_DOWN_RIGHT
_KureDirection_KURE_DIR_DOWN_UP
_KureDirection_KURE_DIR_LEFT_RIGHT
_KureErrorCode_KURE_ERR_DIFF_CONTEXTS
< Relation are in different contexts.
_KureErrorCode_KURE_ERR_INV_ARG
_KureErrorCode_KURE_ERR_NOT_COMPAT_DIM
< Relations are not compatible. (e.g. mult.)
_KureErrorCode_KURE_ERR_NOT_SAME_DIM
< Relations of same dimension expected. (e.g. and)
_KureErrorCode_KURE_ERR_NUM_TOO_BIG
< A number was too big (>MAX_INT)
_KureErrorCode_KURE_ERR_OUT_OF_BOUNDS
< A given value (e.g. col,row) was out of bounds.
_KureErrorCode_KURE_ERR_SUCCESS

Statics§

kure_fun_map

Functions§

kure_I
Sets the given relation to I, that is, \f$R_{x,y}\iff x=y.\f$
kure_L
Sets the given relation to L, that is, \f$\forall x,y: R_{x,y}\f$.
kure_O
Sets the given relation to O, that is, \f$R:=\emptyset\f$.
kure_all
Same as \ref kure_L.
kure_and
Computes \f$rop_{x,y}\iff arg1_{x,y}\land arg2_{x,y}\f$.
kure_atom
kure_check_version
Check whether a given Kure version number is not less than the version number of the current Kure library.
kure_complement
Computes the complement of a given relation. Afterwards, \f$rop_{x,y}\iff \neg arg_{x,y}\f$.
kure_context_deref
Decreases the context’s reference count and destroys it, if it was 1 before the call.
kure_context_destroy
kure_context_get_error
\return The current error object which may be NULL.
kure_context_get_manager
\return The associated BDD manager. Never returns NULL if the argument is valid.
kure_context_get_random_func
\return The current random number generator. Never returns NULL if the argument is valid.
kure_context_get_random_udata
\return The current user-data for the random number generator. Never returns NULL if the argument is valid.
kure_context_get_refs
Returns the reference count of the given \ref KureContext. Returns 0 if the given argument is NULL.
kure_context_new
Creates a new context with a newly created Cudd Manager. The context has a reference count of zero. You should you the reference counting mechanism to destroy the context.
kure_context_new_with_manager
Creates a new context with the given Cudd Manager. The context has a reference count of zero. You should you the reference counting mechanism to destroy the context.
kure_context_random
Returns a random value with the current random function. This is just a shortcut for:
kure_context_ref
In most situations, reference counting is irrelevant with a \ref KureContext. Like usual, there are operations to increase and decrease the counts and if it reaches 0, the object is destroyed. Alternatively, one can use \ref kure_context_destroy to immediately destroy a context. In such a situation, if the reference count is greater than one, a warning is printed on the screen.
kure_context_set_error
Convenience operation to set the associated \ref KureError object of the given context. See \ref kure_set_error or \ref kure_set_error_va for defails.
kure_context_set_random_func
Sets the current random number generator or resets it if random_func is NULL. In the latter case, udata is ignored completely. Otherwise udata is passed to the random function on each call.
kure_direct_product_new
Creates a new direct product domain where the first type has size n and the second has size m.
kure_direct_product_new_si
Same as \ref kure_direct_product_new, except that it expects integers.
kure_direct_sum
Returns the sum of two relations. The relations arg1 and arg2 need to have the same number of columns. The result contains arg1 at the top and arg2 below.
kure_direct_sum_new
Creates a new direct sum domain where the first type has size n and the second has size m.
kure_direct_sum_new_si
Same as \ref kure_direct_sum_new, except that it expects integers.
kure_dom_destroy
Destroys a given domain.
kure_dom_get_comp
Returns the size of the i-th component of the given domain. The parameter size has to be initialized. Returns TRUE if the size is returned and FALSE in case of an error, e.g. i is an invalid compoenent of self is NULL.
kure_dom_get_comp_count
Returns the number sof components of the given domain. This is usually two.
kure_dom_get_name
Returns the name of the given domains.
kure_dom_new_copy
Create a copy of the given domain.
kure_domain
Computes a vector containing the domain of R, that is, a vector v such that rows(v) = rows(R) and \f$rows(v)x \iff \exists y: R{x,y}\f$.
kure_equals
Tests if the two relations are equal. This test is in O(1).
kure_error_destroy
Destroys a given \ref KureError object which may be NULL.
kure_error_new
Creates a new \ref KureError object, which indicates success (\ref KURE_ERR_SUCCESS). It has no associated message.
kure_get_bit
Returns the status of a given bit.
kure_get_bit_fast
Same as \ref kure_get_bit, except that:
kure_get_bit_fast_si
The faster version of \ref kure_get_bit_si. See \ref kure_get_bit_fast for details.
kure_get_bit_si
Same as \ref kure_get_bit, except that here the row and column are integers of limited size.
kure_get_entries
Counts the numbers of entries in the given relation.
kure_get_entries_si
Same as \ref kure_get_entries, except that the number of entries is returned as a integer of limited size. If the number of entries is doesn’t fit into an integer, psuccess is set to FALSE. A(ny) non-negative number is returned anyway.
kure_identity
Same as \ref kure_I.
kure_includes
Tests if one relation is a subset of another.
kure_inj_1
Create the first injection relation for the direct sum and domains of the given size.
kure_inj_2
Create the second injection relation for the direct sum and domains of the given size.
kure_inj_1_dom
Similar to \ref kure_inj_1, except that here the domain is passed as an object.
kure_inj_1_si
Same as \ref kure_inj_1, except that here the domain sizes are passed as integers.
kure_inj_2_dom
Similar to \ref kure_inj_2, except that here the domain is passed as an object.
kure_inj_2_si
Same as \ref kure_inj_2, except that here the domain sizes are passed as integers.
kure_is_cardeq
Tests if the cardinalities of the given relations are equal.
kure_is_cardleq
Tests if the cardinalities of the given relations are equal (less or equal)
kure_is_cardlt
Tests if the cardinality of a relation is less than the cardinality of another relations (less than).
kure_is_empty
Tests if the given relation is empty, that is, R is equal to the empty set.
kure_is_hom
Tests if the given relation is homogeneous, that is, it has as many rows as it has columns.
kure_is_row_complete_si
Tests if a given line is complete. The line is defined using a single point (x,y). In contrast to most other functions, the column (here x) is the first argument and the rows are the second one. The direction is passed as a \ref KureDirection.
kure_is_univalent
Tests if the given relation is univalent, that is, for each x,y,z we have \f$R_{x,y}\f$ and \f$R_{x,z}\f$ implies \f$y=z\f$.
kure_is_vector
Tests if the given relation is a vector, that is, either is row is empty or filled completely.
kure_lang_assign
Similar to \ref kure_lang_exec, but stores the result in a global Lua variable of the given name. If the global variable is non-NULL it is overwritten. If the call fails, the global Lua variable remains unchanged.
kure_lang_exec
Executes the given expression in the embedded language and returns the resulting relation. Expressions are built from ‘|’,‘&’,‘[.,.]’,‘(’,‘)’, etc. and functions calls. Neither assignments nor definitions of other objects (functions, programs) are allowed. Expressions always return a relation if successful. Otherwise, NULL is returned and *perr is set if perr is different from NULL.
kure_lang_expr_to_lua
kure_lang_load
Loads a given translation unit written in the embedded language into the given \ref lua_State which has to be created using \ref kure_lua_new. Translations units may only contain function and program definitions.
kure_lang_load_file
Loads the contents of the given file using \ref kure_lang_load_file.
kure_lang_parse
Parses the given translation unit. Each time a function or program is parsed the corresponding callback function (if non-NULL) is called and provided the original code as well as the generated Lua code.
kure_lang_parse_file
kure_lang_set_assert_func
Sets the current callback function which is called if an assertion fails. The function is directly called from within Lua and has to take the assertions name as first argument.
kure_lang_to_lua
kure_left_residue
Computes the left residue of R and S, that is: \code rop := S/R = -(-S*R^) \endcode
kure_left_tupling
Returns the left tupling of two relations. The argument rop is set as follows: \f[ \llbracket arg1,arg2]{(a,b),x} \iff arg1{a,x}\land arg2_{b,x},. \f] Is computed using the formula: \f[ \llbracket R,S] = \pi R \cap \rho S,. \f]
kure_less_card
Creates a cardinality comparison relation of a given size. Let n be the number of rows of arg. Then it creates a Relation R with \f$2^n\f$ rows and \f$2^n\f$ columns such that for each pair of vectors v,w with one column we have \f$(v,w)\in R \iff |v| < |w|\f$.
kure_lua_destroy
kure_lua_exec
kure_lua_get_context
kure_lua_get_rel_copy
kure_lua_isdom
kure_lua_isrel
kure_lua_new
Creates a new \ref lua_State which can be used with the Kure-Lua binding and the embedded language afterwards. The returned \ref lua_State has the following properties:
kure_lua_set_dom_copy
kure_lua_set_global_context
Sets the current global \ref KureContext. The context is used in operations where no context is passed explicitly and where it cannot derived from operands. This is mainly the case in the domain-specific embedded language.
kure_lua_set_rel_copy
Creates a global Lua variable which points to a copy of the given relation. In the special case where the given relation has the name $, it is replaced by __dollar. This is a convention to be compatible with RelView. This also holds for \ref kure_lua_get_rel and $.
kure_lua_todom
kure_lua_torel
kure_maxsets
Computes the maximum elements in the vector arg w.r.t. to the is-subset-of relation.
kure_maxsets_downset
Computes the maximum elements in the vector arg w.r.t. to the is-subset-of relation. The vector has to represent a down-set for this to work. If this is not the case or you are unsure, use \ref kure_maxsets instead.
kure_membership
Creates the membership relation for a given size.
kure_minsets
Computes the minimum elements in the vector arg w.r.t. to the is-subset-of relation.
kure_minsets_upset
Computes the minimum elements in the vector arg w.r.t. to the is-subset-of relation. The vector has to represent an up-set for this to work. If this is not the case or you are unsure, use \ref kure_minsets instead.
kure_mult
Multiplies two relations. The relations have to be compatible in dimension. That it, cols(arg1)=rows(arg2). The result has a size rows(arg1) x cols(arg2).
kure_mult_norm_transp
Multiplies two relations and transposes the second of them. The relations have to be compatible in dimension. That it, cols(arg1)=cols(arg2). The result has a size rows(arg1) x rows(arg2).
kure_mult_transp_norm
Multiplies two relations and transposes the first of them. The relations have to be compatible in dimension. That it, rows(arg1)=rows(arg2). The result has a size cols(arg1) x cols(arg2).
kure_mult_transp_transp
Multiplies two relations and transposes both of them. The relations have to be compatible in dimension. That it, rows(arg1)=cols(arg2). The result has a size cols(arg1) x rows(arg2).
kure_null
Same as \ref kure_O.
kure_num_vars
Returns the number of variables necessary for the given number of rows/cols. This function is rarely used outside library. If a relation is present, you should use \ref kure_rel_get_vars_rows and \ref kure_rel_get_vars_cols instead.
kure_or
Computes \f$rop_{x,y}\iff arg1_{x,y}\lor arg2_{x,y}\f$.
kure_partial_funcs
Partial functions. An exact specification is given by the following code: \code int i,j,k,col,factor = 1;
kure_partial_funcs_si
Same as \ref kure_partial_funcs but takes an integer for the second size argument.
kure_product_order
Creates the product order relation, that is, \f$ \pi\cdot arg1\cdot \pi^{T} \land \rho\cdot arg2\cdot \rho^T \f$ where \f$\pi,\rho\f$ are the projection relations of arg1 and arg2 respectively.
kure_proj_1
Creates the first projection for the given domains of size m and n.
kure_proj_2
Creates the second projection for the given domains of size m and n.
kure_proj_1_dom
Similar to \ref kure_proj_1, except that here the domain is passed as an object.
kure_proj_1_si
Same as \ref kure_proj_1, except that here the domain sizes are passed as integers.
kure_proj_2_dom
Similar to \ref kure_proj_2, except that here the domain is passed as an object.
kure_proj_2_si
Same as \ref kure_proj_2, except that here the domain sizes are passed as integers.
kure_random
Creates an arbitrary random relation using the given \ref KureRandomFunc. The result has the same dimension as the input.
kure_random_full
Creates an arbitrary random relation using the given \ref KureRandomFunc and the given size. The result has the specified dimension. See \ref kure_random for details.
kure_random_full_si
Creates an arbitrary random relation using the given \ref KureRandomFunc and the given size. The result has the specified dimension. Same as \ref kure_random_full for integer numbers.
kure_random_no_cycles
Creates a random relation without cycles using the given \ref KureRandomFunc. The result has the same dimension as the input.
kure_random_no_cycles_full
Creates a random relation without cycles using the given \ref KureRandomFunc and the given size. The result has the specified dimension. See \ref kure_random_no_cycles for details.
kure_random_no_cycles_full_si
Create a random relation without cycles using the given \ref KureRandomFunc and the given size. The result has the specified dimension. Same as \ref kure_random_no_cycles_full for integer numbers.
kure_random_no_cycles_simple
Creates a random relation without cycles using the random function of the relation’s \ref KureContext. The result has the same dimension as the input.
kure_random_perm
Creates a random permutation using the given random function. The result has the same dimension as the input. The relation has to be homogeneous.
kure_random_perm_full
Creates a random relation without cycles using the given \ref KureRandomFunc and the given size. The result is homogeneous and has the specified dimension.
kure_random_perm_full_si
Creates a random relation without cycles using the given \ref KureRandomFunc and the given size. The result is homogeneous and has the specified dimension. Same as \ref kure_random_perm_full for integers numbers.
kure_random_perm_simple
Creates a random permutation using the random function of the relation’s \ref KureContext. The result has the same dimension as the input. The relation has to be homogeneous.
kure_random_simple
Creates an arbitrary random relation using the random function of the relation’s \ref KureContext. The result has the same dimension as the input.
kure_refl_hull
Computes the reflexive hull (closure) of the given argument. That is: \code rop := arg | I \endcode \param rop The relation to store the result in. Has to be initialized. \param arg The argument. \return Returns TRUE on success and FALSE on error.
kure_rel_assign_from_string
kure_rel_cols_fits_si
kure_rel_destroy
kure_rel_fits_si
kure_rel_get_bdd
Returns the BDD node currently in use. The node has to be referenced in order to be used externally. Use \ref Cudd_Ref to reference it and use Cudd_RecursiveDeref to dereference it. The \ref DdManager is available from the context (\ref kure_rel_get_context and \ref kure_context_get_manager).
kure_rel_get_cols
kure_rel_get_cols_si
kure_rel_get_context
Returns the relations \ref KureContext object. Never returns NULL.
kure_rel_get_rows
kure_rel_get_rows_si
kure_rel_get_vars_cols
kure_rel_get_vars_rows
kure_rel_new
Returns a new and empty relation with one row and one column in the given \ref KureContext.
kure_rel_new_copy
Returns a copy of the given relation in the same manager.
kure_rel_new_from_bdd
Creates a node relation from the given BDD and the given size. If the function succeeds, the node is references by the relation.
kure_rel_new_from_bdd_si
kure_rel_new_from_string
Creates a relation from the given string data which must not be NULL. The relation is created with the given size. Its contents is set w.r.t the characters in s. The relation is filled line-wise, i.e. the first ‘cols’ relevant characters in s determine the first row of the relation and so on. Only characters one_ch and zero_ch are relevant. Consequently, all others are ignored. This allows to use formating characters like spaces and newlines. Whenever a one_ch character appears in s, the current bit is set in the relation. All other bits remain unset.
kure_rel_new_with_cols
Similar to \ref kure_rel_with_cols, but here the number of columns is given and the rows are set to one.
kure_rel_new_with_proto
Creates an empty relation of a given size. The size, as well as the \ref KureContext, is passed implicitly using the given relation.
kure_rel_new_with_rows
Returns an empty relation with the given number of rows and one column in the given \ref KureContext.
kure_rel_new_with_size
Create an empty relation with the given number of rows and columns in the given \ref KureContext.
kure_rel_new_with_size_si
Similar to \ref kure_rel_new_with_size, but takes the number of rows and columns as integers.
kure_rel_prod_fits_si
kure_rel_read_from_dddmp_file
kure_rel_read_from_dddmp_stream
kure_rel_rows_fits_si
kure_rel_same_dim
kure_rel_set_bdd
Sets the current BDD node of the given relation. Recursively dereferences to old BDD node and references the given node. The caller should dereference the node after this call if it is no longer needed. Use \ref Cudd_Deref if you now what you do and \ref Cudd_RecursiveDeref or \ref Cudd_IterDerefBdd otherwise.
kure_rel_set_size
Sets the size of the given relation.
kure_rel_set_size_si
kure_rel_to_string
Converts the given relation into a string of length rows*cols+rows. Each row is terminated by a newline (‘\n’). If a bit is set one_ch is used and zero_ch otherwise.
kure_rel_write_to_dddmp_file
kure_rel_write_to_dddmp_stream
kure_right_residue
Computes the right residue of R and S, that is: \code rop := R\S = -(R^-S) \endcode
kure_right_tupling
Returns the right tupling of two relations. The argument rop is set as follows: \f[ [arg1,arg2\rrbracket_{a,(x,y)} \iff arg1_{a,x}\land arg2_{a,y},. \f] Is computed using the formula: \f[ [R,S\rrbracket = R \pi^t \cap S \rho^t,. \f]
kure_set_bit
Sets a given bit to yes (TRUE) or no (FALSE).
kure_set_bit_si
Same as \ref kure_set_bit, except that here the row and column are integers of limited size.
kure_set_error
Sets an error if perr is non-NULL. Does nothing otherwise. A \ref gmp_printf compatible operation is used to create the message. The fmt argument may be NULL. In this case the message would be set to “Unknown”.
kure_set_error_va
Does the same as \ref kure_set_error.
kure_set_row
Sets or unsets the given row.
kure_set_row_si
Same as \ref kure_set_row, except that here the row is and integer of limited size.
kure_subsetvec_rel
Filters a sets w.r.t. to a given cardinality contraint. Argument pot has to be a vector of size \f$2^k\f$. Then \f$rop_{w}\f$ iff \f$vec_{w}\land |w|<rows(vec)\f$. E.g. if vec has just 1 row, and pot is L, then only \f$\emptyset\f$ is in rop. If vec is equal to k+1 all elements pass the filter.
kure_successors
\note NOT DOCUMENTED.
kure_successors_si
\note NOT DOCUMENTED.
kure_sum_order
Creates the sum order relation, that is, \f$ \iota^{T}\cdot arg1\cdot \iota \land \kappa^{T}\cdot arg2\cdot \iota \f$ where \f$\iota,\kappa\f$ are the injections relations of arg1 and arg2 respectively.
kure_symm_hull
Computes the symmetric hull (closure) of the given argument. That is: \code rop := arg | arg^ \endcode
kure_symm_quotient
Computes the symmetric quotient of R and S, that is: \code rop := syq(R,S) = (R\S) & (R^/S^) = -(R^*-S) & -(-R^*S) \endcode
kure_total_funcs
Total functions. An exact specification is given by the following code: \code int i,j,k,col,factor = 1;
kure_total_funcs_si
Same as \ref kure_total_funcs but takes an integer for the second size argument.
kure_trans_hull
Computes the transitive hull (closure) of the given argument.
kure_transpose
Computes the transpose of a given relation. Afterwards, \f$rop_{x,y}\iff arg_{y,x}\f$.
kure_tupling
Same as \ref kure_right_tupling, that is, \f$[R,S]=[R,S\rrbracket\f$.
kure_vec_begin
Sets v to the vector where the first row is set and all other rows are unset.
kure_vec_begin_full
Sets v to the vector where the first row is set and all other rows are unset. The vector will have the given number of rows and columns.
kure_vec_begin_full_si
Same a \ref kure_vec_begin_full, except that it uses integer numbers.
kure_vec_get_entries
Returns the number of entries in a vector. This is different from the number of entries in a relation if the vector has more than one column. For a vector an entry is a filled row.
kure_vec_get_entries_si
Same as \ref kure_vec_get_entries, except that here an integer is returned. See also \ref kure_get_entries_si.
kure_vec_inj
kure_vec_next
Sets v to the successor of the given argument. If arg is a point and the i-th row is set than v will be a point with the (i+1)-th row set. If there is no such row v is set to the empty relation.
kure_vec_point
Given a vector arg a vector w is returned s.t. exactly one line in w is filled which is also filled in v. The input v must be non-empty.

Type Aliases§

KureContext
@}
KureDom
Main class for domains. Subclasses are direct products and direct sums.
KureError
KureParserObserver
KureRandomFunc
KureRel
Opaque data type to represent a relation. Relations can be creates using, for instance, \ref kure_rel_new.
Kure_bool
Kure_success
\defgroup ErrorHandling Error Handling
_KureDirection
@}
_KureErrorCode
\addtogroup ErrorHandling
__builtin_va_list
va_list