2014年10月17日金曜日

開発環境

計算機プログラムの構造と解釈[第2版](ハロルド エイブルソン (著)、ジュリー サスマン (著)、ジェラルド・ジェイ サスマン (著)、Harold Abelson (原著)、Julie Sussman (原著)、Gerald Jay Sussman (原著)、和田 英一 (翻訳)、翔泳社、原書: Structure and Interpretation of Computer Programs (MIT Electrical Engineering and Computer Science)(SICP))の4(超言語的抽象)、4.3(Schemeの変形 - 非決定性計算)、4.3.3(非決定性プログラムの例)、自然言語の構文解析、問題 4.45.を解いてみる。

その他参考書籍

問題 4.45.

;; 1. classはstudent、catはclass
(sentence
 (simple-noun-phrase (article the) (noun professor))
 (verb-phrase
  (verb lectures)
  (prep-phrase (prep to)
               (noun-phrase
                (simple-noun-phrase
                 (article the) (noun student))
                (prep-phrase (prep in)
                             (noun-phrase
                              (simple-noun-phrase
                               (article the) (noun class))
                              (prep-phrase (prep with)
                                           (simple-noun-phrase
                                            (article the) (noun cat)))))))))

;; 2. classはstudent、catもstudent
(sentence
 (simple-noun-phrase (article the) (noun professor))
 (verb-phrase
  (verb lectures)
  (prep-phrase (prep to)
               (noun-phrase
                (noun-phrase
                 (simple-noun-phrase
                  (article the) (noun student))
                 (prep-phrase (prep in)
                              (simple-noun-phrase
                               (article the) (noun class))))
                (prep-phrase (prep with)
                             (simple-noun-phrase
                              (article the) (noun cat)))))))

;; 3. classはstudent、catはprofessor
(sentence
 (simple-noun-phrase (article the) (noun professor))
 (verb-phrase
  (verb-phrase
   (verb lectures)
   (prep-phrase (prep to)
                (noun-phrase
                 (simple-noun-phrase
                  (article the) (noun student))
                 (prep-phrase (prep in)
                              (simple-noun-phrase
                               (article the) (noun class))))))
  (prep-phrase (prep with)
               (simple-noun-phrase
                (article the) (noun cat)))))

;; 4. classはprofessor、catはclass
(sentence
 (simple-noun-phrase (article the) (noun professor))
 (verb-phrase
  (verb-phrase
   (verb lecture)
   (prep-phrase (prep to)
                (simple-noun-phrase
                 (article the) (noun student))))
  (prep-phrase (prep in)
               (noun-phrase
                (simple-noun-phrase
                 (article the) (noun class))
                (prep-phrase (prep with)
                             (simple-noun-phrase
                              (article the) (noun cat)))))))

;; 5. classはprofessor、catもprofessor
(sentence
 (simple-noun-phrase (article the) (noun professor))
 (verb-phrase
  (verb-phrase
   (verb-phrase
    (verb lecture)
    (prep-phrase (prep to)
                 (simple-noun-phrase
                  (article the) (noun student))))
   (prep-phrase (prep in)
                (simple-noun-phrase
                 (article the) (noun class))))
  (prep-phrase (prep with)
               (simple-noun-phrase
                (article the) (noun cat)))))

0 コメント:

コメントを投稿