(== u v)
A goal that attempts to unify terms u and v.
A goal that attempts to unify terms u and v.
(all)
(all & goals)
Like fresh but does does not create logic variables.
Like fresh but does does not create logic variables.
A relation where x, y, and z are proper collections, such that z is y appended to x
A relation where x, y, and z are proper collections, such that z is y appended to x
(assq k xs)
Similar to Scheme assq, xs must be a List of Pairs
Similar to Scheme assq, xs must be a List of Pairs
(binding-map u w)
(binding-map u w & ts)
Return the binding map that unifies terms u and w. Will prep the terms.
Return the binding map that unifies terms u and w. Will prep the terms.
(binding-map* u w)
(binding-map* u w & ts)
Return the binding map that unifies terms u and w. u and w should prepped terms.
Return the binding map that unifies terms u and w. u and w should prepped terms.
(conda & clauses)
Soft cut. Once the head of a clause has succeeded all other clauses will be ignored. Non-relational.
Soft cut. Once the head of a clause has succeeded all other clauses will be ignored. Non-relational.
(conde & clauses)
Logical disjunction of the clauses. The first goal in a clause is considered the head of that clause. Interleaves the execution of the clauses.
Logical disjunction of the clauses. The first goal in a clause is considered the head of that clause. Interleaves the execution of the clauses.
(condu & clauses)
Committed choice. Once the head (first goal) of a clause has succeeded, remaining goals of the clause will only be run once. Non-relational.
Committed choice. Once the head (first goal) of a clause has succeeded, remaining goals of the clause will only be run once. Non-relational.
(conso a d l)
A relation where l is a collection, such that a is the first of l and d is the rest of l
A relation where l is a collection, such that a is the first of l and d is the rest of l
(defna & rest)
Define a soft cut goal. See conda.
Define a soft cut goal. See conda.
(defne & rest)
Define a goal fn. Supports pattern matching. All patterns will be tried. See conde.
Define a goal fn. Supports pattern matching. All patterns will be tried. See conde.
(defnu & rest)
Define a committed choice goal. See condu.
Define a committed choice goal. See condu.
(emptyo a)
A relation where a is the empty list
A relation where a is the empty list
(firsto l a)
A relation where l is a collection, such that a is the first of l
A relation where l is a collection, such that a is the first of l
(fna & rest)
Define an anonymous soft cut goal. See conda.
Define an anonymous soft cut goal. See conda.
(fne & rest)
Define an anonymous goal fn. Supports pattern matching. All patterns will be tried. See conde.
Define an anonymous goal fn. Supports pattern matching. All patterns will be tried. See conde.
(fnu & rest)
Define an anonymous committed choice goal. See condu.
Define an anonymous committed choice goal. See condu.
(fresh [& lvars] & goals)
Creates fresh variables. Goals occuring within form a logical conjunction.
Creates fresh variables. Goals occuring within form a logical conjunction.
(is u v op)
Set the value of a var to value of another var with the operation applied. Non-relational.
Set the value of a var to value of another var with the operation applied. Non-relational.
(-reify* this v)
(-ext-no-check this u v)
(-ext this u v)
(-walk this v)
(-unify this u v)
(-walk* this v)
(-reify this v)
(-occurs-check this u v)
(-reify-lvar-name _)
(lcons a d)
Constructs a sequence a with an improper tail d if d is a logic variable.
Constructs a sequence a with an improper tail d if d is a logic variable.
(llist f s)
(llist f s & rest)
Constructs a sequence from 2 or more arguments, with the last argument as the tail. The tail is improper if the last argument is a logic variable.
Constructs a sequence from 2 or more arguments, with the last argument as the tail. The tail is improper if the last argument is a logic variable.
(lvaro v)
Goal to test whether a logic var is ground. Non-relational.
Goal to test whether a logic var is ground. Non-relational.
(matcha xs & cs)
Define a soft cut pattern match. See conda.
Define a soft cut pattern match. See conda.
(matche xs & cs)
Pattern matching macro. All patterns will be tried. See conde.
Pattern matching macro. All patterns will be tried. See conde.
(matchu xs & cs)
Define a committed choice goal. See condu.
Define a committed choice goal. See condu.
A relation where l is a collection, such that l contains x
A relation where l is a collection, such that l contains x
(name-with-attributes name macro-args)
To be used in macro definitions. Handles optional docstrings and attribute maps for a name to be defined in a list of macro arguments. If the first macro argument is a string it is added as a docstring to name and removed from the macro argument list. If afterwards the first macro argument is a map, its entries are added to the name's metadata map and the map is removed from the macro argument list. The return value is a vector containing the name with its extended metadata map and the list of unprocessed macro arguments.
To be used in macro definitions. Handles optional docstrings and attribute maps for a name to be defined in a list of macro arguments. If the first macro argument is a string it is added as a docstring to name and removed from the macro argument list. If afterwards the first macro argument is a map, its entries are added to the name's metadata map and the map is removed from the macro argument list. The return value is a vector containing the name with its extended metadata map and the list of unprocessed macro arguments.
(nonlvaro v)
Goal to test whether a logic var is ground. Non-relational.
Goal to test whether a logic var is ground. Non-relational.
(partial-map m)
Given map m, returns partial map that unifies with maps even if it doesn't share all of the keys of that map. Only the keys of the partial map will be unified:
(m/run* [q] (m/fresh [pm x] (m/== pm (partial-map {:a x})) (m/== pm {:a 1 :b 2}) (m/== pm q))) ;;=> ({:a 1})
Given map m, returns partial map that unifies with maps even if it doesn't share all of the keys of that map. Only the keys of the partial map will be unified: (m/run* [q] (m/fresh [pm x] (m/== pm (partial-map {:a x})) (m/== pm {:a 1 :b 2}) (m/== pm q))) ;;=> ({:a 1})
(pred v f)
Check a predicate against the value logic var. Non-relational.
Check a predicate against the value logic var. Non-relational.
(prep expr)
Prep a quoted expression. All symbols preceded by ? will be replaced with logic vars.
Prep a quoted expression. All symbols preceded by ? will be replaced with logic vars.
(project [& vars] & goals)
Extract the values bound to the specified logic vars. Non-relational.
Extract the values bound to the specified logic vars. Non-relational.
(resto l d)
A relation where l is a collection, such that d is the rest of l
A relation where l is a collection, such that d is the rest of l
(run n bindings & goals)
Executes goals until a maximum of n results are found.
Executes goals until a maximum of n results are found.
(run* bindings & goals)
Executes goals until results are exhausted.
Executes goals until results are exhausted.
(run-db n db bindings & goals)
Executes goals until a maximum of n results are found. Uses a specified logic database.
Executes goals until a maximum of n results are found. Uses a specified logic database.
(run-db* db bindings & goals)
Executes goals until results are exhausted. Uses a specified logic database.
Executes goals until results are exhausted. Uses a specified logic database.
(run-nc n bindings & goals)
Executes goals until a maximum of n results are found. Does not occurs-check.
Executes goals until a maximum of n results are found. Does not occurs-check.
(run-nc* & goals)
Executes goals until results are exhausted. Does not occurs-check.
Executes goals until results are exhausted. Does not occurs-check.
(trace-lvars title & lvars)
Goal for tracing the values of logic variables.
Goal for tracing the values of logic variables.
(trace-s)
Goal that prints the current substitution
Goal that prints the current substitution
(unifier u w)
(unifier u w & ts)
Unify the terms u and w. Will prep the terms.
Unify the terms u and w. Will prep the terms.
(unifier* u w)
(unifier* u w & ts)
Unify the terms u and w.
Unify the terms u and w.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close