unifycle

Unifycle is a syntactic unification API for Clojure. Simply put, unification is the process of taking two expressions and substituting all of the variables with matching concrete expressions. The simplest example of this behavior can be illustrated by (unifier '?x 42) ;=> 42 whereby the variable ?x is replaced by the value 42. Unification forms the basis of Prolog’s modus operandi and is often used in applications pertaining to automated reasoning, logic, type systems, and algebra.

example }

(use '[me.fogus.unifycle :only [unifier]])

(unifier '((?a * ?x ** 2) + (?b * ?x) + ?c) 
         '(?z + (4 * 5) + 3))

;=> ((?a * 5 ** 2) + (4 * 5) + 3)

use }

Unifycle is available via Clojars.org. Additional information is available on the offical Unifycle wiki including motivation, use cases, examples, references, and roadmap.

0.7.5