next up previous
Next: ソフトウェアとしての成果 Up: 無題 Previous: 研究内容

研究成果

PRISM実行トレーサは Prolog メタインタプリタで実装した. そのため,我々は確率情報(記号的なものを含む)などを容易に扱うことが できる.一方,Prolog メタインタプリタで問題となるのがカットの扱いであ るが,我々はスタックを持つようにメタインタプリタを設計し, 探索におけるカットの振舞いを正確にシミュレートできるようにした. また,この確率をオンラインで計算,表示する機構を組み込んだ. 下はサンプリング実行の画面である.

| ?- s_trace(bloodtype(X)).
  CALL[1] bloodtype(_63) ? 
    CALL[2] genotype(a,a) ? 
      CALL[3] gene(father,a) ? 
        SAMPLING CALL[4] msw(gene,father,a) ? 

{Sampling msw(gene,father,_)...}
Sampled switch: msw(gene,father,o)   0.544668      ← サンプリング結果

        SAMPLING FAIL[4] msw(gene,father,a) ?      ← サンプリング結果と一致せず失敗
      REDO[3] gene(father,a) ? 
      FAIL[3] gene(father,a) ? 
    REDO[2] genotype(a,a) ? 
    FAIL[2] genotype(a,a) ? 
    CALL[2] genotype(a,o) ? 
      CALL[3] gene(father,a) ? 
        SAMPLING CALL[4] msw(gene,father,a) ? 

{msw(gene,father,_) already sampled.}
Sampled switch: msw(gene,father,o)   0.544668

        SAMPLING FAIL[4] msw(gene,father,a) ?  ← サンプリング結果と一致せず失敗
      REDO[3] gene(father,a) ? 
      FAIL[3] gene(father,a) ? 
    REDO[2] genotype(a,o) ? 
    FAIL[2] genotype(a,o) ? 
    CALL[2] genotype(o,a) ? 
      CALL[3] gene(father,o) ? 
        SAMPLING CALL[4] msw(gene,father,o) ? 

{msw(gene,father,_) already sampled.}
Sampled switch: msw(gene,father,o)   0.544668

        SAMPLING EXIT[4] msw(gene,father,o) ?  ← サンプリング結果と一致したので成功
      EXIT[3] gene(father,o) ? 
      CALL[3] gene(mother,a) ? 
        SAMPLING CALL[4] msw(gene,mother,a) ? 

{Sampling msw(gene,mother,_)...}
Sampled switch: msw(gene,mother,a)   0.292314

        SAMPLING EXIT[4] msw(gene,mother,a) ?  ← サンプリング結果と一致したので成功
      EXIT[3] gene(mother,a) ? 
    EXIT[2] genotype(o,a) ? 
  EXIT[1] bloodtype(a) ? 

----------------
Conjunction of sampled switches:
  msw(gene,father,o) & msw(gene,mother,a)         ← サンプルされたスイッチの連言
The probability: 0.159214                         ← 実行パスの出現確率
 
X = a ?     ← 答え

yes

以上の実行トレーサの実装により,PRISMプログラムのバグの原因発生地点の把 握や,原因となったソースの点検が容易になった.また,例えばゴールの確率表示を 行うことによりプログラムが満たすことを想定した論理的性質と確率的性質の 検証が可能である.



next up previous
Next: ソフトウェアとしての成果 Up: 無題 Previous: 研究内容



www-admin@icot.or.jp