Add a new binding, 'bound', to a unification variable 'alpha'. * If 'alpha' is already bound to a type that doesn't unify with 'bound', then 'false' is returned. * Otherwise variables of 'bound's bindings and 'alpha's bindings (if any) are recursively unified and 'true' is returned. * '*bindings_used' is decremented by the number of pairs of (non-trivial) bindings that are successfully unified.
| 195 | * NULL != bindings_used |
| 196 | */ |
| 197 | static bool applyBinding(unification_var* alpha, binding* bound, size_t* bindings_used) { |
| 198 | unification_cont scratch = {0}; |
| 199 | unification_cont* cont = &scratch; |
| 200 | if (!applyBinding_cont(findRoot(alpha), bound, &cont, bindings_used)) return false; |
| 201 | return NULL == cont || unify_cont(cont, bindings_used); |
| 202 | } |
| 203 | |
| 204 | /* Unify a pair of unification variables. |
| 205 | * If unification fails, then NULL is returned. |
nothing calls this directly
no test coverage detected