Liking cljdoc? Tell your friends :D

cljs.core.logic


*locals*clj

source

*logic-dbs*cljs

source

-fnmclj/smacro

(-fnm fn-gen t as & cs)
source

-incclj/smacro

(-inc & rest)
source

-runclj/smacro

(-run opts [x :as bindings] & goals)
source

==clj/smacro

(== u v)

A goal that attempts to unify terms u and v.

A goal that attempts to unify terms u and v.
sourceraw docstring

allclj/smacro

(all)
(all & goals)

Like fresh but does does not create logic variables.

Like fresh but does does not create logic variables.
sourceraw docstring

all-blank?clj

(all-blank? p)
source

appendocljs

A relation where x, y, and z are proper collections, such that z is x appended to y

A relation where x, y, and z are proper collections, 
such that z is x appended to y
sourceraw docstring

assqcljs

(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
sourceraw docstring

bind*clj/smacro

(bind* a g)
(bind* a g & g-rest)
source

bind-conde-clauseclj

(bind-conde-clause a)
source

bind-conde-clausesclj

(bind-conde-clauses a clauses)
source

binding-mapcljs

(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.
sourceraw docstring

binding-map*cljs

(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.
sourceraw docstring

Choicecljs

source

choicecljs

(choice a f)
source

cond-clausesclj

(cond-clauses a)
source

condaclj/smacro

(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.
sourceraw docstring

condeclj/smacro

(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.
sourceraw docstring

conduclj/smacro

(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.
sourceraw docstring

consocljs

(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
sourceraw docstring

defnaclj/smacro

(defna & rest)

Define a soft cut goal. See conda.

Define a soft cut goal. See conda.
sourceraw docstring

defneclj/smacro

(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.
sourceraw docstring

defnmclj/smacro

(defnm t n & rest)
source

defnuclj/smacro

(defnu & rest)

Define a committed choice goal. See condu.

Define a committed choice goal. See condu.
sourceraw docstring

empty-scljs

source

emptyocljs

(emptyo a)

A relation where a is the empty list

A relation where a is the empty list
sourceraw docstring

env-localsclj

(env-locals & syms)
source

exclj

(ex vs t a)
(ex vs t a exprs)
source

ex*clj

(ex* [[p a :as pa] & par] exprs seen)
source

extract-varsclj

(extract-vars p)
(extract-vars p seen)
source

Failcljs

source

failcljs

(fail a)

A goal that always fails.

A goal that always fails.
sourceraw docstring

failed?cljs

(failed? x)
source

firstocljs

(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
sourceraw docstring

fnaclj/smacro

(fna & rest)

Define an anonymous soft cut goal. See conda.

Define an anonymous soft cut goal. See conda.
sourceraw docstring

fneclj/smacro

(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.
sourceraw docstring

fnmclj/smacro

(fnm t as tabled? & cs)
source

fnuclj/smacro

(fnu & rest)

Define an anonymous committed choice goal. See condu.

Define an anonymous committed choice goal. See condu.
sourceraw docstring

freshclj/smacro

(fresh [& lvars] & goals)

Creates fresh variables. Goals occuring within form a logical conjunction.

Creates fresh variables. Goals occuring within form a logical 
conjunction.
sourceraw docstring

fresh-expr?clj

(fresh-expr? cs)
source

handle-clauseclj

(handle-clause as)
source

handle-clausesclj

(handle-clauses t as cs)
source

IBindcljsprotocol

-bindcljs

(-bind this g)
source

IBuildTermcljsprotocol

-build-termcljs

(-build-term u s)
source

ifa*clj/smacro

(ifa*)
(ifa* [e & gs] & grest)
source

ifu*clj/smacro

(ifu*)
(ifu* [e & gs] & grest)
source

IIfAcljsprotocol

-ifacljs

(-ifa b gs c)
source

IIfUcljsprotocol

-ifucljs

(-ifu b gs c)
source

IMPluscljsprotocol

-mpluscljs

(-mplus a f)
source

Inccljs

source

IOccursCheckTermcljsprotocol

-occurs-check-termcljs

(-occurs-check-term v x s)
source

IReifyTermcljsprotocol

-reify-termcljs

(-reify-term v s)
source

isclj/smacro

(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.
sourceraw docstring

ISubstitutionscljsprotocol

-reify*cljs

(-reify* this v)

-ext-no-checkcljs

(-ext-no-check this u v)

-extcljs

(-ext this u v)

-walkcljs

(-walk this v)

-unifycljs

(-unify this u v)

-walk*cljs

(-walk* this v)

-reifycljs

(-reify this v)

-occurs-checkcljs

(-occurs-check this u v)

-reify-lvar-namecljs

(-reify-lvar-name _)
source

ITakecljsprotocol

-take*cljs

(-take* a)
source

IUnifyTermscljsprotocol

-unify-termscljs

(-unify-terms u v s)
source

IUnifyWithLSeqcljsprotocol

-unify-with-lseqcljs

(-unify-with-lseq v u s)
source

IUnifyWithLVarcljsprotocol

-unify-with-lvarcljs

(-unify-with-lvar v u s)
source

IUnifyWithMapcljsprotocol

-unify-with-mapcljs

(-unify-with-map v u s)
source

IUnifyWithNilcljsprotocol

-unify-with-nilcljs

(-unify-with-nil v u s)
source

IUnifyWithObjectcljsprotocol

-unify-with-objectcljs

(-unify-with-object v u s)
source

IUnifyWithPMapcljsprotocol

unify-with-pmapcljs

(unify-with-pmap pmap u s)
source

IUnifyWithSequentialcljsprotocol

-unify-with-seqcljs

(-unify-with-seq v u s)
source

IWalkTermcljsprotocol

-walk-termcljs

(-walk-term v s)
source

lconscljs

(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.
sourceraw docstring

LConscljs

source

lcons-p?clj

(lcons-p? p)
source

lcons-pr-seqcljs

(lcons-pr-seq x)
source

lcons?cljs

(lcons? x)
source

LConsSeqcljsprotocol

-lnextcljs

(-lnext this)

-lfirstcljs

(-lfirst this)
source

llistclj/smacro

(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.
sourceraw docstring

logclj/smacro

(log & s)

Goal for println

Goal for println
sourceraw docstring

lvarcljs

(lvar)
(lvar name)
source

LVarcljs

source

lvar-bindclj

(lvar-bind sym)
source

lvar-bindsclj

(lvar-binds syms)
source

lvar-sym-countercljs

source

lvar-sym?clj

(lvar-sym? s)
source

lvar?cljs

(lvar? x)
source

lvaroclj/smacro

(lvaro v)

Goal to test whether a logic var is ground. Non-relational.

Goal to test whether a logic var is ground. Non-relational.
sourceraw docstring

make-scljs

(make-s s)
(make-s s c)
source

matchaclj/smacro

(matcha xs & cs)

Define a soft cut pattern match. See conda.

Define a soft cut pattern match. See conda.
sourceraw docstring

matcheclj/smacro

(matche xs & cs)

Pattern matching macro. All patterns will be tried. See conde.

Pattern matching macro. All patterns will be tried.
See conde.
sourceraw docstring

matchuclj/smacro

(matchu xs & cs)

Define a committed choice goal. See condu.

Define a committed choice goal. See condu.
sourceraw docstring

memberocljs

A relation where l is a collection, such that l contains x

A relation where l is a collection, such that l contains x
sourceraw docstring

mpluscljs

(mplus a f)
source

mplus*clj/smacro

(mplus* e)
(mplus* e & e-rest)
source

name-with-attributesclj

(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.
sourceraw docstring

nilocljs

(nilo a)

A relation where a is nil

A relation where a is nil
sourceraw docstring

nonlvaroclj/smacro

(nonlvaro v)

Goal to test whether a logic var is ground. Non-relational.

Goal to test whether a logic var is ground. Non-relational.
sourceraw docstring

not-foundcljs

source

p->llistclj

(p->llist p)
source

paircljs

(pair lhs rhs)
source

Paircljs

source

partial-mapcljs

(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})
sourceraw docstring

PMapcljs

source

predclj/smacro

(pred v f)

Check a predicate against the value logic var. Non-relational.

Check a predicate against the value logic var. Non-relational.
sourceraw docstring

prefixcljs

(prefix s <s)
source

prepcljs

(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.
sourceraw docstring

projectclj/smacro

(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.
sourceraw docstring

project-bindingclj

(project-binding s)
source

project-bindingsclj

(project-bindings vars s)
source

restocljs

(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
sourceraw docstring

runclj/smacro

(run n bindings & goals)

Executes goals until a maximum of n results are found.

Executes goals until a maximum of n results are found.
sourceraw docstring

run*clj/smacro

(run* bindings & goals)

Executes goals until results are exhausted.

Executes goals until results are exhausted.
sourceraw docstring

run-dbclj/smacro

(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.
sourceraw docstring

run-db*clj/smacro

(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.
sourceraw docstring

run-ncclj/smacro

(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.
sourceraw docstring

run-nc*clj/smacro

(run-nc* & goals)

Executes goals until results are exhausted. Does not occurs-check.

Executes goals until results are exhausted. Does not occurs-check.
sourceraw docstring

s#cljs

source

subst?cljs

(subst? x)
source

Substitutionscljs

source

succeedcljs

(succeed a)

A goal that always succeeds.

A goal that always succeeds.
sourceraw docstring

take*cljs

(take* x)
source

to-scljs

(to-s v)
source

to-streamcljs

(to-stream aseq)
source

trace-lvarclj

(trace-lvar a lvar)
source

trace-lvarsclj/smacro

(trace-lvars title & lvars)

Goal for tracing the values of logic variables.

Goal for tracing the values of logic variables.
sourceraw docstring

trace-sclj/smacro

(trace-s)

Goal that prints the current substitution

Goal that prints the current substitution
sourceraw docstring

u#cljs

source

unifiercljs

(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.
sourceraw docstring

unifier*cljs

(unifier* u w)
(unifier* u w & ts)

Unify the terms u and w.

Unify the terms u and w.
sourceraw docstring

unifycljs

(unify s u v)
source

unify-with-map*cljs

(unify-with-map* v u s)
source

walk-term-map*cljs

(walk-term-map* v s)
source

warnclj

(warn & msg)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close