This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
#define MOVE_NONE 0 | |
#define MOVE_LEFT 1 | |
#define MOVE_RIGHT 2 | |
typedef struct Rule { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns turel.core | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn not-membero | |
[x l] | |
(conde [(emptyo l)] | |
[(fresh [head tail] | |
(conso head tail l) | |
(!= head x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns turel.core | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn not-membero | |
[x l] | |
(conde [(emptyo l)] | |
[(fresh [head tail] | |
(conso head tail l) | |
(!= head x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns coins.core | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic) | |
(:require [clojure.core.logic.fd :as fd])) | |
; find possible coin configurations | |
; | |
; $coins = [2, 3, 5, 7, 9]; | |
; $a + ($b * pow($c, 2)) + pow($d, 3) - $e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git init a && cd a && touch hi && git add . && git commit -am 'hi a' && cd .. | |
git clone --bare a b | |
git clone b c && cd c && touch hi-from-c && git add . && git commit -am 'hi from c' && git push && cd .. | |
cd a && git remote add origin ../b && git pull origin master && ls && git log && cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns mu.core | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
(defn i | |
[in out] | |
(conde [(== in [:I]) | |
(== out [:I :U])] | |
[(fresh [in-head out-head] | |
(== in-head out-head) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns pq.core | |
(:refer-clojure :exclude [==]) | |
(:use clojure.core.logic)) | |
; pq system | |
; formal string rewriting system representing addition | |
; from chapter II of Gödel, Escher, Bach by Douglas Hofstadter | |
(defn axiomo | |
[a b c] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use MicroKanren\Core as µ; | |
$goal = µ\callFresh(function ($q) { | |
return µ\disj( | |
µ\eq($q, 'foo'), | |
µ\eq($q, 'lulz') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
use MicroKanren\Core as µ; | |
function membero($x, $l) { | |
return µ\disjPlus( | |
µ\fresh(function ($tail) use ($x, $l) { | |
return µ\eq($l, µ\cons($x, $tail)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$data = <<<'DATA' | |
$program = <<<PROGRAM | |
<?php | |
\$data = <<<'DATA'\n$data\nDATA; | |
$data | |
PROGRAM; | |
$n = 0; | |
if ($n >= 5) { |
OlderNewer