JavaCard p.1/41

Size: px
Start display at page:

Download "JavaCard p.1/41"

Transcription

1 JavaCard nagamiya@comp.cs.gunma-u.ac.jp p.1/41

2 Hoare Java p.2/41

3 (formal method) (formal specification) (formal) JML, D, VDM, (formal method) p.3/41

4 Hoare Java p.4/41

5 (precondition) (postcondition) p.5/41

6 Hoare [φ] P [ψ ] φ, ψ P φ P P ψ [φ] P [ψ ] P p.6/41

7 [ψ[e/x]] x = E [ψ ] ψ[e/x] ψ x E [x + 1 > 1] x = x + 1 [x > 1] p.7/41

8 [φ] C 1 [η ] [η ] C 2 [ψ ] [φ] C 1 ; C 2 [ψ ] φ C 1 η C 2 ψ p.8/41

9 AR φ φ [φ] C [ψ ] AR ψ ψ [φ ] C [ψ ] p.9/41

10 AR 0 = 0 [0 = 0 ] x = 0 [x = 0 ] [ ] x = 0 [x = 0 ] [x = 0 ] y = x [y = 0 ] [ ] x = 0; y = x [y = 0 ] p.10/41

11 AR 0 = 0 [0 = 0 ] x = 0 [x = 0 ] [ ] x = 0 [x = 0 ] [x = 0 ] y = x [y = 0 ] [ ] x = 0; y = x [y = 0 ] [ ] [0 = 0 ] x = 0; [x = 0 ] y = x; [y = 0 ] p.11/41

