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

Size: px
Start display at page:

Download "( ) ( ) lex LL(1) LL(1)"

Transcription

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

2 1 () / (front end) (back end) (phase) (pass) 1 2

3 1 () () var left, right; fun int main() { left = 0; right = 10; return ((left + right) / 2); } VAR ID:left, ID:right ; FUN INT ID:main ( ) { ID:left = NUM:0 ; ID:right = NUM:10 ; RETURN ( ( ID:left + ID:right ) / NUM:2 ) ; } / PROG VAR SEQ SEQ FUN left SEQ INT main SEQ right = SEQ left 0 = SEQ right 10 RET / + 2 left right 3

4 1 () () = val / * m + + n 1 n 1 tmp1 = n + 1 tmp2 = n + 1 tmp3 = tmp1 * tmp2 val = tmp3 / m tmp1 = n + 1 tmp3 = tmp1 * tmp1 val = tmp3 / m LD R1 n ADD R1 1 ST tmp1 R1 LD R1 tmp1 MUL R1 tmp1 ST tmp3 R1 LD R1 tmp3 DIV R1 m ST val R1 4

5 2 () Σ ϵ a Σ a R S (R S) (R S) (R ) < < ϵ { } a { a } R S L R L S R S { xy x L R, y L S } R { x 1 x 2 x n n 0, x 1, x 2,..., x n L R } ( 0 ) xy x y R S L R L S 2 2 { 0, 1 } ::= 0 1 ( 0 1 ) I 2 J. R. J J. E. F

6 2 () 1 () (Q, Σ, δ, q 0, F ) Q Σ δ q a δ(q, a) q 0 q 0 Q F F Q 2 a,b,0,1,% a,b A B 0,1,% % C a,b,0,1 Q = { A, B, C } Σ = { a, b, 0, 1, % } δ q 0 = A F = { B } δ a b 0 1 % A B B C C C B B B B B C C C C C C C 1 () ab1 A, B, B, B B b0%a A, B, B, C, C C I 2 J. R. J

7 2 () () () 0 1 ( 0 1 ) () B 0 C A E 1 F G H I 0 J M 1 N K L D () 0, 1 0, 1 { C, D } { } 0 { A, B, E } { F, G, H, I, M, L, D } 1 { J, K, H, I, M, L, D } { N, K, H, I, M, L, D } 0 1 () 0 0, 1 1 0, 1 0, 1 7

8 2 () lex lex lex lex /* * cprime.l -- CPrime flex * * flex cprime.l && gcc lex.yy.c -lfl &&./a.out < input.txt */ %% var printf("var "); fun printf("fun "); void printf("void "); int printf("int "); if printf("if "); else printf("else "); while printf("while "); return printf("return "); "==" printf("eq "); "!=" printf("neq "); "<=" printf("leq "); ">=" printf("geq "); [+\-*/%<>=(){},;] printf("%c ", *yytext); [0-9]+ printf("num:%s ", yytext); [_a-za-z][_a-za-z0-9]* printf("id:%s ", yytext); [ \t\n]+ /* */. printf("??? "); /* */ %% int main(void) { yylex(); printf("\n"); return 0; } if else while return var fun void int + - * / % > >= < <= ==!= = ( ) { }, ; 123 var x; fun void main() { x = 5; } IF ELSE WHILE RETURN VAR FUN VOID INT + - * / % > GEQ < LEQ EQ NEQ = ( ) { }, ; NUM:123 ID:value??? VAR ID:x ; FUN VOID ID:main ( ) { ID:x = NUM:5 ; } 8

9 3 () (context-free grammar) (V, T, P, S) V (variable)() T (terminal symbol) P (production rule) A α A V, α (V T ) S (start symbol)s V V T α 0 () ID NUM 1 : E ( E + E ) 5 : E ID 2 : E ( E - E ) 6 : E NUM 3 : E ( E * E ) 4 : E ( E / E ) V = { E } T = { (, ), +, -, *, /, ID, NUM } P 6 E E ( E + E ) ( E - E ) ( E * E ) ( E / E ) ID NUM () E ( E + E ) ( ( E * E ) + E ) ( ( NUM * E ) + E ) ( ( NUM * ID ) + E ) ( ( NUM * ID ) + NUM ) 1, 3, 6, 5, 6 { w T S w } 9

10 CPrime () C var ; fun ( ) { } void int ID ( ) ; ID = ; if ( ) else if ( ) while ( ) { } return ; return ; NUM ( ) ID ( ) ID ==!= > < >= <= + - * / % ID, ID, I 2 J. R. J

11 3 () 1 : E ( E + E ) 5 : E ID 2 : E ( E - E ) 6 : E NUM 3 : E ( E * E ) 4 : E ( E / E ) E ( E / E ) 4 ( ( E + E ) / E ) 1 ( ( ID + E ) / E ) 5 ( ( ID + ID ) / E ) 5 ( ( ID + ID ) / NUM ) 6 E ( E / E ) 4 ( E / NUM ) 6 ( ( E + E ) / NUM ) 1 ( ( E + ID ) / NUM ) 5 ( ( ID + ID ) / NUM ) 5 E E E E E ( ( ID + ID ) / NUM ) 1 : E E + E 6 : E ID 2 : E E - E 7 : E NUM 3 : E E * E 4 : E E / E 5 : E ( E ) E E E E E E E E E E E E E E E E ( ID + ID ) / NUM ID + ID / NUM ID + ID / NUM 11

12 4 () () 1 1 () 1 : exp exp && exp 2 : exp! exp 3 : exp VAR 4 : exp CON exp! exp! exp && exp! VAR && exp exp! exp exp && exp! VAR && CON VAR CON () exp exp exp exp exp! exp! exp! exp! exp exp && exp exp && exp exp && exp VAR VAR CON 12

