有限状態機械に基づくプログラミングでのgoto文使用の是非:Hoare論理の観点から  [in Japanese] On the Use of goto's in Programming Based on Finite State Machines: From the Hoare Logic Viewpoint  [in Japanese]

Access this Article

Search this Article

Author(s)

Abstract

Dijkstraのgoto文有害説とそれに引き続く構造的プログラミングの提唱以降,goto文の使用に関する問題は永く議論された.goto文の使用法に関し理論的裏付けを持つ研究としては,逐次的プログラムでの任意の制御フローは順次接続・条件分岐・反復の3基本構造のみで表現可能であるという結果に基づくMillsらのgoto文排斥論以外は皆無である.Dijkstra本来の正しさを示しやすいプログラムを書くための構造化という立場?つまりプログラム検証論の立場?からのgoto文使用の是非は考察されていない.本論文では検証手段としてのHoare論理に基づき有限状態機械モデルに基づくプログラミングでのgoto文の使用を検討する.その結果,状態をラベルで表し状態遷移をgoto文での飛び越しで行うプログラミングスタイルが,状態を表す変数を追加しgoto文を除いたプログラミングスタイルと比べ,Hoare論理による検証での表明が簡単で自然な形となり機械的検証の時間的コストも少ない.ゆえにプログラムの正しさの示しやすさという観点からは有限状態機械モデルに基づくプログラミングでの状態変数導入によるgoto文除去は有害でありgoto文を用いたスタイルの方が望ましいことを示す.There have been a vast amount of debates on the issue on the use of goto statements initiated by the famous Dijkstra's Letter to the Editor of CACM and his proposal of "Structured Programming". Except for the goto-less programming style by Mills based on the fact that any control flows of sequential programs can be expressed by the sequential composition, the conditional (if-then-else) and the indefinite loop (while), there have not been, however, any scientific accounts on this issue from the Dijkstra's own viewpoint of verifiability of programs. In this work, we reconsider this issue from the viewpoint of Hoare Logic, the most standard framework for correctness-proving, and we see that the use of goto's for expressing state transitions in programs designed with the finite state machine modelling can be justified from the Hoare Logic viewpoint by showing the fact that constructing the proof-outline of a program using goto's for this purpose is easier than constructing the proof-outline of a Mills-style program without goto by introducing a new variable.

There have been a vast amount of debates on the issue on the use of goto statements initiated by the famous Dijkstra's Letter to the Editor of CACM and his proposal of "Structured Programming". Except for the goto-less programming style by Mills based on the fact that any control flows of sequential programs can be expressed by the sequential composition, the conditional (if-then-else) and the indefinite loop (while), there have not been, however, any scientific accounts on this issue from the Dijkstra's own viewpoint of verifiability of programs. In this work, we reconsider this issue from the viewpoint of Hoare Logic, the most standard framework for correctness-proving, and we see that the use of goto's for expressing state transitions in programs designed with the finite state machine modelling can be justified from the Hoare Logic viewpoint by showing the fact that constructing the proof-outline of a program using goto's for this purpose is easier than constructing the proof-outline of a Mills-style program without goto by introducing a new variable.

Journal

  • IPSJ journal

    IPSJ journal 45(9), 2124-2137, 2004-09-15

    Information Processing Society of Japan (IPSJ)

References:  14

Codes

  • NII Article ID (NAID)
    110002712260
  • NII NACSIS-CAT ID (NCID)
    AN00116647
  • Text Lang
    JPN
  • Article Type
    Journal Article
  • ISSN
    1882-7764
  • NDL Article ID
    7093564
  • NDL Source Classification
    ZM13(科学技術--科学技術一般--データ処理・計算機)
  • NDL Call No.
    Z14-741
  • Data Source
    CJP  NDL  NII-ELS  IR  IPSJ 
Page Top