12 if [φ B ] C 1 [ψ ] [φ B ] C 2 [ψ ] [φ] if B {C 1 else {C 2 [ψ ] φ true false φ B B φ B C 1 C 2 ψ p.12/41

13 while [ψ B ] C [ψ ] [ψ ] while B {C [ψ B ] ψ (loop invariant) ψ ψ B true B false C ψ B p.13/41

14 y = 1; z = 0; l1: while (z!= x) { z = z + 1; y = y * z; l2: p.14/41

15 [ ] y = 1; z = 0; l1: while (z!= x) { z = z + 1; y = y * z; l2: [y = x!] p.15/41

16 x = 6 z at l1 y at l1 z x! at l true true true true true true false p.16/41

17 x = 6 z at l1 y at l1 z x! at l true true true true true true false y = z! p.16/41

18 while [[ ]] y = 1; z = 0; [[y = z!]] l1: while (z!= x) { [[y = z! z x]] z = z + 1; y = y * z; [[y = z!]] l2: [[y = z! z = x]] [[y = x!]] p.17/41

19 [[ ]] y = 1; z = 0; [[y = z!]] l1: while (z!= x) { [[y = z! z x]] z = z + 1; [[y z = z!]] y = y * z; [[y = z!]] l2: [[y = z! z = x]] [[y = x!]] p.18/41

20 [[ ]] y = 1; z = 0; [[y = z!]] l1: while (z!= x) { [[y = z! z x]] [[y (z + 1) = (z + 1)!]] z = z + 1; [[y z = z!]] y = y * z; [[y = z!]] l2: [[y = z! z = x]] [[y = x!]] p.19/41

21 [[ ]] y = 1; [[y = 0!]] z = 0; [[y = z!]] l1: while (z!= x) { [[y = z! z x]] [[y (z + 1) = (z + 1)!]] z = z + 1; [[y z = z!]] y = y * z; [[y = z!]] l2: [[y = z! z = x]] [[y = x!]] p.20/41

22 [[ ]] [[1 = 0!]] y = 1; [[y = 0!]] z = 0; [[y = z!]] l1: while (z!= x) { [[y = z! z x]] [[y (z + 1) = (z + 1)!]] z = z + 1; [[y z = z!]] y = y * z; [[y = z!]] l2: [[y = z! z = x]] [[y = x!]] p.21/41

23 [[ ]] [[1 = 0!]] AR 1 = 0! y = 1; [[y = 0!]] z = 0; [[y = z!]] l1: while (z!= x) { [[y = z! z x]] AR (y = z! z x) [[y (z + 1) = (z + 1)!]] (y (z + 1) = (z + 1)!) z = z + 1; [[y z = z!]] y = y * z; [[y = z!]] l2: [[y = z! z = x]] [[y = x!]] AR (y = z! z = x) (y = x!) p.22/41

24 [[ ]] [[1 = 0!]] AR 1 = 0! y = 1; [[y = 0!]] z = 0; [[y = z!]] Q.E.D l1: while (z!= x) { [[y = z! z x]] AR (y = z! z x) [[y (z + 1) = (z + 1)!]] (y (z + 1) = (z + 1)!) z = z + 1; [[y z = z!]] y = y * z; [[y = z!]] l2: [[y = z! z = x]] [[y = x!]] AR (y = z! z = x) (y = x!) p.23/41

25 Hoare Java p.24/41

26 (Design by contract) [φ] P [ψ ] (contract) φ P P ψ φ ψ p.25/41

27 (precondition) (postcondition) (invariant) p.26/41

28 Java Modeling Language Java Design by contract p.27/41

29 JML //@... /*@... *@... *@/ p.28/41

30 JML requires ensures requires array.length >=1; ensures \result >= x; invariant public invariant balance >= 0; modefiable modifiable array[x]; p.29/41

31 JML \result E \old(e) \forall, \exists p.30/41

32 Krakatoa+Coq Java + JML (Ocaml) proof obligation ( ) Krakatoa Why Coq Krakatoa: Java/JML Why: Hoare proof obligation Coq: proof obligation p.31/41

33 Krakatoa+Coq Java + JML (Ocaml) proof obligation ( ) Krakatoa Why Coq Krakatoa: Java/JML Why: Hoare proof obligation Coq: proof obligation proof obligation p.31/41

34 Gemplus JavaCard (ID ) p.32/41

35 Utils Jour Mois Annee Decimal Pcpcapinterfaces PurseLoyaltyInterface Loyalty TransactionInterface Shareable p.33/41

36 Utils Jour Mois Annee Decimal Pcpcapinterfaces PurseLoyaltyInterface Loyalty TransactionInterface Shareable p.33/41

37 Decimal JavaCard int intpart, decpart short decpart 3 Decimal 0 <= decpart && decpart < PRECISION setvalue intpart = 3 decpart = 493 oppose PRECISION short 1000 sub add mul p.34/41

38 add private void add(short e, short f) { intpart += e; decpart += f; if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.35/41

39 add Decimal Decimal intpart = 3 intpart = 4 setvalue decpart = 493 oppose setvalue decpart = 507 oppose sub mul add sub mul add intpart * PRECISION + decpart = 3493 p.36/41

40 add private requires -PRECISION < f && f < PRECISION -MAX_DECIMAL_NUMBER <= e && e <= MAX_DECIMAL_NUMBER -MAX_DECIMAL_NUMBER <= e + intpart - 1 e + intpart + 1 <= modifiable intpart, ensures intpart * PRECISION + decpart (\old(intpart) + e) * PRECISION + \old(decpart) + private void all (short e, short f) {... p.37/41

41 add private void add(short e, short f) { intpart += e; decpart += f; if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

42 add private void add(short e, short f) { intpart += e; decpart += f; intpart PRECISION + decpart = (intpart 0 + e) PRECISION + decpart 0 + f if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

43 add private void add(short e, short f) { intpart += e; decpart += f; intpart PRECISION + decpart = (intpart 0 + e) PRECISION + decpart 0 + f intpart PRECISION + decpart = (intpart 0 + e) PRECISION + decpart 0 + f if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

44 add private void add(short e, short f) { intpart += e; decpart += f; intpart PRECISION + decpart = (intpart 0 + e) PRECISION + decpart 0 + f (intpart + 1) PRECISION + decpart = (intpart 0 + e) PRECISION + decpart 0 + f if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

45 add private void add(short e, short f) { intpart += e; decpart += f; intpart PRECISION + decpart = (intpart 0 + e) PRECISION + decpart 0 + f (intpart + 1) PRECISION +(decpart PRECISION ) = (intpart 0 + e) PRECISION + decpart 0 + f if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

46 add (intpart 1) PRECISION + decpart = (intpart 0 + e) PRECISION + decpart 0 + f (intpart + 1) PRECISION +(decpart PRECISION ) = (intpart 0 + e) PRECISION + decpart 0 + f private void add(short e, short f) { intpart += e; decpart += f; if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

47 add (intpart 1) PRECISION +(decpart + PRECISION ) = (intpart 0 + e) PRECISION + decpart 0 + f (intpart + 1) PRECISION +(decpart PRECISION ) = (intpart 0 + e) PRECISION + decpart 0 + f private void add(short e, short f) { intpart += e; decpart += f; if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

48 add (decpart PRECISION ) (intpart 1) PRECISION +(decpart + PRECISION ) = (intpart 0 + e) PRECISION + decpart 0 + f (decpart > PRECISION ) (decpart PRECISION ) (intpart + 1) PRECISION +(decpart PRECISION ) = (intpart 0 + e) PRECISION + decpart 0 + f private void add(short e, short f) { intpart += e; decpart += f; if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

49 add (decpart PRECISION ) (intpart 1) PRECISION +(decpart + PRECISION ) = (intpart 0 + e) PRECISION + decpart 0 + f Q.E.D (decpart > PRECISION ) (decpart PRECISION ) (intpart + 1) PRECISION +(decpart PRECISION ) = (intpart 0 + e) PRECISION + decpart 0 + f private void add(short e, short f) { intpart += e; decpart += f; if (decpart <= -PRECISION) { decpart += PRECISION; intpart--; else if (decpart >= PRECISION) { decpart -= PRECISION; intpart++; p.38/41

50 Hoare Java p.39/41

51 : Krakatoa add proof obligation = : mul p.40/41

52 Thank You! p.41/41

=

= 2. 2.1 2.2 kuri@ice.uec.ac.jp ( 2007/10/30/16:46) 1 . 1. 1 + 2 = 5. 2. 180. 3. 3 3. 4.. 5.. 2 2.1 1.,,,,. 2., ( ) ( ).,,,, 3.,. 4.,,,. 3 1.,. 1. 1 + 2 = 5. (, ) 2. 180. (, ) 3. 3, 3. (, ) 4.. (, ) 5..

More information

「計算と論理」 Software Foundations その4

「計算と論理」  Software Foundations   その4 Software Foundations 4 cal17@fos.kuis.kyoto-u.ac.jp http://www.fos.kuis.kyoto-u.ac.jp/~igarashi/class/cal/ November 7, 2017 ( ) ( 4) November 7, 2017 1 / 51 Poly.v ( ) ( 4) November 7, 2017 2 / 51 : (

More information

8 if switch for while do while 2

8 if switch for while do while 2 (Basic Theory of Information Processing) ( ) if for while break continue 1 8 if switch for while do while 2 8.1 if (p.52) 8.1.1 if 1 if ( ) 2; 3 1 true 2 3 false 2 3 3 8.1.2 if-else (p.54) if ( ) 1; else

More information

ALG ppt

ALG ppt 2012614 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 1 2 2 3 29 20 32 14 24 30 48 7 19 21 31 4 N O(log N) 29 O(N) 20 32 14 24 30 48 7 19 21 31 5

More information

アルゴリズムとデータ構造1

アルゴリズムとデータ構造1 1 200972 (sakai.keiichi@kochi sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi ://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2009/index.html 29 20 32 14 24 30 48 7 19 21 31 Object public class

More information

K227 Java 2

K227 Java 2 1 K227 Java 2 3 4 5 6 Java 7 class Sample1 { public static void main (String args[]) { System.out.println( Java! ); } } 8 > javac Sample1.java 9 10 > java Sample1 Java 11 12 13 http://java.sun.com/j2se/1.5.0/ja/download.html

More information

AWT setcolor, drawstring Java AWT Abstract Window Toolkit Graphics AWT import import java.awt.* ; // AWT Graphics import java.awt.graphics; // AWT Gra

AWT setcolor, drawstring Java AWT Abstract Window Toolkit Graphics AWT import import java.awt.* ; // AWT Graphics import java.awt.graphics; // AWT Gra AWT setcolor, drawstring Java AWT Abstract Window Toolkit Graphics AWT import // AWT Graphics import java.awt.graphics; // AWT Graphics paint g x y ( x, y ) drawline( x, y, x, y ) ; g.drawline( 20, 30,

More information

AWT setcolor, drawstring Java AWT Abstract Window Toolkit Graphics AWT import import java.awt.* ; // AWT Graphics import java.awt.graphics; // AWT Gra

AWT setcolor, drawstring Java AWT Abstract Window Toolkit Graphics AWT import import java.awt.* ; // AWT Graphics import java.awt.graphics; // AWT Gra AWT setcolor, drawstring Java AWT Abstract Window Toolkit Graphics AWT import // AWT Graphics import java.awt.graphics; // AWT Graphics paint g x y ( x, y ) drawline( x, y, x, y ) ; g.drawline( 20, 30,

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

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225 Java Java Java Java Java 4 p35 4-2 * *** ***** *** * Unix p36 4-3 a,b,c,d 100,200,250,500 a*b = 20000 a*b+c = 20250 a*b+c*d = 145000 (a+b)*(c+d) = 225000 a+b*c+d = 50600 b/a+d/c = 4 p38 4-4 (1) mul = 1

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

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

syuryoku

syuryoku 248 24622 24 P.5 EX P.212 2 P271 5. P.534 P.690 P.690 P.690 P.690 P.691 P.691 P.691 P.702 P.702 P.702 P.702 1S 30% 3 1S 3% 1S 30% 3 1S 3% P.702 P.702 P.702 P.702 45 60 P.702 P.702 P.704 H17.12.22 H22.4.1

More information

土壌環境行政の最新動向(環境省 水・大気環境局土壌環境課)

土壌環境行政の最新動向(環境省 水・大気環境局土壌環境課) 201022 1 18801970 19101970 19201960 1970-2 1975 1980 1986 1991 1994 3 1999 20022009 4 5 () () () () ( ( ) () 6 7 Ex Ex Ex 8 25 9 10 11 16619 123 12 13 14 5 18() 15 187 1811 16 17 3,000 2241 18 19 ( 50

More information

明解Javaによるアルゴリズムとデータ構造

明解Javaによるアルゴリズムとデータ構造 21 algorithm List 1-1 a, b, c max Scanner Column 1-1 List 1-1 // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); Chap01/Max3.java

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

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

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

Java演習(4) -- 変数と型 --

Java演習(4)   -- 変数と型 -- 50 20 20 5 (20, 20) O 50 100 150 200 250 300 350 x (reserved 50 100 y 50 20 20 5 (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; (reserved public class Blocks1 extends

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) pref : 2004/6/5 (11:8) 3 5 14 18 21 23 23 24 28 29 29 31 32 34 35 35 36 38 40 44 44 45 46 49 49 50 pref : 2004/6/5 (11:8) 50 51 52 54 55 56 57 58 59 60 61

More information

ALG2012-F.ppt

ALG2012-F.ppt 2012 7 26 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2012/index.html 5 2 3 4 - 5 .. 6 - 7 public class KnapsackBB { // 0-1 private static double maxsofar; private

More information

2

2 () () 980-8578 Tel: 022-795-6092 Fax: 022-795-6096 email: 1. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 17 46 47 4.1.1

More information

!!! 10 1 110 88 7 9 91 79 81 82 87 6 5 90 83 75 77 12 80 8 11 89 84 76 78 85 86 4 2 32 64 10 44 13 17 94 34 33 107 96 14 105 16 97 99 100 106 103 98 63 at 29, 66 at 58 12 16 17 25 56

More information

SystemC言語概論

SystemC言語概論 SystemC CPU S/W 2004/01/29 4 SystemC 1 SystemC 2.0.1 CPU S/W 3 ISS SystemC Co-Simulation 2004/01/29 4 SystemC 2 ISS SystemC Co-Simulation GenericCPU_Base ( ) GenericCPU_ISS GenericCPU_Prog GenericCPU_CoSim

More information

: : : TSTank 2

: : : TSTank 2 Java (8) 2008-05-20 Lesson6 Lesson5 Java 1 Lesson 6: TSTank1, TSTank2, TSTank3 java 2 car1 car2 Car car1 = new Car(); Car car2 = new Car(); car1.setcolor(red); car2.setcolor(blue); car2.changeengine(jet);

More information

Microsoft Word - keisankigairon.ch doc

Microsoft Word - keisankigairon.ch doc 1000000100001010 1000001000001011 0100001100010010 1010001100001100 load %r1,10 load %r2,11 add %r3,%r1,%r2 store %r3,12 k = i + j ; = > (* 1 2 3 4 5 6 7 8 9 10) 3628800 DO 3 I=1,3 DO3I=1.3 DO3I 1.3

More information

PowerPoint Presentation

PowerPoint Presentation UML 2004 7 9 10 ... OOP UML 10 Copyright 2004 Akira HIRASAWA all rights reserved. 2 1. 2. 3. 4. UML 5. Copyright 2004 Akira HIRASAWA all rights reserved. 3 1..... Copyright 2004 Akira HIRASAWA all rights

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

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略   

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略       - LogisticaTRUCKServer-Ⅱ(SQLServer 版 ) 距離計算サーハ API.NET DLL WindowsForm サンフ ルフ ロク ラム - 1 - LogisticaTRUCKServer-Ⅱ 距離計算サーハ.NET DLL WindowsForm VisualBasic での利用方法 LogisticaTRUCKServer-Ⅱ 距離計算.NET DLLのサンプルプログラムの参照サンフ

More information

/ , ,908 4,196 2, ,842 38, / / 2 33 /

/ , ,908 4,196 2, ,842 38, / / 2 33 / MathWorks Automotive Conference 2014 ( ) ECU 0.1. 1 /30 1949 12 16 1,874 4 959 2 4,908 4,196 2,993 139,842 38,581 62 26 35 56 / 6 185 13 4 3 11 / 2 33 / 2014 3 31 0.1. 2 /30 ETC 0.2. 3 /30 1. 1. 2. 2.

More information

アルゴリズムとデータ構造1

アルゴリズムとデータ構造1 1 2005 7 22 22 (sakai.keiichi@kochi sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2005/index.html tech.ac.jp/k1sakai/lecture/alg/2005/index.html f(0) = 1, f(x) =

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

untitled

untitled 2011 7 21 (sakai.keiichi@kochi-tech.ac.jp) http://www.info.kochi-tech.ac.jp/k1sakai/lecture/alg/2011/index.html tech.ac.jp/k1sakai/lecture/alg/2011/index.html html 1 5 2 3 4 - 5 .. 6 - 7 public class KnapsackBB

More information

「計算と論理」 Software Foundations その3

「計算と論理」  Software Foundations   その3 Software Foundations 3 cal17@fos.kuis.kyoto-u.ac.jp October 24, 2017 ( ) ( 3) October 24, 2017 1 / 47 Lists.v ( ) ( ) ( ) ( 3) October 24, 2017 2 / 47 ( ) Inductive natprod : Type := pair : nat nat natprod.

More information

- 1 - - 0.5%5 10 10 5 10 1 5 1

- 1 - - 0.5%5 10 10 5 10 1 5 1 - - - 1 - - 0.5%5 10 10 5 10 1 5 1 - 2 - - - - A B A A A B A B B A - 3 - - 100 100 100 - A) ( ) B) A) A B A B 110 A B 13 - 4 - A) 36 - - - 5 - - 1 - 6-1 - 7 - - 8 - Q.15 0% 10% 20% 30% 40% 50% 60% 70%

More information

untitled

untitled ST0001-1- -2- -3- -4- BorderStyle ControlBox, MinButton, MaxButton True False True False Top Left Height,Width Caption Icon True/False -5- Basic Command1 Click MsgBox " " Command1 Click Command1 Click

More information

Safari AppletViewer Web HTML Netscape Web Web 15-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web up

Safari AppletViewer Web HTML Netscape Web Web 15-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web up Safari AppletViewer Web HTML Netscape Web Web 15-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web update Event Driven paint Signature Overwriting Overriding

More information

Java演習(6) -- 条件分岐 --

Java演習(6)   -- 条件分岐 -- (400, 300) 20 if-else (Stripe.java) import javax.swing.japplet; import java.awt.graphics; import java.awt.color; public class Stripe extends JApplet { public void paint(graphics g) { g.setcolor(color.white);

More information

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac Actual4Test http://www.actual4test.com Actual4test - actual test exam dumps-pass for IT exams Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN

More information

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

新・明解Javaで学ぶアルゴリズムとデータ構造 第 1 章 基本的 1 n 21 1-1 三値 最大値 algorithm List 1-1 a, b, c max // import java.util.scanner; class Max3 { public static void main(string[] args) { Scanner stdin = new Scanner(System.in); List 1-1 System.out.println("");

More information

問題 01 以下は コンソールより年齢を入力させ その年齢にあった料金を表示するプログラムである 年齢ごとの金額は以下の通りである 年齢の範囲金額 0 歳以上 6 歳以下 120 円 7 歳以上 65 歳未満 200 円 65 歳以上無料 package j1.exam02; import java

問題 01 以下は コンソールより年齢を入力させ その年齢にあった料金を表示するプログラムである 年齢ごとの金額は以下の通りである 年齢の範囲金額 0 歳以上 6 歳以下 120 円 7 歳以上 65 歳未満 200 円 65 歳以上無料 package j1.exam02; import java 問題 01 以下は コンソールより年齢を入力させ その年齢にあった料金を表示するプログラムである 年齢ごとの金額は以下の通りである 年齢の範囲金額 0 歳以上 6 歳以下 120 円 7 歳以上 65 歳未満 200 円 65 歳以上無料 public class Ex0201 { System.out.print("input> "); int input = Integer.parseInt(reader.readLine());

More information

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flow

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) flow Java (5) 1 Lesson 3: 2008-05-20 2 x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java 1.1 10 10 0 1.0 2.0, 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flowrate.dat" 10 8 6 4 2 0 0 5 10 15 20 25 time (s) 1 1

More information

Local variable x y i paint public class Sample extends Applet { public void paint( Graphics gc ) { int x, y;... int i=10 ; while ( i < 100 ) {... i +=

Local variable x y i paint public class Sample extends Applet { public void paint( Graphics gc ) { int x, y;... int i=10 ; while ( i < 100 ) {... i += Safari AppletViewer Web HTML Netscape Web Web 13-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web update Event Driven paint Signature Overwriting Overriding

More information

Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の break; まで処理しますどれにも一致致しない場合 def

Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の break; まで処理しますどれにも一致致しない場合 def Java プログラミング Ⅰ 7 回目 switch 文と論理演算子 今日の講義講義で学ぶ内容 switch 文 論理演算子 条件演算子 条件判断文 3 switch 文 switch 文 式が case のラベルと一致する場所から直後の まで処理しますどれにも一致致しない場合 default: から直後の まで処理します 式の結果 ラベル 定数 整数または文字 (byte, short, int,

More information

#include #include #include int gcd( int a, int b) { if ( b == 0 ) return a; else { int c = a % b; return gcd( b, c); } /* if */ } int main() { int a = 60; int b = 45; int

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

新・明解Java入門

新・明解Java入門 537,... 224,... 224,... 32, 35,... 188, 216, 312 -... 38 -... 38 --... 102 --... 103 -=... 111 -classpath... 379 '... 106, 474!... 57, 97!=... 56 "... 14, 476 %... 38 %=... 111 &... 240, 247 &&... 66,

More information

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics; 19 3!!...... (+) (>) (++) (+=) for while 3.1!! 3.1.1 50 20 20 5 (20, 20) 3.1.1 (1)(Blocks1.java) public class Blocks1 extends JApplet { public void paint(graphics g){ 5 g.drawrect( 20, 20, 50, 20); g.drawrect(

More information

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value = Part2-1-3 Java (*) (*).class Java public static final 1 class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value

More information

com.ibm.etools.egl.jsfsearch.tutorial.doc.ps

com.ibm.etools.egl.jsfsearch.tutorial.doc.ps EGL JSF ii EGL JSF EGL JSF.. 1................. 1 1:.... 3 Web.......... 3........... 3........ 4......... 7 2:...... 7..... 7 SQL.... 8 JSF.... 10 Web.... 12......... 13 3: OR....... 14 OR... 14.15 OR.....

More information

2.2 Java C main Java main 2 C 6 C Java 3 C Java ( ) G101Hello.java G101Hello main G101Hello.java /* G101Hello */ class G101Hello { /* main */ public s

2.2 Java C main Java main 2 C 6 C Java 3 C Java ( ) G101Hello.java G101Hello main G101Hello.java /* G101Hello */ class G101Hello { /* main */ public s 2 2013 4 16 2.1............................... 2 1 2.2 Java......................... 2 2 2.3............. 2 2 2.4................................ 2 4 2.5............................ 2 5 2.6............................

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

解きながら学ぶJava入門編

解きながら学ぶJava入門編 44 // class Negative { System.out.print(""); int n = stdin.nextint(); if (n < 0) System.out.println(""); -10 Ÿ 35 Ÿ 0 n if statement if ( ) if i f ( ) if n < 0 < true false true false boolean literalboolean

More information

VB.NETコーディング標準

VB.NETコーディング標準 (C) Copyright 2002 Java ( ) VB.NET C# AS-IS extremeprogramming-jp@objectclub.esm.co.jp bata@gold.ocn.ne.jp Copyright (c) 2000,2001 Eiwa System Management, Inc. Object Club Kenji Hiranabe02/09/26 Copyright

More information

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略   

LogisticaTRUCKServer-Ⅱ距離計算サーバ/Active-Xコントロール/クライアント 概略       - LogisticaTRUCKServer-Ⅱ(SQLServer 版 ) 距離計算サーハ API.NET DLL WebForms ASP.NET サンフ ルフ ロク ラム - 1 - LogisticaTRUCKServer-Ⅱ 距離計算サーハ.NET DLL WebForm ASP.NET VisualBasic での利用方法 LogisticaTRUCKServer-Ⅱ 距離計算.NET

More information

とても使いやすい Boost の serialization

とても使いやすい Boost の serialization とても使いやすい Boost の serialization Zegrahm シリアライズ ( 直列化 ) シリアライズ ( 直列化 ) とは何か? オブジェクトデータをバイト列や XML フォーマットに変換すること もう少しわかりやすく表現すると オブジェクトの状態を表す変数 ( フィールド ) とオブジェクトの種類を表す何らかの識別子をファイル化出来るようなバイト列 XML フォーマット形式で書き出す事を言う

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV tutimura@mist.i.u-tokyo.ac.jp kaneko@ipl.t.u-tokyo.ac.jp http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 12 11 p.1/33 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

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

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

情報処理学会研究報告 IPSJ SIG Technical Report Vol.2015-SE-187 No /3/12 Java 1,a) 1,b) 1,c) 1,d) Known Unknown Unknown Unknown 2 Known Unknown Archface-U

情報処理学会研究報告 IPSJ SIG Technical Report Vol.2015-SE-187 No /3/12 Java 1,a) 1,b) 1,c) 1,d) Known Unknown Unknown Unknown 2 Known Unknown Archface-U Java 1,a) 1,b) 1,c) 1,d) Known Unknown Unknown Unknown 2 Known Unknown Archface-U iarch-u iarch-u Partial Model 1. Known Unknown Unknown Unknown Known Unknown 1 Kyushu University a) fukamachi@posl.ait.kyushu-u.ac.jp

More information

handout.dvi

handout.dvi http://www.kurims.kyoto-u.ac.jp/ ichiro 1 1.1 (formal verification, formal methods) [3] 2 theorem prover proof assistant PVSIsabell/HOLCoq Kripke M ϕ M ϕ M = ϕ model checker M ϕ M ϕ M M ϕ state explosion

More information

() / (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

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1 Java (9) 1 Lesson 7 2008-05-20 Java System.out.println() 1 Java API 1 Java Java 1 GUI 2 Java 3 1.1 5 3 1.0 10.0, 1.0, 0.5 5.0, 3.0, 0.3 4.0, 1.0, 0.6 1 2 4 3, ( 2 3 2 1.2 Java (stream) 4 1 a 5 (End of

More information

{:from => Java, :to => Ruby } Java Ruby KAKUTANI Shintaro; Eiwa System Management, Inc.; a strong Ruby proponent http://kakutani.com http://www.amazon.co.jp/o/asin/4873113202/kakutani-22 http://www.amazon.co.jp/o/asin/477413256x/kakutani-22

More information

TOEIC

TOEIC TOEIC 1 1 3 1.1.............................................. 3 1.2 C#........................................... 3 2 Visual Studio.NET Windows 5 2.1....................................... 5 2.2..........................................

More information

1. 入力画面

1. 入力画面 指定した時刻に指定したマクロ (VBA) を実行するプログラム (VBA) 益永八尋 様々な業務を行っている場合には 指定した時刻に指定したマクロ (Macro VBA) を実行したくなる場合がある たとえば 9:00 17: 00 や 1 時間 6 時間間隔に指定したマクロ (Macro VBA) を実行する この様な場合に対応できるように汎用性の高いプログラムを作成した この場合に注意する必要があるのは

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

D0050.PDF

D0050.PDF Excel VBA 6 3 3 1 Excel BLOCKGAME.xls Excel 1 OK 2 StepA D B1 B4 C1 C2 StepA StepA Excel Workbook Open StepD BLOCKGAME.xls VBEditor ThisWorkbook 3 1 1 2 2 3 5 UserForm1 4 6 UsorForm2 StepB 3 StepC StepD

More information

オブジェクト脳のつくり方

オブジェクト脳のつくり方 2003 12 16 ( ) ML Java,.NET, UML J2EE, Web Java, J2EE.NET SI ex. ) OO OO OO OO OO (Controller) (Promoter) (Analyzer) (Supporter) http://nba.nikkeibp.co.jp/coachsp.html It takes time. OO OK OO 1.

More information

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println(Hello World); (Basic Theory of Information Processing) Java (eclipse ) Hello World! eclipse Java 1 3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello

More information

問題1 以下に示すプログラムは、次の処理をするプログラムである

問題1 以下に示すプログラムは、次の処理をするプログラムである 問題 1 次のプログラムの出力結果を a~d の中から選べ public class Problem1 { int i=2; int j=3; System.out.println("i"+j); a) 23,b) 5,c) i3,d) ij 問題 2 次のプログラムの出力結果を a~d の中から選べ public class Problem2 { int a=6; if((a>=2)&&(a

More information

1

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

More information

1.dll の配置場所配布時はプログラムの実行フォルダーへ配置 2. 開発環境での使用 プロジェクトのプロパティーで [USBPIO.dll] を参照追加してください 開発環境 dll ファイルの場所 VB.Net Express Edition 境プロジェクトのフォルダ \bin\release VB.Netebugビルドの場合プロジェクトのフォルダ \bin\debug VB.Net Releaseビルドの場合プロジェクトのフォルダ

More information

,,,,., C Java,,.,,.,., ,,.,, i

,,,,., C Java,,.,,.,., ,,.,, i 24 Development of the programming s learning tool for children be derived from maze 1130353 2013 3 1 ,,,,., C Java,,.,,.,., 1 6 1 2.,,.,, i Abstract Development of the programming s learning tool for children

More information

# let st1 = {name = "Taro Yamada"; id = };; val st1 : student = {name="taro Yamada"; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n

# let st1 = {name = Taro Yamada; id = };; val st1 : student = {name=taro Yamada; id=123456} { 1 = 1 ;...; n = n } # let string_of_student {n II 6 / : 2001 11 21 (OCaml ) 1 (field) name id type # type student = {name : string; id : int};; type student = { name : string; id : int; } student {} type = { 1 : 1 ;...; n : n } { 1 = 1 ;...; n = n

More information

Java (7) Lesson = (1) 1 m 3 /s m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3

Java (7) Lesson = (1) 1 m 3 /s m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3 Java (7) 2008-05-20 1 Lesson 5 1.1 5 3 = (1) 1 m 3 /s 1 2 3 10 m 2 5 m 2 4 m 2 1 m 3 m 1 m 0.5 m 3 /ms 0.3 m 3 /ms 0.6 m 3 /ms 1 1 3 1.2 java 2 1. 2. 3. 4. 3 2 1.3 i =1, 2, 3 V i (t) 1 t h i (t) i F, k

More information

untitled

untitled 10 KITAKYUSHU IR 2011 2011.10.27 803-8501 TEL093-582-2003 FAX093-582-2070 KITAKYUSHU IR 2011 KITAKYUSHU IR 2011 KITAKYUSHU IR 2011 () KITAKYUSHU IR 2011 KITAKYUSHU IR 2011 KITAKYUSHU IR 2011 1960s 2011

More information

Test IV, March 22, 2016 6. Suppose that 2 n a n converges. Prove or disprove that a n converges. Proof. Method I: Let a n x n be a power series, which converges at x = 2 by the assumption. Applying Theorem

More information

ただし 無作為にスレッドを複数実行すると 結果不正やデッドロックが起きる可能性がある 複数のスレッド ( マルチスレッド ) を安全に実行する ( スレッドセーフにする ) ためには 同期処理を用いるこ とが必要になる 同期処理は 予約語 synchronized で行うことができる ここでは sy

ただし 無作為にスレッドを複数実行すると 結果不正やデッドロックが起きる可能性がある 複数のスレッド ( マルチスレッド ) を安全に実行する ( スレッドセーフにする ) ためには 同期処理を用いるこ とが必要になる 同期処理は 予約語 synchronized で行うことができる ここでは sy オブジェクト指向プログラミング演習 2010/10/27 演習課題 スレッド ( その 2) 同期処理 結果不正 デッドロック 前回のスレッドの演習では 複数のスレッドを実行し 一つのプログラムの中の違う処理を同時に実行し た ただし 無作為にスレッドを複数実行すると 結果不正やデッドロックが起きる可能性がある 複数のスレッド ( マルチスレッド ) を安全に実行する ( スレッドセーフにする )

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

2016 VOCALOID Group, Yamaha Corporation 2

2016 VOCALOID Group, Yamaha Corporation 2 2016 VOCALOID Group, Yamaha Corporation 2016 VOCALOID Group, Yamaha Corporation 2 2016 VOCALOID Group, Yamaha Corporation 3 #if UNITY_EDITOR_WIN UNITY_STANDALONE_WIN using Yamaha.VOCALOID.Windows; #elif

More information

コーディング基準.PDF

コーディング基準.PDF Java Java Java Java.java.class 1 private public package import / //////////////////////////////////////////////////////////////////////////////// // // // // ////////////////////////////////////////////////////////////////////////////////

More information

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2:

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2: Java Jojo ( ) ( ) A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2: Java Jojo Jojo (1) :Globus GRAM ssh rsh GRAM ssh GRAM A rsh B Jojo (2) ( ) Jojo Java VM JavaRMI (Sun) Horb(ETL) ( ) JPVM,mpiJava etc. Send,

More information

PowerPoint Presentation

PowerPoint Presentation 様相論理と時相論理 Kripke 構造 K = S, R, L S: 状態の集合 ( 無限かもしれない ) R: 状態間の遷移関係 R S S L: 状態から命題記号の集合への写像 L(s) は 状態 s S において成り立つ命題記号の集合を与える Kripke 構造 K = S, R, L G = S, R 有向グラフ Kripke 構造 K = S, R, L L : S 2 Atom Atom

More information