13 4 () () 1 1 () 1 : exp exp && exp 2 : exp! exp 3 : exp VAR 4 : exp CON exp exp && exp exp && CON! exp && CON! VAR && CON exp exp && exp! exp CON VAR exp exp exp exp exp && exp exp! exp! exp CON! exp CON () VAR VAR VAR VAR 13

14 4 () () exp! exp exp && exp ( ( exp!, exp exp ( VAR ) ) ), &&, exp( CON ) VAR CON def traverse( T ) visit( T ) n = T for i = 1 to n traverse( T i ) traverse( exp(!, exp( exp( VAR ), &&, exp( CON ) ) ) ) visit( exp ) 1 exp traverse(! ) visit(! ) 2! traverse( exp( exp( VAR ), &&, exp( CON ) ) ) visit( exp ) 3 exp traverse( exp( VAR ) ) visit( exp ) 4 exp traverse( VAR ) visit( VAR ) 5 VAR traverse( && ) visit( && ) 6 && traverse( exp( CON ) ) visit( exp ) 7 exp traverse( CON ) visit( CON ) 8 CON 14

15 4 () () exp! exp exp && exp ( ( exp!, exp exp ( VAR ) ) ), &&, exp( CON ) VAR CON def traverse( T ) n = T for i = 1 to n traverse( T i ) visit( T ) traverse( exp(!, exp( exp( VAR ), &&, exp( CON ) ) ) ) traverse(! ) visit(! ) 1! traverse( exp( exp( VAR ), &&, exp( CON ) ) ) traverse( exp( VAR ) ) traverse( VAR ) visit( VAR ) 2 VAR visit( exp ) 3 exp traverse( && ) visit( && ) 4 && traverse( exp( CON ) ) traverse( CON ) visit( CON ) 5 CON visit( exp ) 6 exp visit( exp ) 7 exp visit( exp ) 8 exp 15

16 4 () () 1 : exp ( exp op exp ) 2 : exp! exp 3 : exp VAR 4 : exp CON 5 : op 6 : op && def parse_exp(): read_token() exp() if token_type()!= END_TOKEN: error() def exp(): if token_type() == ( : print( 1: exp -> ( exp op exp ) ) read_token() exp() op() exp() if token_type() == ) : read_token() else: error() elif token_type() ==! : print( 2: exp ->! exp ) read_token() exp() elif token_type() == VAR : print( 3: exp -> VAR ) read_token() elif token_type() == CON : print( 4: exp -> CON ) read_token() else: error() def op(): if token_type() == : print( 5: op -> ) read_token() elif token_type() == && : print( 6: op -> && ) read_token() else: error() 16

