@inproceedings{oai:ipsj.ixsq.nii.ac.jp:00095547, author = {中野, 圭介 and Keisuke, Nakano}, book = {第54回プログラミング・シンポジウム予稿集}, month = {Jan}, note = {関数型プログラミングにおいて, リストを消費する関数 foldr および生成する関数 unfoldr は重要な役割を果たす. 特に,入力を foldr によって消費し, 出力を unfoldr によって生成するような関数はメタモルフィズムとよばれ,基数変換などに代表される或るデータ表現から別のデータ表現への変換を自然に定義することが可能である.Bird と Gibbons は,このメタモルフィズムに対し,入力を消費しながら出力を生成するようなストリーム処理として実装できるための条件を提示したが,自然数に対する基数変換には応用することができなかった.これは入力の桁を全て読み込まない限り,出力の桁を決定できないためで,彼らの提示した条件を満たしていない.これを解決するために著者が提案した手法が,ジグソーパズルを利用したメタモルフィズムの計算機構である.本稿では,グレイコードのような特別な記数法に対してこの機構を適用し,対応するジグソーモデルの導出方法を示す., The foldr and unfoldr functions play important roles in functional programming: foldr consumes a list and produces a value; unfoldr generates a list from a value. In particular, we call a metamorphism for a function specified by an unfold after a fold, consuming an input by the fold then generating an output by the unfold. It naturally specifies a conversion over data representations such as radix conversion of numbers. Bird and Gibbons have shown that metamorphisms can be incrementally processed in streaming style when a certain condition holds because part of the output can be determined before the whole input is given. However, radix conversion of natural numbers cannot satisfy the condition because it is impossible to determine part of the output before the whole input is completed. To solve the problem, the author has introduced a jigsaw model in which metamorphisms can be partially processed for outputs even when the streaming condition does not hold. In this paper, we illustrate that the jigsaw method can be applied to a special numeral system called Gray codes. It is also shown how we obtain the jigsaw model in a systematic way.}, pages = {181--188}, publisher = {情報処理学会}, title = {ジグソーパズルによる関数型プログラミング}, volume = {2013}, year = {2013} }