r3.dvi

Size: px
Start display at page:

Download "r3.dvi"

Transcription

1 / 94 2 (Lisp ) 3 ( ) , cons cons 2 >(cons a b) (A. B).? Lisp (S ) cons 2 car cdr n A B C D nil = (A B C D) nil nil A D E = (A (B C) D E) B C E = (A B C D. E) A B C D B = (A. B) A nil. (A. nil) == (A) (A. (B. (C. nil))) == (A B C D). 1

2 2 Lisp Lisp (1) ( setq!) (2) (3) defun (defun (... &aux...)...) >(defun sisoku (x y &aux wa sa sho seki) (setq wa (+ x y)) (setq sa (- x y)) (setq sho (/ x y)) (setq seki (* x y)) (list wa sa sho seki)) SISOKU >(sisoku 2 3) (5-1 2/3 6) (loop...) (return ) ( nil ) >(defun power (x n &aux result) (setq result 1) (loop (if (< n 1) (return result)) (setq result (* x result)) (setq n (- n 1)))) POWER >(power 2 3) 8? 1 listlen? (read) --- S (print ) --- 2

3 print >(print (a b c)) (A B C) print (A B C) print jijouloop Pascal?? 3 apply listsum? ( ) ( ) + apply : (apply ) >(apply # + ( )) 10? ( #?) 1 funcall funcall >(funcall ) 10 1 apply funcall 2 1 sigmapi 4 eval eval Lisp > x x x eval > (eval x) (x ) > x 3 (setq ) valuelist 3

4 5 Lisp 5.1 Lisp KCL > S (defun xtoplevel (&aux e) (loop (princ "? ") (setq e (read)) (cond ((eq e end) (return)) (t (print (eval e)) (terpri)))))? S end ( ) >(xtoplevel)? (cons a b) (A. B)? (list a b c d e) (A B C D E)? end NIL > Lisp? 5.2 eval eval Lisp eval xeval x ((. ) (. )... (. )) Lisp ((X. A) (Y. 1) (Z A B C)) x a y 1 z? xassoc 4

5 (defun xassoc (x l) (cond ((null l) nil) ((eq (caar l) x) (car l)) (t (xassoc x (cdr l))))) >(setq l ((x. a) (y. 1) (z a b c))) ((X. A) (Y. 1) (Z A B C)) >(xassoc x l) (X. A) >(xassoc z l) (Z A B C) xeval xeval ( eval ) (defun xeval (e a) (cond ((atom e) (cdr (xassoc e a))) (t error))) xeval S error xtoplevel eval (defun xtoplevel (&aux e) (loop (princ "? ") (setq e (read)) (cond ((eq e end) (return)) (t (print (xeval e *env*)) (terpri))))) *env* ( ) *...* Lisp >(setq *env* ((x. a) (y. 1) (z a b c))) ((X. A) (Y. 1) (Z A B C)) >(xtoplevel)? x A? z (A B C)...? t NIL? (quote a) ERROR t nil *env* (t. t) (nil. nil) 5

6 5.2.2 quote quote xeval (defun xeval (e a) (cond ((atom e) (cdr (xassoc e a))) ((atom (car e)) (cond ((eq (car e) quote) (cadr e)) (t error))) (t error))) e quote... e cadr (quote ) >(setq *env* ((x. a) (y. 1) (z a b c) (t. t) (nil. nil))) ((X. A) (Y. 1) (Z A B C) (T. T) (NIL)) >(xtoplevel)? t T? x A? (quote x) X? (quote (a b c)) (A B C)? (a b c) (A B C)? end NIL >?? (quote...) apply... apply xapply xeval 6

7 (defun xeval (e a) (cond ((atom e) (cdr (xassoc e a))) ((atom (car e)) (cond ((eq (car e) quote) (cadr e)) (t (xapply (car e) (xevlis (cdr e) a) a)))) (t (xapply (car e) (xevlis (cdr e) a) a))))? 2 ( quote ) xevlis (defun xevlis (l a) (cond ((null l) nil) (t (cons (xeval (car l) a) (xevlis (cdr l) a))))) > (xevlis (x z y) *env*) (A (A B C) 1)? xapply (defun xapply (f x a) (cond ((eq f car) (caar x)) ((eq f cdr) (cdar x)) ((eq f cons) (cons (car x) (cadr x))) ((eq f atom) (atom (car x))) ((eq f eq) (eq (car x) (cadr x))) (t error))) car x 1 ((car x)) car car? S 5 >(xtoplevel)? (car (a b)) A? (cons x (y z)) (X Y Z)? (cons x (cons y (cons z nil))) (X Y Z)? (eq x x) T lambda Lisp? lambda xpairlis 7

8 (defun xpairlis (x y a) (cond ((null x) a) ((null y) a) (t (cons (cons (car x) (car y)) (xpairlis (cdr x) (cdr y) a))))) a 1 b 3... >(xpairlis (a b) (1 3) *env*) ((A. 1) (B. 3) (X. A) (Y. 1) (Z A B C) (T. T) (NIL)) xapply (defun xapply (f x a) (cond ((eq f car) (caar x)) ((eq f cdr) (cdar x)) ((eq f cons) (cons (car x) (cadr x))) ((eq f atom) (atom (car x))) ((eq f eq) (eq (car x) (cadr x))) ((atom f) error) ((eq (car f) lambda) (xeval (caddr f) (xpairlis (cadr f) x a))) (t error))) (lambda... (xapply (lambda (x) (cons x x)) (a)) (x. a) a y (cons x x)? >(xtoplevel)? ((lambda (x) (cons (cons x nil) nil)) a) ((A)) defun lambda? xapply (atom f) error ((atom f) (xapply (cdr (xassoc f a)) x a)) xapply xtoplevel defun! 8

9 (defun xtoplevel (&aux e) (loop (princ "? ") (setq e (read)) (cond ((eq e end) (return)) ((and (listp e) (eq (car e) defun)) (setq *env* (cons (cons (cadr e) (cons lambda (cddr e))) *env*))) (t (print (xeval e *env*)) (terpri))))) S defun ( lambda ) >(xtoplevel)? (defun f (x y) (cons y x))? (f aa bb) (BB. AA) cond? 1 cond! xeval quote cond (defun xeval (e a) (cond ((atom e) (cdr (xassoc e a))) ((atom (car e)) (cond ((eq (car e) quote) (cadr e)) ((eq (car e) cond) (xevcon (cdr e) a)) (t (xapply (car e) (xevlis (cdr e) a) a)))) (t (xapply (car e) (xevlis (cdr e) a) a)))) xevcon (defun xevcon (l a) (cond ((null l) nil) ((xeval (caar l) a) (xeval (cadar l) a)) (t (xevcon (cdr l) a))))... OK Lisp 9

10 >(xtoplevel)? (defun g (l) (cond (l (cons (cons (car l) (car l)) (g (cdr l)))) (t nil)))? (g (a b c)) ((A. A) (B. B) (C. C))? end NIL (null l) null xeval! Lisp? A 1 3 ( ) Lisp 1 ( + ) Lisp ( ) Q1. Lisp Q2. / Q3. 5 B Lisp 3 3 ( ) CommonLisp Lisp 1 10

11 A: if then else B: loop return loop (while ) C: cond D: E: defun setq 2 if loop print F: Lisp! 1 G: CommonLisp ( ) lambda Lisp (?) H: lambda if ( nlambda ) ndefun I: lambda + list 1 ( llambda ) ldefun J: 2 1 ( flambda ) fdefun K: ( mlambda ) defmacro (defmacro if (x y z) (list cond (list x y) (list t z))) (if (null l) a b) 2 setq (!) 3 (numberp ) 3 11

12 (cond ((null l) a) (t b))... if (!) A4 1. ( / 94 Lisp ) ! 6. 12

r3.dvi

r3.dvi 2012 3 / Lisp(2) 2012.4.19 1 Lisp 1.1 Lisp Lisp (1) (setq) (2) (3) setq defun (defun (... &aux...)...) ( ) ( nil ) [1]> (defun sisoku (x y &aux wa sa sho seki) (setq wa (+ x y)) (setq sa (- x y)) (setq

More information

Microsoft PowerPoint - 2-LispProgramming-full

Microsoft PowerPoint - 2-LispProgramming-full 2013 年 5 月 31 日 Lisp プログラミング入門 西田豊明 Copyright 2013 Toyoaki Nishida All Rights Reserved. 今回あらすじ 1. Lisp の実践的な使い方を学習する. 2. Lisp インタープリタの動かし方, 電卓的使い方, 関数定義, 条件分岐,S 式の基本操作, プログラミング手法, プロトタイピング法などを中心に解説する.

More information

( ) [2] H 4 4! H 4 4! (5 4 3 )= = Fortran C 0 #include <stdio.h> 1 #include

( ) [2] H 4 4! H 4 4! (5 4 3 )= = Fortran C 0 #include <stdio.h> 1 #include J.JSSAC (2006) Vol. 12, No. 3, pp. 3-16 IIJ 2000 8 bit TULIPS KING KISS WINK 1 ( ) Ackermann GC [1] CPU 6502 wada@u-tokyo.ac.jp c 2006 Japan Society for Symbolic and Algebraic Computation 4 12 3 2006 (1943-05-16

More information

(CC Attribution) Lisp 2.1 (Gauche )

(CC Attribution) Lisp 2.1 (Gauche ) http://www.flickr.com/photos/dust/3603580129/ (CC Attribution) Lisp 2.1 (Gauche ) 2 2000EY-Office 3 4 Lisp 5 New York The lisps Sammy Tunis flickr lisp http://www.flickr.com/photos/dust/3603580129/ (CC

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

1. A0 A B A0 A : A1,...,A5 B : B1,...,B 1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 3. 4. 5. A0 A B f : A B 4 (i) f (ii) f (iii) C 2 g, h: C A f g = f h g = h (iv) C 2 g, h: B C g f = h f g = h 4 (1) (i) (iii) (2) (iii) (i) (3) (ii) (iv) (4)

More information

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装

つくって学ぶプログラミング言語 RubyによるScheme処理系の実装 Ruby Scheme 2013-04-16 ( )! SICP *1 ;-) SchemeR SICP MIT * 1 Structure and Interpretaion of Computer Programs 2nd ed.: 2 i SchemeR Ruby Ruby Ruby Ruby & 3.0 Ruby ii https://github.com/ichusrlocalbin/scheme_in_ruby

More information

Microsoft PowerPoint Lisp.ppt [互換モード]

Microsoft PowerPoint Lisp.ppt [互換モード] 櫻井彰人 プログラム言語論 (8) Lisp, 1960 Historical Lisp 展望 古いアイデアには古いものもある 古いアイデアには新しいものもある エレガントな 極めてコンパクトな言語 C とは異世界 : 別の考え方をするよい機会 言語設計における多くの一般的課題を含む 参考文献 McCarthy, Recursive functions of symbolic expressions

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 5 3. 4. 5. A0 (1) A, B A B f K K A ϕ 1, ϕ 2 f ϕ 1 = f ϕ 2 ϕ 1 = ϕ 2 (2) N A 1, A 2, A 3,... N A n X N n X N, A n N n=1 1 A1 d (d 2) A (, k A k = O), A O. f

More information

連立1次方程式Ax=bの解法:公式にしたがって解くのは,計算量大

連立1次方程式Ax=bの解法:公式にしたがって解くのは,計算量大 Common Lisp プログラミング入門 概要 Lisp は記号の構造的な表現である S 式を操作するインタープリタ方式を基調とするプログラミング言語である. ここでは, 思考のツールとしての Lisp を強調した解説を行う.. Lisp のしくみ Lisp で中心となるのは,S 式 (Symbolic Expression) と呼ばれる記号の構造的な表現である.Lisp ユーザはインタープリタを使って,S

More information

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

1. A0 A B A0 A : A1,...,A5 B : B1,...,B 1. A0 A B A0 A : A1,...,A5 B : B1,...,B12 2. 3. 4. 5. A0 A, B Z Z m, n Z m n m, n A m, n B m=n (1) A, B (2) A B = A B = Z/ π : Z Z/ (3) A B Z/ (4) Z/ A, B (5) f : Z Z f(n) = n f = g π g : Z/ Z A, B (6)

More information

6-1

6-1 6-1 (data type) 6-2 6-3 ML, Haskell, Scala Lisp, Prolog (setq x 123) (+ x 456) (setq x "abc") (+ x 456) ; 6-4 ( ) subtype INDEX is INTEGER range -10..10; type DAY is (MON, TUE, WED, THU, FRI, SAT, SUN);

More information

Scheme Hygienic Macro stibear (@stibear1996) 1 Scheme Scheme Lisp Lisp Common Lisp Emacs Lisp Clojure Scheme 1 Lisp Lisp Lisp Lisp Homoiconicity Lisper 2 Common Lisp gensym Scheme Common Lisp Scheme Lisp-1

More information

parser.y 3. node.rb 4. CD-ROM

parser.y 3. node.rb 4. CD-ROM 1. 1 51 2. parser.y 3. node.rb 4. CD-ROM 1 10 2 i 0 i 10 " i i+1 3 for(i = 0; i

More information

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

離散数理工学 第 2回  数え上げの基礎:漸化式の立て方 2 okamotoy@uec.ac.jp 2015 10 20 2015 10 18 15:29 ( ) (2) 2015 10 20 1 / 45 ( ) 1 (10/6) ( ) (10/13) 2 (10/20) 3 ( ) (10/27) (11/3) 4 ( ) (11/10) 5 (11/17) 6 (11/24) 7 (12/1) 8 (12/8) ( ) (2) 2015 10 20

More information

Microsoft PowerPoint - IntroAlgDs-05-7.ppt

Microsoft PowerPoint - IntroAlgDs-05-7.ppt アルゴリズムとデータ構造入門 2005 年 11 月 15 日 アルゴリズムとデータ構造入門 2. データによる抽象の構築 2 Building Abstractions with Data 奥乃 博 具体から抽象へは行けるが 抽象から具体へは行けない ( 畑村洋太郎 直観でわかる数学 岩波書店 ) 1 11 月 15 日 本日のメニュー 2 Building Abstractions with Data

More information

109 i Lisp KVM Java VM Lisp Java Lisp JAKLD KVM Lisp JAKLD Java Lisp KVM API We present a Lisp system that can be downloaded to and used on mobile pho

109 i Lisp KVM Java VM Lisp Java Lisp JAKLD KVM Lisp JAKLD Java Lisp KVM API We present a Lisp system that can be downloaded to and used on mobile pho 109 i Lisp KVM Java VM Lisp Java Lisp JAKLD KVM Lisp JAKLD Java Lisp KVM API We present a Lisp system that can be downloaded to and used on mobile phones. This system was developed as a side-product of

More information

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

離散数理工学 第 2回  数え上げの基礎:漸化式の立て方 2 okamotoy@uec.ac.jp 2014 10 21 2014 10 29 10:48 ( ) (2) 2014 10 21 1 / 44 ( ) 1 (10/7) ( ) (10/14) 2 (10/21) 3 ( ) (10/28) 4 ( ) (11/4) 5 (11/11) 6 (11/18) 7 (11/25) ( ) (2) 2014 10 21 2 / 44 ( ) 8 (12/2)

More information

jakld-lecture13.pptx

jakld-lecture13.pptx 1 大学院情報学研究科知能情報学専攻知能メディア講座音声メディア分野 http://winnie.kuis.kyoto-u.ac.jp/~uno/lecture/10/introalgds/ uno@i.kyoto-u.ac.jp, uno@nue.org TA の居室は総合研究 7 号館 4 階 418 号室 (M1) 奥乃研 音楽情報処理 G (M1) 奥乃研 ロボット聴覚 G (M1) 奥乃研

More information

Jacques Garrigue

Jacques Garrigue Jacques Garrigue Garrigue 1 Garrigue 2 $ print_lines () > for i in $1; do > echo $i > done $ print_lines "a b c" a b c Garrigue 3 Emacs Lisp (defun print-lines (lines) (dolist (str lines) (insert str)

More information

Microsoft PowerPoint - IntroAlgDs-06-8.ppt

Microsoft PowerPoint - IntroAlgDs-06-8.ppt アルゴリズムとデータ構造入門 2006 年 11 月 21 日 アルゴリズムとデータ構造入門 2. データによる抽象の構築 2.2 階層データ構造と閉包性 奥乃博大学院情報学研究科知能情報学専攻知能メディア講座音声メディア分野 http://winnie.kuis.kyoto-u.ac.jp/~okuno/lecture/06/introalgds/ okuno@i.kyoto-u.ac.jp 12

More information

情報科学概論 第1回資料

情報科学概論 第1回資料 1. Excel (C) Hiroshi Pen Fujimori 1 2. (Excel) 2.1 Excel : 2.2Excel Excel (C) Hiroshi Pen Fujimori 2 256 (IV) :C (C 65536 B4 :2 (2 A3 Excel (C) Hiroshi Pen Fujimori 3 Tips: (1) B3 (2) (*1) (3) (4)Word

More information

広報さっぽろ 2016年8月号 厚別区

広報さっぽろ 2016年8月号 厚別区 8/119/10 P 2016 8 11 12 P4 P6 P6 P7 13 P4 14 15 P8 16 P6 17 18 19 20 P4 21 P4 22 P7 23 P6 P7 24 25 26 P4 P4 P6 27 P4 P7 28 P6 29 30 P4 P5 31 P5 P6 2016 9 1 2 3 P4 4 P4 5 P5 6 7 8 P4 9 10 P4 1 b 2 b 3 b

More information

平成27年度三菱重工グループ保険 フルガードくん(シニア)

平成27年度三菱重工グループ保険 フルガードくん(シニア) TEL 0120-004-443 TEL 045-200-6560 TEL 042-761-2328 TEL 0120-539-022 TEL 042-762-0535 TEL 052-565-5211 TEL 077-552-9161 TEL 0120-430-372 TEL 0120-45-9898 TEL 0120-63-0051 TEL 0120-252-892 TEL 083-266-8041

More information

( ) ( ) lex LL(1) LL(1)

( ) ( ) lex LL(1) LL(1) () () lex LL(1) LL(1) http://www.cs.info.mie-u.ac.jp/~toshi/lectures/compiler/ 29 5 14 1 1 () / (front end) (back end) (phase) (pass) 1 2 1 () () var left, right; fun int main() { left = 0; right = 10;

More information

ohp07.dvi

ohp07.dvi 17 7 (2) 2017.9.13 1 BNF BNF ( ) ( ) 0 ( ) + 1 ( ) ( ) [ ] BNF BNF BNF prog ::= ( stat ) stat ::= ident = expr ; read ident ; print expr ; if ( expr ) stat while ( expr ) stat { prog expr ::= term ( +

More information

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I  Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~alse I Exercise on Programming I http://bit.ly/oitprog1 1, 2 of 14 ( RD S ) I 1, 2 of 14 1 / 44 Ruby Ruby ( RD S ) I 1, 2 of 14 2 / 44 7 5 9 2 9 3 3 2 6 5 1 3 2 5 6 4 7 8 4 5 2 7 9 6 4 7 1 3 ( RD S ) I 1, 2

More information

haskell.gby

haskell.gby Haskell 1 2 3 Haskell ( ) 4 Haskell Lisper 5 Haskell = Haskell 6 Haskell Haskell... 7 qsort [8,2,5,1] [1,2,5,8] "Hello, " ++ "world!" "Hello, world!" 1 + 2 div 8 2 (+) 1 2 8 div 2 3 4 map even [1,2,3,4]

More information

Microsoft PowerPoint - IntroAlgDs-05-2.ppt

Microsoft PowerPoint - IntroAlgDs-05-2.ppt アルゴリズムとデータ構造入門 2005 年 10 月 11 日 アルゴリズムとデータ構造入門 1. 手続きによる抽象の構築 1.1 プログラムの要素 奥乃 博 1. TUT Schemeが公開されました. Windowsは動きます. Linux, Cygwin はうまく行かず. 調査中. 2. 随意課題 7の追加 友人の勉学を助け,TAの手伝いをする. 支援した内容を毎回のレポート等で詳細に報告.

More information

51 Lego MindStorms Lisp XS Lego MindStorms 8 CPU RCX RCX Lisp XS XS RCX PC Scheme Lego MindStorms is a robot development kit which makes it possible t

51 Lego MindStorms Lisp XS Lego MindStorms 8 CPU RCX RCX Lisp XS XS RCX PC Scheme Lego MindStorms is a robot development kit which makes it possible t 51 Lego MindStorms Lisp XS Lego MindStorms 8 CPU RCX RCX Lisp XS XS RCX PC Scheme Lego MindStorms is a robot development kit which makes it possible to control one s own robot by attaching various sensors

More information

4 (induction) (mathematical induction) P P(0) P(x) P(x+1) n P(n) 4.1 (inductive definition) A A (basis ) ( ) A (induction step ) A A (closure ) A clos

4 (induction) (mathematical induction) P P(0) P(x) P(x+1) n P(n) 4.1 (inductive definition) A A (basis ) ( ) A (induction step ) A A (closure ) A clos 4 (induction) (mathematical induction) P P(0) P(x) P(x+1) n P(n) 4.1 (inductive definition) A A (basis ) ( ) A (induction step ) A A (closure ) A closure 81 3 A 3 A x A x + A A ( A. ) 3 closure A N 1,

More information

1

1 2 章 1 整数を一つ読み込み, その階乗を計算する RAM プログラムを書け f (n) = n! ( n 0) 何でもよい ( n

More information

Microsoft PowerPoint - 11RubyIntro-No02.ppt [互換モード]

Microsoft PowerPoint - 11RubyIntro-No02.ppt [互換モード] Ruby 入門 東京電機大学櫻井彰人 Ruby とは? Ruby: 松本ゆきひろ氏による (1993) 純粋オブジェクト指向 スクリプト言語 Web プログラムで どんどんポピュラーに Ruby on Rails (http://www.rubyonrails.org/) なぜか きわめて Lisp like 松本行弘 (Matz) Introduction 実行環境 Windows/Unix/Linux/

More information

N88 BASIC 0.3 C: My Documents 0.6: 0.3: (R) (G) : enterreturn : (F) BA- SIC.bas 0.8: (V) 0.9: 0.5:

N88 BASIC 0.3 C: My Documents 0.6: 0.3: (R) (G) : enterreturn : (F) BA- SIC.bas 0.8: (V) 0.9: 0.5: BASIC 20 4 10 0 N88 Basic 1 0.0 N88 Basic..................................... 1 0.1............................................... 3 1 4 2 5 3 6 4 7 5 10 6 13 7 14 0 N88 Basic 0.0 N88 Basic 0.1: N88Basic

More information

Microsoft PowerPoint - IntroAlgDs pptx

Microsoft PowerPoint - IntroAlgDs pptx アルゴリズムとデータ構造入門 -14 2012 年 1 月 8 日 大学院情報学研究科知能情報学専攻 http://winnie.kuis.kyoto-u.ac.jp/~okuno/lecture/11/introalgds/ okuno@i.kyoto-u.ac.jp,okuno@nue.org if mod( 学籍番号の下 3 桁,3) 0 if mod( 学籍番号の下 3 桁,3) 1 if

More information

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool

VDM-SL VDM VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web bool VDM-SL VDM++ 23 6 28 VDM-SL Toolbox VDM++ Toolbox 1 VDM-SL VDM++ Web 2 1 3 1.1............................................... 3 1.1.1 bool......................................... 3 1.1.2 real rat int

More information

2

2 2011.11.11 1 2 MapReduce 3 4 5 6 Functional Functional Programming 7 8 9 10 11 12 13 [10, 20, 30, 40, 50] 0 n n 10 * 0 + 20 * 1 + 30 * 2 + 40 * 3 + 50 *4 = 400 14 10 * 0 + 20 * 1 + 30 * 2 + 40 * 3 + 50

More information

̤Äê

̤Äê SNS 1, IT.,.,.,., SNS,,,..,,.,,,.,.,,. 2 1 6 1.1................................................ 6 1.2................................................ 6 1.3...............................................

More information

Acta Epsilonica Volume 1, Number 3, Pages Received: June 15th, 2016, Accepted: June 22nd, Sxxxxx-Yamashita s Euler s Triangle Note:, 3: R

Acta Epsilonica Volume 1, Number 3, Pages Received: June 15th, 2016, Accepted: June 22nd, Sxxxxx-Yamashita s Euler s Triangle Note:, 3: R Acta Epsilonica Volume 1, Number 3, Pages 53 72. Received: June 15th, 2016, Accepted: June 22nd, 2016. Sxxxxx-Yamashita s Euler s Triangle Note:, 3: R n (x), kymst,. time stamp Sat Jun 27 18:08:25 2015

More information

431 a s a s a s d a s a 10 d s 11 f a 12 g s 13 a 14 a 15

431 a s a s a s d a s a 10 d s 11 f a 12 g s 13 a 14 a 15 431 a s a s a s d a sa 10ds 11fa 12gs 13a 14a 15 a s d f g h a s d 10f 11g a 12h s 13j a 14k s 15 432 433 10 11 12 13 14 15 10 11 12 13 14 15 434 10 11 12 13 14 15 10 11 12 13 14 15 10 11 12 13 14 15 435

More information

2/ 土 :30 11:20 似通った科目名がありますので注意してください. 受験許可されていない科目を解答した場合は無効 整理番号と科目コードは受験許可証とよく照合し正確に記入

2/ 土 :30 11:20 似通った科目名がありますので注意してください. 受験許可されていない科目を解答した場合は無効 整理番号と科目コードは受験許可証とよく照合し正確に記入 2/ 土 28 9 10 10:30 11:20 似通った科目名がありますので注意してください. 受験許可されていない科目を解答した場合は無効 整理番号と科目コードは受験許可証とよく照合し正確に記入 30 10 11 12 00011 00016 01101 02607 02703 (1) AB AB 100 cm 2 3.00 cm 2 9.80 m/s 2 AB A B A 10.0 kg A

More information

Microsoft PowerPoint - IntroAlgDs pptx

Microsoft PowerPoint - IntroAlgDs pptx アルゴリズムとデータ構造入門 -11 2013 年 12 月 17 日 大学院情報学研究科知能情報学専攻 http://winnie.kuis.kyotou.ac.jp/~okuno/lecture/13/introalgds/ okuno@i.kyoto-u.ac.jp if mod( 学籍番号の下 3 桁,3) 0 if mod( 学籍番号の下 3 桁,3) 1 if mod( 学籍番号の下 3

More information

2 Mar Java (2) Java 3 Java (1) Java 19),20) Scheme Java car public static void Lcar(BCI bci) { Object x = bci.vs[bci.vsbase + 1]; if (!(x instan

2 Mar Java (2) Java 3 Java (1) Java 19),20) Scheme Java car public static void Lcar(BCI bci) { Object x = bci.vs[bci.vsbase + 1]; if (!(x instan Vol. 44 No. SIG 4(PRO 17) Mar. 2003 Java Lisp Java Lisp (1) Lisp Java (2) (3) Java Java Lisp Lisp Lisp IEEE Scheme 3,500 100 K A Lisp Driver to Be Embedded in Java Applications Taiichi Yuasa We present

More information

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal

Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS Pascal Pascal Pascal Pascal Free Pascal CPad for Pascal Microsoft Windows OS 2010 10 1 Pascal 2 1.1.......................... 2 1.2.................. 2 1.3........................ 3 2 4 2.1................................

More information

能力を持っている点 リスト (C 言語などでいう配列を強化したようなもので 可変長で入れ子 (nest) 構造をとれるデータの集合 ) を処理できる点 (Lisp の語源は LISt Processor LIStProgramming などと言われています ) などがあります これらの特長が人工知能

能力を持っている点 リスト (C 言語などでいう配列を強化したようなもので 可変長で入れ子 (nest) 構造をとれるデータの集合 ) を処理できる点 (Lisp の語源は LISt Processor LIStProgramming などと言われています ) などがあります これらの特長が人工知能 Lisp,Prolog で N-Queen 問題を解く 工学部情報知能工学科徳永大輔 1. はじめに Lisp Prolog という人工知能の分野で良く使われるプログラミング言語を紹介し 簡単なパズル を解かせてみたいと思います 2. N-Queen 問題 N-Queen 問題というパズルがあります 1 回で上下左右斜めに何マスでも自由に動ける Queen という駒がチェスにはあります ( 将棋でいう飛車

More information

untitled

untitled 30 callcc yhara ( ( ) (1) callcc (2) callcc (3) callcc callcc Continuation callcc (1) (2) (3) (1) (2) (3) (4) class Foo def f p 1 callcc{ cc return cc} p 2 class Bar def initialize @cc = Foo.new.f def

More information

fp.gby

fp.gby 1 1 2 2 3 2 4 5 6 7 8 9 10 11 Haskell 12 13 Haskell 14 15 ( ) 16 ) 30 17 static 18 (IORef) 19 20 OK NG 21 Haskell (+) :: Num a => a -> a -> a sort :: Ord a => [a] -> [a] delete :: Eq a => a -> [a] -> [a]

More information

r1.dvi

r1.dvi Ruby 2009.9.7 1 ( ) --- ( ( ) ( ) 1 --- ( ) 1 ( ) (?) IT 7K( )?? ( ) ( )? IT ( ) --- ( ) 1 ( ) --- ( ) (?) 2-3% Top-Level ICT Professional 5% ICT Professional 10% 100% 50% 20% Devl. Experiment Adv. ICT

More information

compiler-text.dvi

compiler-text.dvi 2018.4 1 2 2.1 1 1 1 1: 1. (source program) 2. (object code) 3. 1 2.2 C if while return C input() output() fun var ( ) main() C (C-Prime) C A B C 2.3 Pascal P 1 C LDC load constant LOD load STR store AOP

More information

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1

ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 More Logic More Types ML/OCaml GADT Jacques Garrigue ( ) Jacques Le Normand (Google) Didier Rémy (INRIA) @garriguejej ocamlgadt ML Edinburgh LCF ML Curry-Howard ML ( ) ( ) ( ) ( ) 1 ( ) ML type nebou and

More information

ホームページ (URL) を開く 閉じる 益永八尋 VBA からホームページを開いたり 閉じたりします ホームページを開くはシート名 HP_Open で操作し ホームページを閉じるはシート名 "HP_Close" で操作します ホームページを開く方法はいくつかありますがここでは 1 例のみを表示します なお これは Web から入手したサンプルプログラムから使い勝手が良いように修正 追加したものです

More information

1 NScripter 1 [ NScripter ] NScripter NScripter 2 nathki bugyo 1 http://www.shuwasystem.co.jp/cgi-bin/detail.cgi?isbn=4-7980-1104-5 2 http://www.pulltop.com/gp04/ 2 NScripter NScripter BASIC ( ) NScLisper

More information

Emacs ML let start ::= exp (1) exp ::= (2) fn id exp (3) ::= (4) (5) ::= id (6) const (7) (exp) (8) let val id = exp in

Emacs ML let start ::= exp (1) exp ::= (2) fn id exp (3) ::= (4) (5) ::= id (6) const (7) (exp) (8) let val id = exp in Emacs, {l06050,sasano}@sic.shibaura-it.ac.jp Eclipse Visual Studio Standard ML Haskell Emacs 1 Eclipse Visual Studio variable not found LR(1) let Emacs Emacs Emacs Java Emacs JDEE [3] JDEE Emacs Java 2

More information

lifedesign_contest_No3

lifedesign_contest_No3 1 3 5 Apple Developer Program 5 AWS 8 Raspberry Pi 14 18 19 { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "sns:createplatformendpoint" ], "Resource": [ ] ] #

More information

Microsoft PowerPoint - 13Kadai.pptx

Microsoft PowerPoint - 13Kadai.pptx 提出 講義での説明を聞いて下さい 櫻井彰人 コンパイラ理論課題 締め切りは 8 月 1 日とします 順不同で できるものをできるだけ多く回答して下さい 電子メールで sakurai あっと ae どっと keio どっと ac どっと jp に送ってください ファイル形式は pdf か MsWord で ただし プログラムはテキストファイルで レポート課題 1 それぞれ 1 問として考えます 電卓

More information

1 4 2 (1) (B4:B6) (2) (B12:B14) (3) 1 (D4:H4) D5:H243 (4) 240 20 (B8:B10) (5) 240 (B8) 0 1

1 4 2 (1) (B4:B6) (2) (B12:B14) (3) 1 (D4:H4) D5:H243 (4) 240 20 (B8:B10) (5) 240 (B8) 0 1 4 1 4 (1) (2) (3) (4) 1 4 2 (1) (B4:B6) (2) (B12:B14) (3) 1 (D4:H4) D5:H243 (4) 240 20 (B8:B10) (5) 240 (B8) 0 1 4 3 2 2.1 2 Excel 2 (A1:A14 D3:H3 B4,B5,B6) B5 0.035 4 4 2.2 3 1 1 B12: =B5+1 B13: =B12

More information

/

/ / 1 UNIX AWK( ) 1.1 AWK AWK AWK A.V.Aho P.J.Weinberger B.W.Kernighan 3 UNIX AWK GNU AWK 1 1.2 1 mkdir ~/data data ( ) cd data 1 98 MS DOS FD 1 2 AWK 2.1 AWK 1 2 1 byte.data 1 byte.data 900 0 750 11 810

More information

新・明解C言語 ポインタ完全攻略

新・明解C言語 ポインタ完全攻略 2 1-1 1-1 /* 1-1 */ 1 int n = 100; int *p = &n; printf(" n %d\n", n); /* n int */ printf("*&n %d\n", *&n); /* *&n int */ printf(" p %p\n", p); /* p int * */ printf("&*p %p\n", &*p); /* &*p int * */ printf("sizeof(n)

More information

n 第1章 章立ての部分は、書式(PC入門大見出し)を使います

n 第1章 章立ての部分は、書式(PC入門大見出し)を使います FORTRAN FORTRAN FORTRAN ) DO DO IF IF FORTRAN FORTRAN(FORmula TRANslator)1956 IBM FORTRAN IV FORTRAN77 Fortran90 FORTRAN77 FORTRAN FORTARN IF, DO C UNIX FORTRAN PASCAL COBOL PL/I BASIC Lisp PROLOG Lisp

More information

jssst-ocaml.mgp

jssst-ocaml.mgp Objective Caml Jacques Garrigue Kyoto University garrigue@kurims.kyoto-u.ac.jp Objective Caml? 2 Objective Caml GC() Standard MLHaskell 3 OCaml () OCaml 5 let let x = 1 + 2 ;; val x : int = 3 ;; val-:

More information

1 2

1 2 ( ) ( ) ( ) 1 2 59 2 21 24 275 43 3 26 486 103 27 28 98 105 104 99 1 48 25 29 72 14 33 11-10 3 11 8 14,663 4 8 1 6.0 8 1 0.7 11-6 27 19 22 71 5 12 22 12 1,356 6 4,397 3 4 11 8 9 5 10 27 17 6 12 22 9

More information

1.ppt

1.ppt /* * Program name: hello.c */ #include int main() { printf( hello, world\n ); return 0; /* * Program name: Hello.java */ import java.io.*; class Hello { public static void main(string[] arg)

More information

Taro-Basicの基礎・条件分岐(公

Taro-Basicの基礎・条件分岐(公 0. 目次 3. 条件分岐 3. 1 If 文 3. 1. 1 処理を分岐する方法 3. 1. 2 処理を 2 つに分岐する方法 3. 1. 3 処理を 3 つ以上に分岐する方法 3. 2 Select Case 文 - 1 - 3. 条件分岐 条件により ある 文 を実行したりしなかったりするとき If 文を使う たとえば ある変数の値により 奇数 と表示したり 偶数 と表示したりするような処理ができる

More information

PX-047A Series

PX-047A Series B K L & L & A B C D E F A B A B C A B C A B A B A B C D E F G P BB H I y y & & K L L & & K L L L L & & & & L d L & & & & L L & & & L & & & & L & & & & & & & & L L L L L L & & & A B C D E F G

More information

AJAN IO制御コマンド コマンドリファレンス

AJAN IO制御コマンド コマンドリファレンス - 1 - Interface Corporation 1 3 2 4 2.1...4 2.2...8 2.3...9 2.4...19 2.5...20 3 21 3.1...21 3.2...23 3.3...24 3.4...28 3.5...29 30 31 Interface Corporation - 2 - 1 AJANI/O Linux Web site GPG-2000 http://www.interface.co.jp/catalog/soft/prdc_soft_all.asp?name=gpg-2000

More information

C言語によるアルゴリズムとデータ構造

C言語によるアルゴリズムとデータ構造 Algorithms and Data Structures in C 4 algorithm List - /* */ #include List - int main(void) { int a, b, c; int max; /* */ Ÿ 3Ÿ 2Ÿ 3 printf(""); printf(""); printf(""); scanf("%d", &a); scanf("%d",

More information

Boo Boo 2 Boo 2.NET Framework SDK 2 Subversion 2 2 Java 4 NAnt 5 Boo 5 5 Boo if 11 for 11 range 12 break continue 13 pass

Boo Boo 2 Boo 2.NET Framework SDK 2 Subversion 2 2 Java 4 NAnt 5 Boo 5 5 Boo if 11 for 11 range 12 break continue 13 pass Boo Boo 2 Boo 2.NET Framework SDK 2 Subversion 2 2 Java 4 NAnt 5 Boo 5 5 Boo 6 6 7 9 10 11 if 11 for 11 range 12 break continue 13 pass 13 13 14 15 15 23 23 24 24 24 25 import 26 27-1- Boo Boo Python CLI.NET

More information

コンピュータ概論

コンピュータ概論 4.1 For Check Point 1. For 2. 4.1.1 For (For) For = To Step (Next) 4.1.1 Next 4.1.1 4.1.2 1 i 10 For Next Cells(i,1) Cells(1, 1) Cells(2, 1) Cells(10, 1) 4.1.2 50 1. 2 1 10 3. 0 360 10 sin() 4.1.2 For

More information

11042 計算機言語7回目 サポートページ:

11042 計算機言語7回目  サポートページ: 11042 7 :https://goo.gl/678wgm November 27, 2017 10/2 1(print, ) 10/16 2(2, ) 10/23 (3 ) 10/31( ),11/6 (4 ) 11/13,, 1 (5 6 ) 11/20,, 2 (5 6 ) 11/27 (7 12/4 (9 ) 12/11 1 (10 ) 12/18 2 (10 ) 12/25 3 (11

More information

untitled

untitled II 4 Yacc Lex 2005 : 0 1 Yacc 20 Lex 1 20 traverse 1 %% 2 [0-9]+ { yylval.val = atoi((char*)yytext); return NUM; 3 "+" { return + ; 4 "*" { return * ; 5 "-" { return - ; 6 "/" { return / ; 7 [ \t] { /*

More information

3 ( 9 ) ( 13 ) ( ) 4 ( ) (3379 ) ( ) 2 ( ) 5 33 ( 3 ) ( ) 6 10 () 7 ( 4 ) ( ) ( ) 8 3() 2 ( ) 9 81

3 ( 9 ) ( 13 ) ( ) 4 ( ) (3379 ) ( ) 2 ( ) 5 33 ( 3 ) ( ) 6 10 () 7 ( 4 ) ( ) ( ) 8 3() 2 ( ) 9 81 1 ( 1 8 ) 2 ( 9 23 ) 3 ( 24 32 ) 4 ( 33 35 ) 1 9 3 28 3 () 1 (25201 ) 421 5 ()45 (25338 )(2540 )(1230 ) (89 ) () 2 () 3 ( ) 2 ( 1 ) 3 ( 2 ) 4 3 ( 9 ) ( 13 ) ( ) 4 ( 43100 ) (3379 ) ( ) 2 ( ) 5 33 ( 3 )

More information

Lesson 1 1 EXVBA2000 Lesson01 Lesson01.xls 2

Lesson 1 1 EXVBA2000 Lesson01 Lesson01.xls 2 Excel2000VBA L e a r n i n g S c h o o l 1 Lesson 1 1 EXVBA2000 Lesson01 Lesson01.xls 2 3 Module1:(General)- Public Sub () Dim WS As Object Dim DiffDate As Integer Dim MaxRows As Integer, CopyRows As Integer

More information

Parametric Polymorphism

Parametric Polymorphism ML 2 2011/04/19 Parametric Polymorphism Type Polymorphism ? : val hd_int : int list - > int val hd_bool : bool list - > bool val hd_i_x_b : (int * bool) list - > int * bool etc. let hd_int = function (x

More information

1 Ex Ex. 2 2

1 Ex Ex. 2 2 I 20 100 85 40 85 PDF Windows TA ruby TA6 2 8 1. 2. PDF 3. PDF 1 Ex. 1 2 2 Ex. 2 2 2 Ex. 3 seisu = Array.new(3, 0) seisu[0] = gets.chomp.to_i seisu[1] = gets.chomp.to_i seisu[2] = gets.chomp.to_i wa =

More information

2011.12.3 1 2 Q) A) 3 Q) A) 4 5 6 Haskell 7 8 Parser data Parser a = Parser (String -> [(a,string)]) Parser pwrap :: a -> Parser a pwrap v = Parser $ \inp -> [(v,inp)] Parser pbind :: Parser a -> (a ->

More information

(search: ) [1] ( ) 2 (linear search) (sequential search) 1

(search: ) [1] ( ) 2 (linear search) (sequential search) 1 2005 11 14 1 1.1 2 1.2 (search:) [1] () 2 (linear search) (sequential search) 1 2.1 2.1.1 List 2-1(p.37) 1 1 13 n

More information

AccessVBA−‹ŠpŁÒ-flO“Z

AccessVBA−‹ŠpŁÒ-flO“Z Microsoft Access 1 2 Private Sub After5days_Click( ) msg = Date + 5 MsgBox mag End Sub 3 Me.Filter = " =' " & Me! & "'" 4 5 Private Sub _Click() If IsNull(Me!) Then MsgBox " " Me!.SetFocus Me!.Dropdown

More information

3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200,

3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200, WEB DB PRESS Vol.1 79 3 Powered by mod_perl, Apache & MySQL use Item; my $item = Item->new( id => 1, name => ' ', price => 1200, http://www.postgresql.org/http://www.jp.postgresql.org/ 80 WEB DB PRESS

More information

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 初版 1 刷発行時のものです.

Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます.   このサンプルページの内容は, 初版 1 刷発行時のものです. Excel ではじめる数値解析 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. http://www.morikita.co.jp/books/mid/009631 このサンプルページの内容は, 初版 1 刷発行時のものです. Excel URL http://www.morikita.co.jp/books/mid/009631 i Microsoft Windows

More information

&

& & & & c & B & c & & aa c c a a nk a a & a aa aaa & A A A A & 7 & & c og og & c c k g a og ok c c & 7 7 n & aa & & & & & & & & & & & g & & a a & & 171 1 & 1 7 1 1 6 de 666 66 6 7 6 f 6 & & c & 1 1 1 1 1

More information