MCPcopy Create free account
hub / github.com/ElementsProject/elements / unify

Function unify

src/simplicity/typeInference.c:217–219  ·  view source on GitHub ↗

Unify a pair of unification variables. * If unification fails, then NULL is returned. * If unification is successful, the representative of the equivalence class of unified pair of variables is returned. * If alpha or beta is NULL, then NULL is returned. This allows you to chain calls to 'unify'. * * '*bindings_used' is decremented by the number of pairs of (non-trivial) bindings that are su

Source from the content-addressed store, hash-verified

215 * have their '.rank' fields active.
216 */
217static unification_var* unify(unification_var* alpha, unification_var* beta, size_t* bindings_used) {
218 return alpha && beta ? unify_cont(&(unification_cont){ .alpha = alpha, .beta = beta }, bindings_used) : NULL;
219}
220
221/* Given a census containing a tally of the different tags that occurs in some Simplicity DAG,
222 * return an upper bound on number of extra unification variables, 'extra_var',

Callers 1

typeInferenceFunction · 0.85

Calls 1

unify_contFunction · 0.85

Tested by

no test coverage detected