Download the PHP package mudge/php-microkanren without Composer

On this page you can find all versions of the php package mudge/php-microkanren. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-microkanren

PHPµKanren Build Status

A PHP implementation of Jason Hemann and Daniel P. Friedman's µKanren.

Installation

Add the following to your composer.json:

Usage

Inside the MicroKanren\Core namespace, there are implementations of the core µKanren functions as described in the original paper as well as common Lisp primitives needed for their execution. As the reference implementation is in Chez Scheme, this implementation attempts to mimic that particular Lisp as closely as possible.

Lisp Primitives

cons($car, $cdr)

Return a new cons cell with $car and $cdr (this is the most basic primitive for creating lists).

car($alist)

Return the first element of $alist.

cdr($alist)

Return the rest of the $alist.

nil()

Return the empty list. Note that all instances of nil are identical.

isPair($obj)

Return true if $obj is a valid pair (viz. a cons cell that is not the empty list, equivalent to Petite Scheme's pair?).

isNull($obj)

Return true is $obj is the empty list (equivalent to Petite Scheme's null?).

assp($proc, $alist)

"Return the first element of $alist for whose car $proc returns true, or false." — Petite Scheme's assp

alist(...)

A convenience function for constructing cons cells, equivalent to Petite Scheme's list.

length($alist)

Return the length of $alist.

map($proc, $alist)

Return a list resulting in applying $proc to each value in $alist.

µKanren functions

variable($c)

Return a new variable containing an index $c (equivalent to var).

isVariable($x)

Returns true if $x is a variable (equivalent to var?).

isVariableEquals($x1, $x2)

Returns true if $x1 and $x2 refer to the same variable (equivalent to var=?).

mzero()

Return the empty stream (equivalent to mzero).

walk($u, $s)

Searches for a variable's value in the substitution. If a non-variable term is walked, return that term.

extS($x, $v, $s)

Extends the substitution with a new binding (equivalent to ext-s).

unit($sC)

Lifts the state into a stream whose only element is that state.

unify($u, $v, $s)

Unifies two terms in a substitution.

eq($u, $v)

Returns a goal that succeeds if two terms unify in the received state (equivalent to from the paper and == from the reference implementation).

callFresh($f)

Returns a goal given a unary function whose body is a goal (equivalent to call/fresh).

mplus($d1, $d2)

Merges streams.

bind($d, $g)

Invokes a goal on each element of a stream.

disj($g1, $g2)

Returns a goal that succeeds if either of the given goals succeed.

conj($g1, $g2)

Returns a goal that succeeds if both given goals succeed.

emptyState()

Returns a state with an empty substitution and variable index set to 0 (equivalent to empty-state).

pull($d)

Advances a stream until it matures.

takeAll($d)

Returns all results from a stream (equivalent to take-all).

take($n, $d)

Returns a $n results from a stream.

reifyName($n)

Returns a string name for a given number (equivalent to reify-name).

reifyS($v, $s)

Reifies a state's substitution with respect to a variable (equivalent to reify-s).

walkStar($v, $s)

Equivalent to walk*.

reifyFirst($sC)

Equivalent to reify-1st.

See the test suite for more examples of usage.

References

License

Copyright © 2014 Paul Mucur.

Distributed under the MIT License.


All versions of php-microkanren with dependencies

PHP Build Version
Package Version
Requires php Version >= 5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mudge/php-microkanren contains the following files

Loading the files please wait ....