17 token_type() read_token() error() END_TOKEN read_token() 1 ( CON && (! VAR VAR ) ) () 1: exp -> ( exp op exp ) 4: exp -> CON 6: op -> && 1: exp -> ( exp op exp ) 2: exp ->! exp 3: exp -> VAR 5: op -> 3: exp -> VAR exp ( exp op exp ) 1 ( ( CON op exp ) 4 ( CON ( CON && exp ) 6 ( CON && ( CON && ( exp op exp ) ) 1 ( CON && ( ( CON && (! exp op exp ) ) 2 ( CON && (! ( CON && (! VAR op exp ) ) 3 ( CON && (! VAR ( CON && (! VAR exp ) ) 5 ( CON && (! VAR ( CON && (! VAR VAR ) ) 3 ( CON && (! VAR VAR ( CON && (! VAR VAR ) )! VAR && VAR 2: exp ->! exp 3: exp -> VAR syntax error at token && 17

18 4 () 2 () (factoring) 1 : stm ID = NUM 2 : stm ID = ID 1 : stm ID = atom 2 : atom NUM 3 : atom ID ID = 1 2, 3 1 : exp ( exp + exp ) 2 : exp ( exp * exp ) 3 : exp VAR 4 : exp NUM 1 : exp ( exp op exp ) 2 : exp VAR 3 : exp NUM 4 : op + 5 : op * 1, 2 ( exp exp ) 1 1, 2 4, 5 A αβ 1 γ A αβ 2 γ A αbγ B β 1 B β 2 γ α 18

19 : A + Aα A V α (V T ) 0 1 : list list NUM 2 : list 1 : list NUM list 2 : list 1 1 : seq seq, NUM 2 : seq NUM 1 : seq NUM seq 2 : seq, NUM seq 3 : seq seq seq seq NUM, NUM, NUM seq seq seq seq NUM, NUM, NUM NUM, NUM 0, NUM 0 NUM βα α A Aα A β A βαa A αa A A. V. M. S. R. J. D

20 5 () LL(1) LL(1) ID = NUM ID = ID ID = NUM ID 1 + NUM ( + ) NUM NUM NUM + NUM () 1 () () ( NUM + NUM + NUM 2 ) α First(α) A α A α First(α) First(α ) = 20

21 NUM NUM NUM NUM NUM LL(1) A α α α A α First(α) { {a T α aβ β (V T ) } (α ) First(α) := {a T α aβ β (V T ) } {} (α ) S A Follow(A) Follow(A) := {a T {$} S$ αaaβ α T, β (V T {$}) } $ $ V T Director(A α) { First(α) (α ) Director(A α) := First(α) \ {} Follow(A) (α ) A α A α Director(A α) Director(A α ) = LL(1) LL(1) A. V. M. S. R. J. D

22 5 () LL(1) LL(1) First Follow Director 3 LL(1) LL(1) () First ( ) A α First(α) NUM + - () α () α First () First Follow ( $) A α NUM + - First(α) {+, -, NUM} {} {+, -, NUM} {+} {-} {} Follow(A) () $ () A First () A Follow Director ( $) A α First(α) Follow(A) Director(A α) {+, -, NUM} {$, +, -, NUM} {} NUM {+, -, NUM} {$, +, -, NUM} + {+} {NUM} - {-} {} () α First () α First A Follow 22

23 LL(1) () A α First(α) Follow(A) Director(A α) NUM + - LL(1) () CON => LL(1) First A α => ( ) CON First(α) {(, CON} {(, CON} {(} {CON} ( CON LL(1) LL(1) () First, Follow, Director 3 A α First(α) Follow(A) Director(A α) {(, CON} {$, )} {(, CON} => {=>} {$, )} {=>} {} {$, )} ( ) {(} {$, ), =>} {(} CON {CON} {CON} ( Director LL(1) ) {=>} {$, )} {(} {CON} LL(1) 23

() / (front end) (back end) (phase) (pass) 1 2

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

More information

untitled

untitled II yacc 005 : 1, 1 1 1 %{ int lineno=0; 3 int wordno=0; 4 int charno=0; 5 6 %} 7 8 %% 9 [ \t]+ { charno+=strlen(yytext); } 10 "\n" { lineno++; charno++; } 11 [^ \t\n]+ { wordno++; charno+=strlen(yytext);}

More information

() () (parse tree) ( (( ) * 50) ) ( ( NUM 10 + NUM 30 ) * NUM 50 ) ( * ) ( + ) NUM 50 NUM NUM (abstract syntax tree, AST) ( (( ) * 5

() () (parse tree) ( (( ) * 50) ) ( ( NUM 10 + NUM 30 ) * NUM 50 ) ( * ) ( + ) NUM 50 NUM NUM (abstract syntax tree, AST) ( (( ) * 5 3 lex yacc http://www.cs.info.mie-u.ac.jp/~toshi/lectures/compiler/ 2018 6 1 () () (parse tree) ( ((10 + 30) * 50) ) ( ( NUM 10 + NUM 30 ) * NUM 50 ) ( * ) ( + ) NUM 50 NUM NUM 10 30 (abstract syntax tree,

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

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

(ver. 1.3 (2018) ) yacc 1 1 yacc yacc (Yet Another Compiler Compiler) UNIX yacc yacc y *.y yacc ) yacc *.tab.h *.tab.c C C yacc yacc UNIX yacc bison 2

(ver. 1.3 (2018) ) yacc 1 1 yacc yacc (Yet Another Compiler Compiler) UNIX yacc yacc y *.y yacc ) yacc *.tab.h *.tab.c C C yacc yacc UNIX yacc bison 2 (ver. 1.3 (2018) ) yacc 1 1 yacc yacc (Yet Another Compiler Compiler) UNIX yacc yacc y *.y yacc ) yacc *.tab.h *.tab.c C C yacc yacc UNIX yacc bison 2 yacc yacc lex %token yacc yacc token *.tab.h #define

More information

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * *

I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) + x * x + x x (4) * * 2015 2015 07 30 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF S + S S * S S x S +, *, x BNF S (parse tree) : * x + x x S * S x + S S S x x (1) * x x * x (2) * + x x x (3) +

More information

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y

II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C main main 1 NULL NULL for 2 (a) Yacc 2 (b) 2 3 y II 3 yacc (2) 2005 : Yacc 0 ~nakai/ipp2 1 C 1 6 9 1 main main 1 NULL NULL 1 15 23 25 48 26 30 32 36 38 43 45 47 50 52 for 2 (a) 2 2 1 Yacc 2 (b) 2 3 yytext tmp2 ("") tmp2->next->word tmp2 yytext tmp2->next->word

More information

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* (

I. Backus-Naur BNF : N N 0 N N N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) (2) (3) (4) II. 0(0 101)* ( 2016 2016 07 28 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF : 11011 N N 0 N N 11 1001 N N N N 0, 1 BNF N N 0 11 (parse tree) 11 (1) 1100100 (2) 1111011 (3) 1110010 (4) 1001011

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2017 2017 08 03 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF X [ S ] a S S ; X X X, S [, a, ], ; BNF X (parse tree) (1) [a;a] (2) [[a]] (3) [a;[a]] (4) [[a];a] : [a] X 2 222222

More information

:30 12:00 I. I VI II. III. IV. a d V. VI

:30 12:00 I. I VI II. III. IV. a d V. VI 2018 2018 08 02 10:30 12:00 I. I VI II. III. IV. a d V. VI. 80 100 60 1 I. Backus-Naur BNF N N y N x N xy yx : yxxyxy N N x, y N (parse tree) (1) yxyyx (2) xyxyxy (3) yxxyxyy (4) yxxxyxxy N y N x N yx

More information

F = 0 F α, β F = t 2 + at + b (t α)(t β) = t 2 (α + β)t + αβ G : α + β = a, αβ = b F = 0 F (t) = 0 t α, β G t F = 0 α, β G. α β a b α β α β a b (α β)

F = 0 F α, β F = t 2 + at + b (t α)(t β) = t 2 (α + β)t + αβ G : α + β = a, αβ = b F = 0 F (t) = 0 t α, β G t F = 0 α, β G. α β a b α β α β a b (α β) 19 7 12 1 t F := t 2 + at + b D := a 2 4b F = 0 a, b 1.1 F = 0 α, β α β a, b /stlasadisc.tex, cusp.tex, toileta.eps, toiletb.eps, fromatob.tex 1 F = 0 F α, β F = t 2 + at + b (t α)(t β) = t 2 (α + β)t

More information

main

main 14 1. 12 5 main 1.23 3 1.230000 3 1.860867 1 2. 1988 1925 1911 1867 void JPcalendar(int x) 1987 1 64 1 1 1 while(1) Ctrl C void JPcalendar(int x){ if (x > 1988) printf(" %d %d \n", x, x-1988); else if(x

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

: gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp

: gettoken(1) module P = Printf exception End_of_system (* *) let _ISTREAM = ref stdin let ch = ref ( ) let read () = (let c =!ch in ch := inp 7 OCaml () 1. 2. () (compiler) (interpreter) 2 OCaml (syntax) (BNF,backus normal form ) 1 + 2; let x be 2-1 in x; ::= ; let be in ; ::= + - ::= * / ::= 7.1 ( (printable characters) (tokens) 1 (lexical

More information

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v 1 http://www7.bpe.es.osaka-u.ac.jp/~kota/classes/jse.html kota@fbs.osaka-u.ac.jp /* do-while */ #include #include int main(void) double val1, val2, arith_mean, geo_mean; printf( \n );

More information

yacc.dvi

yacc.dvi 2017 c 8 Yacc Mini-C C/C++, yacc, Mini-C, run,, Mini-C 81 Yacc Yacc, 1, 2 ( ), while ::= "while" "(" ")" while yacc 1: st while : lex KW WHILE lex LPAREN expression lex RPAREN statement 2: 3: $$ = new

More information

オートマトンと言語理論 テキスト 成蹊大学理工学部情報科学科 山本真基 ii iii 1 1 1.1.................................. 1 1.2................................ 5 1.3............................. 5 2 7 2.1..................................

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

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

第86回日本感染症学会総会学術集会後抄録(I)

第86回日本感染症学会総会学術集会後抄録(I) κ κ κ κ κ κ μ μ β β β γ α α β β γ α β α α α γ α β β γ μ β β μ μ α ββ β β β β β β β β β β β β β β β β β β γ β μ μ μ μμ μ μ μ μ β β μ μ μ μ μ μ μ μ μ μ μ μ μ μ β

More information

Int Int 29 print Int fmt tostring 2 2 [19] ML ML [19] ML Emacs Standard ML M M ::= x c λx.m M M let x = M in M end (M) x c λx.

Int Int 29 print Int fmt tostring 2 2 [19] ML ML [19] ML Emacs Standard ML M M ::= x c λx.m M M let x = M in M end (M) x c λx. 1, 2 1 m110057@shibaura-it.ac.jp 2 sasano@sic.shibaura-it.ac.jp Eclipse Visual Studio ML Standard ML Emacs 1 ( IDE ) IDE C C++ Java IDE IDE IDE IDE Eclipse Java IDE Java Standard ML 1 print (Int. 1 Int

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

橡Pro PDF

橡Pro PDF 1 void main( ) char c; /* int c; */ int sum=0; while ((c = getchar())!= EOF) if(isdigit(c) ) sum += (c-'0'); printf("%d\n", sum); main()int i,sum=0; for(i=0;i

More information

e.c e.s e.scala /* e.c */ int add(int a, int b) { return a + b; void main() { int a = add(3, 4); printf( %d n, a); ; e.s.text.globl _add _add: pushq %rbp movq %rsp, %rbp movl %edi, -4(%rbp) movl %esi,

More information

Ⅰ Report#1 Report#1 printf() /* Program : hello.c Student-ID : 095740C Author UpDate Comment */ #include int main(){ : Yuhi,TOMARI : 2009/04/28(Thu) : Used Easy Function printf() 10 printf("hello,

More information

untitled

untitled 146,650 168,577 116,665 122,915 22,420 23,100 7,564 22,562 140,317 166,252 133,581 158,677 186 376 204 257 5,594 6,167 750 775 6,333 2,325 298 88 5,358 756 1,273 1,657 - - 23,905 23,923 1,749 489 1,309

More information

O1-1 O1-2 O1-3 O1-4 O1-5 O1-6

O1-1 O1-2 O1-3 O1-4 O1-5 O1-6 O1-1 O1-2 O1-3 O1-4 O1-5 O1-6 O1-7 O1-8 O1-9 O1-10 O1-11 O1-12 O1-13 O1-14 O1-15 O1-16 O1-17 O1-18 O1-19 O1-20 O1-21 O1-22 O1-23 O1-24 O1-25 O1-26 O1-27 O1-28 O1-29 O1-30 O1-31 O1-32 O1-33 O1-34 O1-35

More information

1 911 9001030 9:00 A B C D E F G H I J K L M 1A0900 1B0900 1C0900 1D0900 1E0900 1F0900 1G0900 1H0900 1I0900 1J0900 1K0900 1L0900 1M0900 9:15 1A0915 1B0915 1C0915 1D0915 1E0915 1F0915 1G0915 1H0915 1I0915

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

r07.dvi

r07.dvi 19 7 ( ) 2019.4.20 1 1.1 (data structure ( (dynamic data structure 1 malloc C free C (garbage collection GC C GC(conservative GC 2 1.2 data next p 3 5 7 9 p 3 5 7 9 p 3 5 7 9 1 1: (single linked list 1

More information

ohp07.dvi

ohp07.dvi 19 7 ( ) 2019.4.20 1 (data structure) ( ) (dynamic data structure) 1 malloc C free 1 (static data structure) 2 (2) C (garbage collection GC) C GC(conservative GC) 2 2 conservative GC 3 data next p 3 5

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

( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1

( ) ( ) 30 ( ) 27 [1] p LIFO(last in first out, ) (push) (pup) 1 () 2006 2 27 1 10 23 () 30 () 27 [1] p.97252 7 2 2.1 2.1.1 1 LIFO(last in first out, ) (push) (pup) 1 1: 2.1.2 1 List 4-1(p.100) stack[] stack top 1 2 (push) (pop) 1 2 void stack push(double val) val stack

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

koji07-01.dvi

koji07-01.dvi 2007 I II III 1, 2, 3, 4, 5, 6, 7 5 10 19 (!) 1938 70 21? 1 1 2 1 2 2 1! 4, 5 1? 50 1 2 1 1 2 2 1?? 2 1 1, 2 1, 2 1, 2, 3,... 3 1, 2 1, 3? 2 1 3 1 2 1 1, 2 2, 3? 2 1 3 2 3 2 k,l m, n k,l m, n kn > ml...?

More information

lexex.dvi

lexex.dvi (2018, c ) http://istksckwanseiacjp/ ishiura/cpl/ 4 41 1 mini-c lexc,, 2 testlexc, lexc mini-c 1 ( ) mini-c ( ) (int, char, if, else, while, return 6 ) ( ) (+, -, *, /, %, &, =, ==,!=, >, >=,

More information

‚åŁÎ“·„´Šš‡ðŠp‡¢‡½‹âfi`fiI…A…‰…S…−…Y…•‡ÌMarkovŸA“½fiI›ð’Í

‚åŁÎ“·„´Šš‡ðŠp‡¢‡½‹âfi`fiI…A…‰…S…−…Y…•‡ÌMarkovŸA“½fiI›ð’Í Markov 2009 10 2 Markov 2009 10 2 1 / 25 1 (GA) 2 GA 3 4 Markov 2009 10 2 2 / 25 (GA) (GA) L ( 1) I := {0, 1} L f : I (0, ) M( 2) S := I M GA (GA) f (i) i I Markov 2009 10 2 3 / 25 (GA) ρ(i, j), i, j I

More information

1.

1. 3 ( ) 1. n Tiny C n yacc (bison) lex (flex) n IA n n n n n n (lex ) 50 (yacc ) 400 200 550 n n yacc/lex TA Tiny C n C n int n (if, while) int fact(int n) {! if (n == 1) return 1;! else return n * fact(n-1);!

More information

言語プロセッサ2005 -No.6-

言語プロセッサ2005 -No.6- 言語プロセッサ 2014 -No.5- 東京工科大学 コンピュータサイエンス学部 亀田弘之 お知らせ ( 確認 ) 平成 26 年 11 月 17 日 ( 月 ) は休講 平成 26 年 12 月 20 日 ( 土 ) に補講の予定 ( 注 ) 平成 26 年 1 月 21 日 ( 水 ) も台風補講の予定 言語プロセッサ 2014 担当 : 亀田弘之 ( 東京工科大学 ) 2 これからの内容 1.

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

漸化式のすべてのパターンを解説しましたー高校数学の達人・河見賢司のサイト

漸化式のすべてのパターンを解説しましたー高校数学の達人・河見賢司のサイト https://www.hmg-gen.com/tuusin.html https://www.hmg-gen.com/tuusin1.html 1 2 OK 3 4 {a n } (1) a 1 = 1, a n+1 a n = 2 (2) a 1 = 3, a n+1 a n = 2n a n a n+1 a n = ( ) a n+1 a n = ( ) a n+1 a n {a n } 1,

More information

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

, = = 7 6 = 42, =

, = = 7 6 = 42, = http://www.ss.u-tokai.ac.jp/~mahoro/2016autumn/alg_intro/ 1 1 2016.9.26, http://www.ss.u-tokai.ac.jp/~mahoro/2016autumn/alg_intro/ 1.1 1 214 132 = 28258 2 + 1 + 4 1 + 3 + 2 = 7 6 = 42, 4 + 2 = 6 2 + 8

More information

> > <., vs. > x 2 x y = ax 2 + bx + c y = 0 2 ax 2 + bx + c = 0 y = 0 x ( x ) y = ax 2 + bx + c D = b 2 4ac (1) D > 0 x (2) D = 0 x (3

> > <., vs. > x 2 x y = ax 2 + bx + c y = 0 2 ax 2 + bx + c = 0 y = 0 x ( x ) y = ax 2 + bx + c D = b 2 4ac (1) D > 0 x (2) D = 0 x (3 13 2 13.0 2 ( ) ( ) 2 13.1 ( ) ax 2 + bx + c > 0 ( a, b, c ) ( ) 275 > > 2 2 13.3 x 2 x y = ax 2 + bx + c y = 0 2 ax 2 + bx + c = 0 y = 0 x ( x ) y = ax 2 + bx + c D = b 2 4ac (1) D >

More information

( 9 1 ) 1 2 1.1................................... 2 1.2................................................. 3 1.3............................................... 4 1.4...........................................

More information

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf("hello World\n"); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf(hello World\n); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o 18 C ( ) 1 1 1.1 hello world.c 5 printf("hello World\n"); 6 } [ ] [ ] #include % cc hello_world.c %./a.out Hello World [a.out ] % cc hello_world.c -o hello_world [ ( ) ] (K&R 4.1.1) #include

More information

ex01.dvi

ex01.dvi ,. 0. 0.0. C () /******************************* * $Id: ex_0_0.c,v.2 2006-04-0 3:37:00+09 naito Exp $ * * 0. 0.0 *******************************/ #include int main(int argc, char **argv) { double

More information

プログラミング言語 8 字句解析器(lexer)と構文解析器(parser)

プログラミング言語 8   字句解析器(lexer)と構文解析器(parser) 8 (lexer) (parser) 1 / 73 (lexer, tokenizer) (parser) Web Page (HTML XML) CSV, SVG,...... config file... ( )! 2 / 73 1 1 OCaml : ocamllex ocamlyacc 2 Python : ply 2! 3 / 73 ( ) 字句解析器 構文解析器 ご注文はうさぎさんですか?

More information

8 / 0 1 i++ i 1 i-- i C !!! C 2

8 / 0 1 i++ i 1 i-- i C !!! C 2 C 2006 5 2 printf() 1 [1] 5 8 C 5 ( ) 6 (auto) (static) 7 (=) 1 8 / 0 1 i++ i 1 i-- i 1 2 2.1 C 4 5 3 13!!! C 2 2.2 C ( ) 4 1 HTML はじめ mkdir work 作業用ディレクトリーの作成 emacs hoge.c& エディターによりソースプログラム作成 gcc -o fuga

More information

18/12/06 情報工学実験 C コンパイラ (2018 年度 ) 担当 : 笹倉 佐藤 その 3 yacc の構造 定義部 %% 定義部の終了 規則部 %% 規則部の終了 ユーザ定義サブルーチン部 :C のプログラムを書く 形は lex と同じ 1

18/12/06 情報工学実験 C コンパイラ (2018 年度 ) 担当 : 笹倉 佐藤 その 3 yacc の構造 定義部 %% 定義部の終了 規則部 %% 規則部の終了 ユーザ定義サブルーチン部 :C のプログラムを書く 形は lex と同じ 1 情報工学実験 C コンパイラ (2018 年度 ) 担当 : 笹倉 佐藤 2018.12.6 その 3 yacc の構造 定義部 定義部の終了 規則部 規則部の終了 ユーザ定義サブルーチン部 :C のプログラムを書く 形は lex と同じ 1 yacc yacc のキモは規則部 規則部には文法規則を書く左辺 : 右辺 yacc は入力されたプログラムを右辺から左辺に 還元 していく この規則にアクションが書かれていたら還元するときにアクションも実行する.

More information

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 新装版 1 刷発行時のものです.

C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます.  このサンプルページの内容は, 新装版 1 刷発行時のものです. C による数値計算法入門 ( 第 2 版 ) 新装版 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. http://www.morikita.co.jp/books/mid/009383 このサンプルページの内容は, 新装版 1 刷発行時のものです. i 2 22 2 13 ( ) 2 (1) ANSI (2) 2 (3) Web http://www.morikita.co.jp/books/mid/009383

More information

Microsoft PowerPoint - Compiler06note.pptx

Microsoft PowerPoint - Compiler06note.pptx コンパイラ 第 6 回構文解析 構文解析プログラムの作成 http://www.info.kindai.ac.jp/compiler 38 号館 4 階 N-411 内線 5459 takasi-i@info.kindai.ac.jp コンパイラの構造 字句解析系 構文解析系 制約検査系 中間コード生成系 最適化系 目的コード生成系 処理の流れ情報システムプロジェクト I の場合 output (ab);

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 - Compiler06.pptx

Microsoft PowerPoint - Compiler06.pptx コンパイラ 第 6 回構文解析 構文解析プログラムの作成 http://www.info.kindai.ac.jp/compiler 38 号館 4 階 N-411 内線 5459 takasi-i@info.kindai.ac.jp コンパイラの構造 字句解析系 構文解析系 制約検査系 中間コード生成系 最適化系 目的コード生成系 処理の流れ 情報システムプロジェクト I の場合 output (ab);

More information

R R S S 6 S S D D S3 S3 R R S 6 S 6 S S D D w.o S3 S3 R5 3-0 R S 06 S 6 6 S S 6 D D 30 S3 w.o S3 R R8 7 3-

R R S S 6 S S D D S3 S3 R R S 6 S 6 S S D D w.o S3 S3 R5 3-0 R S 06 S 6 6 S S 6 D D 30 S3 w.o S3 R R8 7 3- 3 9 3 5 5 9 4 5 6 7 8 0 4 R R5 S S D S3 S S D S3 6 6 6 6 6 6 6 30 30 3 0 0 3 4 6 R R8 S S D S3 S S D S3 6 6 7 30 3 0 6 6 3 4 5 6 3 6 0 w.o 3R 30 3 3R3 S S D S3 S S D S3 6 6 6 4 6 6 4 4 0 0 3 6 6 6 R R9

More information

C のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i<=10; i++) sum=sum + i; printf ("sum=%d n",sum); 2

C のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i<=10; i++) sum=sum + i; printf (sum=%d n,sum); 2 アセンブラ (Z80) の例 ORG 100H LD B,10 SUB A LOOP: ADD A,B DEC B JR NZ,LOOP LD (SUM),A HALT ORG 200H SUM: DEFS 1 END 1 C のコード例 (Z80 と同機能 ) int main(void) { int i,sum=0; for (i=1; i

More information

W u = u(x, t) u tt = a 2 u xx, a > 0 (1) D := {(x, t) : 0 x l, t 0} u (0, t) = 0, u (l, t) = 0, t 0 (2)

W u = u(x, t) u tt = a 2 u xx, a > 0 (1) D := {(x, t) : 0 x l, t 0} u (0, t) = 0, u (l, t) = 0, t 0 (2) 3 215 4 27 1 1 u u(x, t) u tt a 2 u xx, a > (1) D : {(x, t) : x, t } u (, t), u (, t), t (2) u(x, ) f(x), u(x, ) t 2, x (3) u(x, t) X(x)T (t) u (1) 1 T (t) a 2 T (t) X (x) X(x) α (2) T (t) αa 2 T (t) (4)

More information

新・明解C言語で学ぶアルゴリズムとデータ構造

新・明解C言語で学ぶアルゴリズムとデータ構造 第 1 章 基本的 1 n 141 1-1 三値 最大値 algorithm List 1-1 a, b, c max /* */ #include int main(void) { int a, b, c; int max; /* */ List 1-1 printf("\n"); printf("a"); scanf("%d", &a); printf("b"); scanf("%d",

More information

‚æ4›ñ

‚æ4›ñ ( ) ( ) ( ) A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 (OUS) 9 26 1 / 28 ( ) ( ) ( ) A B C D Z a b c d z 0 1 2 9 (OUS) 9

More information

exec.dvi

exec.dvi 2018 c 6, Mini-C C++ 6211 611, 61, print,,, (run ),,, (int ), 7, x, x "a" 3 "b" 4 "x" 10 (, ), x STL map 1 + 2, 1 2,, x = ;, 1, 2 x { 1 ; 2 ; ; m, if ( ) { 1 else { 2, 1,, 2 0, 1, 3 0, 2,,, main 6 1 ,,

More information

文法と言語 ー文脈自由文法とLR構文解析2ー

文法と言語 ー文脈自由文法とLR構文解析2ー 文法と言語ー文脈自由文法とLR 構文解析 2 ー 和田俊和資料保存場所 http://vrl.sys.wakayama-u.ac.jp/~twada/syspro/ 前回までの復習 最右導出と上昇型構文解析 最右導出を前提とした場合, 上昇型の構文解析がしばしば用いられる. 上昇型構文解析では生成規則の右辺にマッチする部分を見つけ, それを左辺の非終端記号に置き換える 還元 (reduction)

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

9. 05 L x P(x) P(0) P(x) u(x) u(x) (0 < = x < = L) P(x) E(x) A(x) P(L) f ( d EA du ) = 0 (9.) dx dx u(0) = 0 (9.2) E(L)A(L) du (L) = f (9.3) dx (9.) P

9. 05 L x P(x) P(0) P(x) u(x) u(x) (0 < = x < = L) P(x) E(x) A(x) P(L) f ( d EA du ) = 0 (9.) dx dx u(0) = 0 (9.2) E(L)A(L) du (L) = f (9.3) dx (9.) P 9 (Finite Element Method; FEM) 9. 9. P(0) P(x) u(x) (a) P(L) f P(0) P(x) (b) 9. P(L) 9. 05 L x P(x) P(0) P(x) u(x) u(x) (0 < = x < = L) P(x) E(x) A(x) P(L) f ( d EA du ) = 0 (9.) dx dx u(0) = 0 (9.2) E(L)A(L)

More information

untitled

untitled C -1 - -2 - concept lecture keywords FILE, fopen, fclose, fscanf, fprintf, EOF, r w a, typedef gifts.dat Yt JZK-3 Jizake tsumeawase 45 BSP-15 Body soap set 3 BT-2 Bath towel set 25 TEA-2 Koutya

More information

PL : pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc ( ) Visitor DepthFirstAdapter 1 (Depth

PL : pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc ( ) Visitor DepthFirstAdapter 1 (Depth PL0 2007 : 2007.05.29 pl0 ( ) 1 SableCC ( sablecc ) 1.1 sablecc sablecc Étienne Gagnon [1] Java sablecc sablecc () Visitor DepthFirstAdapter 1 (Depth First traversal) ( ) (breadth first) 2 sablecc 1.2

More information

listings-ext

listings-ext (6) Python (2) ( ) ohsaki@kwansei.ac.jp 5 Python (2) 1 5.1 (statement)........................... 1 5.2 (scope)......................... 11 5.3 (subroutine).................... 14 5 Python (2) Python 5.1

More information

[1] convention Minkovski i Polchinski [2] 1 Clifford Spin 1 2 Euclid Clifford 2 3 Euclid Spin 6 4 Euclid Pin Clifford Spin 10 A 12 B 17 1 Cliffo

[1] convention Minkovski i Polchinski [2] 1 Clifford Spin 1 2 Euclid Clifford 2 3 Euclid Spin 6 4 Euclid Pin Clifford Spin 10 A 12 B 17 1 Cliffo [1] convention Minkovski i Polchinski [2] 1 Clifford Spin 1 2 Euclid Clifford 2 3 Euclid Spin 6 4 Euclid Pin + 8 5 Clifford Spin 10 A 12 B 17 1 Clifford Spin D Euclid Clifford Γ µ, µ = 1,, D {Γ µ, Γ ν

More information

r02.dvi

r02.dvi 172 2017.7.16 1 1.1? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X ( ) 1.2 1 2-0 ( ) ( ) ( ) (12) ( ) (112) (131) 281 26 1 (syntax) (semantics) ( ) 2 2.1 BNF BNF(Backus Normal Form) Joun Backus (grammer) English

More information

研修コーナー

研修コーナー l l l l l l l l l l l α α β l µ l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l

More information

ohp02.dvi

ohp02.dvi 172 2017.7.16 1 ? X A B A X B ( )? IBMPL/I FACOM PL1 ( ) X 2 ( ) 3 2-0 ( ) ( ) ( ) (12) ( ) (112) 31) 281 26 1 4 (syntax) (semantics) ( ) 5 BNF BNF(Backus Normal Form) Joun Backus (grammer) English grammer

More information

Taro-2分探索木Ⅱ(公開版).jtd

Taro-2分探索木Ⅱ(公開版).jtd 2 分探索木 Ⅱ 0. 目次 5. 2 分探索木の操作 5. 1 要素の探索 5. 2 直前の要素の探索 5. 3 直後の要素の探索 5. 4 要素の削除 5. 5 問題 問題 1-1 - 5. 2 分探索木の操作 5. 1 要素の探索 要素 44 の探索 (1) 要素 と 44 を比較して 左部分木をたどる (2) 要素 33 と 44 を比較して 右部分木をたどる (3) 要素 44 を見つけた

More information

r3.dvi

r3.dvi / 94 2 (Lisp ) 3 ( ) 1994.5.16,1994.6.15 1 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.

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

gcc C C tcc lex yacc flex bison [ ] Tiny C 2 Lex [ 2.6 ] 2.1 lex yacc [ ] lex flex yacc bison yacc yyparse() C yyparse() yylex() yylex() yylex() flex

gcc C C tcc lex yacc flex bison [ ] Tiny C 2 Lex [ 2.6 ] 2.1 lex yacc [ ] lex flex yacc bison yacc yyparse() C yyparse() yylex() yylex() yylex() flex 3 1 C Tiny C Tiny C int if while Tiny C 4 C Tiny C % cat test.tc int f(int x) while(x > 1) x = x - 2; return x; Tiny C NASM [3] tcc C % tcc < test.tc GLOBAL f f push ebp mov ebp, esp L1 mov eax, [ebp+8]

More information

1. 2 P 2 (x, y) 2 x y (0, 0) R 2 = {(x, y) x, y R} x, y R P = (x, y) O = (0, 0) OP ( ) OP x x, y y ( ) x v = y ( ) x 2 1 v = P = (x, y) y ( x y ) 2 (x

1. 2 P 2 (x, y) 2 x y (0, 0) R 2 = {(x, y) x, y R} x, y R P = (x, y) O = (0, 0) OP ( ) OP x x, y y ( ) x v = y ( ) x 2 1 v = P = (x, y) y ( x y ) 2 (x . P (, (0, 0 R {(,, R}, R P (, O (0, 0 OP OP, v v P (, ( (, (, { R, R} v (, (, (,, z 3 w z R 3,, z R z n R n.,..., n R n n w, t w ( z z Ke Words:. A P 3 0 B P 0 a. A P b B P 3. A π/90 B a + b c π/ 3. +

More information

debug ( ) 1) ( ) 2) ( ) assert, printf ( ) Japan Advanced Institute of Science and Technology

debug ( ) 1) ( ) 2) ( ) assert, printf ( ) Japan Advanced Institute of Science and Technology I117 28 School of Information Science, Japan Advanced Institute of Science and Technology debug ( ) 1) ( ) 2) ( ) assert, printf ( ) Japan Advanced Institute of Science and Technology 2008 1-2 1 a) b)

More information

CVMに基づくNi-Al合金の

CVMに基づくNi-Al合金の CV N-A (-' by T.Koyama ennard-jones fcc α, β, γ, δ β α γ δ = or α, β. γ, δ α β γ ( αβγ w = = k k k ( αβγ w = ( αβγ ( αβγ w = w = ( αβγ w = ( αβγ w = ( αβγ w = ( αβγ w = ( αβγ w = ( βγδ w = = k k k ( αγδ

More information

r9.dvi

r9.dvi 2011 9 2011.12.9 Ruby B Web ( ) 1 1.1 2 def delete if at then return @cur = @prev.next = @cur.next (1) EOF (2)@cur 1 ()@prev 1 def exch if at @cur.next == @tail then return a = @prev; b = @cur.next; c

More information

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0)

9 8 7 (x-1.0)*(x-1.0) *(x-1.0) (a) f(a) (b) f(a) Figure 1: f(a) a =1.0 (1) a 1.0 f(1.0) E-mail: takio-kurita@aist.go.jp 1 ( ) CPU ( ) 2 1. a f(a) =(a 1.0) 2 (1) a ( ) 1(a) f(a) a (1) a f(a) a =2(a 1.0) (2) 2 0 a f(a) a =2(a 1.0) = 0 (3) 1 9 8 7 (x-1.0)*(x-1.0) 6 4 2.0*(x-1.0) 6 2 5 4 0 3-2

More information

1 (Contents) (1) Beginning of the Universe, Dark Energy and Dark Matter Noboru NAKANISHI 2 2. Problem of Heat Exchanger (1) Kenji

1 (Contents) (1) Beginning of the Universe, Dark Energy and Dark Matter Noboru NAKANISHI 2 2. Problem of Heat Exchanger (1) Kenji 8 4 2018 6 2018 6 7 1 (Contents) 1. 2 2. (1) 22 3. 31 1. Beginning of the Universe, Dark Energy and Dark Matter Noboru NAKANISHI 2 2. Problem of Heat Exchanger (1) Kenji SETO 22 3. Editorial Comments Tadashi

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

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2 " 2 B R b

I ASCII ( ) NUL 16 DLE SP P p 1 SOH 17 DC1! 1 A Q a q STX 2 18 DC2  2 B R b I 4 003 4 30 1 ASCII ( ) 0 17 0 NUL 16 DLE SP 0 @ P 3 48 64 80 96 11 p 1 SOH 17 DC1! 1 A Q a 33 49 65 81 97 113 q STX 18 DC " B R b 34 50 66 8 98 114 r 3 ETX 19 DC3 # 3 C S c 35 51 67 83 99 115 s 4 EOT

More information

Microsoft PowerPoint - Compiler05.pptx

Microsoft PowerPoint - Compiler05.pptx コンパイラ 第 5 回下降型構文解析 http://www.info.kindai.ac.jp/compiler 38 号館 4 階 N-411 内線 5459 takasi-i@info.kindai.ac.jp コンパイラの構造 字句解析系 構文解析系 制約検査系 中間コード生成系 最適化系 目的コード生成系 処理の流れ 情報システムプロジェクト I の場合 output (ab); 字句解析系

More information

2 1 1 α = a + bi(a, b R) α (conjugate) α = a bi α (absolute value) α = a 2 + b 2 α (norm) N(α) = a 2 + b 2 = αα = α 2 α (spure) (trace) 1 1. a R aα =

2 1 1 α = a + bi(a, b R) α (conjugate) α = a bi α (absolute value) α = a 2 + b 2 α (norm) N(α) = a 2 + b 2 = αα = α 2 α (spure) (trace) 1 1. a R aα = 1 1 α = a + bi(a, b R) α (conjugate) α = a bi α (absolute value) α = a + b α (norm) N(α) = a + b = αα = α α (spure) (trace) 1 1. a R aα = aα. α = α 3. α + β = α + β 4. αβ = αβ 5. β 0 6. α = α ( ) α = α

More information

2 2 1?? 2 1 1, 2 1, 2 1, 2, 3,... 1, 2 1, 3? , 2 2, 3? k, l m, n k, l m, n kn > ml...? 2 m, n n m

2 2 1?? 2 1 1, 2 1, 2 1, 2, 3,... 1, 2 1, 3? , 2 2, 3? k, l m, n k, l m, n kn > ml...? 2 m, n n m 2009 IA I 22, 23, 24, 25, 26, 27 4 21 1 1 2 1! 4, 5 1? 50 1 2 1 1 2 1 4 2 2 2 1?? 2 1 1, 2 1, 2 1, 2, 3,... 1, 2 1, 3? 2 1 3 1 2 1 1, 2 2, 3? 2 1 3 2 3 2 k, l m, n k, l m, n kn > ml...? 2 m, n n m 3 2

More information