2015-02-19から1日間の記事一覧

1 Getting Starged 使ってみよう ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

この本は、各章がモジュールになっている hugsを使うことを前提として書いてある(このブログはghciを使っている。ずっと続けられるか、どこかでうまくいかなくなるかは、おいおいわかるはず) Exercise 1.3 以下をprime.hsというファイルで保存 divides d n =…

10 Corecursion ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

ones = 1 : ones -- [1,1,1,1,1,...] nats = 0: map (+1) nats -- [0,1,2,...] nats !! 10^100-2 -- 999999999999999999999...98 odds = 1 : map (+2) odds iterate :: (a -> a) -> a -> [a] iterage f x = x : iterate f (f x) theOnes = iterate id 1 theN…

9 Polynomials 多項式 ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

整数係数多項式 多項式も代数的には「数」なので、自然数・有理数・実数・無理数・複素数の流れで定義拡張できる

2 Talking about Mathematical Objects 数学オブジェクトを語る ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

この章はどちらかというと、論理演算の概論。Haskellで実装できない・しないでよい部分も多いので読むのを基本に。 Connectives 論理演算子の話 and(conjunction),or(disjunction),not(negation),if-then(implication),if-and-only-if=iff(equivalence) GS> …

8 Working with Numbers 数とは何か(自然数、公約数・公倍数、実数、虚数、複素数とか) ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

自然数をカリー入れ子で表し、それを「アラビア数字的自然数」として読み直す(順序のある集合としての1,2,...) 有理数は自然数の組、ただし、分母は0以外 無理数、実数、イプシロン・デルタ論法 複素数の定義。その演算の定義

7 Induction and Recursion 帰納と再帰 ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

数学的帰納法 ペアノの自然数(カリー) 再帰的定義 木構造上の再帰…フラクタルは扱われていないけれど、できるはず

6 Functions 関数 (写像とか一対一対応とか、そういう雰囲気) ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

像、カーネル :l FCT.hs image (\x -> (x-1)*(x-2)) [0..5] coImage (\x -> (x-1)*(x-2)) [0..5] [0]

5 Relations 関係(二項関係、とかそういう『数学的な関係』という意味での関係) ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

関係は、順序を問題にするペアの集合として定まる 関係が持つ性質にはreflexive, irreflexive,symmetric,asymmetric,antisymmetric,transitive,intransitive, pre-order(quasi-order),strict-partial-order,parial-order,linear,total-orderとかがあって、そ…

4 Sets, Types and Lists 集合、型(型理論とかの型?)、リスト ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

値をまとめて持つときに、順序を気にするか、気にしないか べき集合

ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

昨日の記事で48時間でschemeをぱらぱらし始めて、「これは自分に向いていない」とすぐにやめたが… こちらの『The Haskell Road to Logic, Maths and Programming』は自分の読み方に合っている印象が強いので、ぱらぱらしてみる(PDF) The Haskell Road To Log…

3 The Use of Logic: Proof 論理として使う、証明 ぱらぱらめくる『The Haskell Road to Logic, Maths and Programming』

既作成のモジュールを読み込んでみよう この章で作るいろいろは、TUOLP.hsとして保存するとして、その「空バージョン」を以下のように作るとしよう module TUOLP where import TAMO import GS myEven :: Integer -> Bool myEven x | rem x 2 == 0 = True | o…