# HG changeset patch # User Shinji KONO # Date 1353306125 -32400 # Node ID 5a5db338e71cda00c4f55ae5b3e8bf979b8ba4d1 # Parent a48e22ceed00186d311b48b1065f54726647d0be add mind map diff -r a48e22ceed00 -r 5a5db338e71c Alice.mm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Alice.mm Mon Nov 19 15:22:05 2012 +0900 @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r a48e22ceed00 -r 5a5db338e71c Paper/alice.ind --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Paper/alice.ind Mon Nov 19 15:22:05 2012 +0900 @@ -0,0 +1,5 @@ +-title: Code Segment と Data Segment によるプログラミング手法 + +--author: 河野 真治, 杉本 優 + +-- diff -r a48e22ceed00 -r 5a5db338e71c Paper/ipsjsort.bst --- a/Paper/ipsjsort.bst Mon Nov 19 09:57:51 2012 +0900 +++ b/Paper/ipsjsort.bst Mon Nov 19 15:22:05 2012 +0900 @@ -1,1 +1,1 @@ -% ipsjsort.bst nakasima@kuis.kyoto-u.ac.jp (Hiroshi Nakashima) % jssst.bst tomura@etl.go.jp (Satoru Tomura) % BibTeX standard bibliography style `jplain' % version 0.10 for JBibTeX versions 0.10 or later, JLaTeX version 2.09. % by Shouichi Matsui, matsui@denken.junet ENTRY { address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher school series title type volume year yomi } {} { label } INTEGERS { output.state before.all mid.sentence after.sentence after.block } INTEGERS { before.year } FUNCTION {init.state.consts} { #0 'before.all := #1 'mid.sentence := #2 'after.sentence := #3 'after.block := #4 'before.year := % year doesn't follows "," nor ".". (H.N.) } STRINGS { s t } FUNCTION {output.nonnull} { 's := output.state mid.sentence = { ", " * write$ } { output.state after.block = { add.period$ write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { output.state before.year = % year doesn't follows "," nor ".". (H.N.) { " " * write$ } { add.period$ " " * write$ } if$ } if$ } if$ mid.sentence 'output.state := } if$ s } FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ } FUNCTION {required.argument} { 't := empty$ {"Missing required argument " t * " in " * cite$ * warning$} 'skip$ if$ } FUNCTION {required.exclusive.or.argument} { 't := empty$ { 's := empty$ { t " or " * s * " is missing in " * cite$ * warning$} 'skip$ if$ } { 's := empty$ 'skip$ { "You can use only one of " t * " and " * s * " in " * cite$ * warning$} if$ } if$ } FUNCTION {required.and.or.argument} { 't := empty$ { 's := empty$ { "there's no " t * " and/or " * s * cite$ * warning$ } 'skip$ if$ } { pop$ pop$ } if$ } FUNCTION {optional.series.volume.number.argument} { series empty$ { volume empty$ { number empty$ 'skip$ { "there's a number but no series in " cite$ * warning$ } if$ } { number empty$ { "there's a volume but no series in " cite$ * warning$ } { "you can use only one of volume and number in " cite$ * warning$} if$ } if$ } { volume empty$ { number empty$ { "there's a series but neither volume nor number in " cite$ * warning$ } 'skip$ if$ } { number empty$ 'skip$ { "you can use only one of volume and number in " cite$ * warning$ } if$ } if$ } if$ } FUNCTION {output.bibitem} { newline$ "\bibitem{" write$ cite$ write$ "}" write$ newline$ before.all 'output.state := } FUNCTION {fin.entry} { add.period$ write$ newline$ } FUNCTION {new.block} { output.state before.all = 'skip$ { after.block 'output.state := } if$ } FUNCTION {new.sentence} { output.state after.block = 'skip$ { output.state before.all = 'skip$ { after.sentence 'output.state := } if$ } if$ } FUNCTION {not} { { #0 } { #1 } if$ } FUNCTION {and} { 'skip$ { pop$ #0 } if$ } FUNCTION {or} { { pop$ #1 } 'skip$ if$ } FUNCTION {new.block.checka} { empty$ 'skip$ 'new.block if$ } FUNCTION {new.block.checkb} { empty$ swap$ empty$ and 'skip$ 'new.block if$ } FUNCTION {new.sentence.checka} { empty$ 'skip$ 'new.sentence if$ } FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and 'skip$ 'new.sentence if$ } FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } 'skip$ if$ } FUNCTION {is.kanji} %%%{ #1 text.prefix$ chr.to.int$ #127 > } %%%{ #1 #1 substring$ chr.to.int$ #127 > } %%%{ purify$ #1 text.prefix$ chr.to.int$ #127 >} { is.kanji.str$ } FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { duplicate$ is.kanji 'skip$ { "{\em " swap$ * "\/}" * } if$ } if$ } INTEGERS { nameptr namesleft numnames } FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr s nameptr "{ll}" format.name$ is.kanji { "{ff}{vv}{ll}" } { "{vv }{ll}{, jj}{, f.}" } if$ format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { % numnames #2 > % { "," * } % 'skip$ % if$ % Don't put "," before "and" (H.N.) % % numnames #3 < % { t is.kanji % {"," * "" *} 'skip$ if$ % } % 'skip$ % if$ % Don't put "," before "ق" (H.N.) % t "others" = { s is.kanji {"ق" * } {" et al." * } if$ } { s is.kanji % {" " * t * } {", " * t * } % put "," here for Kanji (H.N.) {" and " * t * } if$ } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {format.authors} { author empty$ { "" } { author format.names } if$ } FUNCTION {format.editors} { editor empty$ { "" } { editor format.names editor num.names$ #1 > { editor is.kanji {"()" * } %%{", editors" * } if$ {"(eds.)" *} if$ } { editor is.kanji {"()" *} %%{", editor" * } if$ {"(ed.)" *} if$ } if$ } if$ } FUNCTION {n.dashify} { 't := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "--" * t #2 global.max$ substring$ 't := } { { t #1 #1 substring$ "-" = } { "-" * t #2 global.max$ substring$ 't := } while$ } if$ } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } if$ } while$ } FUNCTION {format.date} { before.year 'output.state := % year doesn't follows "," nor ".". (H.N.) year empty$ { month empty$ { "" } { "there's a month but no year in " cite$ * warning$ % month % no worth to put month only. (H.N.) "" } if$ } % { month empty$ % 'year % { month " " * year * } % if$ % } % month is not printed even if it is given. (H.N.) % { "(" year ")" * * } % year is surrounded by parens. (H.N.) if$ } FUNCTION {tie.or.space.connect} { duplicate$ text.length$ #3 < { "~" } { "\ " } if$ swap$ * * } FUNCTION {output.volume} { volume empty$ 'skip$ { "Vol.~" volume * output} if$ } FUNCTION {output.number} { number empty$ 'skip$ { "No.~" number * output} if$ } FUNCTION {output.series.volume.number} { series empty$ { output.volume output.number } { series is.kanji volume empty$ number empty$ or and { series " " * volume * number * output} { series output output.volume output.number} if$ } if$ } FUNCTION {format.edition} { edition empty$ { "" } { output.state mid.sentence = { edition "l" change.case$ " edition" * } { edition "t" change.case$ " edition" * } if$ } if$ } INTEGERS { multiresult } FUNCTION {multi.page.check} { 't := #0 'multiresult := { multiresult not t empty$ not and } { t #1 #1 substring$ duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or { #1 'multiresult := } { t #2 global.max$ substring$ 't := } if$ } while$ multiresult } FUNCTION {format.pages} { pages empty$ { "" } { pages multi.page.check % { "pp.~" pages n.dashify tie.or.space.connect } % { "pp.~" pages tie.or.space.connect } % '~' might be add by tie.or.space.connect. (H.N.) % "p." is probably better for single page reference (H.N.) { "pp." pages n.dashify tie.or.space.connect } { "p." pages tie.or.space.connect } if$ } if$ } % This function is replaced by format.vol.num.pages (H.N.) %FUNCTION {format.volume.number.year.pages} %{ volume empty$ % { number empty$ % { year empty$ % { "" } % { "(" year * ")" * } % if$} % { year empty$ % { "No.~" number * } % { "No.~" number * "(" * year * ")" * } % if$} % if$} % { number empty$ % { year empty$ % { "Vol.~" volume * } % { "Vol.~" volume * "(" * year * ")" * } % if$} % { year empty$ % {"Vol.~" volume * "," * "No.~" * number * } % {"Vol.~" volume * "," * "No.~" * number * "(" * year * ")" * } % if$} % if$} % if$ % pages empty$ % 'skip$ % { duplicate$ empty$ % { pop$ format.pages } % { "," * " pp.~" * pages n.dashify * } % if$ % } % if$ %} FUNCTION {format.vol.num.pages} { volume empty$ { ""} { " Vol.~" volume * } if$ number empty$ 'skip$ { volume empty$ { "there's a number but no volume in " cite$ * warning$ } { "," *} if$ " No.~" number * * } if$ pages empty$ 'skip$ { duplicate$ empty$ { pop$ format.pages } { ", " * format.pages * } % tieing "pp." and the first page will be too hard for a narrow column. (H.N.) if$ } if$ } FUNCTION {format.chapter.pages} { chapter empty$ 'format.pages { type empty$ { "chapter" chapter tie.or.space.connect } { type is.kanji { chapter type tie.or.space.connect } { type "l" change.case$ chapter tie.or.space.connect } if$ } if$ pages empty$ 'skip$ { ", " * format.pages * } if$ } if$ } FUNCTION {format.in.ed.booktitle} { booktitle empty$ { "" } { editor empty$ { booktitle is.kanji { " " booktitle emphasize * } { " " booktitle emphasize * } if$ } { booktitle is.kanji % { booktitle emphasize "(" * format.editors * ")" *} % { booktitle emphasize "(" * format.editors * ")" *} % awful without leading space (H.N.) { booktitle emphasize " (" * format.editors * ")" *} { booktitle emphasize " (" * format.editors * ")" *} if$ } if$ } if$ } FUNCTION {empty.misc.check} { author empty$ title empty$ howpublished empty$ month empty$ year empty$ note empty$ and and and and and key empty$ not and { "all relevant fields are empty in " cite$ * warning$ } 'skip$ if$ } FUNCTION {format.thesis.type} { type empty$ 'skip$ { pop$ type "t" change.case$ } if$ } FUNCTION {format.tr.number} { type empty$ { title empty$ { "Technical Report" } { title is.kanji { "Zp" } { "Technical Report" } if$ } if$ } {type} if$ number empty$ { "t" change.case$ } { number tie.or.space.connect } if$ } FUNCTION {format.article.crossref} { key empty$ { journal empty$ { "need key or journal for " cite$ * " to crossref " * crossref * warning$ "" } { "In " journal emphasize * } if$ } { "In " key * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.crossref.editor} { editor #1 "{vv }{ll}" format.name$ editor num.names$ duplicate$ #2 > { editor is.kanji {pop$ " ق" *} {pop$ " et al." * } if$ } { #2 < 'skip$ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = { editor is.kanji {" ق" *} {"et al." * } if$ } { editor is.kanji {" " * editor #2 "{vv }{ll}" format.name$ * } {" and " * editor #2 "{vv }{ll}" format.name$ * } if$ } if$ } if$ } if$ } FUNCTION {format.book.crossref} { volume empty$ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ title is.kanji {" "} {"In "} if$ } { "Volume" volume tie.or.space.connect " of " * } if$ editor empty$ editor field.or.null author field.or.null = or { key empty$ { series empty$ { "need editor, key, or series for " cite$ * " to crossref " * crossref * warning$ "" * } { series emphasize } if$ } { key * } if$ } { format.crossref.editor * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.incoll.inproc.crossref} { editor empty$ editor field.or.null author field.or.null = or { key empty$ { booktitle empty$ { "need editor, key, or booktitle for " cite$ * " to crossref " * crossref * warning$ "" } { booktitle is.kanji booktitle {"In " booktitle emphasize * } if$ } if$ } { "In " key * } if$ } { title is.kanji {" " format.crossref.editor * } {"In " format.crossref.editor * } if$ } if$ " \cite{" * crossref * "}" * } FUNCTION {article} { %%%% author "author" required.argument title "title" required.argument journal "journal" required.argument year "year" required.argument %%%% jssst volume "volume" number "number" required.and.or.argument pages "pages" required.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { journal emphasize output % format.volume.number.year.pages output % date is always at the end. (H.N.) format.vol.num.pages output format.date output } { format.article.crossref output.nonnull format.pages output } if$ new.block note output fin.entry } FUNCTION {book} { %%%% author "author" editor "editor" required.exclusive.or.argument title "title" required.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem author empty$ { format.editors} { format.authors} if$ ": " * title emphasize output crossref missing$ { output.series.volume.number publisher output address output } { new.block format.book.crossref output.nonnull } if$ format.edition output format.date output new.block note output fin.entry } FUNCTION {booklet} { %%%% title "title" required.argument %%%% jssst author "author" required.argument %%%% output.bibitem format.authors ": " * title output howpublished output address output format.date output new.block note output fin.entry } FUNCTION {inbook} { %%%% author "author" editor "editor" required.exclusive.or.argument title "title" required.argument chapter "chapter" pages "pages" required.and.or.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem author empty$ { format.editors} { format.authors} if$ ": " * title emphasize output crossref missing$ { output.series.volume.number publisher output } { format.chapter.pages output new.block format.book.crossref output.nonnull } if$ format.edition output % format.date output format.chapter.pages output format.date output % date is always at the end. (H.N.) new.block note output fin.entry } FUNCTION {incollection} { %%%% author "author" required.argument title "title" required.argument booktitle "booktitle" required.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { format.in.ed.booktitle output output.series.volume.number publisher output address output format.edition output format.chapter.pages output % date is always at the end. (H.N.) format.date output } { format.incoll.inproc.crossref output.nonnull format.chapter.pages output } if$ % format.chapter.pages output new.block note output fin.entry } FUNCTION {inproceedings} { %%%% author "author" required.argument title "title" required.argument booktitle "booktitle" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { format.in.ed.booktitle output output.series.volume.number address output organization output publisher output % format.date output format.pages output format.date output % date is always at the end. (H.N.) } { format.incoll.inproc.crossref output.nonnull format.pages output } if$ new.block note output fin.entry } FUNCTION {conference} { inproceedings } FUNCTION {manual} { %%%% title "title" required.argument %%%% jssst author "author" organization "organazaion" required.exclusive.or.argument %%%% output.bibitem author empty$ { organization} { format.authors} if$ ": " * title emphasize output author empty$ 'skip$ { organization output } if$ address output format.edition output format.date output new.block note output fin.entry } FUNCTION {mastersthesis} { %%%% author "author" required.argument title "title" required.argument school "school" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title output author empty$ { "Master's thesis" } { author is.kanji { "Cm_" } { "Master's thesis" } if$ } if$ format.thesis.type output.nonnull school output address output format.date output new.block note output fin.entry } FUNCTION {misc} { %%%% %%%% jssst author "author" required.argument title "title" required.argument %%%% output.bibitem format.authors ": " * title output howpublished output format.date output new.block note output fin.entry empty.misc.check } FUNCTION {phdthesis} { %%%% author "author" required.argument title "title" required.argument school "school" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title emphasize output author empty$ { "PhD Thesis" } { author is.kanji { "m_" } { "PhD Thesis" } if$ } if$ format.thesis.type output.nonnull school output address output format.date output new.block note output fin.entry } FUNCTION {proceedings} { %%%% title "title" required.argument year "year" required.argument optional.series.volume.number.argument %%%% jssst editor "editor" organization "organization" required.exclusive.or.argument %%%% output.bibitem editor empty$ { organization } { format.editors } if$ ": " * title emphasize output output.series.volume.number address output editor empty$ 'skip$ { organization output } if$ publisher output format.date output new.block note output fin.entry } FUNCTION {techreport} { %%%% author "author" required.argument title "title" required.argument institution "institution" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title output format.tr.number output.nonnull institution output address output format.date output new.block note output fin.entry } FUNCTION {unpublished} { %%%% author "author" required.argument title "title" required.argument note "note" required.argument %%%% output.bibitem format.authors ": " * title output format.date output new.block note output fin.entry } FUNCTION {default.type} { misc } MACRO {jan} {"January"} MACRO {feb} {"February"} MACRO {mar} {"March"} MACRO {apr} {"April"} MACRO {may} {"May"} MACRO {jun} {"June"} MACRO {jul} {"July"} MACRO {aug} {"August"} MACRO {sep} {"September"} MACRO {oct} {"October"} MACRO {nov} {"November"} MACRO {dec} {"December"} MACRO {acmcs} {"ACM Computing Surveys"} MACRO {acta} {"Acta Informatica"} MACRO {cacm} {"Communications of the ACM"} MACRO {ibmjrd} {"IBM Journal of Research and Development"} MACRO {ibmsj} {"IBM Systems Journal"} MACRO {ieeese} {"IEEE Transactions on Software Engineering"} MACRO {ieeetc} {"IEEE Transactions on Computers"} MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} MACRO {ipl} {"Information Processing Letters"} MACRO {jacm} {"Journal of the ACM"} MACRO {jcss} {"Journal of Computer and System Sciences"} MACRO {scp} {"Science of Computer Programming"} MACRO {sicomp} {"SIAM Journal on Computing"} MACRO {tocs} {"ACM Transactions on Computer Systems"} MACRO {tods} {"ACM Transactions on Database Systems"} MACRO {tog} {"ACM Transactions on Graphics"} MACRO {toms} {"ACM Transactions on Mathematical Software"} MACRO {toois} {"ACM Transactions on Office Information Systems"} MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} MACRO {tcs} {"Theoretical Computer Science"} READ FUNCTION {sortify} { purify$ "l" change.case$ } INTEGERS { len } FUNCTION {chop.word} { 's := 'len := s #1 len substring$ = { s len #1 + global.max$ substring$ } 's if$ } FUNCTION {sort.format.names} { 's := yomi empty$ 'skip$ { yomi 's := } if$ #1 'nameptr := "" s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { nameptr #1 > { " " * } 'skip$ if$ s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := nameptr numnames = t "others" = and { "et al" * } { t sortify * } if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {sort.format.title} { 't := "A " #2 "An " #3 "The " #4 t chop.word chop.word chop.word sortify #1 global.max$ substring$ } FUNCTION {author.sort} { author empty$ { key empty$ { "to sort, need author or key in " cite$ * warning$ "" } { key sortify } if$ } { author sort.format.names } if$ } FUNCTION {author.editor.sort} { author empty$ { editor empty$ { key empty$ { "to sort, need author, editor, or key in " cite$ * warning$ "" } { key sortify } if$ } { editor sort.format.names } if$ } { author sort.format.names } if$ } FUNCTION {author.organization.sort} { author empty$ { organization empty$ { key empty$ { "to sort, need author, organization, or key in " cite$ * warning$ "" } { key sortify } if$ } { "The " #4 organization chop.word sortify } if$ } { author sort.format.names } if$ } FUNCTION {editor.organization.sort} { editor empty$ { organization empty$ { key empty$ { "to sort, need editor, organization, or key in " cite$ * warning$ "" } { key sortify } if$ } { "The " #4 organization chop.word sortify } if$ } { editor sort.format.names } if$ } FUNCTION {presort} { type$ "book" = type$ "inbook" = or 'author.editor.sort { type$ "proceedings" = 'editor.organization.sort { type$ "manual" = 'author.organization.sort 'author.sort if$ } if$ } if$ " " * year field.or.null sortify * " " * title field.or.null sort.format.title * #1 entry.max$ substring$ 'sort.key$ := } ITERATE {presort} SORT STRINGS { longest.label } INTEGERS { number.label longest.label.width } FUNCTION {initialize.longest.label} { "" 'longest.label := #1 'number.label := #0 'longest.label.width := } FUNCTION {longest.label.pass} { number.label int.to.str$ 'label := number.label #1 + 'number.label := label width$ longest.label.width > { label 'longest.label := label width$ 'longest.label.width := } 'skip$ if$ } EXECUTE {initialize.longest.label} ITERATE {longest.label.pass} FUNCTION {begin.bib} { preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{" longest.label * "}" * write$ newline$ } EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib} \ No newline at end of file +% ipsjsort.bst nakasima@kuis.kyoto-u.ac.jp (Hiroshi Nakashima) % jssst.bst tomura@etl.go.jp (Satoru Tomura) % BibTeX standard bibliography style `jplain' % version 0.10 for JBibTeX versions 0.10 or later, JLaTeX version 2.09. % by Shouichi Matsui, matsui@denken.junet ENTRY { address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher school series title type volume year yomi } {} { label } INTEGERS { output.state before.all mid.sentence after.sentence after.block } INTEGERS { before.year } FUNCTION {init.state.consts} { #0 'before.all := #1 'mid.sentence := #2 'after.sentence := #3 'after.block := #4 'before.year := % year doesn't follows "," nor ".". (H.N.) } STRINGS { s t } FUNCTION {output.nonnull} { 's := output.state mid.sentence = { ", " * write$ } { output.state after.block = { add.period$ write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { output.state before.year = % year doesn't follows "," nor ".". (H.N.) { " " * write$ } { add.period$ " " * write$ } if$ } if$ } if$ mid.sentence 'output.state := } if$ s } FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ } FUNCTION {required.argument} { 't := empty$ {"Missing required argument " t * " in " * cite$ * warning$} 'skip$ if$ } FUNCTION {required.exclusive.or.argument} { 't := empty$ { 's := empty$ { t " or " * s * " is missing in " * cite$ * warning$} 'skip$ if$ } { 's := empty$ 'skip$ { "You can use only one of " t * " and " * s * " in " * cite$ * warning$} if$ } if$ } FUNCTION {required.and.or.argument} { 't := empty$ { 's := empty$ { "there's no " t * " and/or " * s * cite$ * warning$ } 'skip$ if$ } { pop$ pop$ } if$ } FUNCTION {optional.series.volume.number.argument} { series empty$ { volume empty$ { number empty$ 'skip$ { "there's a number but no series in " cite$ * warning$ } if$ } { number empty$ { "there's a volume but no series in " cite$ * warning$ } { "you can use only one of volume and number in " cite$ * warning$} if$ } if$ } { volume empty$ { number empty$ { "there's a series but neither volume nor number in " cite$ * warning$ } 'skip$ if$ } { number empty$ 'skip$ { "you can use only one of volume and number in " cite$ * warning$ } if$ } if$ } if$ } FUNCTION {output.bibitem} { newline$ "\bibitem{" write$ cite$ write$ "}" write$ newline$ before.all 'output.state := } FUNCTION {fin.entry} { add.period$ write$ newline$ } FUNCTION {new.block} { output.state before.all = 'skip$ { after.block 'output.state := } if$ } FUNCTION {new.sentence} { output.state after.block = 'skip$ { output.state before.all = 'skip$ { after.sentence 'output.state := } if$ } if$ } FUNCTION {not} { { #0 } { #1 } if$ } FUNCTION {and} { 'skip$ { pop$ #0 } if$ } FUNCTION {or} { { pop$ #1 } 'skip$ if$ } FUNCTION {new.block.checka} { empty$ 'skip$ 'new.block if$ } FUNCTION {new.block.checkb} { empty$ swap$ empty$ and 'skip$ 'new.block if$ } FUNCTION {new.sentence.checka} { empty$ 'skip$ 'new.sentence if$ } FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and 'skip$ 'new.sentence if$ } FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } 'skip$ if$ } FUNCTION {is.kanji} %%%{ #1 text.prefix$ chr.to.int$ #127 > } %%%{ #1 #1 substring$ chr.to.int$ #127 > } %%%{ purify$ #1 text.prefix$ chr.to.int$ #127 >} { is.kanji.str$ } FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { duplicate$ is.kanji 'skip$ { "{\em " swap$ * "\/}" * } if$ } if$ } INTEGERS { nameptr namesleft numnames } FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr s nameptr "{ll}" format.name$ is.kanji { "{ff}{vv}{ll}" } { "{vv }{ll}{, jj}{, f.}" } if$ format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { % numnames #2 > % { "," * } % 'skip$ % if$ % Don't put "," before "and" (H.N.) % % numnames #3 < % { t is.kanji % {"," * "" *} 'skip$ if$ % } % 'skip$ % if$ % Don't put "," before "ほか" (H.N.) % t "others" = { s is.kanji {"ほか" * } {" et al." * } if$ } { s is.kanji % {" " * t * } {", " * t * } % put "," here for Kanji (H.N.) {" and " * t * } if$ } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {format.authors} { author empty$ { "" } { author format.names } if$ } FUNCTION {format.editors} { editor empty$ { "" } { editor format.names editor num.names$ #1 > { editor is.kanji {"(編)" * } %%{", editors" * } if$ {"(eds.)" *} if$ } { editor is.kanji {"(編)" *} %%{", editor" * } if$ {"(ed.)" *} if$ } if$ } if$ } FUNCTION {n.dashify} { 't := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "--" * t #2 global.max$ substring$ 't := } { { t #1 #1 substring$ "-" = } { "-" * t #2 global.max$ substring$ 't := } while$ } if$ } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } if$ } while$ } FUNCTION {format.date} { before.year 'output.state := % year doesn't follows "," nor ".". (H.N.) year empty$ { month empty$ { "" } { "there's a month but no year in " cite$ * warning$ % month % no worth to put month only. (H.N.) "" } if$ } % { month empty$ % 'year % { month " " * year * } % if$ % } % month is not printed even if it is given. (H.N.) % { "(" year ")" * * } % year is surrounded by parens. (H.N.) if$ } FUNCTION {tie.or.space.connect} { duplicate$ text.length$ #3 < { "~" } { "\ " } if$ swap$ * * } FUNCTION {output.volume} { volume empty$ 'skip$ { "Vol.~" volume * output} if$ } FUNCTION {output.number} { number empty$ 'skip$ { "No.~" number * output} if$ } FUNCTION {output.series.volume.number} { series empty$ { output.volume output.number } { series is.kanji volume empty$ number empty$ or and { series " " * volume * number * output} { series output output.volume output.number} if$ } if$ } FUNCTION {format.edition} { edition empty$ { "" } { output.state mid.sentence = { edition "l" change.case$ " edition" * } { edition "t" change.case$ " edition" * } if$ } if$ } INTEGERS { multiresult } FUNCTION {multi.page.check} { 't := #0 'multiresult := { multiresult not t empty$ not and } { t #1 #1 substring$ duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or { #1 'multiresult := } { t #2 global.max$ substring$ 't := } if$ } while$ multiresult } FUNCTION {format.pages} { pages empty$ { "" } { pages multi.page.check % { "pp.~" pages n.dashify tie.or.space.connect } % { "pp.~" pages tie.or.space.connect } % '~' might be add by tie.or.space.connect. (H.N.) % "p." is probably better for single page reference (H.N.) { "pp." pages n.dashify tie.or.space.connect } { "p." pages tie.or.space.connect } if$ } if$ } % This function is replaced by format.vol.num.pages (H.N.) %FUNCTION {format.volume.number.year.pages} %{ volume empty$ % { number empty$ % { year empty$ % { "" } % { "(" year * ")" * } % if$} % { year empty$ % { "No.~" number * } % { "No.~" number * "(" * year * ")" * } % if$} % if$} % { number empty$ % { year empty$ % { "Vol.~" volume * } % { "Vol.~" volume * "(" * year * ")" * } % if$} % { year empty$ % {"Vol.~" volume * "," * "No.~" * number * } % {"Vol.~" volume * "," * "No.~" * number * "(" * year * ")" * } % if$} % if$} % if$ % pages empty$ % 'skip$ % { duplicate$ empty$ % { pop$ format.pages } % { "," * " pp.~" * pages n.dashify * } % if$ % } % if$ %} FUNCTION {format.vol.num.pages} { volume empty$ { ""} { " Vol.~" volume * } if$ number empty$ 'skip$ { volume empty$ { "there's a number but no volume in " cite$ * warning$ } { "," *} if$ " No.~" number * * } if$ pages empty$ 'skip$ { duplicate$ empty$ { pop$ format.pages } { ", " * format.pages * } % tieing "pp." and the first page will be too hard for a narrow column. (H.N.) if$ } if$ } FUNCTION {format.chapter.pages} { chapter empty$ 'format.pages { type empty$ { "chapter" chapter tie.or.space.connect } { type is.kanji { chapter type tie.or.space.connect } { type "l" change.case$ chapter tie.or.space.connect } if$ } if$ pages empty$ 'skip$ { ", " * format.pages * } if$ } if$ } FUNCTION {format.in.ed.booktitle} { booktitle empty$ { "" } { editor empty$ { booktitle is.kanji { " " booktitle emphasize * } { " " booktitle emphasize * } if$ } { booktitle is.kanji % { booktitle emphasize "(" * format.editors * ")" *} % { booktitle emphasize "(" * format.editors * ")" *} % awful without leading space (H.N.) { booktitle emphasize " (" * format.editors * ")" *} { booktitle emphasize " (" * format.editors * ")" *} if$ } if$ } if$ } FUNCTION {empty.misc.check} { author empty$ title empty$ howpublished empty$ month empty$ year empty$ note empty$ and and and and and key empty$ not and { "all relevant fields are empty in " cite$ * warning$ } 'skip$ if$ } FUNCTION {format.thesis.type} { type empty$ 'skip$ { pop$ type "t" change.case$ } if$ } FUNCTION {format.tr.number} { type empty$ { title empty$ { "Technical Report" } { title is.kanji { "技術報告" } { "Technical Report" } if$ } if$ } {type} if$ number empty$ { "t" change.case$ } { number tie.or.space.connect } if$ } FUNCTION {format.article.crossref} { key empty$ { journal empty$ { "need key or journal for " cite$ * " to crossref " * crossref * warning$ "" } { "In " journal emphasize * } if$ } { "In " key * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.crossref.editor} { editor #1 "{vv }{ll}" format.name$ editor num.names$ duplicate$ #2 > { editor is.kanji {pop$ " ほか" *} {pop$ " et al." * } if$ } { #2 < 'skip$ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = { editor is.kanji {" ほか" *} {"et al." * } if$ } { editor is.kanji {" " * editor #2 "{vv }{ll}" format.name$ * } {" and " * editor #2 "{vv }{ll}" format.name$ * } if$ } if$ } if$ } if$ } FUNCTION {format.book.crossref} { volume empty$ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ title is.kanji {" "} {"In "} if$ } { "Volume" volume tie.or.space.connect " of " * } if$ editor empty$ editor field.or.null author field.or.null = or { key empty$ { series empty$ { "need editor, key, or series for " cite$ * " to crossref " * crossref * warning$ "" * } { series emphasize } if$ } { key * } if$ } { format.crossref.editor * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.incoll.inproc.crossref} { editor empty$ editor field.or.null author field.or.null = or { key empty$ { booktitle empty$ { "need editor, key, or booktitle for " cite$ * " to crossref " * crossref * warning$ "" } { booktitle is.kanji booktitle {"In " booktitle emphasize * } if$ } if$ } { "In " key * } if$ } { title is.kanji {" " format.crossref.editor * } {"In " format.crossref.editor * } if$ } if$ " \cite{" * crossref * "}" * } FUNCTION {article} { %%%% author "author" required.argument title "title" required.argument journal "journal" required.argument year "year" required.argument %%%% jssst volume "volume" number "number" required.and.or.argument pages "pages" required.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { journal emphasize output % format.volume.number.year.pages output % date is always at the end. (H.N.) format.vol.num.pages output format.date output } { format.article.crossref output.nonnull format.pages output } if$ new.block note output fin.entry } FUNCTION {book} { %%%% author "author" editor "editor" required.exclusive.or.argument title "title" required.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem author empty$ { format.editors} { format.authors} if$ ": " * title emphasize output crossref missing$ { output.series.volume.number publisher output address output } { new.block format.book.crossref output.nonnull } if$ format.edition output format.date output new.block note output fin.entry } FUNCTION {booklet} { %%%% title "title" required.argument %%%% jssst author "author" required.argument %%%% output.bibitem format.authors ": " * title output howpublished output address output format.date output new.block note output fin.entry } FUNCTION {inbook} { %%%% author "author" editor "editor" required.exclusive.or.argument title "title" required.argument chapter "chapter" pages "pages" required.and.or.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem author empty$ { format.editors} { format.authors} if$ ": " * title emphasize output crossref missing$ { output.series.volume.number publisher output } { format.chapter.pages output new.block format.book.crossref output.nonnull } if$ format.edition output % format.date output format.chapter.pages output format.date output % date is always at the end. (H.N.) new.block note output fin.entry } FUNCTION {incollection} { %%%% author "author" required.argument title "title" required.argument booktitle "booktitle" required.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { format.in.ed.booktitle output output.series.volume.number publisher output address output format.edition output format.chapter.pages output % date is always at the end. (H.N.) format.date output } { format.incoll.inproc.crossref output.nonnull format.chapter.pages output } if$ % format.chapter.pages output new.block note output fin.entry } FUNCTION {inproceedings} { %%%% author "author" required.argument title "title" required.argument booktitle "booktitle" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { format.in.ed.booktitle output output.series.volume.number address output organization output publisher output % format.date output format.pages output format.date output % date is always at the end. (H.N.) } { format.incoll.inproc.crossref output.nonnull format.pages output } if$ new.block note output fin.entry } FUNCTION {conference} { inproceedings } FUNCTION {manual} { %%%% title "title" required.argument %%%% jssst author "author" organization "organazaion" required.exclusive.or.argument %%%% output.bibitem author empty$ { organization} { format.authors} if$ ": " * title emphasize output author empty$ 'skip$ { organization output } if$ address output format.edition output format.date output new.block note output fin.entry } FUNCTION {mastersthesis} { %%%% author "author" required.argument title "title" required.argument school "school" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title output author empty$ { "Master's thesis" } { author is.kanji { "修士論文" } { "Master's thesis" } if$ } if$ format.thesis.type output.nonnull school output address output format.date output new.block note output fin.entry } FUNCTION {misc} { %%%% %%%% jssst author "author" required.argument title "title" required.argument %%%% output.bibitem format.authors ": " * title output howpublished output format.date output new.block note output fin.entry empty.misc.check } FUNCTION {phdthesis} { %%%% author "author" required.argument title "title" required.argument school "school" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title emphasize output author empty$ { "PhD Thesis" } { author is.kanji { "博士論文" } { "PhD Thesis" } if$ } if$ format.thesis.type output.nonnull school output address output format.date output new.block note output fin.entry } FUNCTION {proceedings} { %%%% title "title" required.argument year "year" required.argument optional.series.volume.number.argument %%%% jssst editor "editor" organization "organization" required.exclusive.or.argument %%%% output.bibitem editor empty$ { organization } { format.editors } if$ ": " * title emphasize output output.series.volume.number address output editor empty$ 'skip$ { organization output } if$ publisher output format.date output new.block note output fin.entry } FUNCTION {techreport} { %%%% author "author" required.argument title "title" required.argument institution "institution" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title output format.tr.number output.nonnull institution output address output format.date output new.block note output fin.entry } FUNCTION {unpublished} { %%%% author "author" required.argument title "title" required.argument note "note" required.argument %%%% output.bibitem format.authors ": " * title output format.date output new.block note output fin.entry } FUNCTION {default.type} { misc } MACRO {jan} {"January"} MACRO {feb} {"February"} MACRO {mar} {"March"} MACRO {apr} {"April"} MACRO {may} {"May"} MACRO {jun} {"June"} MACRO {jul} {"July"} MACRO {aug} {"August"} MACRO {sep} {"September"} MACRO {oct} {"October"} MACRO {nov} {"November"} MACRO {dec} {"December"} MACRO {acmcs} {"ACM Computing Surveys"} MACRO {acta} {"Acta Informatica"} MACRO {cacm} {"Communications of the ACM"} MACRO {ibmjrd} {"IBM Journal of Research and Development"} MACRO {ibmsj} {"IBM Systems Journal"} MACRO {ieeese} {"IEEE Transactions on Software Engineering"} MACRO {ieeetc} {"IEEE Transactions on Computers"} MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} MACRO {ipl} {"Information Processing Letters"} MACRO {jacm} {"Journal of the ACM"} MACRO {jcss} {"Journal of Computer and System Sciences"} MACRO {scp} {"Science of Computer Programming"} MACRO {sicomp} {"SIAM Journal on Computing"} MACRO {tocs} {"ACM Transactions on Computer Systems"} MACRO {tods} {"ACM Transactions on Database Systems"} MACRO {tog} {"ACM Transactions on Graphics"} MACRO {toms} {"ACM Transactions on Mathematical Software"} MACRO {toois} {"ACM Transactions on Office Information Systems"} MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} MACRO {tcs} {"Theoretical Computer Science"} READ FUNCTION {sortify} { purify$ "l" change.case$ } INTEGERS { len } FUNCTION {chop.word} { 's := 'len := s #1 len substring$ = { s len #1 + global.max$ substring$ } 's if$ } FUNCTION {sort.format.names} { 's := yomi empty$ 'skip$ { yomi 's := } if$ #1 'nameptr := "" s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { nameptr #1 > { " " * } 'skip$ if$ s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't := nameptr numnames = t "others" = and { "et al" * } { t sortify * } if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {sort.format.title} { 't := "A " #2 "An " #3 "The " #4 t chop.word chop.word chop.word sortify #1 global.max$ substring$ } FUNCTION {author.sort} { author empty$ { key empty$ { "to sort, need author or key in " cite$ * warning$ "" } { key sortify } if$ } { author sort.format.names } if$ } FUNCTION {author.editor.sort} { author empty$ { editor empty$ { key empty$ { "to sort, need author, editor, or key in " cite$ * warning$ "" } { key sortify } if$ } { editor sort.format.names } if$ } { author sort.format.names } if$ } FUNCTION {author.organization.sort} { author empty$ { organization empty$ { key empty$ { "to sort, need author, organization, or key in " cite$ * warning$ "" } { key sortify } if$ } { "The " #4 organization chop.word sortify } if$ } { author sort.format.names } if$ } FUNCTION {editor.organization.sort} { editor empty$ { organization empty$ { key empty$ { "to sort, need editor, organization, or key in " cite$ * warning$ "" } { key sortify } if$ } { "The " #4 organization chop.word sortify } if$ } { editor sort.format.names } if$ } FUNCTION {presort} { type$ "book" = type$ "inbook" = or 'author.editor.sort { type$ "proceedings" = 'editor.organization.sort { type$ "manual" = 'author.organization.sort 'author.sort if$ } if$ } if$ " " * year field.or.null sortify * " " * title field.or.null sort.format.title * #1 entry.max$ substring$ 'sort.key$ := } ITERATE {presort} SORT STRINGS { longest.label } INTEGERS { number.label longest.label.width } FUNCTION {initialize.longest.label} { "" 'longest.label := #1 'number.label := #0 'longest.label.width := } FUNCTION {longest.label.pass} { number.label int.to.str$ 'label := number.label #1 + 'number.label := label width$ longest.label.width > { label 'longest.label := label width$ 'longest.label.width := } 'skip$ if$ } EXECUTE {initialize.longest.label} ITERATE {longest.label.pass} FUNCTION {begin.bib} { preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{" longest.label * "}" * write$ newline$ } EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib} \ No newline at end of file diff -r a48e22ceed00 -r 5a5db338e71c Paper/ipsjunsrt.bst --- a/Paper/ipsjunsrt.bst Mon Nov 19 09:57:51 2012 +0900 +++ b/Paper/ipsjunsrt.bst Mon Nov 19 15:22:05 2012 +0900 @@ -1,1 +1,1 @@ -% ipsjsort.bst nakasima@kuis.kyoto-u.ac.jp (Hiroshi Nakashima) % jssst.bst tomura@etl.go.jp (Satoru Tomura) % BibTeX standard bibliography style `jplain' % version 0.10 for JBibTeX versions 0.10 or later, JLaTeX version 2.09. % by Shouichi Matsui, matsui@denken.junet ENTRY { address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher school series title type volume year yomi } {} { label } INTEGERS { output.state before.all mid.sentence after.sentence after.block } INTEGERS { before.year } FUNCTION {init.state.consts} { #0 'before.all := #1 'mid.sentence := #2 'after.sentence := #3 'after.block := #4 'before.year := % year doesn't follows "," nor ".". (H.N.) } STRINGS { s t } FUNCTION {output.nonnull} { 's := output.state mid.sentence = { ", " * write$ } { output.state after.block = { add.period$ write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { output.state before.year = % year doesn't follows "," nor ".". (H.N.) { " " * write$ } { add.period$ " " * write$ } if$ } if$ } if$ mid.sentence 'output.state := } if$ s } FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ } FUNCTION {required.argument} { 't := empty$ {"Missing required argument " t * " in " * cite$ * warning$} 'skip$ if$ } FUNCTION {required.exclusive.or.argument} { 't := empty$ { 's := empty$ { t " or " * s * " is missing in " * cite$ * warning$} 'skip$ if$ } { 's := empty$ 'skip$ { "You can use only one of " t * " and " * s * " in " * cite$ * warning$} if$ } if$ } FUNCTION {required.and.or.argument} { 't := empty$ { 's := empty$ { "there's no " t * " and/or " * s * cite$ * warning$ } 'skip$ if$ } { pop$ pop$ } if$ } FUNCTION {optional.series.volume.number.argument} { series empty$ { volume empty$ { number empty$ 'skip$ { "there's a number but no series in " cite$ * warning$ } if$ } { number empty$ { "there's a volume but no series in " cite$ * warning$ } { "you can use only one of volume and number in " cite$ * warning$} if$ } if$ } { volume empty$ { number empty$ { "there's a series but neither volume nor number in " cite$ * warning$ } 'skip$ if$ } { number empty$ 'skip$ { "you can use only one of volume and number in " cite$ * warning$ } if$ } if$ } if$ } FUNCTION {output.bibitem} { newline$ "\bibitem{" write$ cite$ write$ "}" write$ newline$ before.all 'output.state := } FUNCTION {fin.entry} { add.period$ write$ newline$ } FUNCTION {new.block} { output.state before.all = 'skip$ { after.block 'output.state := } if$ } FUNCTION {new.sentence} { output.state after.block = 'skip$ { output.state before.all = 'skip$ { after.sentence 'output.state := } if$ } if$ } FUNCTION {not} { { #0 } { #1 } if$ } FUNCTION {and} { 'skip$ { pop$ #0 } if$ } FUNCTION {or} { { pop$ #1 } 'skip$ if$ } FUNCTION {new.block.checka} { empty$ 'skip$ 'new.block if$ } FUNCTION {new.block.checkb} { empty$ swap$ empty$ and 'skip$ 'new.block if$ } FUNCTION {new.sentence.checka} { empty$ 'skip$ 'new.sentence if$ } FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and 'skip$ 'new.sentence if$ } FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } 'skip$ if$ } FUNCTION {is.kanji} %%%{ #1 text.prefix$ chr.to.int$ #127 > } %%%{ #1 #1 substring$ chr.to.int$ #127 > } %%%{ purify$ #1 text.prefix$ chr.to.int$ #127 >} { is.kanji.str$ } FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { duplicate$ is.kanji 'skip$ { "{\em " swap$ * "\/}" * } if$ } if$ } INTEGERS { nameptr namesleft numnames } FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr s nameptr "{ll}" format.name$ is.kanji { "{ff}{vv}{ll}" } { "{vv }{ll}{, jj}{, f.}" } if$ format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { % numnames #2 > % { "," * } % 'skip$ % if$ % Don't put "," before "and" (H.N.) % % numnames #3 < % { t is.kanji % {"," * "" *} 'skip$ if$ % } % 'skip$ % if$ % Don't put "," before "ق" (H.N.) % t "others" = { s is.kanji {"ق" * } {" et al." * } if$ } { s is.kanji % {" " * t * } {", " * t * } % put "," here for Kanji (H.N.) {" and " * t * } if$ } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {format.authors} { author empty$ { "" } { author format.names } if$ } FUNCTION {format.editors} { editor empty$ { "" } { editor format.names editor num.names$ #1 > { editor is.kanji {"()" * } %%{", editors" * } if$ {"(eds.)" *} if$ } { editor is.kanji {"()" *} %%{", editor" * } if$ {"(ed.)" *} if$ } if$ } if$ } FUNCTION {n.dashify} { 't := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "--" * t #2 global.max$ substring$ 't := } { { t #1 #1 substring$ "-" = } { "-" * t #2 global.max$ substring$ 't := } while$ } if$ } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } if$ } while$ } FUNCTION {format.date} { before.year 'output.state := % year doesn't follows "," nor ".". (H.N.) year empty$ { month empty$ { "" } { "there's a month but no year in " cite$ * warning$ % month % no worth to put month only. (H.N.) "" } if$ } % { month empty$ % 'year % { month " " * year * } % if$ % } % month is not printed even if it is given. (H.N.) % { "(" year ")" * * } % year is surrounded by parens. (H.N.) if$ } FUNCTION {tie.or.space.connect} { duplicate$ text.length$ #3 < { "~" } { "\ " } if$ swap$ * * } FUNCTION {output.volume} { volume empty$ 'skip$ { "Vol.~" volume * output} if$ } FUNCTION {output.number} { number empty$ 'skip$ { "No.~" number * output} if$ } FUNCTION {output.series.volume.number} { series empty$ { output.volume output.number } { series is.kanji volume empty$ number empty$ or and { series " " * volume * number * output} { series output output.volume output.number} if$ } if$ } FUNCTION {format.edition} { edition empty$ { "" } { output.state mid.sentence = { edition "l" change.case$ " edition" * } { edition "t" change.case$ " edition" * } if$ } if$ } INTEGERS { multiresult } FUNCTION {multi.page.check} { 't := #0 'multiresult := { multiresult not t empty$ not and } { t #1 #1 substring$ duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or { #1 'multiresult := } { t #2 global.max$ substring$ 't := } if$ } while$ multiresult } FUNCTION {format.pages} { pages empty$ { "" } { pages multi.page.check % { "pp.~" pages n.dashify tie.or.space.connect } % { "pp.~" pages tie.or.space.connect } % '~' might be add by tie.or.space.connect. (H.N.) % "p." is probably better for single page reference (H.N.) { "pp." pages n.dashify tie.or.space.connect } { "p." pages tie.or.space.connect } if$ } if$ } % This function is replaced by format.vol.num.pages (H.N.) %FUNCTION {format.volume.number.year.pages} %{ volume empty$ % { number empty$ % { year empty$ % { "" } % { "(" year * ")" * } % if$} % { year empty$ % { "No.~" number * } % { "No.~" number * "(" * year * ")" * } % if$} % if$} % { number empty$ % { year empty$ % { "Vol.~" volume * } % { "Vol.~" volume * "(" * year * ")" * } % if$} % { year empty$ % {"Vol.~" volume * "," * "No.~" * number * } % {"Vol.~" volume * "," * "No.~" * number * "(" * year * ")" * } % if$} % if$} % if$ % pages empty$ % 'skip$ % { duplicate$ empty$ % { pop$ format.pages } % { "," * " pp.~" * pages n.dashify * } % if$ % } % if$ %} FUNCTION {format.vol.num.pages} { volume empty$ { ""} { " Vol.~" volume * } if$ number empty$ 'skip$ { volume empty$ { "there's a number but no volume in " cite$ * warning$ } { "," *} if$ " No.~" number * * } if$ pages empty$ 'skip$ { duplicate$ empty$ { pop$ format.pages } { ", " * format.pages * } % tieing "pp." and the first page will be too hard for a narrow column. (H.N.) if$ } if$ } FUNCTION {format.chapter.pages} { chapter empty$ 'format.pages { type empty$ { "chapter" chapter tie.or.space.connect } { type is.kanji { chapter type tie.or.space.connect } { type "l" change.case$ chapter tie.or.space.connect } if$ } if$ pages empty$ 'skip$ { ", " * format.pages * } if$ } if$ } FUNCTION {format.in.ed.booktitle} { booktitle empty$ { "" } { editor empty$ { booktitle is.kanji { " " booktitle emphasize * } { " " booktitle emphasize * } if$ } { booktitle is.kanji % { booktitle emphasize "(" * format.editors * ")" *} % { booktitle emphasize "(" * format.editors * ")" *} % awful without leading space (H.N.) { booktitle emphasize " (" * format.editors * ")" *} { booktitle emphasize " (" * format.editors * ")" *} if$ } if$ } if$ } FUNCTION {empty.misc.check} { author empty$ title empty$ howpublished empty$ month empty$ year empty$ note empty$ and and and and and key empty$ not and { "all relevant fields are empty in " cite$ * warning$ } 'skip$ if$ } FUNCTION {format.thesis.type} { type empty$ 'skip$ { pop$ type "t" change.case$ } if$ } FUNCTION {format.tr.number} { type empty$ { title empty$ { "Technical Report" } { title is.kanji { "Zp" } { "Technical Report" } if$ } if$ } {type} if$ number empty$ { "t" change.case$ } { number tie.or.space.connect } if$ } FUNCTION {format.article.crossref} { key empty$ { journal empty$ { "need key or journal for " cite$ * " to crossref " * crossref * warning$ "" } { "In " journal emphasize * } if$ } { "In " key * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.crossref.editor} { editor #1 "{vv }{ll}" format.name$ editor num.names$ duplicate$ #2 > { editor is.kanji {pop$ " ق" *} {pop$ " et al." * } if$ } { #2 < 'skip$ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = { editor is.kanji {" ق" *} {"et al." * } if$ } { editor is.kanji {" " * editor #2 "{vv }{ll}" format.name$ * } {" and " * editor #2 "{vv }{ll}" format.name$ * } if$ } if$ } if$ } if$ } FUNCTION {format.book.crossref} { volume empty$ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ title is.kanji {" "} {"In "} if$ } { "Volume" volume tie.or.space.connect " of " * } if$ editor empty$ editor field.or.null author field.or.null = or { key empty$ { series empty$ { "need editor, key, or series for " cite$ * " to crossref " * crossref * warning$ "" * } { series emphasize } if$ } { key * } if$ } { format.crossref.editor * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.incoll.inproc.crossref} { editor empty$ editor field.or.null author field.or.null = or { key empty$ { booktitle empty$ { "need editor, key, or booktitle for " cite$ * " to crossref " * crossref * warning$ "" } { booktitle is.kanji booktitle {"In " booktitle emphasize * } if$ } if$ } { "In " key * } if$ } { title is.kanji {" " format.crossref.editor * } {"In " format.crossref.editor * } if$ } if$ " \cite{" * crossref * "}" * } FUNCTION {article} { %%%% author "author" required.argument title "title" required.argument journal "journal" required.argument year "year" required.argument %%%% jssst volume "volume" number "number" required.and.or.argument pages "pages" required.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { journal emphasize output % format.volume.number.year.pages output % date is always at the end. (H.N.) format.vol.num.pages output format.date output } { format.article.crossref output.nonnull format.pages output } if$ new.block note output fin.entry } FUNCTION {book} { %%%% author "author" editor "editor" required.exclusive.or.argument title "title" required.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem author empty$ { format.editors} { format.authors} if$ ": " * title emphasize output crossref missing$ { output.series.volume.number publisher output address output } { new.block format.book.crossref output.nonnull } if$ format.edition output format.date output new.block note output fin.entry } FUNCTION {booklet} { %%%% title "title" required.argument %%%% jssst author "author" required.argument %%%% output.bibitem format.authors ": " * title output howpublished output address output format.date output new.block note output fin.entry } FUNCTION {inbook} { %%%% author "author" editor "editor" required.exclusive.or.argument title "title" required.argument chapter "chapter" pages "pages" required.and.or.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem author empty$ { format.editors} { format.authors} if$ ": " * title emphasize output crossref missing$ { output.series.volume.number publisher output } { format.chapter.pages output new.block format.book.crossref output.nonnull } if$ format.edition output % format.date output format.chapter.pages output format.date output % date is always at the end. (H.N.) new.block note output fin.entry } FUNCTION {incollection} { %%%% author "author" required.argument title "title" required.argument booktitle "booktitle" required.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { format.in.ed.booktitle output output.series.volume.number publisher output address output format.edition output format.chapter.pages output % date is always at the end. (H.N.) format.date output } { format.incoll.inproc.crossref output.nonnull format.chapter.pages output } if$ % format.chapter.pages output new.block note output fin.entry } FUNCTION {inproceedings} { %%%% author "author" required.argument title "title" required.argument booktitle "booktitle" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { format.in.ed.booktitle output output.series.volume.number address output organization output publisher output % format.date output format.pages output format.date output % date is always at the end. (H.N.) } { format.incoll.inproc.crossref output.nonnull format.pages output } if$ new.block note output fin.entry } FUNCTION {conference} { inproceedings } FUNCTION {manual} { %%%% title "title" required.argument %%%% jssst author "author" organization "organazaion" required.exclusive.or.argument %%%% output.bibitem author empty$ { organization} { format.authors} if$ ": " * title emphasize output author empty$ 'skip$ { organization output } if$ address output format.edition output format.date output new.block note output fin.entry } FUNCTION {mastersthesis} { %%%% author "author" required.argument title "title" required.argument school "school" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title output author empty$ { "Master's thesis" } { author is.kanji { "Cm_" } { "Master's thesis" } if$ } if$ format.thesis.type output.nonnull school output address output format.date output new.block note output fin.entry } FUNCTION {misc} { %%%% %%%% jssst author "author" required.argument title "title" required.argument %%%% output.bibitem format.authors ": " * title output howpublished output format.date output new.block note output fin.entry empty.misc.check } FUNCTION {phdthesis} { %%%% author "author" required.argument title "title" required.argument school "school" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title emphasize output author empty$ { "PhD Thesis" } { author is.kanji { "m_" } { "PhD Thesis" } if$ } if$ format.thesis.type output.nonnull school output address output format.date output new.block note output fin.entry } FUNCTION {proceedings} { %%%% title "title" required.argument year "year" required.argument optional.series.volume.number.argument %%%% jssst editor "editor" organization "organization" required.exclusive.or.argument %%%% output.bibitem editor empty$ { organization } { format.editors } if$ ": " * title emphasize output output.series.volume.number address output editor empty$ 'skip$ { organization output } if$ publisher output format.date output new.block note output fin.entry } FUNCTION {techreport} { %%%% author "author" required.argument title "title" required.argument institution "institution" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title output format.tr.number output.nonnull institution output address output format.date output new.block note output fin.entry } FUNCTION {unpublished} { %%%% author "author" required.argument title "title" required.argument note "note" required.argument %%%% output.bibitem format.authors ": " * title output format.date output new.block note output fin.entry } FUNCTION {default.type} { misc } MACRO {jan} {"January"} MACRO {feb} {"February"} MACRO {mar} {"March"} MACRO {apr} {"April"} MACRO {may} {"May"} MACRO {jun} {"June"} MACRO {jul} {"July"} MACRO {aug} {"August"} MACRO {sep} {"September"} MACRO {oct} {"October"} MACRO {nov} {"November"} MACRO {dec} {"December"} MACRO {acmcs} {"ACM Computing Surveys"} MACRO {acta} {"Acta Informatica"} MACRO {cacm} {"Communications of the ACM"} MACRO {ibmjrd} {"IBM Journal of Research and Development"} MACRO {ibmsj} {"IBM Systems Journal"} MACRO {ieeese} {"IEEE Transactions on Software Engineering"} MACRO {ieeetc} {"IEEE Transactions on Computers"} MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} MACRO {ipl} {"Information Processing Letters"} MACRO {jacm} {"Journal of the ACM"} MACRO {jcss} {"Journal of Computer and System Sciences"} MACRO {scp} {"Science of Computer Programming"} MACRO {sicomp} {"SIAM Journal on Computing"} MACRO {tocs} {"ACM Transactions on Computer Systems"} MACRO {tods} {"ACM Transactions on Database Systems"} MACRO {tog} {"ACM Transactions on Graphics"} MACRO {toms} {"ACM Transactions on Mathematical Software"} MACRO {toois} {"ACM Transactions on Office Information Systems"} MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} MACRO {tcs} {"Theoretical Computer Science"} READ STRINGS { longest.label } INTEGERS { number.label longest.label.width } FUNCTION {initialize.longest.label} { "" 'longest.label := #1 'number.label := #0 'longest.label.width := } FUNCTION {longest.label.pass} { number.label int.to.str$ 'label := number.label #1 + 'number.label := label width$ longest.label.width > { label 'longest.label := label width$ 'longest.label.width := } 'skip$ if$ } EXECUTE {initialize.longest.label} ITERATE {longest.label.pass} FUNCTION {begin.bib} { preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{" longest.label * "}" * write$ newline$ } EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib} \ No newline at end of file +% ipsjsort.bst nakasima@kuis.kyoto-u.ac.jp (Hiroshi Nakashima) % jssst.bst tomura@etl.go.jp (Satoru Tomura) % BibTeX standard bibliography style `jplain' % version 0.10 for JBibTeX versions 0.10 or later, JLaTeX version 2.09. % by Shouichi Matsui, matsui@denken.junet ENTRY { address author booktitle chapter edition editor howpublished institution journal key month note number organization pages publisher school series title type volume year yomi } {} { label } INTEGERS { output.state before.all mid.sentence after.sentence after.block } INTEGERS { before.year } FUNCTION {init.state.consts} { #0 'before.all := #1 'mid.sentence := #2 'after.sentence := #3 'after.block := #4 'before.year := % year doesn't follows "," nor ".". (H.N.) } STRINGS { s t } FUNCTION {output.nonnull} { 's := output.state mid.sentence = { ", " * write$ } { output.state after.block = { add.period$ write$ newline$ "\newblock " write$ } { output.state before.all = 'write$ { output.state before.year = % year doesn't follows "," nor ".". (H.N.) { " " * write$ } { add.period$ " " * write$ } if$ } if$ } if$ mid.sentence 'output.state := } if$ s } FUNCTION {output} { duplicate$ empty$ 'pop$ 'output.nonnull if$ } FUNCTION {required.argument} { 't := empty$ {"Missing required argument " t * " in " * cite$ * warning$} 'skip$ if$ } FUNCTION {required.exclusive.or.argument} { 't := empty$ { 's := empty$ { t " or " * s * " is missing in " * cite$ * warning$} 'skip$ if$ } { 's := empty$ 'skip$ { "You can use only one of " t * " and " * s * " in " * cite$ * warning$} if$ } if$ } FUNCTION {required.and.or.argument} { 't := empty$ { 's := empty$ { "there's no " t * " and/or " * s * cite$ * warning$ } 'skip$ if$ } { pop$ pop$ } if$ } FUNCTION {optional.series.volume.number.argument} { series empty$ { volume empty$ { number empty$ 'skip$ { "there's a number but no series in " cite$ * warning$ } if$ } { number empty$ { "there's a volume but no series in " cite$ * warning$ } { "you can use only one of volume and number in " cite$ * warning$} if$ } if$ } { volume empty$ { number empty$ { "there's a series but neither volume nor number in " cite$ * warning$ } 'skip$ if$ } { number empty$ 'skip$ { "you can use only one of volume and number in " cite$ * warning$ } if$ } if$ } if$ } FUNCTION {output.bibitem} { newline$ "\bibitem{" write$ cite$ write$ "}" write$ newline$ before.all 'output.state := } FUNCTION {fin.entry} { add.period$ write$ newline$ } FUNCTION {new.block} { output.state before.all = 'skip$ { after.block 'output.state := } if$ } FUNCTION {new.sentence} { output.state after.block = 'skip$ { output.state before.all = 'skip$ { after.sentence 'output.state := } if$ } if$ } FUNCTION {not} { { #0 } { #1 } if$ } FUNCTION {and} { 'skip$ { pop$ #0 } if$ } FUNCTION {or} { { pop$ #1 } 'skip$ if$ } FUNCTION {new.block.checka} { empty$ 'skip$ 'new.block if$ } FUNCTION {new.block.checkb} { empty$ swap$ empty$ and 'skip$ 'new.block if$ } FUNCTION {new.sentence.checka} { empty$ 'skip$ 'new.sentence if$ } FUNCTION {new.sentence.checkb} { empty$ swap$ empty$ and 'skip$ 'new.sentence if$ } FUNCTION {field.or.null} { duplicate$ empty$ { pop$ "" } 'skip$ if$ } FUNCTION {is.kanji} %%%{ #1 text.prefix$ chr.to.int$ #127 > } %%%{ #1 #1 substring$ chr.to.int$ #127 > } %%%{ purify$ #1 text.prefix$ chr.to.int$ #127 >} { is.kanji.str$ } FUNCTION {emphasize} { duplicate$ empty$ { pop$ "" } { duplicate$ is.kanji 'skip$ { "{\em " swap$ * "\/}" * } if$ } if$ } INTEGERS { nameptr namesleft numnames } FUNCTION {format.names} { 's := #1 'nameptr := s num.names$ 'numnames := numnames 'namesleft := { namesleft #0 > } { s nameptr s nameptr "{ll}" format.name$ is.kanji { "{ff}{vv}{ll}" } { "{vv }{ll}{, jj}{, f.}" } if$ format.name$ 't := nameptr #1 > { namesleft #1 > { ", " * t * } { % numnames #2 > % { "," * } % 'skip$ % if$ % Don't put "," before "and" (H.N.) % % numnames #3 < % { t is.kanji % {"," * "" *} 'skip$ if$ % } % 'skip$ % if$ % Don't put "," before "ほか" (H.N.) % t "others" = { s is.kanji {"ほか" * } {" et al." * } if$ } { s is.kanji % {" " * t * } {", " * t * } % put "," here for Kanji (H.N.) {" and " * t * } if$ } if$ } if$ } 't if$ nameptr #1 + 'nameptr := namesleft #1 - 'namesleft := } while$ } FUNCTION {format.authors} { author empty$ { "" } { author format.names } if$ } FUNCTION {format.editors} { editor empty$ { "" } { editor format.names editor num.names$ #1 > { editor is.kanji {"(編)" * } %%{", editors" * } if$ {"(eds.)" *} if$ } { editor is.kanji {"(編)" *} %%{", editor" * } if$ {"(ed.)" *} if$ } if$ } if$ } FUNCTION {n.dashify} { 't := "" { t empty$ not } { t #1 #1 substring$ "-" = { t #1 #2 substring$ "--" = not { "--" * t #2 global.max$ substring$ 't := } { { t #1 #1 substring$ "-" = } { "-" * t #2 global.max$ substring$ 't := } while$ } if$ } { t #1 #1 substring$ * t #2 global.max$ substring$ 't := } if$ } while$ } FUNCTION {format.date} { before.year 'output.state := % year doesn't follows "," nor ".". (H.N.) year empty$ { month empty$ { "" } { "there's a month but no year in " cite$ * warning$ % month % no worth to put month only. (H.N.) "" } if$ } % { month empty$ % 'year % { month " " * year * } % if$ % } % month is not printed even if it is given. (H.N.) % { "(" year ")" * * } % year is surrounded by parens. (H.N.) if$ } FUNCTION {tie.or.space.connect} { duplicate$ text.length$ #3 < { "~" } { "\ " } if$ swap$ * * } FUNCTION {output.volume} { volume empty$ 'skip$ { "Vol.~" volume * output} if$ } FUNCTION {output.number} { number empty$ 'skip$ { "No.~" number * output} if$ } FUNCTION {output.series.volume.number} { series empty$ { output.volume output.number } { series is.kanji volume empty$ number empty$ or and { series " " * volume * number * output} { series output output.volume output.number} if$ } if$ } FUNCTION {format.edition} { edition empty$ { "" } { output.state mid.sentence = { edition "l" change.case$ " edition" * } { edition "t" change.case$ " edition" * } if$ } if$ } INTEGERS { multiresult } FUNCTION {multi.page.check} { 't := #0 'multiresult := { multiresult not t empty$ not and } { t #1 #1 substring$ duplicate$ "-" = swap$ duplicate$ "," = swap$ "+" = or or { #1 'multiresult := } { t #2 global.max$ substring$ 't := } if$ } while$ multiresult } FUNCTION {format.pages} { pages empty$ { "" } { pages multi.page.check % { "pp.~" pages n.dashify tie.or.space.connect } % { "pp.~" pages tie.or.space.connect } % '~' might be add by tie.or.space.connect. (H.N.) % "p." is probably better for single page reference (H.N.) { "pp." pages n.dashify tie.or.space.connect } { "p." pages tie.or.space.connect } if$ } if$ } % This function is replaced by format.vol.num.pages (H.N.) %FUNCTION {format.volume.number.year.pages} %{ volume empty$ % { number empty$ % { year empty$ % { "" } % { "(" year * ")" * } % if$} % { year empty$ % { "No.~" number * } % { "No.~" number * "(" * year * ")" * } % if$} % if$} % { number empty$ % { year empty$ % { "Vol.~" volume * } % { "Vol.~" volume * "(" * year * ")" * } % if$} % { year empty$ % {"Vol.~" volume * "," * "No.~" * number * } % {"Vol.~" volume * "," * "No.~" * number * "(" * year * ")" * } % if$} % if$} % if$ % pages empty$ % 'skip$ % { duplicate$ empty$ % { pop$ format.pages } % { "," * " pp.~" * pages n.dashify * } % if$ % } % if$ %} FUNCTION {format.vol.num.pages} { volume empty$ { ""} { " Vol.~" volume * } if$ number empty$ 'skip$ { volume empty$ { "there's a number but no volume in " cite$ * warning$ } { "," *} if$ " No.~" number * * } if$ pages empty$ 'skip$ { duplicate$ empty$ { pop$ format.pages } { ", " * format.pages * } % tieing "pp." and the first page will be too hard for a narrow column. (H.N.) if$ } if$ } FUNCTION {format.chapter.pages} { chapter empty$ 'format.pages { type empty$ { "chapter" chapter tie.or.space.connect } { type is.kanji { chapter type tie.or.space.connect } { type "l" change.case$ chapter tie.or.space.connect } if$ } if$ pages empty$ 'skip$ { ", " * format.pages * } if$ } if$ } FUNCTION {format.in.ed.booktitle} { booktitle empty$ { "" } { editor empty$ { booktitle is.kanji { " " booktitle emphasize * } { " " booktitle emphasize * } if$ } { booktitle is.kanji % { booktitle emphasize "(" * format.editors * ")" *} % { booktitle emphasize "(" * format.editors * ")" *} % awful without leading space (H.N.) { booktitle emphasize " (" * format.editors * ")" *} { booktitle emphasize " (" * format.editors * ")" *} if$ } if$ } if$ } FUNCTION {empty.misc.check} { author empty$ title empty$ howpublished empty$ month empty$ year empty$ note empty$ and and and and and key empty$ not and { "all relevant fields are empty in " cite$ * warning$ } 'skip$ if$ } FUNCTION {format.thesis.type} { type empty$ 'skip$ { pop$ type "t" change.case$ } if$ } FUNCTION {format.tr.number} { type empty$ { title empty$ { "Technical Report" } { title is.kanji { "技術報告" } { "Technical Report" } if$ } if$ } {type} if$ number empty$ { "t" change.case$ } { number tie.or.space.connect } if$ } FUNCTION {format.article.crossref} { key empty$ { journal empty$ { "need key or journal for " cite$ * " to crossref " * crossref * warning$ "" } { "In " journal emphasize * } if$ } { "In " key * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.crossref.editor} { editor #1 "{vv }{ll}" format.name$ editor num.names$ duplicate$ #2 > { editor is.kanji {pop$ " ほか" *} {pop$ " et al." * } if$ } { #2 < 'skip$ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = { editor is.kanji {" ほか" *} {"et al." * } if$ } { editor is.kanji {" " * editor #2 "{vv }{ll}" format.name$ * } {" and " * editor #2 "{vv }{ll}" format.name$ * } if$ } if$ } if$ } if$ } FUNCTION {format.book.crossref} { volume empty$ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ title is.kanji {" "} {"In "} if$ } { "Volume" volume tie.or.space.connect " of " * } if$ editor empty$ editor field.or.null author field.or.null = or { key empty$ { series empty$ { "need editor, key, or series for " cite$ * " to crossref " * crossref * warning$ "" * } { series emphasize } if$ } { key * } if$ } { format.crossref.editor * } if$ " \cite{" * crossref * "}" * } FUNCTION {format.incoll.inproc.crossref} { editor empty$ editor field.or.null author field.or.null = or { key empty$ { booktitle empty$ { "need editor, key, or booktitle for " cite$ * " to crossref " * crossref * warning$ "" } { booktitle is.kanji booktitle {"In " booktitle emphasize * } if$ } if$ } { "In " key * } if$ } { title is.kanji {" " format.crossref.editor * } {"In " format.crossref.editor * } if$ } if$ " \cite{" * crossref * "}" * } FUNCTION {article} { %%%% author "author" required.argument title "title" required.argument journal "journal" required.argument year "year" required.argument %%%% jssst volume "volume" number "number" required.and.or.argument pages "pages" required.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { journal emphasize output % format.volume.number.year.pages output % date is always at the end. (H.N.) format.vol.num.pages output format.date output } { format.article.crossref output.nonnull format.pages output } if$ new.block note output fin.entry } FUNCTION {book} { %%%% author "author" editor "editor" required.exclusive.or.argument title "title" required.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem author empty$ { format.editors} { format.authors} if$ ": " * title emphasize output crossref missing$ { output.series.volume.number publisher output address output } { new.block format.book.crossref output.nonnull } if$ format.edition output format.date output new.block note output fin.entry } FUNCTION {booklet} { %%%% title "title" required.argument %%%% jssst author "author" required.argument %%%% output.bibitem format.authors ": " * title output howpublished output address output format.date output new.block note output fin.entry } FUNCTION {inbook} { %%%% author "author" editor "editor" required.exclusive.or.argument title "title" required.argument chapter "chapter" pages "pages" required.and.or.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem author empty$ { format.editors} { format.authors} if$ ": " * title emphasize output crossref missing$ { output.series.volume.number publisher output } { format.chapter.pages output new.block format.book.crossref output.nonnull } if$ format.edition output % format.date output format.chapter.pages output format.date output % date is always at the end. (H.N.) new.block note output fin.entry } FUNCTION {incollection} { %%%% author "author" required.argument title "title" required.argument booktitle "booktitle" required.argument publisher "publisher" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { format.in.ed.booktitle output output.series.volume.number publisher output address output format.edition output format.chapter.pages output % date is always at the end. (H.N.) format.date output } { format.incoll.inproc.crossref output.nonnull format.chapter.pages output } if$ % format.chapter.pages output new.block note output fin.entry } FUNCTION {inproceedings} { %%%% author "author" required.argument title "title" required.argument booktitle "booktitle" required.argument year "year" required.argument optional.series.volume.number.argument %%%% output.bibitem format.authors ": " * title output crossref missing$ { format.in.ed.booktitle output output.series.volume.number address output organization output publisher output % format.date output format.pages output format.date output % date is always at the end. (H.N.) } { format.incoll.inproc.crossref output.nonnull format.pages output } if$ new.block note output fin.entry } FUNCTION {conference} { inproceedings } FUNCTION {manual} { %%%% title "title" required.argument %%%% jssst author "author" organization "organazaion" required.exclusive.or.argument %%%% output.bibitem author empty$ { organization} { format.authors} if$ ": " * title emphasize output author empty$ 'skip$ { organization output } if$ address output format.edition output format.date output new.block note output fin.entry } FUNCTION {mastersthesis} { %%%% author "author" required.argument title "title" required.argument school "school" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title output author empty$ { "Master's thesis" } { author is.kanji { "修士論文" } { "Master's thesis" } if$ } if$ format.thesis.type output.nonnull school output address output format.date output new.block note output fin.entry } FUNCTION {misc} { %%%% %%%% jssst author "author" required.argument title "title" required.argument %%%% output.bibitem format.authors ": " * title output howpublished output format.date output new.block note output fin.entry empty.misc.check } FUNCTION {phdthesis} { %%%% author "author" required.argument title "title" required.argument school "school" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title emphasize output author empty$ { "PhD Thesis" } { author is.kanji { "博士論文" } { "PhD Thesis" } if$ } if$ format.thesis.type output.nonnull school output address output format.date output new.block note output fin.entry } FUNCTION {proceedings} { %%%% title "title" required.argument year "year" required.argument optional.series.volume.number.argument %%%% jssst editor "editor" organization "organization" required.exclusive.or.argument %%%% output.bibitem editor empty$ { organization } { format.editors } if$ ": " * title emphasize output output.series.volume.number address output editor empty$ 'skip$ { organization output } if$ publisher output format.date output new.block note output fin.entry } FUNCTION {techreport} { %%%% author "author" required.argument title "title" required.argument institution "institution" required.argument year "year" required.argument %%%% output.bibitem format.authors ": " * title output format.tr.number output.nonnull institution output address output format.date output new.block note output fin.entry } FUNCTION {unpublished} { %%%% author "author" required.argument title "title" required.argument note "note" required.argument %%%% output.bibitem format.authors ": " * title output format.date output new.block note output fin.entry } FUNCTION {default.type} { misc } MACRO {jan} {"January"} MACRO {feb} {"February"} MACRO {mar} {"March"} MACRO {apr} {"April"} MACRO {may} {"May"} MACRO {jun} {"June"} MACRO {jul} {"July"} MACRO {aug} {"August"} MACRO {sep} {"September"} MACRO {oct} {"October"} MACRO {nov} {"November"} MACRO {dec} {"December"} MACRO {acmcs} {"ACM Computing Surveys"} MACRO {acta} {"Acta Informatica"} MACRO {cacm} {"Communications of the ACM"} MACRO {ibmjrd} {"IBM Journal of Research and Development"} MACRO {ibmsj} {"IBM Systems Journal"} MACRO {ieeese} {"IEEE Transactions on Software Engineering"} MACRO {ieeetc} {"IEEE Transactions on Computers"} MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"} MACRO {ipl} {"Information Processing Letters"} MACRO {jacm} {"Journal of the ACM"} MACRO {jcss} {"Journal of Computer and System Sciences"} MACRO {scp} {"Science of Computer Programming"} MACRO {sicomp} {"SIAM Journal on Computing"} MACRO {tocs} {"ACM Transactions on Computer Systems"} MACRO {tods} {"ACM Transactions on Database Systems"} MACRO {tog} {"ACM Transactions on Graphics"} MACRO {toms} {"ACM Transactions on Mathematical Software"} MACRO {toois} {"ACM Transactions on Office Information Systems"} MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"} MACRO {tcs} {"Theoretical Computer Science"} READ STRINGS { longest.label } INTEGERS { number.label longest.label.width } FUNCTION {initialize.longest.label} { "" 'longest.label := #1 'number.label := #0 'longest.label.width := } FUNCTION {longest.label.pass} { number.label int.to.str$ 'label := number.label #1 + 'number.label := label width$ longest.label.width > { label 'longest.label := label width$ 'longest.label.width := } 'skip$ if$ } EXECUTE {initialize.longest.label} ITERATE {longest.label.pass} FUNCTION {begin.bib} { preamble$ empty$ 'skip$ { preamble$ write$ newline$ } if$ "\begin{thebibliography}{" longest.label * "}" * write$ newline$ } EXECUTE {begin.bib} EXECUTE {init.state.consts} ITERATE {call.type$} FUNCTION {end.bib} { newline$ "\end{thebibliography}" write$ newline$ } EXECUTE {end.bib} \ No newline at end of file diff -r a48e22ceed00 -r 5a5db338e71c Paper/sugi-prosym.tex --- a/Paper/sugi-prosym.tex Mon Nov 19 09:57:51 2012 +0900 +++ b/Paper/sugi-prosym.tex Mon Nov 19 15:22:05 2012 +0900 @@ -1,1 +1,226 @@ -\documentclass[private]{ipsjpapers} \usepackage{listings} % 巻数,号数などの設定 %\setcounter{巻数}{41} %\setcounter{号数}{6} %\setcounter{volpageoffset}{1234} %\受付{12}{2}{4} %\採録{12}{5}{11} % ユーザが定義したマクロなど. \makeatletter \let\@ARRAY\@array \def\@array{\def\<{\inhibitglue}\@ARRAY} \def\<{\(\langle\)} \def\>{\(\rangle\)} %\def\|{\verb|} \def\Underline{\setbox0\hbox\bgroup\let\\\endUnderline} \def\endUnderline{\vphantom{y}\egroup\smash{\underline{\box0}}\\} \def\LATEX{\iLATEX\Large} \def\LATEx{\iLATEX\normalsize} \def\LATex{\iLATEX\small} \def\iLATEX#1{L\kern-.36em\raise.3ex\hbox{#1\bf A}\kern-.15em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX} \def\LATEXe{\ifx\LaTeXe\undefined \LaTeX 2e\else\LaTeXe\fi} \def\LATExe{\ifx\LaTeXe\undefined \iLATEX\scriptsize 2e\else\LaTeXe\fi} \def\Quote{\list{}{}\item[]} \let\endQuote\endlist \def\TT{\if@LaTeX@e\tt\fi} \def\CS#1{\if@LaTeX@e\tt\expandafter\string\csname#1\endcsname\else $\backslash$#1\fi} %\checklines % 行送りを確認する時に使用 \begin{document}%{ % 和文表題 \title[Code Segment と Data Segment によるプログラミング手法]% {Code Segment と Data Segment によるプログラミング手法 } % 英文表題 \etitle{How to Programming with Code Segment and Data Segment} % 所属ラベルの定義 \affilabel{URYUKYU}{琉球大学\\University of the Ryukyu} % 和文著者名 \author{河野 真治\affiref{URYUKYU}\member{19841765}\and 杉本 優\affiref{URYUKYU}\nomember} % 英文著者名 \eauthor{Shinji Kono\affiref{URYUKYU}\and Yu Sugimoto\affiref{URYUKYU}} % 連絡先(投稿時に必要.製版用では無視される.) \contact{杉本 優\\ 〒903-0213 沖縄県中頭郡西原町字千原1番地\\ 琉球大学 情報工学科\\ TEL: (098)895-8723\qquad FAX: (098)895-8727\\ email: sugi@cr.ie.u-ryukyu.ac.jp} % 和文概要 \begin{abstract} 本研究室では分散プログラミングにおいて、データをData Segment、タスクをCode Segmentという単位に分割して記述する方法を提唱している。 しかし、前述した方法をプログラマーが一から記述することは大変である。そこで、本研究室で分散ネットフレームワーク Alice を作成した。本論文では実際にAliceを用いてCode Segment と Data Segment によるプログラミング手法の例を示す。 \end{abstract} % 英文概要 \begin{eabstract} \end{eabstract} % 表題などの出力 \maketitle % }{ % 本文はここから始まる \section{歴史的経緯} 本研究室では、並列タスク管理フレームワークCeriumの管理を行なっているが、その設計と実装を行うにあたり、並列プログラミングと分散プログラミング は本質的には同じことを行なっていることが分かった。特にヘテロジーニアスマルチコアであり、ローカルストアをそれぞれのコアが持っているというCell の特異な環境は、分散プログラミング環境と告示している。それらを踏まえて、Ceriumのタスク管理手法を分散に応用できないかと考えた。 Ceriumに置いても、タスクとそれの入出力データの取り扱いは難しい課題である。データを操作するAPIを考えて、タスクを自然に記述し、効率良く実行する方法を考えてきた。そこで考えられた手法が、データをDataSegment、タスクをCodeSegmentという単位に分割して記述する方法である。 % }{ \section{分散ネットフレームワークAlice}\label{sec:ITEM} \subsection{Aliceとは} Aliceは本研究室の卒業生である赤嶺一樹氏が、本研究室で開発を行なっている並列タスク管理フレームワーク Cerium と先行研究である Federated Linda の開発を通して得られた知見を生かされている。 Federated Linda の設計はシングルスレッドで行われている。しかし、近年ではマルチコアのマシンが主流となっている。将来的にはメニーコアのマシンが主流になってくると考えられるそのような背景を踏まえてAliceはマルチスレッド向けに設計されている。 AliceはData SegmentとCode Segmentという単位でデータと処理を細かく分割し、それぞれの依存関係を記述して分散プログラムを作成する。また、他のマシンとの接続トポロジーの構成の機能も有しているのでユーザーはトポロジー構成後の処理を記述するだけでよい。 % }{ \subsection{Data Segment} AliceではData Semgnetをデータベースとして利用している。KeyValueStoreで実装されており、キーごとにリストを持っている。Data Segment APIを用いることで、リストにデータを追加、削除を適宜行うことができる。 \subsubsection{Data Segment Manager} 大量のData Segmentを管理するのがData Segment Managerである。Data Segment Managerは文字列のキーでData Segmentを整理する。各キーごとにキュー構造を持っている。それらをData Segment APIを用いて操作する。 データの読み出し("peek" または "take")時に、希望のデータがなかった場合、ブロッキングを行う機能を持つ。 しかし、ブロッキングといってもそこで同期するわけではない。 非同期でデータを通信する。 そのため、 "peek" と "take" は他の API とは違い、レスポンスが発生する。 \subsubsection{Data Segment API} 表番号)が用意されているData Segment APIである。これらを用いてデータの送受信を行う。 \begin{itemize} \item {\ttfamily void put(String key, Value val)} \item {\ttfamily void update(String key, Value val)} \item {\ttfamily void peek(Receiver receiver, String key, int id)} \item {\ttfamily void take(Receiver receiver, String key, int id)} \end{itemize} \subsubsection*{"put"} "put" はデータを追加するための API である。 "put" は受け取ったデータ val を Data Segment 内のキューに対してエンキューする。 この時、キーごとに重複しない連番の ID を受け取った順に振る。 %(図 \ref{fig:put}) \subsubsection*{"update"} "update" はデータを置き換えるための API である。 "update" はキューの先頭にあるデータをひとつだけ削除する。 その後は "put" と同じく、 受け取ったデータ val を Data Segment 内のキューに対してエンキューする。 この時、キーごとに重複しない連番の ID を受け取った順に振る。 %(図 \ref{fig:update}) \subsubsection*{"peek"} "peek" はデータを読み込むための API である。 "peek" は前回読み込んだデータの id を引数で指定する。省略した場合は、 0 が id として渡される。 id よりも値の大きい id のデータがキューに含まれていれば、そのデータを receiver に返す。 もし id 以下のデータしか無いならば、データの更新が前回の "peek" 発行時から更新が無いものと考え、リストに格納されて保留される。 %(図 \ref{fig:peek}) "take" や "update" によりデータの更新があれば、 "peek" が直ちに実行される。 \subsubsection*{"take"} "take" もデータを読み込むための API である。 基本的な id に関する部分は "peek" と同じである。 "peek" との決定的な違いは、読み込まれたデータは Data Segment 内のキューから取り除かれるということである。 %(図 \ref{fig:take}) %after \lstset{ language={java}, basicstyle={\small}, identifierstyle={\small}, commentstyle={\small\itshape}, keywordstyle={\small\bfseries}, ndkeywordstyle={\small}, stringstyle={\small\ttfamily}, frame={tb}, breaklines=true, columns=[l]{fullflexible}, numbers=left, xrightmargin=0zw, xleftmargin=3zw, numberstyle={\scriptsize}, stepnumber=1, numbersep=1zw, lineskip=-0.5ex } \subsection{Code Segment} Code Segmentはタスクのことである。Code Segmentをユーザーが記述するときに、Code Segment 内で使用するData Segment を記述し、依存関係を作る。依存関係により、実行される順番が一意に決まる。実際に使用するData Segment はCode Segmentの入出力に相当する。それぞれ、Input Data Segment、Output Data Segmentとする。 \subsubsection{Code Segmentの実行方法} Code Semgnetを実行するためにはStart Code SegmentというCode Segmentを実行させる必要がある。 Start Code SegmentはどのData Segmentにも依存しない。つまりInput Data Segmentを持たない。このCode Segmentをmainメソッド内でnewし、executeメソッドを呼ぶことで実行を開始させることができる。 \begin{table}[tb] \lstinputlisting[label=StartCodeSegment, caption=StartCodeSegment]{source/StartCodeSegment.java} \end{table} \subsubsection{Code Segmentの記述方法} Code Segmentをユーザーが記述する際にはCodeSegmentを継承して記述する。そのCodeSegmentはInputDataSegmentManagerとOutputDataSegmentManagerを利用することができる。 \subsubsection*{InputDataSegmentManager} InputDataSegmentManagerはCode Segmentのidsというフィールドを用いてアクセスする。 \begin{itemize} \item {\ttfamily Receiver create(CommandType type)} \end{itemize} createでコマンドが実行された際に取得されるData Segmentが格納される受け皿を作る。引数にはCommandTypeが取られ、指定できるCommandTypeはPEEKまたはTAKEである。 \begin{itemize} \item {\ttfamily void setKey(String managerKey, String key, int id)} \end{itemize} setKeyメソッドにより、どこのData Segmentのあるkeyに対してpeekまたはtakeコマンドを実行させるかを指定することができる。 コマンドの結果がレスポンスとして届き次第Code Segmentは実行される。 \subsubsection*{OutputDataSegmentManager} OutputDataSegmentManagerはCode Segmentのodsというフィールドを用いてアクセスする。 OutPutDataSegmentManagerは"put"または"update"を実行することができる。 \begin{itemize} \item {\ttfamily void put(String managerKey, String key, \\ Value val)} \item {\ttfamily void update(String managerKey, String key, Value val)} \end{itemize} \subsection{Topology Manager} TopologyManagerはAlice同士の接続トポロジーを管理する。TopologyManager関連の通信処理はCode Segmentで実装してある。 TopologyManagerはトポロジーファイルを読み込み、参加を表明したクライアント(以下、Topology Node)に接続するべきクライアントのIPアドレスやポート番号、接続名を送り、トポロジーファイルに記述された通りにトポロジーを作成する。 \subsection{Topology Managerの設定ファイル} Topology Managerはトポロジーファイルを読み込むが、トポロジーファイル自体はDOT Languageという言語で記述される。 DOT Languageとはプレーンテキストを用いて、データ構造としてのグラフを表現するための、データ記述言語の一種である。このDOT Languageのグラフを利用して、クライアント間の接続を表現する。DOT Languageファイルはdotコマンドを用いて、グラフの画像ファイルを出力することができるので、記述したトポロジーが正しいことを可視化して確認することができる。 クライアント間の接続にはlabelを用いて名前が割り振られており、この接続名を用いてユーザーはData Segment Managerにアクセスすることができる。 前述したReceiver にsetKeyを行う際、odsでputまたはupdateする際の引数のmanagerKeyがこれにあたる。 \subsection{Topology Managerの使用方法} Topology Nodeを起動する際にコマンドライン引数としてTopology ManagerのIPアドレスとポート番号を指定をする。 そしてmain関数内でTopologyNodeをnewを行えば良い。 TopologyNodeの第一引数は Alice デーモンの設定オブジェクト、第二引数はStart Code Segmentである。 ここで指定した、Start Code Segmentがトポロジーが完成した後実行される。 % }{ \section{ゲームの例題}\label{sec:Enum}\label{sec:item} \subsection{水族館} 今回作成した例題は水族館である。複数のクライアントのディスプレイを複数の魚が移動していくものである。魚は画面の端まで移動すると自分の画面上からは消え、別のクライアントの画面の端から魚が出てくる。また、魚のうち一匹はクライアントが直接操作することができる。トポロジーはTopologyManagerによりツリー状に構成してある。 \subsection{データの伝搬} \begin{enumerate} \item ユーザーが魚を操作するまたはCode Segmentにより魚の座標が更新される。 \item 画面に表示させるためのSetLocation (Code Segment)が実行され実際に魚のオブジェクトにセットされ画面に反映される。 \item Update(Code Segment)にFishPosition(魚の座標データ)が渡される。 \item Updateにlist(送信者リスト)が渡される。 \item Updateが実行され、listを元にデータが送信される。ただし、この時にFishPositionには送信元情報が付加されているので、送信元には送信されない。 \item 各clientで2 - 4が実行される。 \end{enumerate} \section{評価} \section{まとめと今後の課題} \end{document} \ No newline at end of file +\documentclass[private]{ipsjpapers} +\usepackage{listings} +% 巻数,号数などの設定 +%\setcounter{巻数}{41} +%\setcounter{号数}{6} +%\setcounter{volpageoffset}{1234} +%\受付{12}{2}{4} +%\採録{12}{5}{11} + +% ユーザが定義したマクロなど. +\makeatletter +\let\@ARRAY\@array \def\@array{\def\<{\inhibitglue}\@ARRAY} +\def\<{\(\langle\)} +\def\>{\(\rangle\)} +%\def\|{\verb|} +\def\Underline{\setbox0\hbox\bgroup\let\\\endUnderline} +\def\endUnderline{\vphantom{y}\egroup\smash{\underline{\box0}}\\} +\def\LATEX{\iLATEX\Large} +\def\LATEx{\iLATEX\normalsize} +\def\LATex{\iLATEX\small} +\def\iLATEX#1{L\kern-.36em\raise.3ex\hbox{#1\bf A}\kern-.15em + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX} +\def\LATEXe{\ifx\LaTeXe\undefined \LaTeX 2e\else\LaTeXe\fi} +\def\LATExe{\ifx\LaTeXe\undefined \iLATEX\scriptsize 2e\else\LaTeXe\fi} +\def\Quote{\list{}{}\item[]} +\let\endQuote\endlist +\def\TT{\if@LaTeX@e\tt\fi} +\def\CS#1{\if@LaTeX@e\tt\expandafter\string\csname#1\endcsname\else + $\backslash$#1\fi} + +%\checklines % 行送りを確認する時に使用 +\begin{document}%{ +% 和文表題 +\title[Code Segment と Data Segment によるプログラミング手法]% +{Code Segment と Data Segment によるプログラミング手法 } +% 英文表題 +\etitle{How to Programming with Code Segment and Data Segment} +% 所属ラベルの定義 +\affilabel{URYUKYU}{琉球大学\\University of the Ryukyu} +% 和文著者名 +\author{河野 真治\affiref{URYUKYU}\member{19841765}\and + 杉本 優\affiref{URYUKYU}\nomember} + + +% 英文著者名 +\eauthor{Shinji Kono\affiref{URYUKYU}\and +Yu Sugimoto\affiref{URYUKYU}} + + +% 連絡先(投稿時に必要.製版用では無視される.) +\contact{杉本 優\\ + 〒903-0213 沖縄県中頭郡西原町字千原1番地\\ + 琉球大学 情報工学科\\ + TEL: (098)895-8723\qquad FAX: (098)895-8727\\ + email: sugi@cr.ie.u-ryukyu.ac.jp} + +% 和文概要 +\begin{abstract} +本研究室では分散プログラミングにおいて、データをData Segment、タスクをCode Segmentという単位に分割して記述する方法を提唱している。 +しかし、前述した方法をプログラマーが一から記述することは大変である。そこで、本研究室で分散ネットフレームワーク Alice を作成した。本論文では実際にAliceを用いてCode Segment と Data Segment によるプログラミング手法の例を示す。 +\end{abstract} +% 英文概要 +\begin{eabstract} +\end{eabstract} + +% 表題などの出力 +\maketitle + +% }{ + +% 本文はここから始まる +\section{歴史的経緯} +本研究室では、並列タスク管理フレームワークCeriumの管理を行なっているが、その設計と実装を行うにあたり、並列プログラミングと分散プログラミング +は本質的には同じことを行なっていることが分かった。特にヘテロジーニアスマルチコアであり、ローカルストアをそれぞれのコアが持っているというCell の特異な環境は、分散プログラミング環境と告示している。それらを踏まえて、Ceriumのタスク管理手法を分散に応用できないかと考えた。 + + +Ceriumに置いても、タスクとそれの入出力データの取り扱いは難しい課題である。データを操作するAPIを考えて、タスクを自然に記述し、効率良く実行する方法を考えてきた。そこで考えられた手法が、データをDataSegment、タスクをCodeSegmentという単位に分割して記述する方法である。 +% }{ + +\section{分散ネットフレームワークAlice}\label{sec:ITEM} +\subsection{Aliceとは} +Aliceは本研究室の卒業生である赤嶺一樹氏が、本研究室で開発を行なっている並列タスク管理フレームワーク Cerium と先行研究である Federated Linda の開発を通して得られた知見を生かされている。 +Federated Linda の設計はシングルスレッドで行われている。しかし、近年ではマルチコアのマシンが主流となっている。将来的にはメニーコアのマシンが主流になってくると考えられるそのような背景を踏まえてAliceはマルチスレッド向けに設計されている。 + +AliceはData SegmentとCode Segmentという単位でデータと処理を細かく分割し、それぞれの依存関係を記述して分散プログラムを作成する。また、他のマシンとの接続トポロジーの構成の機能も有しているのでユーザーはトポロジー構成後の処理を記述するだけでよい。 +% }{ +\subsection{Data Segment} +AliceではData Semgnetをデータベースとして利用している。KeyValueStoreで実装されており、キーごとにリストを持っている。Data Segment APIを用いることで、リストにデータを追加、削除を適宜行うことができる。 + +\subsubsection{Data Segment Manager} +大量のData Segmentを管理するのがData Segment Managerである。Data Segment Managerは文字列のキーでData Segmentを整理する。各キーごとにキュー構造を持っている。それらをData Segment APIを用いて操作する。 +データの読み出し("peek" または "take")時に、希望のデータがなかった場合、ブロッキングを行う機能を持つ。 +しかし、ブロッキングといってもそこで同期するわけではない。 +非同期でデータを通信する。 +そのため、 "peek" と "take" は他の API とは違い、レスポンスが発生する。 +\subsubsection{Data Segment API} +表番号)が用意されているData Segment APIである。これらを用いてデータの送受信を行う。 +\begin{itemize} +\item {\ttfamily void put(String key, Value val)} +\item {\ttfamily void update(String key, Value val)} +\item {\ttfamily void peek(Receiver receiver, String key, int id)} +\item {\ttfamily void take(Receiver receiver, String key, int id)} +\end{itemize} + +\subsubsection*{"put"} +"put" はデータを追加するための API である。 + +"put" は受け取ったデータ val を Data Segment 内のキューに対してエンキューする。 +この時、キーごとに重複しない連番の ID を受け取った順に振る。 + +%(図 \ref{fig:put}) +\subsubsection*{"update"} +"update" はデータを置き換えるための API である。 + +"update" はキューの先頭にあるデータをひとつだけ削除する。 +その後は "put" と同じく、 受け取ったデータ val を Data Segment 内のキューに対してエンキューする。 +この時、キーごとに重複しない連番の ID を受け取った順に振る。 +%(図 \ref{fig:update}) +\subsubsection*{"peek"} +"peek" はデータを読み込むための API である。 + +"peek" は前回読み込んだデータの id を引数で指定する。省略した場合は、 0 が id として渡される。 +id よりも値の大きい id のデータがキューに含まれていれば、そのデータを receiver に返す。 +もし id 以下のデータしか無いならば、データの更新が前回の "peek" 発行時から更新が無いものと考え、リストに格納されて保留される。 +%(図 \ref{fig:peek}) + +"take" や "update" によりデータの更新があれば、 "peek" が直ちに実行される。 +\subsubsection*{"take"} +"take" もデータを読み込むための API である。 +基本的な id に関する部分は "peek" と同じである。 + +"peek" との決定的な違いは、読み込まれたデータは Data Segment 内のキューから取り除かれるということである。 +%(図 \ref{fig:take}) + +%after +\lstset{ + language={java}, + basicstyle={\small}, + identifierstyle={\small}, + commentstyle={\small\itshape}, + keywordstyle={\small\bfseries}, + ndkeywordstyle={\small}, + stringstyle={\small\ttfamily}, + frame={tb}, + breaklines=true, + columns=[l]{fullflexible}, + numbers=left, + xrightmargin=0zw, + xleftmargin=3zw, + numberstyle={\scriptsize}, + stepnumber=1, + numbersep=1zw, + lineskip=-0.5ex +} + + + +\subsection{Code Segment} +Code Segmentはタスクのことである。Code Segmentをユーザーが記述するときに、Code Segment 内で使用するData Segment を記述し、依存関係を作る。依存関係により、実行される順番が一意に決まる。実際に使用するData Segment はCode Segmentの入出力に相当する。それぞれ、Input Data Segment、Output Data Segmentとする。 +\subsubsection{Code Segmentの実行方法} +Code Semgnetを実行するためにはStart Code SegmentというCode Segmentを実行させる必要がある。 +Start Code SegmentはどのData Segmentにも依存しない。つまりInput Data Segmentを持たない。このCode Segmentをmainメソッド内でnewし、executeメソッドを呼ぶことで実行を開始させることができる。 +\begin{table}[tb] +\lstinputlisting[label=StartCodeSegment, caption=StartCodeSegment]{source/StartCodeSegment.java} +\end{table} + +\subsubsection{Code Segmentの記述方法} +Code Segmentをユーザーが記述する際にはCodeSegmentを継承して記述する。そのCodeSegmentはInputDataSegmentManagerとOutputDataSegmentManagerを利用することができる。 +\subsubsection*{InputDataSegmentManager} +InputDataSegmentManagerはCode Segmentのidsというフィールドを用いてアクセスする。 +\begin{itemize} +\item {\ttfamily Receiver create(CommandType type)} +\end{itemize} +createでコマンドが実行された際に取得されるData Segmentが格納される受け皿を作る。引数にはCommandTypeが取られ、指定できるCommandTypeはPEEKまたはTAKEである。 +\begin{itemize} +\item {\ttfamily void setKey(String managerKey, String key, int id)} +\end{itemize} +setKeyメソッドにより、どこのData Segmentのあるkeyに対してpeekまたはtakeコマンドを実行させるかを指定することができる。 +コマンドの結果がレスポンスとして届き次第Code Segmentは実行される。 +\subsubsection*{OutputDataSegmentManager} +OutputDataSegmentManagerはCode Segmentのodsというフィールドを用いてアクセスする。 +OutPutDataSegmentManagerは"put"または"update"を実行することができる。 +\begin{itemize} +\item {\ttfamily void put(String managerKey, String key, \\ Value val)} +\item {\ttfamily void update(String managerKey, String key, Value val)} +\end{itemize} + +\subsection{Topology Manager} +TopologyManagerはAlice同士の接続トポロジーを管理する。TopologyManager関連の通信処理はCode Segmentで実装してある。 +TopologyManagerはトポロジーファイルを読み込み、参加を表明したクライアント(以下、Topology Node)に接続するべきクライアントのIPアドレスやポート番号、接続名を送り、トポロジーファイルに記述された通りにトポロジーを作成する。 + +\subsection{Topology Managerの設定ファイル} +Topology Managerはトポロジーファイルを読み込むが、トポロジーファイル自体はDOT Languageという言語で記述される。 +DOT Languageとはプレーンテキストを用いて、データ構造としてのグラフを表現するための、データ記述言語の一種である。このDOT Languageのグラフを利用して、クライアント間の接続を表現する。DOT Languageファイルはdotコマンドを用いて、グラフの画像ファイルを出力することができるので、記述したトポロジーが正しいことを可視化して確認することができる。 + +クライアント間の接続にはlabelを用いて名前が割り振られており、この接続名を用いてユーザーはData Segment Managerにアクセスすることができる。 +前述したReceiver にsetKeyを行う際、odsでputまたはupdateする際の引数のmanagerKeyがこれにあたる。 + +\subsection{Topology Managerの使用方法} +Topology Nodeを起動する際にコマンドライン引数としてTopology ManagerのIPアドレスとポート番号を指定をする。 +そしてmain関数内でTopologyNodeをnewを行えば良い。 +TopologyNodeの第一引数は Alice デーモンの設定オブジェクト、第二引数はStart Code Segmentである。 +ここで指定した、Start Code Segmentがトポロジーが完成した後実行される。 + +% }{ +\section{ゲームの例題}\label{sec:Enum}\label{sec:item} +\subsection{水族館} +今回作成した例題は水族館である。複数のクライアントのディスプレイを複数の魚が移動していくものである。魚は画面の端まで移動すると自分の画面上からは消え、別のクライアントの画面の端から魚が出てくる。また、魚のうち一匹はクライアントが直接操作することができる。トポロジーはTopologyManagerによりツリー状に構成してある。 +\subsection{データの伝搬} + +\begin{enumerate} +\item ユーザーが魚を操作するまたはCode Segmentにより魚の座標が更新される。 +\item 画面に表示させるためのSetLocation (Code Segment)が実行され実際に魚のオブジェクトにセットされ画面に反映される。 +\item Update(Code Segment)にFishPosition(魚の座標データ)が渡される。 +\item Updateにlist(送信者リスト)が渡される。 +\item Updateが実行され、listを元にデータが送信される。ただし、この時にFishPositionには送信元情報が付加されているので、送信元には送信されない。 +\item 各clientで2 - 4が実行される。 +\end{enumerate} + +\section{評価} + + +\section{まとめと今後の課題} + + +\end{document}