Skip to content

Instantly share code, notes, and snippets.

View ikedaisuke's full-sized avatar

Ikegami Daisuke ikedaisuke

View GitHub Profile
@ikedaisuke
ikedaisuke / CoqSearchLemmaOnTheFly.md
Last active January 5, 2017 09:41
[Coq] search lemma on the fly

Search lemma on the fly in ProofGeneral

A helm extension for Search command.

/disambiguation/

  • in the text, helm means Emacs-helm
  • not means the HELM library of mathematics.
@ikedaisuke
ikedaisuke / markdown-filter.el
Last active January 28, 2016 03:29
render a markdown document on your browser in real time by impatient-mode and markdown-mode
;; How to use:
;; impatient-mode
;; M-x imp-set-user-filter
;; markdown-filter
;; see also https://github.com/skeeto/impatient-mode
(defun markdown-filter (buffer)
"Render a markdown document on your browser in real time by impatient-mode and markdown-mode."
(princ
(with-temp-buffer
(let ((tempname (buffer-name)))
@ikedaisuke
ikedaisuke / getting-started-magit.md
Last active November 19, 2015 02:08
Emacs の git クライアント magit の個人的なまとめ

Emacs の git クライアント magit の個人的なまとめです。正確かどうかは保証しません。

こんな cheat sheet を参照するくらいなら magit の公式ドキュメント読んだほうがいいと思う。

Magit!

バージョン

git
@ikedaisuke
ikedaisuke / simple-uniq.idr
Last active October 26, 2017 21:38
simple uniq in Idris
-- % idris simple-uniq.idr -o uniq
module Main
getContents : IO String
getContents = go ""
where go : String -> IO String
go s = do case !(feof stdin) of
True => return s
False => do t <- fread stdin
go (s ++ t)
Real world (functional) programming with dependent types!
---------------------------------------------------------
* we want to write a program with /dependent types/
* shallow embedding vs. deep embedding
* we want to prove some properties of each part of the program
* we need reasoning about programs
* especially, a program will run correctly
* interactiton with I/O
* mutable state
* etc.

ぷるーふさみっと2015、ライトニングトーク、ラジオー(仮)の台本

みなさん、こんにちは、「発表者」です。 この番組ではリスナーの皆さんに「定理証明」の話題をお届けいたします。 たぶん、今回が最初で最後だと思います。

これから15分ほどの間、お付き合いくださいませ。

それではさっそくメールを読み上げていきたいと思います。 ラジオネーム「とあるHaskell golfer」さんから質問をいただきました。

@ikedaisuke
ikedaisuke / gist:9a2445879612de12239c
Last active August 29, 2015 14:25
プログラミング言語の基礎概念 p.4 導出システム Nat
; try the following code at http://rise4fun.com/z3/tutorial
; data type Nat
(declare-datatypes () ((Nat zero (succ (pred Nat)))))
; plus as a rule
(declare-fun plus (Nat Nat Nat) Bool)
; rule P-Zero
(assert (forall ((n Nat)) (plus zero n n)))
; rule P-succ
(assert (forall ((m Nat) (n Nat) (r Nat))
(=> (plus m n r) (plus (succ m) n (succ r)))))
@ikedaisuke
ikedaisuke / gist:fc5a93562286d37301c9
Last active August 29, 2015 14:23
Current Trends on Gröbner Bases 関連文書まとめ
# Current Trends on Gröbner Bases 関連文書まとめ
The 8th Mathematical Society of Japan Seasonal Institute
Current Trends on Gröbner Bases
— The 50th Anniversary of Gröbner Bases —
July 1 - July 10, 2015
http://www.math.sci.osaka-u.ac.jp/~msj-si-2015/index.html
@ikedaisuke
ikedaisuke / rose.png
Last active August 29, 2015 14:14
generic rose tree とは
Ruby の Array は関数型プログラミングの List とは違います。
が、Ruby 1.8.7 以上で Enumerable は大きく変わりました。
その結果、関数型プログラミングの文脈における List のかなりのことが、
短いプログラム断片で書けるようになったと理解しています。
関数型プログラミングでは、さらに List を抽象化できます。
その一つが Rose tree [Bird 1998] です。
Ruby でも、このような抽象化があれば役にたつと思います。
@ikedaisuke
ikedaisuke / protocol.jpg
Last active August 29, 2015 13:55
りりろじさんの「よくわかる(かもしれない)トークン問題」を Spin にやってもらいました

説明はあとで(適当に)します。 このファイルを protocol.pml という名前で保存して、次の手順を踏みます:

> spin -a protocol.pml
> gcc pan.c
> ./a.out
> spin -M -t protocol.pml

以上で protocol.pml.ps という PostScript ファイルができあがります。