JP2004220458A - Automatic programming for machinery according to daily language and deductive inference engine - Google Patents

Automatic programming for machinery according to daily language and deductive inference engine Download PDF

Info

Publication number
JP2004220458A
JP2004220458A JP2003008980A JP2003008980A JP2004220458A JP 2004220458 A JP2004220458 A JP 2004220458A JP 2003008980 A JP2003008980 A JP 2003008980A JP 2003008980 A JP2003008980 A JP 2003008980A JP 2004220458 A JP2004220458 A JP 2004220458A
Authority
JP
Japan
Prior art keywords
knowledge
clause
language
subject
predicate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003008980A
Other languages
Japanese (ja)
Inventor
Taku Obata
小幡卓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to JP2003008980A priority Critical patent/JP2004220458A/en
Publication of JP2004220458A publication Critical patent/JP2004220458A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Machine Translation (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To make machinery understand daily language through a deductive inference engine by executing the automatic programming operation of machinery such as a robot in daily language. <P>SOLUTION: Daily language in a subject/predicate format is rearranged in the connection format of clauses such as subject/predicate/negative word/conjunction/adverb/adjective/exclamation/ending while the position of a punctuation mark or specific term is defined as a landmark, and translated into an extended production rule format, and connected with an already existing deductive inference engine so that a program capable of performing deductive inference can be developed. Then, machinery is made to store the knowledge/instruction of the acquired daily language so that the machinery can be made to execute the same control operation with the same instruction afterwards. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、命題論理、推論エンジン、機械の制御技術および自動プログラミングの技術分野に属する。
【0002】
【従来の技術】
ロボットなどの機械を制御するためのプログラム作成作業には多くの工数を必要とし、わずかなプログラムの修正にも大がかりな変更作業が必要である。
もし機械が、人間が話す日常言葉を理解して命令を実行し、それを記憶して次からは自動的に同じ命令で同じ動作をするならば、言語を介してプログラミング作業ができることになり、作業は飛躍的に楽になる。しかし、複雑な動作では、命令が単一でなく複数命令の組み合わせになるので、そのためには複数命令を総合的に理解するための機能が必要である。
今日、ニューロと呼ばれるパターン認識技術を使って人間の顔を識別し、人間の言葉を理解すると称する対話型ロボットは、すでに開発されている。それらは、対象物を繰り返し見せて名前を教え、学習させることが可能であり、また名前や好みを聞かれて返事を返し、四則演算が可能で、複数人の話し手の顔を認識し、別々の名前で話しかけるなどの機能を持つ。
しかし、ニューロ技術は具体的な形状認識が可能なものだけにしか適用できず、花や人間というような抽象性のある概念の理解にまで及ぶものではない。また学習の初期には誤認識が多く、正しく覚えるまでには試行錯誤が必要である。
対話機能に関しては、話し手が予め登録されている言葉で話しかけたとき、その言葉とリンクされた特定の答を返すか、言葉から階層的に連想される複数の言語にジャンプして会話を誘導しているに過ぎず、複数命令をまとめて理解することは出来ない。
本発明は、これとは異なり、言葉を通じて機械に知識を教えるものであり、単に登録語だけではなく、複数命令を総合的に理解させる機能を備えている。
総合的に判断するとは、例えば机の上に、リンゴとミカンがあったとき、ミカンでない、と言われてリンゴを選んだり、「部屋が暗ければ、電気をつけてちょうだい」のような周囲状況の判断を伴う命令を実行したりすることである。これは、命題論理の一般化された三段論法を機械的に解く演繹推論を行うことに他ならないが、従来、演繹推論を機械的に速く行うことは困難であった。
【0003】
【本発明が解決しようとする課題】
人間が言葉を理解するということは、言葉を取り巻く背景、主語・述語関係、接続詞などを理解して心の中に概念やイメージを抱くことであるが、機械には心がなく、言葉を概念やイメージで捉えることができない。従って、心があることが推論の必要条件なら、言葉を理解する機械は当分の間実現しないと思われる。
だが、命題論理によれば、複数の知識を組み合わせて推論された新しい知識はそれらの知識が持つ文構造だけに依存し、知識内容には依存しない。
従って、論理学の法則に従って言葉を文節単位に分解し、適切に並べ替え、文字同士を照合し、パターン・マッチングを行えば、機械が言葉を概念やイメージとして理解していなくとも論理的な解答をさせることができる。それを、対話する人間から見ると、機械が実際には何一つ理解していないにもかかわらず、あたかも心を持って対話しているように見える筈である。
このように、論理的な対話を機械的に行わせるアイデアは数学者ライプニッツの時代からあったが、二つの難関のため未だに実現していない。それは、言語を機械が推論可能な形式に翻訳すること、もう一つは翻訳文を演繹推論して解を得ることである。本発明は、前半分に関するものであり、それを既存の演繹推論エンジンと組み合わせ、一体として演繹推論可能とするものである。これにより、日常言語で機械を制御することが可能となる。
【0004】
【発明の実施の形態】
例として、机の上にあるミカン、梨、リンゴ、バナナがある時、ロボットにリンゴを選んで持って来させる問題を考える。ロボットは、テレビカメラと触覚センサーを備え、従来技術により机の上にあるA、B、C、Dという4つの対象物の形状や色、硬さなどを認識する機能を備え、以下の1から5までの情報を自動的に得る機能を持っているものとする。そして、リンゴがAであることが分かれば、「リンゴを持っておいで」という命令に対してAを持ってくることはできるが、どの果物がA,B,C,Dのどれに対応するかに関する知識は持っていないものとする。
そこで、言葉で果物の特徴を教え、ロボットに判断させようというのが狙いである。与える知識は6から18である。
1. Aでなく、Bでなく、Cでなければ、Dである。
2. Bは、丸く、黄色である。
3. Cは、柔らかく、黄色でない。
4. Dは、細長い。
5. Aは、紅い色である。
6. ミカンでなく、リンゴでなく、梨でなければ、バナナである。
7. ミカンは、やや柔らかく、オレンジ色で、かなり小さい。
8. リンゴは、丸く、固く、どちらかといえば紅い色である。
9. 梨は、丸く、固く、黄色である。
10. バナナは、特に細長く、黄色である。
11. 柔らかければ、バナナか、ミカンである。
12. 丸ければ、リンゴか、梨である。
13. オレンジ色なら、ミカンである。
14. 細長ければ、バナナである。
15. オレンジ色は、紅い色でなく、黄色でない。
16. 黄色は、紅い色でない。
17. 丸いなら、細長くない。
18. 柔らかいなら、固くない。
これらの文を正しく解釈し、「リンゴを持ってこい」という命令に対してリンゴを持ってくれば、このレベルでロボットは「言葉を理解している」と解釈できる。
人間は、命題論理の推論手法を使って次のように推論する。8から、リンゴは丸く、固く、紅い色である。17から、丸いならば細長くない。4から、細長ければDではない。18から、固ければ柔らかくない。3から、柔らかくなければCではない。16から、紅ければ黄色ではない。2から、黄色でなければBではない。従って1より、Bでなく、Cでなく、DでないからAである。もし、以上の論理をロボットに組み込むことが出来れば、ロボットに正しくAを選んで持ってこさせることができるはずである。
以上の推論過程は、一般化された三段論法の問題を機械的に解く問題である。
これを機械的に解くため、まず[0003]で示す複数の日本語文を、それぞれ主語・述語・否定語・接続詞・副詞・形容詞・感嘆詞・語尾に識別・分解し、不要要素を除去して「節形式」と呼ばれる形式に変換しなければならない。
【0005】
[主語述語分離]
知識1や2の「である」は語尾、7の「やや」、「かなり」、8の「どちらかといえば」等は副詞であり、省略しても基本的な意味は変わらない。そこで、これらを除去すると、文は主語・述語・否定語・接続詞のみになる。これら4つがどのように組み合わさっているかで日本語構造が規定される。最も基本的なのは主語と述語の分離を機械的に行うことである。人間は、
「ソクラテスは人間である」
という言葉を概念で理解するので、主語は「ソクラテス」、述語は「人間」、語尾は「です」であると識別する。両者を分離する語句は「は」である。しかし、機械の場合には、内容を理解しているわけではないので、主語述語の識別子として単に「は」を使うと
「彼がはならびのいい人です」
のような文では、主語を「彼が」、述語を「ならびのいい人」、語尾を「です」で誤って区切ってしまう。これを避けるために、主語述語を分離するための識別子の「は」、「が」、「も」の後には必ず「は、」「が、」、「も、」と読点をつけることとすれば、上の文は
「彼が、はならびのいい人です」
となり、主語は「彼」、述語は「はならびのいい人」、語尾を「です」と正しく分離出来る。但し、「話し言葉」の場合には、自動的には読点が挿入されないため、「は」の後で少し間をおく必要がある。
英語や日本語では「...は...である」という文形式と「...ならば...である」という文形式は別の文構造として扱われている。英語では、前者は
「He is a boy」
のように be、 am、 is、 are で表現され、後者は
「If he is going、 then I am going」
のように表現される。しかし、両者は論理学的には同じ意味である。
【図3】は、「aはbである」、あるいは「aならばbである」という形式の文構造を示したものである。命題論理学的には「bという概念の中にaという概念が包含される」と解釈される。例えば、「バラは花である」という表現は「バラ」が、「花」という、より広義のクラス概念の中に包含されていることを意味する。
一方、「君が行くなら、私も行く」という表現は、「私が行く条件」はいろいろあるが、その中には「君が行く」という条件も含まれている」と解釈される。従って、「aはbだ」、および「aならばbだ」という表現は共に、「a then b」となり、aがbの部分集合であることを意味している。「...であれば」、「...ならば」、「...と言ったら」、「...と尋ねたら」などもすべてこの形式である。
【0006】
[否定語]
否定語は「...は、...ではない」、「...でなければ、...である」のように文意の一部、または全部を否定する意味で使われる。英語では 「then not...」、「not... then」である。
【0007】
[接続詞]
接続詞には多くの同義語があるが、大別すれば and と or に区分される。論理学では「a and b」 は、「aであり、かつbである」という意味であり、「a or b」 は「aかbのどちらかである」という意味である。「a and b」 は、「aである」と「bである」という二つの言葉に分割できるが、「a or b」 は分解できない。
【図4】は「aならばb1であり、かつb2であり、かつb3である」という文構造を図示したものであり、論理学的には「a then b1 and b2 and b3」となる。これは「a thenb1」、「a then b2」、「a then b3」という3つの知識に分解される。
【図5】は、a1、 a2、 a3が、すべてbという概念に包含されるケースであり、日本語では「a1も、a2も、a3もbだ」、あるいは「a1であるか、a2であるか、a3ならばbである」という表現形式である。 「ウイスキーも、ワインも、ビールも酒である」は「ウイスキーは酒である」、「ワインは酒である」、「ビールは酒である」の3つの知識に分解できる。
論理学ではこれと同じ意味の表現は「a1 or a2 or a3 then b」であって、「a1 and a2 and a3 then b」ではない。「a1 and a2 and a3 then b」とすると「a1であり、かつa2であり、かつa3であるところのものはbである」という意味になる。
【図6】は「aは、b1、b2、b3のうちのいずれかである」という文構造を図示したものである。論理学的には「a then b1 or b2 or b3」となる。
【0008】
[プログラム・フローチャート]
[0007]で日本語を and、 or、 then、 not を使ったルール形式に変換する際の一般論を述べたが、日本語には多くの同義語や例外事項があるため、それらもすべて考慮し、多種多様の日本語表現を読めるようにする必要がある。以下個々のケースをプログラム・フローチャートで説明する。
【図7】は質問がどのように変換されるかをあらわすものである。質問は単節に限定されるため、Xは何か?Xは誰か?Xは?というような質問、および「....である」、「...だ」のような語尾は省略され、単にXとなる。
【図8】は文章中に副詞があった場合の処理である。「非常に、」、「相当、」、「かなり、」、「極端に、」、「とてつもなく、」、「見たこともないほど、」、「信じられないほど、」等の副詞は、述語の意味を強めるものであり、省略しても意味に本質的な違いはないので、翻訳過程で省略する。なお、副詞の識別はあらかじめ登録してある語句により行う。
【図9】は質問の基本形である。「あなた」、「君」、「お前」、「手前」、「おぬし」、「貴様」などはすべて「あなた」と解釈される。「あなたの名前 then 私の名前は...です」とすれば、名前を訊ねたときに答えるプログラムとなる。日本語は異なる発音を持つ同意語が多くあるので、それらのすべてを同じ意味だと理解させるには辞書が必要である。
【図10】は、主語述語形式のルールの変換過程である。主語と述語を分離する識別子「は、」、「が、」、「ならば、」、「...すれば、」、「...するならば、」等の字句の有無が確認される。識別子の末には必ず句読点が必要である。
【図11】は述語に否定語を含む場合である。
【図12】は、主語が否定形である場合である。「でないならば、」、「でなければ、」、「...しないならば、」、「...しなかったならば、」等の語句の有無が主語述語分離箇所を識別するために使われる。
【図13】は述語に「および」、「ならびに」、「や」、「も」、「で」など複数の述語が接続されている場合である。これらはすべて and に置き換えられる。
【図14】は、述語に「かつ」、「あるいは」、「か」、などの接続詞が使われている場合である。これらはすべて or に置き換えられる。
【図15】は、主語が「も」、「あるいは」、「および」などの接続詞で結ばれている場合である。主語の場合、「も、」は or であって and ではない。and にすると日本酒であり、かつワインであり、かつビールであるものは酒である、という意味になるが、そのようなものは存在しない。なお、辞書では主語の後に説明があり、さらに句点の後で主語が省略されて説明が続くことがある。このようなケースを考慮し、句点を and という接続詞で結ぶこともある。
【図16】は、主語が複合形で、and で結ばれている場合である。
【図17】は、解を得た後、より人間に近い会話にするため、解の語尾に「です。」や「ではありません。」をつけた場合である。
【0009】
【実施例】
上記のフローチャートに基づいて作成されたプログラムで、[0004]の1から18の知識を翻訳すると以下のようになる。
1. not A and not B and not C then D
2. B then 丸い and 黄色
3. C then 柔らかい and not 黄色
4. D then 細長い
5. A then 紅い色
6. not ミカンand not リンゴ and not 梨 then バナナ
7. ミカン then 柔らかい and オレンジ色 and 小さい
8. リンゴ then 丸い and 固い and 紅い色
9. 梨 then 丸い and 固い and 黄色
10. バナナ then 細長い and 黄色
11. 柔らかい then バナナ or ミカン
12. 丸い then リンゴ or 梨
13. オレンジ色 then ミカン
14. 細長い then バナナ
15. オレンジ色 then not 紅い色 and not 黄色
16. 黄色 then not 紅い色
17. 丸い then not 細長い
18. 柔らかい then not 固い
これらは「梨」や「丸い」などの知識をあらわす部分が、 then、 not 、 or 、 and という4つの英語に挟み込まれた形をしており、それらの組み合わせによって文構造が規定されている。一旦、この形式に翻訳できれば、発明特許の演繹推論エンジン(米国特許5、390、287 (Feb.14、1995) 及び米国特許5、493、633 (Feb.20、1996)....以下引用特許発明と呼ぶ。発明者は本出願人と同じ。)を使って演繹解を得ることができる。
【0010】
次に「拡張プロダクションルール形式」を、パターン・マッチング可能な節形式、即ち then and を含まず、 not とor だけの形に変換する。一つの「拡張プロダクションルール形式」が複数個の節形式に分解されることもあるので、全部で次の28個の知識になる。
1. A or B or C or D
2. not B or 丸い
3. not B or 黄色
4. not C or 柔らかい
5. C or not 黄色
6. not D or 細長い
7. not A or 紅い色
8. ミカン or リンゴ or 梨 or バナナ
9. not ミカンor 柔らかい
10. not ミカンor オレンジ色
11. not ミカンor 小さい
12. not リンゴ or 丸い
13. not リンゴ or 固い
14. not リンゴ or 紅い色
15. not 梨 or 丸い
16. not 梨 or 固い
17. not 梨 or 黄色
18. not バナナ or 細長い
19. not バナナ or 黄色
20. not 柔らかい or バナナ or ミカン
21. not 丸い or リンゴ or 梨
22. not オレンジ色 or ミカン
23. not 細長い or バナナ
24. not オレンジ色 or not 紅い色
25. not オレンジ色 or not 黄色
26. not 黄色 or not 紅い色
27. not 丸い or not 細長い
28. not 柔らかい or not 固い
【0011】
[0010]の知識を例に、演繹推論過程を説明する。
(ア) 話し手から「リンゴを持ってこい」と命令されると、ロボットの推論エンジンに「リンゴ」という単節が入力される。
(イ) 12.の「not リンゴ or 丸い」と「リンゴ」から、パターン・マッチングにより「リンゴ」が消去され、「丸い」が得られる。「not リンゴ」と「リンゴ」がキャンセルできるのは導出演算によるものである。
(ウ) 同様に、13.の「not リンゴ or 固い」と「リンゴ」から「固い」が得られる。
(エ) 14.の「not リンゴ or 紅い色」とリンゴから「紅い色」が得られる。
(オ) 27.と「丸い」から「not 細長い」が得られる。
(カ) 28.と「固い」から「not 柔らかい」が得られる。
(キ) 24.と「紅い色」から「not オレンジ色」が得られる。
(ク) 26.と「紅い色」から「not 黄色」が得られる。
(ケ) 6.と「not 細長い」から「not D」が得られる。
(コ) 23.と「not 細長い」から「not バナナ」が得られる。
(サ) 4.と「not 柔らかい」から「not C」が得られる。
(シ) 9.と「not 柔らかい」から「not ミカン」が得られる。
(ス) 2.と「丸い」から「not B」が得られる。
(セ) 「B」でなく、「C」でなく、「D」でないから、1.より「A」でなければならない。 即ち、リンゴはAである。
【0012】
[0004]の日本語を入力すると、プログラム内部で自動的に[0009]、[0010]の形式へと変換され、演繹推論エンジンに入力される。その結果、以下1から14のような演繹解が得られる。
1. リンゴ
2. 丸い
3. 固い
4. 紅い色
5. 細長くない
6. 柔らかくない
7. オレンジ色ではない
8. 黄色ではない
9. Dではない
10. バナナではない
11. Cではない
12. ミカンではない
13. Bではない
14. A
これらは、[0004]の知識を与えて「リンゴを持っておいで」と命令したときの解になっている。即ち、命令されたロボットは推論によりAを求め、[図1]のようにAを持ってくる。
なお、解は複数の知識の組み合わせから得られているので[0004]の知識のいくつかが欠ければ「A」という解は得られない。
[0004]の知識をロボットに記憶させれば、次に「ミカンを持っておいで」、「バナナを持っておいで」という命令に対してもロボットは正しくC、Dを選んで持ってくる。即ち、日常言語によりロボットの自動プログラミングが行われたことになる。
【0013】
【発明の効果】
技術的に可能であっても、上記のような制御プログラムを従来手法で組もうとすれば、膨大な工数が必要となると思われるが、本発明では数行の知識を教えることで同じ目的を達成することが可能となる。
また、知識付与のためのデータベースと命令を同一のカテゴリで取り扱うことが出来るので、室温がある温度以上になったらクーラーのスイッチを入れさせたい場合、「室温が摂氏28度以上なら、クーラーのスイッチを入れなさい」という命令をロボットに伝えるだけで、以後ロボットは室温が摂氏28度以上になれば必ずクーラーのスイッチを入れるようになる。
データベースは、ロボットの記憶装置にテキスト文で書き込まれるのでデバッギング作業も容易である。これにより、従来膨大な人出を要していたロボットや機械のプログラミング作業が画期的に省力化される。
応用はロボットにとどまらない。この技術を使えば、航空機、船舶、自動車、火力発電所、遠隔地の通信機等を管理するコンピュータに、異常事態発生時どのような対処手順をとるべきかを予め記憶させておき、センサーからの異常信号を感知したら自動的に応急措置を施すと同時に、オペレーターに通報するようにすることも日常言語でプログラムできるようになる。
【0014】
日常言語を拡張プロダクションルール形式に変換しても、推論エンジンを介して演繹を行うことが出来なければ意味がない。今日、現存する推論エンジンでそれが可能なのは引用発明特許のみである。
以下は、本特許の一部ではないが、本発明とのかかわりを明確にするため、参考として引用発明特許の一部の内容を転載するものである。
【0015】
[既存推論エンジンの限界]
機械は基本的に機械語しか理解できない。そのため、日常言語を機械に理解させるには、機械語に翻訳する必要がある。
機械語は数字の羅列であり、人間には理解しにくいので、今日プログラムを機械語に翻訳するためのコンパイラ言語が開発されている。従って、日常語を直接機械語に翻訳するよりも、コンパイラ言語の一つに翻訳し、それと接続して推論を行わしめる方が合理的である。
今日使われているコンパイラ言語の代表的なものを[図2]に示す。用途や使い勝手によって言語の種類も異なるが、このうち、手続き型言語は主として数値演算を行うためのものであり、[0004]のような日本語を読ませる問題には馴染まない。
このため、知識データベース構築には従来、Prolog や LISP などの記述型言葉が使われている。しかし、Prolog や LISP には厳しい制約がある。それは、「ホーン節」、あるいは「プロダクションルール」と呼ばれる特別のルール言語形式しか処理できないという制約である。また、「組み合わせの爆発」と呼ばれる現象を伴うため、比較的小規模の知識ベースしか取り扱うことができないという不具合がある。ここで、ホーン節とは
a1 and a2 and a3 ...an then b
という形式である。then の左側には and しか使うことが許されず、かつ a1、 a2の前に not がつくことは許されない。その理由は、知識を組み合わせて「導出」と呼ばれる推論演算を行う場合、これ以外の表現形式では論理的妥当性が失われてしまうからである。
このため、LISP やPrologでは、「オレンジ色でなければミカンではない」というような知識を表現することは出来ない。「オレンジ色でない」、および「ミカンではない」という概念を、新しい概念に置き換えれば形式上は表現できるが、その場合、それらが「オレンジ色」、「ミカン」という概念とは無関係のものとして取り扱われるので、推論により新しい知識を得ることは出来ない。しかし、このような知識表現が許されないような表現形式は推論エンジンとしては不適である。
今日、ホーン節でないルール形式を取り扱うことが可能で、組み合わせの爆発が起こらない「速い演算」が可能な推論エンジンは、唯一引用発明特許のURA (Unit Resolution Algorithm; 単節導出アルゴリズム)である。従って、日常言語を先ずURAが使う言語に翻訳することが最も現実的である。
URAは知識の一方を単節に限定することにより、ホーン節の制約から逃れthen の右側と左側に not、or, and を自由に使うことを可能としたものである。表現形式は「プロダクションルール」よりも幅広い表現形式が認められるという意味で、造語であるが「拡張プロダクションルール」と呼ぶべきものである。URAでは何故ホーン節の制約がないのかを説明するためには、記号論理学について簡単に触れる。
【0016】
[記号論理学]
演繹推論の理論的基礎は記号論理学である。記号論理学においてはブール代数に似た演算法則が適用される。記号論理学で使われる記号は以下の5つである。
a、b、c、d... 文字変数。リテラルともいう。
and 「および」を意味する論理演算記号。
or 「または」を意味する論理演算記号。
then 「ならば」を意味する論理演算記号。
not 「否定」を意味する論理演算記号。
知識やルールを文字変数と論理演算記号であらわしたものを論理式といい、
then と and を含まない論理式を節形式という。なお、説明文中の <=>は、記号の右と左が論理的に等価であることを意味する。基本的な知識形式と、その論理式、節形式は以下の通りである。

Figure 2004220458
Figure 2004220458
上の式で a then b <=> not a or b は
「aならばb」ろ「aでないか、bである」は論理的に同じであることを意味している。直感的には理解しにくいが、「すべてのものは a か a でないかのどちらである」。従って「not a or a」 は常に成り立つ。しかし「a ならば b」であるから 「not a or b」も常に成り立たなければならない。故に、a then b <=> not a or bである。
次に、節A、 B、 C、 Dは次式で表されるものとする。
Figure 2004220458
これから次式が導かれる。
Figure 2004220458
Figure 2004220458
より複雑な式は、これらの式から誘導することができる。例えば
Figure 2004220458
となる。このようにして、任意のルールは節形式に変換できるので、以降は節形式に限定して議論を進める。
なお、上記の変換公式は、aiの代わりに not ai、bjの代わりに not bjと置き換えても成立するので論理変数の符号の正負に関係しない。このような表現形式が「拡張プロダクションルール形式」である。すでに見てきたように、これらの式は記号論理学の公式から容易に導かれるが、LISPや Prolog の手法ではこの形式は導出可能でないため、従来はあまり注目されていなかった。
【0017】
[導出可能条件]
複数個の節からなる知識(ルール)を論理方程式とみなし、それを解く操作が演繹推論である。論理方程式から解を得るためには、まず、与えられた複数個のルールを節形式に変換し、中に含まれる論理変数をパターン・マッチングにより順次消去して簡略化する必要がある。
論理変数を以下述べる導出操作で逐次消去する試みは最初に1966年、
J.A Robinsonによってなされた。異なる二つの節の各々に、「同じ論理値で符号の異なる論理変数がただ一組だけ含まれている」とき、この二つの節は導出可能であるという。
例えば p を単節、Q を、p を含まない複節、 R を not p を含まない複節とするとき、パターン・マッチングにより「p or Q」、「not p or R」から p、not pを消去して、新しい節「Q or R」が得られる、というのが導出の考え方である。
この場合、もとの対を親節、それにより生じた新しい節を子節という。「ソクラテスは人間である」「人間は死ぬ」から「故にソクラテスは死ぬ」という結論を得る操作は、「not ソクラテス or 人間」、「not 人間 or 死ぬ」という親節から「人間」という言葉を消去して「not ソクラテス or 死ぬ」という子節を得る導出操作である。
「ただ一組」という条件は、導出演算上大きな制約である。もし親節が符号の異なる別の対を持っていたとすればp or Q、 not p or Rは
p or Q = p or Q1 or not t
not p or R = not p or R1 or t
のように書くことができる。形式的に導出演算を適用すると、この2式から
Q1 or R1が得られるが、これは論理的に正しくない。つまり、親節Q、Rに符号の異なる論理変数が二組以上含まれている場合には導出演算は許されない。知識のすべての組み合わせについて、「ただひと組しか存在しない」という条件を確認するのは、知識数が多くなると非常に時間がかかる。
そのため、Prolog や LISP 等では、予めこの条件が保証されている節形式だけを導出演算の対象として取り上げてきた。具体的には
a1 and a2 and...an then b = not a1 or not a2 or ... or not an or b
b then c1 or c2 or c3 or ... or cm = not b or c1 or c2 ...or cm
という、thenの左側がすべて and で結ばれ、右側はすべて or で結ばれている知識形式である。これらは、「ホーン節」、あるいは「プロダクションルール形式」と呼ばれ、前述の「拡張プロダクション・ルール形式」の特殊な場合である。ホーン節では、導出対象となる対は予め「b 、not b」ただ一組しかないことが保証されるので、対から導出により子節
not a1 or not a2 or not a3 or.... or not an or c1 or c2 ... or cm
が得られる。これにより「ただ一組」、という条件は満足されるが、すべての知識形式がホーン節で表現できるとは限らないので知識表現に大きな制約がある。
【0018】
[組み合わせの爆発]
人間は推論する際、記憶しているすべての知識を順次呼び出すわけではなく、その都度必要な知識だけを呼び出し、照合して推論する能力を持っている。しかし、機械の場合、予め知識に優先順位をつけることが出来ないので、推論過程で記憶されているすべての知識を機械的に呼び出して照合する操作が必要となる。このやり方では知識数が多くなると、組み合わせの数が知識数の指数乗に比例して増大する。
何故なら、二つの知識を照合させて新しい知識が得られても、それによって元の知識が不要になるわけではなく、演算過程にそのまま残るためである。例えば、「ソクラテスは人間である」「人間は死ぬ」という親節から「故にソクラテスは死ぬ」という子節が得られても、それにより元の親節が不要になるわけではない。このため、照合によって生じた子節と別の親節の間でさらなる照合が必要となる。当初の知識数をn個とすれば、知識が3つ組み合わされる場合、4つ組み合わされる場合などをすべて含めると、組み合わせの総数は
Figure 2004220458
【式1】
つまり2のn乗の演算回数が必要となる。この値はnが30で約10億、40では約1兆である。これでは演算に膨大な時間がかかり、大きな知識ベースを取り扱うことは出来ない。
従来の演繹推論エンジンが比較的小さな知識データベースの場合にしか実用化されていない主な理由である。
【0019】
[引用発明特許は如何に組み合わせの爆発を避けているか]
今日、数多くの演繹推論エンジンが開発されているが、それらは子節が生まれても、親節がそのまま残るアルゴリズムである。このため知識数が30を超えると解を得るのに非常に時間がかかるので大きな知識ベースを取り扱うことが出来ない。これに対して、引用発明特許の「URA単節導出アルゴリム」は、「新しい知識を生み出す際、古い親節のどちらかが強制的に削除される条件」を求め、その条件下でパターン・マッチングを行うものである。この条件が満足されれば、ルール数の総数は当初のn から増えないので、組み合わせの総数はたかだか n個から2個を取り出す組み合わせの総数、
【式2】
Figure 2004220458
つまり、nの2乗のオーダーにしかならない。これは2のn乗より遙かに小さく、それだけ早い推論が可能となる。
「親節のどちらかが強制的に削除される条件」を求めるためには「吸収」という概念を使う。即ち、節PとQにおいて、PがQの部分集合であるとき「PはQを吸収する」といい、吸収された節Qは以降の演算から削除することが出来る。例えば
P ≡ a 「aである」
Q ≡ a or b or not c 「aか、bか、cでない」
であるならば、PはQの部分集合であるので削除できる。何故なら、Pは、解が「aである」と断言しており、Qよりも範囲が限定されているのでQは不要だからである。同様に、[0015]の「p or Q」、「not p or R」から p、not p を消去して、導出により子節「Q or R」が得られた時、親節のどちらかを省略できるためには、子節が親節の一方を吸収すればよい。しかるに「Q or R」が「p or Q」、「not p or R」のどちらかを吸収出来るのは以下二つの場合に限られる。
[Q、 Rの一方が他方の部分集合である時]
この場合、例えばRがQの部分集合とすると、「Q or R」 は単にQとなるので「p or Q」を吸収できる。しかし、これはRとQはお互い独立した知識ではない特殊なケースであり、一般性はない。
[R、 Qのうち一方が(中身がない)空節の場合]
Qが空節なら、「Q or R」は単にRとなる。これは「not p or R」を吸収する。また、Rが空節なら「Q or R」はQとなる。これは「p or Q」を吸収する。従って、この場合には、及びこの場合に限り、導出演算で子節が生じたときに親節のどちらかが削除できるので知識総数は増えない。
言い換えれば、p、not p が単節である場合にだけ、組み合わせの総数は増加しない。このアイデアをアルゴリズム化した導出手法が引用特許発明のURA (Unit Resolution Algorithm)である。
単節導出では、知識の片方は常に単節であるため、「対の親節の中にただ一個しか符号の異なる論理変数が存在することができない」という条件は自動的に満足される。
このため、「知識形式をホーン節に限定する」という制約条件を考慮する必要はない。URAで拡張プロダクションルール形式が導出可能であるのはこのためである。
【0020】
[単節導出アルゴリズム]
以上のアイデアをアルゴリズム化する際に「ピボット法」の手法を用いる。その一部を引用発明特許から再掲する。以下は推論対象例題である。
p then q (pならばqである)
not p then q or r (pでなければqかrである)
not s then t (sでなければtである)
not r then x (rでなければxである)
r then not s (rならばsでない)
not q(qでない) ← 単節
以上を節形式に変換すると次のようになる。
not p or q
p or q or r
s or t
r or x
not r or not s
not q
単節導出が可能なためには、単節が1個以上存在する必要があるが、ここでは「not q」が単節である。
上記を [図18]のように行列形式であらわす。論理記号の正符号は1、not は −1に対応している。not qに該当する場所は「▲6▼、q」である。それと「▲1▼、q」、「▲2▼、q」から新しい子節「not p」、及び 「q or r」が生ずる過程を[図18]のようにあらわす。
【図19】で not p は単節となるので、新たな導出ステップのピボット軸は「▲1▼、p」である。p の行で符号が異なる列を探すと、▲2▼列がこれに該当する。「not p」と「p or r」からrが得られるので、r が次の導出単節となる。
【図20】は「▲2▼、r」がピボット軸である。 ここでrの行を見ると、▲4▼列目には同じ1がある。これは「r or x」という節形式である。「r」はその部分節であるので、▲4▼列は▲2▼列に吸収され、以降の演算から削除される。
【図21】は、[図19]にピボット演算を行った結果である。新たな軸は「▲5▼、s」である。s の行で▲3▼が次の導出対象となる。
【図22】が、得られた新しい行列である。ここでは、すべての論理変数が単節となったので、演算は終了する。解は「not p」、「r」、「t」、「not s」、「not q」である。xは不定であり、解は定まらない。なお、すべての論理変数が単節とならなくとも、手順が続かなくなった時点で演算は停止する。 すでに見てきたように、単節導出アルゴリズムでは、当初6個ある記号の数は、導出によって増加しないため、多くとも6回の演算で解が収束することが保証される。
【0021】
[単節導出と一般導出の違い]
以上述べたように、単節導出には知識をホーン節に限定する、という制約がなく、かつ速い推論が可能である。パソコン程度の演算速度でも数千の知識ベースを処理できるので、並列演算システムのような高価な器材を使わなくとも良いという優れた特徴がある。
一方、単節導出は一般導出の特殊な場合であるから、運用上の制約があり、ルールを読み込ませただけでは解はアウトプットされない。例えば「ソクラテスは人間だ」、「人間は死ぬ」という知識を教えても、自動的には「ソクラテスは死ぬ」という結論は得られない。
ここで「ソクラテスは何か」?(ソクラテス?....単節)という質問が入力されると初めて「人間」、「死ぬ」という単節解が得られる。
しかし、センサー情報、および人間によるロボットへの命令は、基本的に単節情報の集まりであるので、入力が単節に限定されることについての実用上の不都合はほとんどない。単節でない命令、例えば「リンゴかナシを持っておいで」、というような命令は実行されない。しかし、このような場合は、「最初のものを選ぶ」というような条件を予め教えておけば不都合はない。
また 「暗ければ、灯りをつけなさい」という条件付き命令も単節ではない。しかし、ロボットが明暗を判断する機能を持っていれば、暗いか明るいかは自力で判断する。その結果、暗ければ「灯りをつけなさい」という単節命令が実行され、そうでなければ命令は無視される。従って、これは単節入力と同等である。
また出力が単節であることについても、不都合ではなく、却って望ましいという見方ができる。「AかBである」とか「AならばBだ」という解では、むしろ混乱を招くからである。
【図面の簡単な説明】
【図1】は本発明の概念を図示したものである。
【図2】は特許請求範囲を示す概念図である。
【図3】は「a は b だ」、「a ならば b である」という文の構造図である。
【図4】は「a1 か、a2 か、a3 なら b だ」という文の構造図である。
【図5】は「a ならば b1 であり、b2 であり、b3 である」という文の構造図である。
【図6】は「a ならば b1 か、b2 か、b3である」という文の構造図である。
【図7】は機械への質問で、末尾処理モジュールにより語尾が削除されるフローである。
【図8】は副詞が省略され、基本的な主語述語形式に変換されるフローである。
【図9】は「あなたの名前は」という質問に対しては「私の名前は...です」と答えなさいというプログラムのフローである。
【図10】は文を主語述語に分離し、拡張プロダクションルールに翻訳するフローである。
【図11】は述語が否定語を含む場合の翻訳のフローである。
【図12】は主語が否定語を含む場合の翻訳のフローである。
【図13】は述語が and 接続詞を含む場合の翻訳のフローである。
【図14】は述語が or 接続詞を含む場合の翻訳のフローである。
【図15】は主語が or 接続詞を含む場合の翻訳のフローである。
【図16】は主語が and 接続詞を含む場合の翻訳のフローである。
【図17】は解が得られた場合に、それをより人間の言葉に近づけるために「です。」をつける場合のフローである。
【図18】は演繹推論問題の例題を行列形式にあらわしたものの第1ステップである。
【図19】は演繹推論問題の例題を行列形式にあらわしたものの第2ステップである。
【図20】は演繹推論問題の例題を行列形式にあらわしたものの第3ステップである。
【図21】は演繹推論問題の例題を行列形式にあらわしたものの第4ステップである。
【図22】は演繹推論問題の例題を行列形式にあらわしたものの最終ステップである。[0001]
TECHNICAL FIELD OF THE INVENTION
The invention belongs to the technical fields of propositional logic, inference engines, machine control technology and automatic programming.
[0002]
[Prior art]
Creating a program for controlling a machine such as a robot requires a lot of man-hours, and even a small program modification requires a major change.
If the machine understands the everyday language spoken by humans, executes the command, memorizes it, and then automatically performs the same operation with the same command, it will be possible to do programming work via language, The work becomes much easier. However, in a complicated operation, the instruction is not a single instruction but a combination of a plurality of instructions. For this purpose, a function for comprehensively understanding the plurality of instructions is required.
Today, interactive robots that use a pattern recognition technology called neuro to identify human faces and claim to understand human words have already been developed. They can show the object repeatedly to teach and learn names, and can be asked for names and preferences and return replies, can perform four arithmetic operations, recognize the faces of multiple speakers, recognize It has functions such as talking with the name of the person.
However, neurotechnology can be applied only to those capable of recognizing specific shapes, and does not extend to the understanding of abstract concepts such as flowers and humans. In addition, there are many misrecognitions at the beginning of learning, and trial and error are required to learn correctly.
Regarding the dialogue function, when a speaker speaks in a pre-registered language, the speaker returns a specific answer linked to the word or jumps to a plurality of languages hierarchically associated with the word to guide the conversation. It is not possible to understand multiple instructions at once.
The present invention, on the other hand, teaches a machine through words, and has a function of comprehensively understanding not only a registered word but also a plurality of instructions.
Judging comprehensively means, for example, when there is an apple and a mandarin orange on a desk, it is said that it is not a mandarin orange, and an apple is selected. Or to execute an instruction with a judgment of the situation. This is nothing less than performing deductive inference that mechanically solves the generalized syllogism of propositional logic, but conventionally, it has been difficult to perform deductive inference mechanically quickly.
[0003]
[Problems to be solved by the present invention]
To understand a word means to have a concept or image in the mind by understanding the background surrounding the word, subject / predicate relations, conjunctions, etc. And can not be captured in the image. Thus, if mind is a prerequisite for reasoning, a machine that understands words will not be realized for the foreseeable future.
However, according to propositional logic, new knowledge inferred by combining multiple knowledges depends only on the sentence structure of those knowledges, not on the content of the knowledge.
Therefore, if words are broken down into phrases according to the rules of logic, rearranged appropriately, characters are collated, and pattern matching is performed, logical answers can be obtained even if the machine does not understand the words as concepts or images. Can be made. From the point of view of the person interacting with it, it should appear as if they are talking with heart, even though the machine does not actually understand anything.
Thus, the idea of mechanically conducting logical dialogues has existed since the days of mathematician Leibniz, but has not yet been realized due to two difficulties. One is to translate a language into a form that can be inferred by a machine, and the other is to obtain a solution by deducing and inferring a translation. The present invention relates to the first half and combines it with the existing deductive inference engine to enable deductive inference as a whole. This makes it possible to control the machine in everyday language.
[0004]
BEST MODE FOR CARRYING OUT THE INVENTION
As an example, consider the problem of having a robot pick and bring an apple when there are oranges, pears, apples, and bananas on the desk. The robot is equipped with a TV camera and a tactile sensor, and has a function of recognizing the shape, color, hardness, and the like of four objects A, B, C, and D on a desk by a conventional technique. It is assumed that it has a function of automatically obtaining information up to 5. And if you know that the apple is A, you can bring A to the command "Please bring the apple", but which fruit corresponds to which of A, B, C, D You do not have knowledge about
The aim is to teach the characteristics of fruits in words and let the robot judge them. The knowledge given is 6 to 18.
1. If not A, not B, and not C, then D.
2. B is round and yellow.
3. C is soft and not yellow.
4. D is elongated.
5. A is a red color.
6. If it is not an orange, not an apple, and not a pear, it is a banana.
7. The mandarin orange is rather soft, orange and quite small.
8. Apples are round, hard, and have a rather red color.
9. Pears are round, hard and yellow.
10. Bananas are particularly elongated and yellow.
11. If it's soft, it's banana or orange.
12. If it is round, it is an apple or a pear.
13. If it is orange, it is orange.
14. If it is slender, it is a banana.
15. Orange is not red or yellow.
16. Yellow is not red.
17. If it is round, it is not elongated.
18. If soft, not hard.
If these sentences are interpreted correctly and an apple is brought in response to the command "Please bring an apple", the robot can be interpreted as "understand the language" at this level.
Humans make inferences using propositional logic inference methods as follows. From 8, the apples are round, hard and reddish in color. From 17, if it is round it is not elongated. From 4, it is not D if it is slender. From 18, it is not soft if it is hard. From 3, it is not C if it is not soft. From 16, it is not yellow if it is red. From 2, it is not B unless it is yellow. Therefore, from 1, it is A because it is not B, not C, and not D. If the above logic can be incorporated into the robot, the robot should be able to correctly select and bring A.
The above inference process is a problem for mechanically solving a generalized syllogism problem.
In order to solve this mechanically, first, a plurality of Japanese sentences shown in [0003] are identified and decomposed into subjects, predicates, negative words, conjunctions, adverbs, adjectives, exclamation words, and endings, and unnecessary elements are removed. It must be converted to a form called "section form".
[0005]
[Subject predicate separation]
The word "is" in knowledge 1 or 2 is the ending, the word "slightly" and "quite" in 7 is an adverb, and the word "somewhat" is 8 and so on. Therefore, if these are removed, the sentence becomes only the subject, predicate, negation, and conjunction. The Japanese structure is defined by how these four are combined. The most basic is to mechanically separate the subject from the predicate. People are,
"Socrates is a human"
, The subject is "Socrates," the predicate is "human," and the ending is "is." The word that separates them is "ha". However, in the case of machines, we do not understand the contents, so if we simply use "ha" as the subject predicate identifier,
"He is a good person"
In a sentence like, the subject is mistakenly separated by "he", the predicate by "nice person", and the ending by "is". In order to avoid this, be sure to add "ha,""ga," and "mo," after the identifiers "ha,""ga," and "mo," which are used to separate subject predicates. So the sentence above
"He is a good person."
The subject can be correctly separated as "he", the predicate as "a good person", and the ending as "is". However, in the case of "spoken language", a reading point is not automatically inserted, so it is necessary to wait a little after "wa".
In English and Japanese, the sentence format of "... is ..." and the sentence format of "... is ..." are treated as different sentence structures. In English, the former is
"He is a boy"
Expressed as be, am, is, are, and the latter is
"If he is going, then I am going"
It is expressed as However, both have the same logical meaning.
FIG. 3 shows a sentence structure of the form “a is b” or “a is b”. Propositional logic is interpreted as "the concept of a is included in the concept of b." For example, the expression “rose is a flower” means that “rose” is included in the broader class concept of “flower”.
On the other hand, the expression "If you go, I will go" is interpreted as "there are various conditions for I to go, but also includes the condition for you to go". Therefore, the expressions “a is b” and “a is b” are both “a then b”, which means that a is a subset of b. "If ...", "If ...", "If you say ...", "If you ask ..." are all in this format.
[0006]
[Negative word]
Negative words are used to deny part or all of the sentence meaning, such as "... is not ..." or "If ... is not, then ...". In English, they are "then not ..." and "not ... then".
[0007]
[conjunction]
There are many synonyms for conjunctions, but they can be broadly divided into and and or. In logic, “a and b” means “a and b”, and “a or b” means “either a or b”. “A and b” can be divided into two words, “a” and “b”, but “a or b” cannot be decomposed.
FIG. 4 illustrates a sentence structure of “if a, b1 and b2 and b3”, logically “a then b1 and b2 and b3”. This is decomposed into three pieces of knowledge, "a thenb1", "a then b2", and "a then b3".
FIG. 5 shows a case in which a1, a2, and a3 are all included in the concept of b. In Japanese, “a1, a2, and a3 are both b” or “a1 or a2. Or if a3, then b. ""Whiskey, wine, and beer are also alcohol" can be decomposed into three types of knowledge: "whiskey is alcohol,""wine is alcohol," and "beer is alcohol."
In logic, the expression having the same meaning is “a1 or a2 or a3 then b”, not “a1 and a2 and a3 then b”. The expression "a1 and a2 and a3 then b" means that "a1, a2, and a3 are b."
FIG. 6 illustrates a sentence structure in which “a is one of b1, b2, and b3”. Logically, "a then b1 or b2 or b3".
[0008]
[Program flow chart]
[0007] In [0007], the general theory of converting Japanese into a rule format using and, or, then, and not was described. However, since there are many synonyms and exceptions in Japanese, they are all considered. They need to be able to read a wide variety of Japanese expressions. Hereinafter, each case will be described with a program flowchart.
FIG. 7 shows how a question is transformed. Since the question is limited to a single clause, what is X? Who is X? X? And endings such as "is ..." and "... is" are omitted and simply X.
FIG. 8 shows processing when there is an adverb in a sentence. Adverbs such as "very,""verymuch,""verymuch,""extremely,""outrageously,""unseen,""incredibly," are predicates Is omitted in the translation process because there is no essential difference in meaning even if omitted. The adverb is identified by a phrase registered in advance.
FIG. 9 is a basic form of a question. "You", "you", "you", "front", "onushi", "you", etc. are all interpreted as "you". "Your name then my name is ..." is a program that answers when you ask for your name. Japanese has many synonyms with different pronunciations, so a dictionary is needed to make them all have the same meaning.
FIG. 10 shows a process of converting a rule in a subject predicate format. The presence or absence of lexical characters such as "ha,""ga,""if,""if...","... if, if," which separates the subject from the predicate, is checked. . Punctuation is always required at the end of the identifier.
FIG. 11 shows a case where a predicate includes a negative word.
FIG. 12 shows a case where the subject is a negative form. The presence or absence of a phrase such as "If not,""Ifnot,""If, if not," or "If, if not," is used to identify subject predicate separation. used.
FIG. 13 shows a case where a plurality of predicates such as “and”, “and”, “ya”, “mo”, and “de” are connected to the predicate. These are all replaced by and.
FIG. 14 is a case where a conjunction such as “and”, “or”, or “ka” is used in a predicate. These are all replaced by or.
FIG. 15 shows a case where the subjects are connected by conjunctions such as “mo”, “or”, and “and”. In the case of the subject, "mo," is or and not and. And and means that what is sake, wine and beer is sake, but there is no such thing. In the dictionary, the description may be provided after the subject, and the description may be omitted after the period and the subject may be omitted. Considering such a case, punctuation may be connected by a conjunction "and".
FIG. 16 shows a case where the subject is a compound form and connected by and.
FIG. 17 shows a case in which, after obtaining the solution, the ending of the solution is “is.” Or “is not.” In order to make the conversation more human-like.
[0009]
【Example】
By translating the knowledge from [0004] 1 to 18 using a program created based on the above flowchart, the following is obtained.
1. not A and not B and not C then D
2. B then round and yellow
3. C then soft and not yellow
4. D then slender
5. A then red color
6. not mandarin orange and not apple and not pear then banana
7. Oranges then soft and orange and small
8. Apple then round and hard and crimson
9. Pear then round and hard and yellow
10. Banana then slender and yellow
11. Soft then banana or orange
12. Round then apple or pear
13. Orange then oranges
14. Elongated then banana
15. Orange then not crimson and not yellow
16. Yellow then not red color
17. Round then not elongated
18. Soft then not hard
In these, a part representing knowledge such as "pear" or "round" is sandwiched between four English words, then, not, or, and and, and a sentence structure is defined by a combination of these. Once translated into this form, the inference engine for invention patents (U.S. Pat. No. 5,390,287 (Feb. 14, 1995) and U.S. Pat. No. 5,493,633 (Feb. 20, 1996) ... quoted below). (The inventor is the same as the present applicant.).
[0010]
Next, the "extended production rule format" is converted into a clause format that can be subjected to pattern matching, that is, a format that does not include the then and, but has only not and or. Since one "extended production rule format" may be decomposed into a plurality of clause formats, a total of the following 28 pieces of knowledge are obtained.
1. A or Bor C or D
2. not B or round
3. not B or yellow
4. not Cor soft
5. Cor not yellow
6. not Dor
7. not A or red color
8. Mandarin orange or apple or pear or banana
9. not orange or soft
10. not orange or orange
11. not orange or small
12. not apple or round
13. not apple or hard
14. not apple or red color
15. not pear or round
16. not pear or hard
17. not pear or yellow
18. not banana or elongated
19. not banana or yellow
20. not soft or banana or orange
21. not round or apple or pear
22. not orange or orange
23. not slender or banana
24. not orange or not crimson
25. not orange or not yellow
26. not yellow or not crimson color
27. not round or not slender
28. not soft or not hard
[0011]
The deductive inference process will be described using the knowledge of [0010] as an example.
(A) When the speaker instructs "to bring an apple", a single phrase "apple" is input to the inference engine of the robot.
(B) 12. From the “not apple or round” and “apple”, “apple” is deleted by pattern matching, and “round” is obtained. The reason why “not apple” and “apple” can be canceled is based on a derived operation.
(C) Similarly, 13. "Not apple or hard" and "apple" yield "hard".
(D) 14. "Not apple or red color" and "red color" can be obtained from apples.
(E) 27. And “round” give “not slender”.
(F) 28. And "not soft" from "hard".
(G) 24. And "red orange" from "red color".
(H) 26. And “red color” gives “not yellow”.
(G) 6. "Not D" is obtained from "not elongated".
(Co) 23. "Not banana" is obtained from "not elongated".
(Sa) 4. “Not C” is obtained from “not soft”.
(S) 9. And "not soft" gives "not orange".
(S) 2. And “round B”, “not B” is obtained.
(C) Because it is not “B”, not “C”, and not “D”, Must be more "A". That is, the apple is A.
[0012]
When the Japanese of [0004] is input, it is automatically converted into the format of [0009] or [0010] inside the program and input to the deductive inference engine. As a result, deductive solutions such as the following 1 to 14 are obtained.
1. Apple
2. round
3. Hard
4. Red color
5. Not slender
6. Not soft
7. Not orange
8. Not yellow
9. Not D
10. Not a banana
11. Not C
12. Not orange
13. Not B
14. A
These are the solutions when giving the knowledge of [0004] and ordering "Keep an apple". That is, the instructed robot obtains A by inference, and brings A as shown in FIG.
Since the solution is obtained from a combination of a plurality of knowledges, the solution “A” cannot be obtained if some of the knowledge of [0004] is missing.
If the knowledge of [0004] is stored in the robot, the robot will correctly select C and D for the next command of "Keep oranges" and "Keep bananas". That is, the automatic programming of the robot is performed in the everyday language.
[0013]
【The invention's effect】
Even if it is technically possible, it would seem that enormous man-hours would be required if a control program like the one described above were to be constructed by the conventional method, but the present invention achieves the same purpose by teaching several lines of knowledge. Can be achieved.
In addition, since the database and instructions for providing knowledge can be handled in the same category, if you want to turn on the cooler when the room temperature exceeds a certain temperature, "If the room temperature is 28 degrees Celsius or higher, switch on the cooler Just tell the robot to turn on the cooler, and the robot will always turn on the cooler when the room temperature rises above 28 degrees Celsius.
Since the database is written in a text storage in the storage device of the robot, the debugging operation is also easy. As a result, the labor of programming robots and machines, which previously required a huge amount of labor, can be dramatically reduced.
Applications are not limited to robots. If this technology is used, a computer that manages aircraft, ships, automobiles, thermal power plants, remote communication devices, etc., stores in advance what countermeasures should be taken in the event of an abnormal situation, and from the sensor When an abnormal signal is detected, emergency measures can be taken automatically and the operator can be notified in a daily language.
[0014]
There is no point in converting everyday language into extended production rule format unless it can be deduced via an inference engine. Today, only the cited invention patents are available with existing inference engines.
The following is not a part of the present patent, but the contents of a part of the cited invention patent are reproduced for reference in order to clarify the relation with the present invention.
[0015]
[Limitations of existing inference engines]
Machines can basically only understand machine language. Therefore, in order for a machine to understand everyday language, it is necessary to translate it into machine language.
Since machine language is a sequence of numbers and is difficult for humans to understand, a compiler language for translating a program into machine language has been developed today. Therefore, it is more reasonable to translate everyday language into one of the compiler languages and connect with it to make inferences than to translate directly into machine language.
A representative compiler language used today is shown in FIG. Although the type of language differs depending on the application and usability, the procedural language is mainly for performing numerical operations, and is not adapted to the problem of reading Japanese as in [0004].
Therefore, descriptive words such as Prolog and LISP are conventionally used for constructing a knowledge database. However, Prolog and LISP have severe restrictions. The limitation is that it can only process a special form of rule language called "horn clause" or "production rule". In addition, since a phenomenon called "combination explosion" is involved, there is a problem that only a relatively small knowledge base can be handled. Here, the Horn clause
a1 and a2 and a3. . . an then b
It is a form. Only "and" is allowed on the left side of "then", and "not" is not allowed before a1 and a2. The reason is that when an inference operation called “derivation” is performed by combining knowledge, logical validity is lost in other expression forms.
For this reason, LISP or Prolog cannot express knowledge such as "it is not orange unless it is orange". The concept of "not orange" and "not orange" can be expressed formally by replacing it with a new concept, in which case they are treated as having nothing to do with the concept of "orange" or "citrus" Therefore, new knowledge cannot be obtained by inference. However, an expression form in which such knowledge expression is not allowed is not suitable as an inference engine.
Today, the only inference engine capable of handling rule forms that are not Horn clauses and capable of “fast operation” without explosion of combinations is the URA (Unit Resolution Algorithm; single-section derivation algorithm) of the cited invention patent. Therefore, it is most practical to translate everyday language first into the language used by the URA.
By limiting one of the knowledge to a single clause, the URA escapes the constraints of the Horn clause and allows not, or, and and to be used freely on the right and left sides of then. The expression form is a coined word in the sense that a wider expression form than "production rules" is recognized, but it should be called "extended production rules". To explain why there is no Horn clause constraint in the URA, we will briefly touch on semiotics.
[0016]
[Logistics]
The theoretical basis of deductive reasoning is semiotics. In symbolic logic, arithmetic rules similar to Boolean algebra are applied. The following five symbols are used in semiotics.
a, b, c, d. . . Character variable. Also called literal.
and A logical operation symbol meaning "and".
or A logical operation symbol meaning "or".
then A logical operation symbol meaning "if".
not Logical operation symbol meaning "negation".
Expressions that express knowledge and rules using character variables and logical operation symbols are called logical expressions.
A logical expression that does not include then and and is called clause form. Note that <=> in the description means that the right and left of the symbol are logically equivalent. The basic knowledge format, its logical formula and clause format are as follows.
Figure 2004220458
Figure 2004220458
In the above equation, a then b <=> not a or b is
“If a, b” and “not a or b” mean that they are logically the same. It's hard to understand intuitively, but "everything is either a or not a." Therefore, "not a or a" always holds. However, since “a is b if”, “not a or b” must always hold. Therefore, a then b <=> not a or b.
Next, nodes A, B, C, and D are represented by the following equations.
Figure 2004220458
This leads to the following equation.
Figure 2004220458
Figure 2004220458
More complex equations can be derived from these equations. For example
Figure 2004220458
It becomes. In this way, any rule can be converted to clause form, and the discussion will be limited to clause form.
Note that the above conversion formula holds even if not ai is replaced by not ai and bj is replaced by not bj, so that it is not related to the sign of the logical variable. Such an expression format is an “extended production rule format”. As we have seen, these formulas are easily derived from semiotics formulas, but have not received much attention in the past because the LISP and Prolog methods cannot derive this form.
[0017]
[Derivable conditions]
The operation of solving knowledge (rules) consisting of a plurality of clauses as a logical equation and solving it is deductive inference. In order to obtain a solution from a logical equation, it is necessary to first convert a plurality of given rules into a clause form, and to simplify the logic variables contained therein by sequentially deleting them by pattern matching.
Attempts to eliminate logical variables sequentially in the derivation operation described below were first made in 1966,
J. A Made by Robinson. Two clauses are said to be derivable if each of the two distinct clauses "contains only one set of logical variables with the same logical value and different sign."
For example, when p is a single clause, Q is a multiple clause that does not include p, and R is a multiple clause that does not include not p, p, not p is obtained from “p or Q” and “not p or R” by pattern matching. Is eliminated, and a new section “Q or R” is obtained.
In this case, the original pair is called a parent clause, and the resulting new clause is called a child clause. The operation of obtaining the conclusion that "Socrates dies" from "Socrates is human" and "Human dies" erases the word "human" from the parent clauses "not socrates or human" and "not human or dying". This is a derivation operation to obtain a child clause "not socrates or die".
The condition of “only one set” is a great restriction on the derived operation. If the parent clause had another pair with a different sign, p or Q, not p or R would be
por Q = por Q1 or not t
notporR = notporR1 ort
Can be written as Formally applying the derived operation, from these two equations
Q1 or R1 is obtained, which is not logically correct. That is, when the parent clauses Q and R include two or more sets of logical variables having different signs, the derivation operation is not allowed. Checking the condition that there is only one set for all combinations of knowledge takes a very long time as the number of knowledge increases.
For this reason, in Prolog, LISP, and the like, only clause forms in which this condition is guaranteed in advance have been taken up as targets for derivation operations. In particular
a1 and a2 and. . . an then b = not a1 or not a2 or. . . or not an or b
b then c1 or c2 or c3 or. . . or cm = notbor or c1 or c2. . . or cm
That is, the left side of the then is a knowledge form connected by all and and the right side is all connected by or. These are called "horn clause" or "production rule format", which is a special case of the above-mentioned "extended production rule format". In the Horn clause, it is guaranteed that there is only one set of pairs to be derived in advance, "b, not b".
not a1 or not a2 or not a3 or. . . . or not an or c1 or c2. . . or cm
Is obtained. This satisfies the condition of “one set”, but there is a great restriction on knowledge representation because not all knowledge forms can be represented by Horn clauses.
[0018]
[Combination explosion]
When inferring, humans do not sequentially call all the stored knowledge, but have the ability to call only necessary knowledge and collate and infer each time. However, in the case of a machine, priorities cannot be prioritized for knowledge, so that an operation of mechanically calling and collating all the knowledge stored in the inference process is required. In this manner, as the number of knowledge increases, the number of combinations increases in proportion to the exponentiation of the number of knowledge.
This is because even if new knowledge is obtained by collating two pieces of knowledge, the original knowledge is not made unnecessary but remains in the operation process. For example, if a parent clause "Socrates is a human" and "a human dies" give a child clause "So Socrates dies", that does not mean that the original parent clause is unnecessary. For this reason, further matching is required between the child clause generated by the matching and another parent clause. Assuming that the initial number of knowledges is n, including all cases where three knowledges are combined or four knowledges are combined, the total number of combinations becomes
Figure 2004220458
(Equation 1)
That is, the number of calculations of 2 to the power of n is required. This value is about 1 billion at n = 30 and about 1 trillion at n = 40. This requires an enormous amount of calculation time, and cannot handle a large knowledge base.
This is the main reason that the conventional deductive inference engine has been implemented only for a relatively small knowledge database.
[0019]
[How cited invention patents avoid explosions of combinations]
Today, a number of deductive inference engines have been developed, but these are algorithms in which parent clauses remain when child clauses are born. Therefore, if the number of knowledges exceeds 30, it takes a very long time to obtain a solution, and a large knowledge base cannot be handled. On the other hand, the cited invention patent “URA single clause derivation algorithm” seeks “the condition under which one of the old parent clauses is forcibly deleted when generating new knowledge”, and performs pattern matching under that condition. Is what you do. If this condition is satisfied, the total number of rules does not increase from the initial n, so the total number of combinations is at most the total number of combinations that take two out of n,
[Equation 2]
Figure 2004220458
That is, it is only on the order of the square of n. This is much smaller than 2 to the power of n, allowing faster inference.
The concept of "absorption" is used to determine "the condition under which one of the parent clauses is forcibly deleted". That is, in the nodes P and Q, when P is a subset of Q, "P absorbs Q", and the absorbed node Q can be deleted from the subsequent calculation. For example
P a a "is a"
Q ≡ a or b or not c "a or b or not c"
, P is a subset of Q and can be deleted. This is because P asserts that the solution is “a”, and Q is unnecessary because the range is more limited than Q. Similarly, when p and not p are deleted from “p or Q” and “not p or R” in [0015], and a child clause “Q or R” is obtained by derivation, one of the parent clauses is determined. In order to be able to omit, the child clause should absorb one of the parent clauses. However, "Q or R" can absorb either "por Q" or "not por R" only in the following two cases.
[When one of Q and R is a subset of the other]
In this case, for example, if R is a subset of Q, "Q or R" is simply Q, so "p or Q" can be absorbed. However, this is a special case where R and Q are not independent of each other, and is not general.
[When one of R and Q is an empty clause]
If Q is an empty node, “Q or R” is simply R. This absorbs "not por R". If R is an empty node, “Q or R” is Q. This absorbs "p or Q". Accordingly, in this case and only in this case, when a child clause occurs in the derivation operation, either of the parent clauses can be deleted, and the total number of knowledge does not increase.
In other words, the total number of combinations does not increase only when p and not p are single clauses. A derivation method that algorithmizes this idea is the URA (Unit Resolution Algorithm) of the cited patent invention.
In single-clause derivation, since one of the knowledge is always a single clause, the condition that "only one logical variable with a different sign can exist in the parent clause of a pair" is automatically satisfied.
For this reason, it is not necessary to consider the constraint of "restricting the knowledge format to the Horn clause". This is why the extended production rule format can be derived in URA.
[0020]
[Single clause derivation algorithm]
When the above ideas are algorithmized, a "pivot method" is used. Some of them are reprinted from cited invention patents. The following is an inference target example.
p then q (p is q)
not p then q or r (q or r if not p)
not s then t (t if not s)
not r then x (x if not r)
r then not s (r is not s)
not q (not q) ← single clause
The above is converted into clause form as follows.
not por q
p or q or r
s or t
r or x
notr or nots
not q
In order to be able to derive a single clause, there must be one or more single clauses, but here, “not q” is a single clause.
The above is expressed in a matrix format as shown in FIG. The positive sign of the logical symbol corresponds to 1, and not corresponds to -1. The place corresponding to not q is “<6>, q”. The process in which new child clauses "not p" and "q or r" are generated from "(1), q" and "(2), q" is shown in FIG. 18.
In FIG. 19, since not p is a single node, the pivot axis of the new derivation step is “(1), p”. When a column with a different sign is searched for in the row of p, column (2) corresponds to this. Since r is obtained from "not p" and "por r", r is the next derived single clause.
In FIG. 20, "(2), r" is a pivot axis. Here, looking at the row of r, there is the same 1 in the column (4). This is a clause form of "r or x". Since "r" is a sub-clause, column (4) is absorbed by column (2) and is deleted from the subsequent calculations.
FIG. 21 shows the result of performing a pivot operation on [FIG. 19]. The new axis is “5, s”. In the row of s, (3) is the next derivation target.
FIG. 22 shows the obtained new matrix. Here, since all the logical variables are unified, the operation ends. The solutions are "not p", "r", "t", "not s", and "not q". x is indefinite, and the solution is not determined. Even if all the logical variables do not become single clauses, the operation stops when the procedure stops. As we have seen, the unary derivation algorithm guarantees that the solution converges in at most six operations because the number of symbols initially six does not increase with derivation.
[0021]
[Difference between single clause derivation and general derivation]
As described above, single-clause derivation does not have the restriction of limiting knowledge to Horn clauses, and enables fast inference. Since it can process thousands of knowledge bases even at the operation speed of a personal computer, it has an excellent feature that it is not necessary to use expensive equipment such as a parallel operation system.
On the other hand, since single-clause derivation is a special case of general derivation, there are operational restrictions, and a solution is not output only by reading rules. For example, if you teach the knowledge that "Socrates is a human," or "humans will die," the conclusion that "Socrates dies" is not automatically obtained.
Where is "What is Socrates?" Only when the question (Socrates? ... single clause) is input is a single clause solution of "human" and "die" obtained.
However, since the sensor information and the command from the human to the robot are basically a set of single-syllable information, there is almost no practical disadvantage that the input is limited to a single-syllable. Instructions that are not simplex, such as "Keep an apple or pear," are not executed. However, in such a case, there is no inconvenience if a condition such as "select the first one" is taught in advance.
Also, the conditional command, "Turn on the lights if it's dark," is not unary. However, if the robot has a function of judging light and dark, it is judged by itself whether it is dark or bright. As a result, if it is dark, the single light instruction of "light on" is executed, otherwise the instruction is ignored. Thus, this is equivalent to a single clause input.
Also, the fact that the output is a single clause is not inconvenient and can be viewed as rather desirable. The solution "A is B" or "A is B" is rather confusing.
[Brief description of the drawings]
FIG. 1 illustrates the concept of the present invention.
FIG. 2 is a conceptual diagram showing claims.
FIG. 3 is a structural diagram of a sentence "a is b" and "a is b".
FIG. 4 is a structural diagram of a sentence “If a1, a2, or a3, then b”.
FIG. 5 is a structural diagram of a sentence “if a is b1, b2 and b3”.
FIG. 6 is a structural diagram of a sentence “if a is b1, b2, or b3”.
FIG. 7 is a flow of a question to a machine, in which a ending is deleted by a tail processing module.
FIG. 8 is a flow in which an adverb is omitted and converted into a basic subject predicate form.
[Figure 9] is the flow of the program to answer "My name is ..." to the question "Your name is".
FIG. 10 is a flow of separating a sentence into a subject predicate and translating the sentence into an extended production rule.
FIG. 11 is a flow of translation when a predicate includes a negative word.
FIG. 12 is a flowchart of a translation process when a subject includes a negative word.
FIG. 13 is a flow of translation when a predicate includes an and conjunction.
FIG. 14 is a flow of translation when a predicate includes an or conjunction.
FIG. 15 is a flowchart of translation when the subject includes an or conjunction.
FIG. 16 is a translation flow in the case where the subject includes an and conjunction.
FIG. 17 is a flow in the case where a solution is obtained and “is.” Is added in order to bring it closer to human language.
FIG. 18 is a first step in which an example of a deductive inference problem is represented in a matrix format.
FIG. 19 shows a second step in which an example of a deductive inference problem is represented in a matrix format.
FIG. 20 is a third step in which an example of the deductive inference problem is expressed in a matrix format.
FIG. 21 is a fourth step of the example of the deductive inference problem expressed in a matrix form.
FIG. 22 shows the final step of an example of a deductive inference problem in a matrix format.

Claims (2)

主語・述語形式の日常言語を、句読点や特定用語の位置を目印として主語・述語・否定語・接続詞・副詞・形容詞・感嘆詞・語尾などの節の結合形に並べ替え、拡張プロダクションルール形式に翻訳して既存の演繹推論エンジンと接続し、演繹推論を可能とするプログラム。The subject / predicate form of everyday language is rearranged using the punctuation marks and the position of specific terms as markers to link the clauses of the subject, predicate, negation, conjunction, adverb, adjective, exclamation, ending, etc., to the extended production rule format. A program that translates and connects with existing deductive inference engines to enable deductive inference. 【請求項3】で得られた日常言語の知識・命令を機械に記憶させ、次から同じ命令で同じ制御動作を行わせる自動プログラミング構造。3. An automatic programming structure in which the knowledge and instructions of the everyday language obtained in the step (3) are stored in a machine, and the same control operation is performed with the same instructions from then on.
JP2003008980A 2003-01-17 2003-01-17 Automatic programming for machinery according to daily language and deductive inference engine Pending JP2004220458A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003008980A JP2004220458A (en) 2003-01-17 2003-01-17 Automatic programming for machinery according to daily language and deductive inference engine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003008980A JP2004220458A (en) 2003-01-17 2003-01-17 Automatic programming for machinery according to daily language and deductive inference engine

Publications (1)

Publication Number Publication Date
JP2004220458A true JP2004220458A (en) 2004-08-05

Family

ID=32898604

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003008980A Pending JP2004220458A (en) 2003-01-17 2003-01-17 Automatic programming for machinery according to daily language and deductive inference engine

Country Status (1)

Country Link
JP (1) JP2004220458A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7414735B2 (en) 2018-05-04 2024-01-16 スプーン Method for controlling multiple robot effectors

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7414735B2 (en) 2018-05-04 2024-01-16 スプーン Method for controlling multiple robot effectors

Similar Documents

Publication Publication Date Title
Frederiksen Discourse comprehension and early reading
Zelle et al. Learning to parse database queries using inductive logic programming
US5966686A (en) Method and system for computing semantic logical forms from syntax trees
US20030144832A1 (en) Machine translation system
US10628743B1 (en) Automated ontology system
Veena et al. A graph-based relation extraction method for question answering system
Kalaivani et al. A review on feature extraction techniques for sentiment classification
Schwind An intelligent language tutoring system
US20040243395A1 (en) Method and system for processing, storing, retrieving and presenting information with an extendable interface for natural and artificial languages
CN114492796A (en) Multitask learning sign language translation method based on syntax tree
de Felice Categorical tools for natural language processing
Şeker Temporal logic extension for self-referring, nonexistence, multiple recurrence, and anterior past events
KR102206742B1 (en) Method and apparatus for representing lexical knowledge graph from natural language text
JP5881030B2 (en) Artificial intelligence device that expands knowledge in a self-organizing manner
Wei et al. Comparative studies of AIML
Stramandinoli et al. Grounding speech utterances in robotics affordances: An embodied statistical language model
Scheler Learning the semantics of aspect
JP2004220458A (en) Automatic programming for machinery according to daily language and deductive inference engine
Inago et al. Parsing Parking Instructions for Self-driving Cars into Spatial Semantic Descriptions.
Goertzel Lojban++: an interlingua for communication between humans and AGIs
Hunt Natural language processing
Dorrn et al. A Textual Information Extraction Application based on XML Data Models and a Multidimensional Natural Language Processing Pipeline Approach
Chiruzzo et al. Spanish HPSG Treebank based on the AnCora Corpus
Islam et al. Visualizing Chat-Bot Knowledge Graph Using RDF
Chen Understanding mental states in natural language

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20051004

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051209

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060411

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060825