This file contains hidden or 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
prover> (eval `(trace/dotrace ~(keys (ns-interns 'prover)) (test-prove))) | |
TRACE t8307: (test-prove) | |
TRACE t8308: | (prove #<prover$eval8191$fn__8262 prover$eval8191$fn__8262@aaf5002> (((X = (((N - 1) * N) DIV 2)) and ((1 <= N) and (N <= M))) implies ((X + N) = ((((N + 1) - 1) * (N + 1)) DIV 2)))) | |
TRACE t8309: | | (repeat-apply #<prover$prove$fn__4032 prover$prove$fn__4032@7badb8c8> (((X = (((N - 1) * N) DIV 2)) and ((1 <= N) and (N <= M))) implies ((X + N) = ((((N + 1) - 1) * (N + 1)) DIV 2)))) | |
TRACE t8310: | | | (depth-imp-simp (((X = (((N - 1) * N) DIV 2)) and ((1 <= N) and (N <= M))) implies ((X + N) = ((((N + 1) - 1) * (N + 1)) DIV 2)))) | |
TRACE t8311: | | | | (imp-simp X) | |
TRACE t8312: | | | | | (imp-subst-simp X) | |
TRACE t8312: | | | | | => X | |
TRACE t8313: | | | | | (imp-and-simp X) | |
TRACE t8313: | | | | | => X |
This file contains hidden or 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 custom-client | |
(:require [lamina.core :as lamina] | |
[aleph.http.client :as client])) | |
(defn make-connection [request] ;;http-connection is actually private. | |
(assoc request :connection (client/http-connection request))) | |
(defn enqueue-request [{:keys [connection] :as request}] | |
(lamina/run-pipeline connection |
This file contains hidden or 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
(use '[clojure.test]) | |
(defn powerset | |
([ls] (lazy-seq (cons () (powerset '(()) ls)))) | |
([acc ls] | |
(if (empty? ls) | |
() | |
(let [fs (first ls) | |
added (map #(conj % fs) acc)] | |
(lazy-cat added | |
(powerset (concat acc added) (rest ls))))))) |
This file contains hidden or 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
(use 'clojure.contrib.str-utils) | |
(def digits {"零" 0 "一" 1 "二" 2 "三" 3 "四" 4 "五" 5 "六" 6 "七" 7 "八" 8 "九" 9}) | |
(defn- str-first [s] | |
(str (.charAt s 0))) | |
(defn- trans-ichi [s] | |
(let [n (re-find #"[一二三四五六七八九]$" s)] | |
(if (nil? n) 0 (digits n)))) |
NewerOlder