Liking cljdoc? Tell your friends :D

clojure.core.unify

A unification library for Clojure.

extract-lvars


(extract-lvars form)
(extract-lvars lv-fn form)

Takes a datastructure form and returns a distinct set of the logical variables found within. By default, the lvar? predicate is used to detect nested lvars, but the function also accepts a custom predciate lv-fn to use instead.

Source

flatten-bindings


(flatten-bindings binds)
(flatten-bindings variable? binds)

Flattens recursive bindings in binds to the same ground, if possible. If a variable cannot be resolved then it is left in place.

Source

ignore-variable?


(ignore-variable? sym)

Source

lvar?


(lvar? %1)

Returns true if a symbol represents a core.unify lvar. By default, core.unify expects a symbol starting with ? or just _.

Source

make-occurs-subst-fn


(make-occurs-subst-fn variable-fn)

Given a function to recognize logic variables, returns a function that will attempt to substitute unification bindings between two expressions. This function uses an 'occurs check' to detect cycles.

Source

make-occurs-unifier-fn


(make-occurs-unifier-fn variable-fn)

Given a function to recognize logic variables, returns a function to perform the unification of two expressions. This function uses an 'occurs check' to detect cycles.

Source

make-occurs-unify-fn


(make-occurs-unify-fn variable-fn)

Given a function to recognize logic variables, returns a function to return a bindings map for two expressions. This function uses an 'occurs check' to detect cycles.

Source

make-subst-fn


(make-subst-fn variable-fn)

Given a function to recognize unification variables, returns a function that will attempt to substitute unification bindings between two expressions without an 'occurs check'.

Source

make-unifier-fn


(make-unifier-fn variable-fn)

Given a function to recognize unification variables, returns a function to perform the unification of two expressions without an 'occurs check'.

Source

make-unify-fn


(make-unify-fn variable-fn)

Given a function to recognize unification variables, returns a function to return a bindings map for two expressions without an 'occurs check'.

Source

subst


(subst expression bindings)

Attempts to substitute the logic variables within an expression with their mapped values in bindings.

Source

unifier


(unifier expression1 expression2)

Attempts the entire unification process from garnering the bindings to substituting the appropriate bindings, using an 'occurs check'.

Source

unifier-


(unifier- expression1 expression2)

Attempts the entire unification process from garnering the bindings to substituting the appropriate bindings. This function is not guranteed to terminate if cyclic logic variables are present.

Source

unify


(unify expression1 expression2)

Attempts to unify x and y with the given bindings (if any). May return a map of the unifiers (bindings) found. Will throw if an 'occurs check' determines that the expressions contain cyclic bindings or if the sub-expressions clash.

Source

unify-


(unify- expression1 expression2)

Attempt to unify x and y with the given bindings (if any). May return a map of the unifiers (bindings) found. Will throw if the sub-expressions clash. This function is not guranteed to terminate if cyclic logic variables are present.

Source

wildcard?


(wildcard? form)

Returns true if form starts with a core.unify wildcard. By default, core.unify expects the symbol &.

Source

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close