JP7253760B2 - Method, computer program and apparatus for implementing negation in logic programming - Google Patents

Method, computer program and apparatus for implementing negation in logic programming Download PDF

Info

Publication number
JP7253760B2
JP7253760B2 JP2017092057A JP2017092057A JP7253760B2 JP 7253760 B2 JP7253760 B2 JP 7253760B2 JP 2017092057 A JP2017092057 A JP 2017092057A JP 2017092057 A JP2017092057 A JP 2017092057A JP 7253760 B2 JP7253760 B2 JP 7253760B2
Authority
JP
Japan
Prior art keywords
computer program
expression
cpu
affirmative
logic
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.)
Active
Application number
JP2017092057A
Other languages
Japanese (ja)
Other versions
JP2018190182A (en
Inventor
中村圭介
Original Assignee
ナレルシステム株式会社
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 ナレルシステム株式会社 filed Critical ナレルシステム株式会社
Priority to JP2017092057A priority Critical patent/JP7253760B2/en
Publication of JP2018190182A publication Critical patent/JP2018190182A/en
Application granted granted Critical
Publication of JP7253760B2 publication Critical patent/JP7253760B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

特許法第30条第2項適用 ▲1▼ 未踏アドバンスト事業 プロジェクト提案書(写し) ▲2▼ 第71回粟ヶ崎ビジネスサロン 補助資料(当日配布済) ▲3▼ 第71回粟ヶ崎ビジネスサロン用スライド(当日説明、山田先生経由で金沢市に配布) ▲4▼ 金沢市様CVCK2017・3・8の発表スライド&質問対応資料をスライドシェアに2017・3・9にアップロードし、FaceBook公開ページにリンクしたもの)Application of Patent Law Article 30, Paragraph 2 ▲1▼ MITOU Advanced Business Project Proposal (Copy) ▲2▼ 71st Awagasaki Business Salon Supplementary materials (distributed on the day) ▲3▼ 71st Awagasaki Business Salon Slides for use (Explanation on the day, distributed to Kanazawa City via Professor Yamada) (4) Kanazawa City CVCK 2017/3/8 presentation slides & Q&A materials uploaded to slide share on 2017/3/9 and posted on Facebook public page linked)

本発明は、論理型プログラミングにおいて否定を実現する方法、コンピュータプログラム及び装置に関する。 The present invention relates to a method, computer program and apparatus for implementing negation in logic programming.

伝統的なPROLOGとその機能サブセットを自然言語やインターネットに対応するように拡張した言語(例えば、当社による下記の「特許文献1」)、等が、論理型(あるは宣言型)プログラミング言語として知られており、その開発・実行環境(アプリケーションソフトウエア)も整備されている。
これらの言語ならびに環境では、「メモリに存在せずルールによる自動証明もできない命題を偽」とみなす「閉世界仮説」と呼ばれる解釈方針が一般的に採用されてる。
その理由は、論理の種類を、証拠(事実、ファクト)や論理(推論規則、ルール)の組み合わせで(自動)証明できることと(自動)証明できないことの二種類(二値)に割り切ったほうが、知識や文脈状態の表現が簡単であり、問い合わせへの回答のためのパターンマッチング(単一化)や三段論法(自動証明、再帰的)を含む解探索・推論の処理も、簡潔に実現(高速性)でき、正当性(一定の完全性、健全性)も検証しやすかったからだと考えられる。
この方針をとった場合のいわゆる「NOT」は「証明の失敗としてのNOT」と呼ばれることが多く、PROLOGの多くの教科書には、「!」(カットオペレータ)や「fail」(探索をわざと失敗させる)を用いたその実現例(2行程度)が示されている。
しかし、「科学/技術/営業/公序/倫理的にありえない」アイディア等を解の候補から排除する必要がある場合等、実社会の状況や問題設定をより正確かつより効率的に表現して処理しなければならない多くの場面では、「証明の失敗としてのNOT」では記述能力が不十分であり、これと整合しやすい「メモリに存在せずルールによる自動証明もできない命題を偽」とみなす解釈方針は、新しいアイディア(特に自然言語による利用者にとって自由な存在論(オントロジ)や語用論(特に言葉の組み合わせによる新規概念や新規アイディアの合成))の探求を不当に制限しすぎる弊害があった。
すなわち、従来の「NOT」よりも進歩した表現能力と意味論(人間による意味付けとコンピュータによる解釈方法)が、特に利用者からの自然言語による自由な存在論や語用論を活かせる立場(特許文献1、2、3のシステム)から求められていた。
Traditional PROLOG and its functional subsets are extended to correspond to natural languages and the Internet (for example, our company's "Patent Document 1" below), etc. are known as logical (or declarative) programming languages. and its development/execution environment (application software) is well maintained.
These languages and environments generally adopt an interpretation policy called the "closed-world hypothesis," which regards "propositions that do not exist in memory and cannot be automatically proved by rules as false."
The reason is that it is better to divide the types of logic into two types (binary) of things that can be (automatically) proven and things that cannot be (automatically) proven by combining evidence (facts, facts) and logic (inference rules, rules). Expression of knowledge and contextual state is simple, and solution search and inference processing including pattern matching (unification) and syllogism (automatic proof, recursive) for answering queries can be easily realized (high speed). This is thought to be because it was easy to verify the legitimacy (a certain degree of completeness and soundness).
The so-called "NOT" when this policy is adopted is often called "NOT as failure of proof", and many PROLOG textbooks include "!" ) is shown (about two lines).
However, when it is necessary to exclude ideas such as "science, technology, business, public policy, and ethical improbability" from the solution candidates, it is possible to more accurately and efficiently express real-world situations and problem settings. In many situations where it is necessary, ``NOT as a failure to prove'' is insufficient in its descriptive ability, and an interpretation policy that considers ``a proposition that does not exist in memory and cannot be automatically proved by rules to be false'' is easy to match with this. has the harmful effect of unreasonably restricting the exploration of new ideas (especially ontology (ontology) and pragmatics (especially the synthesis of new concepts and ideas by combining words) that are free for users of natural language). .
In other words, the expressive ability and semantics (meaning by humans and the interpretation method by computers) that are more advanced than the conventional "NOT" can make use of free ontology and pragmatics by natural language especially from users ( It was required from the systems of Patent Documents 1, 2, and 3).

特願2013-087008 自然言語に変数を埋め込んだリテラルの多長一致と無限集合の管理等Patent Application No. 2013-087008 Multi-length matching of literals with variables embedded in natural language and management of infinite sets, etc. 特願2016-009324 コンピュータから利用者への逆質問と動的な事実(一時文脈)追加Patent Application No. 2016-009324 Reverse question from computer to user and addition of dynamic facts (temporary context) 特願2017-092047 前向き推論による動的な事実(一時文脈)の追加Patent Application No. 2017-092047 Addition of Dynamic Facts (Temporary Context) by Forward Inference

本発明は、かかる問題に鑑み、「科学/技術/営業/公序/倫理的にありえない」アイディア等を解の候補から排除する必要がある場合等も効率的に知識表現してコンピュータで解釈する方法、装置、コンピュータプログラムを提供することを目的とする。
また、その進歩した表現能力と意味論により、利用者からの自然言語の自由さを活かしやすくすることを目的とする。
In view of such problems, the present invention provides a method of efficiently expressing knowledge and interpreting it by a computer even when it is necessary to exclude "science/technology/business/public order/ethical improbable" ideas from solution candidates. , an apparatus and a computer program.
It also aims to make it easier for users to take advantage of the freedom of natural language through its advanced expressiveness and semantics.

本発明は、かかる課題を解決するため、
本発明の請求項1は、
利用者が入力する質問文、事実、ルールの条件もしくはルールの効果、又は、論理プログラムの事実、ルールの条件もしくルールの効果において、
証拠事実の存在もしくは自動証明の成功としての肯定(真)並びにその否定(証拠事実の不存在かつ自動証明失敗/不能)以外に、
否定する証拠事実の存在もしくは否定する自動証明の成功を意味する「ありえない」の表現を許容し、
変数を最初から含まないもしくは変数束縛により含まなくなった肯定表現を根拠として用いる際に、
該肯定表現に対応する「ありえない」の表現が存在しないかつ自動証明できないことを自動確認して、
該「ありえない」の表現が存在する又は自動証明できる場合に該対応する肯定表現の使用を制限するようにした
コンピュータプログラムを提供する。
:ここで「肯定表現に対応する」とは、例えば肯定文「太郎は長男」に対応する「ありえない」の表現が「!太郎は長男」であることをいい、両者(肯定と「ありえない」)が論理プログラムや一時文脈に共存するときは、「ありえない」を意味する「!太郎は長男」を優先して推論を進める(知識表現を解釈・探索する)方針としておくことにより、安定した解釈・判断が可能になる。
これにより、例えば以下のリストのようにある種の「経済的・倫理的にありえない」範囲を簡潔に表現してアイディアから排除することが可能になる。

15: !$Xに$Yを食べさせて儲ける :- $Xは家畜 ; $Yは毒 ;
16: $Xを使った$Yの廃棄物処理方法 :- $Xに$Yを食べさせて儲ける ;
17: $Xに$Yを食べさせて儲ける :- $Xは$Yを食べる ;
18: ヤギは家畜
19: ヒ素のついた紙は毒
20: ヤギは菜種油のついた紙を食べる
21: ヤギはヒ素のついた紙を食べる
:この場合、「ヤギを使った菜種油のついた紙の廃棄物処理方法」はアイディアとして生成されるが、「ヤギを使ったヒ素のついた紙の廃棄物処理方法」という解候補は、16行目でその根拠(十分条件)となる「ヤギにヒ素のついた紙を食べさせて儲ける」が15行目により制限されるため、生成されないことになる。
:このような生成の抑制(制限)は、前記特許文献1における自然言語に変数を埋めこんだリテラルの束縛処理によりアイディアが固定文字列になった時点では、現実的な時間での計算が明らかに可能となるため、そのようなタイミングですべての論理プログラムを探索して、例えば15行目により抑制・排除することが有利である。
:なお、「!」を一律に「ありえない」の意味として取り決めた場合には、事実「太郎は長男でない」と事実「!太郎は長男でない」の関係は、事実「太郎は長男である」と事実「!太郎は長男である」の関係と同じであり、文言を見て解釈する日本人の解釈だけがちょうど反対の意味になる。文末の「でない」を一律に「ありえない」の意味として取り決めた場合には、知識表現の論理プログラマや利用者がそのようなコーディング規約に従うことにより、コンピュータによって「!」の場合と同様の上記「ありえない」の機械的解釈(解候補の自動制限等)が可能である。
>「~でありえない」あるいは「~でない」を意味するいわば制約は、現実の問題を制約として表現した制約充足問題等を解く上できわめて重要な知識表現であり、論理プログラムの現実問題の表現能力が大幅に改善されることになる。
In order to solve such problems, the present invention
Claim 1 of the present invention is
In a question, fact, rule condition or rule effect entered by a user, or in a logic program fact, rule condition or rule effect,
In addition to the affirmation (true) as the existence of evidence facts or the success of automatic proof and its denial (absence of evidence facts and automatic proof failure/impossibility),
Permitting the use of the word "impossible" to imply the existence of evidence to the contrary or the success of automatic proof to the contrary;
When using an affirmative expression that does not include the variable from the beginning or does not include it due to variable binding,
Automatically confirming that the expression "impossible" corresponding to the affirmative expression does not exist and cannot be automatically proved,
To provide a computer program for restricting the use of the corresponding affirmative expression when the "impossible" expression exists or can be automatically proved.
: Here, ``corresponding to an affirmative expression'' means, for example, that the expression ``impossible'' corresponding to the affirmative sentence ``Taro is the eldest son'' is ``!Taro is the eldest son.'' When Taro coexists in a logic program or temporary context, by prioritizing ``! judgment becomes possible.
This allows certain "economically and ethically implausible" ranges to be succinctly expressed and eliminated from the idea, for example the list below.

15: !feed $X $Y and make money :- $X is livestock; $Y is poison;
16: How to dispose of $Y's waste using $X :- Make $X eat $Y ;
17: Make $X eat $Y and make money :- $X eats $Y ;
18: Goats are Livestock
19: Paper with arsenic is poisonous
20: Goats eat paper with rapeseed oil
21: Goats eat arsenic paper. The solution candidate "waste disposal method" is not generated because the ground (sufficient condition) for the solution "make money by feeding goats with arsenic paper" is restricted by line 15. Become.
:Suppression (restriction) of such generation is obvious at the time when the idea becomes a fixed character string by the literal binding process in which the variable is embedded in the natural language in the above-mentioned Patent Document 1, the calculation in a realistic time is clear. Therefore, it is advantageous to search for all logical programs at such timings and suppress/exclude them by, for example, line 15.
: In addition, when ``!'' is uniformly agreed to mean ``impossible'', the relationship between the fact ``Taro is not the eldest son'' and the fact ``!Taro is not the eldest son'' becomes the fact ``Taro is the eldest son'' In fact, it is the same as "! Taro is the eldest son." If it is agreed that the end of the sentence "is not possible" uniformly means "impossible", the above "!" It is possible to mechanically interpret "impossible" (automatic restriction of solution candidates, etc.).
> Constraints, meaning "cannot be" or "not", are extremely important knowledge representations for solving constraint satisfaction problems that express real problems as constraints, and the ability of logic programs to express real problems. will be greatly improved.

上でも説明したとおり、本発明の請求項2は、
「ありえない」を意味する知識表現を、対応する肯定表現よりも一律に優先させる(または一律に劣後させる)ことを特徴とする
コンピュータプログラムを提供する。
「優先させる」場合、「ありえない」側に証明したい場合には、コンピュータプログラムが肯定表現の不存在を確認する探索コストが不要になる。これは、仮に逆の「劣後させる」方針(肯定表現優先)を採用した場合でも同様のコスト削減効果が得られる。
なお、ルールの条件式においては、従来のNOT(証拠の不存在と自動証明の失敗)も、「ありえない」を意味する知識表現と併記することが可能であり、上記したさまざまな都合で「ありえない」として排除することの要/不要にかかわらず、明らかに必要かつ有用である。
この併記の場合、例えば、「ありえない」を意味する知識表現を(!・・・)とし、従来のNOTを意味する知識表現を(~・・・・)とすることができる。
自然言語に変数を埋め込んだリテラルを許容する方式におけるこの従来のNOT(上では、~・・・)は、リテラル(・・・)に変数が存在しない場合は論理の逆転(存在する/自動証明できる場合は偽、存在せず自動証明もできない場合は真)となり、リテラルに変数が存在する場合は、NOT取り除いてできる条件を充足する変数束縛をそのルールの解候補から排除する意味となる(従来のPROLOGと同様)。
この排除(~)は、「ありえない」を意味する知識表現(!)が、根拠にしようとしている固定文字列を媒介としてグローバルスコープで矛盾を同定・検出して束縛や自動証明の経路を排除(制限)していることとは対照的に、根拠にしようとしている具体的な固定文字列(変数のない事実)と矛盾であるかどうか等は検出せずにルール内ローカルスコープの変数の束縛単位で排除するものである(実装上は、ルール上の変数組にを束縛してはいけない値組の集合を管理していくことで、たとえ、「~$Xは男」という条件が、「$Xは日本人」など$Xの解候補集合を初めて出現させる条件の前(通常はボディ部の左側)に出現したとしても、この機能を実現することができる)。
なお、この従来のNOT(~・・・)をボディ部の条件に用いるだけでは、上記のリストと同じ意味の知識内容を表現するのが困難又は高コストであることを確認されたい。これは家畜と毒の、N段論法を経た組み合わせこそが経済的・倫理的に問題視されているのであって、安価で無害で生命の尊重を考慮しなくてよいバクテリア等が毒を消化することをN段論法後に意味するアイディアまでは問題視しない、というニュアンスを表現できなければならないからである。

また、本発明の請求項3は、
論理の翻意を最新の利用者入力を優先させて行うことを特徴とする
請求項1又は2に記載のコンピュータプログラムを提供する。
ここで、論理の翻意とは、以下の三種類に分類される。
1)肯定表現から「ありえない」を意味する表現への翻意とその逆の翻意
2)肯定表現を追加したり削除したりする翻意
3)「ありえない」を意味する表現を追加したり削除したりする翻意
「最新の利用者入力」を優先させる理由は、現場や状況を知っている利用者のより具体的なもしくはより最新の認識事実を、知識推論に反映させるためである。
具体的には、最新の「利用者入力」に沿って、1)の場合は反対の意味の表現を論理プログラムや一時文脈を格納するメモリから削除するかコメントアウト(理由とタイムスタンプつきで)することができる。オプションとして論理プログラム保護モードを用意し、このモードのときは、論理プログラムについてのみ実行時の削除もコメントアウトも抑制できるようにする(一時文脈は変更可)ことが有利である。
「ありえない」を優先する場合は、「ありえない」への翻意に際して肯定文をそのまま残しておいても論理プログラム全体としての総合的な論理は変わらないということになるが、計算速度や可読性の面から削除又はコメントアウトすることが有利であり、以下の例のようにコメントアウトした上でさらにそのコメントとして理由とタイムスタンプを自動的に付する場合は、推論実行時における論理プログラム及び一時文脈のバージョン管理も容易になる。

例:///今日はいい天気///2017.5.1_12:21:21 利用者が「!今日はいい天気」と入力し、同事実が一時文脈に追加されたことが原因
また、「利用者入力を優先」させる結果として、利用者入力に起因する前記特許文献2の逆質問(コンピュータから利用者への動的質問)や特許文献3の前向き推論(コンピュータによる自動推理)によって確認・証明された事実(一時文脈)も、最新の利用者入力に類するものとして、反対の知識表現より優先させるよう上記処理を行うことが、総合的な整合性や論理性・予測性を確保する上で有利である。

したがって、本発明の請求項4は、
論理に翻意時に反対の意味の表現を論理プログラム又は一時文脈を格納するメモリから削除することを特徴とする、
請求項3に記載のコンピュータプログラムを提供する。
これにより、削除後の論理プログラムや一時文脈の可読性が向上し、総合的な論理の人的・機械的な整理が容易になる。
なお、ここで「論理プログラム」とは、上記リストの15~21のような内容であり、「一時文脈」とは、これに加えて、利用者が具体的な問題案件を表現する事実等を入力してメモリに追加したもの(及び、特許文献2、3の逆質問や前向き推論で動的に(=実行時に)メモリ追加された事実等)である(本明細書にわたって同じ)。

また、本発明の請求項5は、
論理に翻意時に反対の意味の表現を論理プログラム又は一時文脈を格納するメモリからコメントアウトすることを特徴とする、
請求項3に記載のコンピュータプログラムを提供する。
これにより、コメントアウト後の論理プログラムや一時文脈の論理の整理の経緯が可視化され、総合的な論理の機械的な整理、人又は機械による(論理プログラムや一時文脈の)バージョン管理が容易になる。
また、本発明の請求項6は、
コメントに、タイムスタンプ又は原因イベント識別情報を自動付与することを特徴とする
請求項5に記載のコンピュータプログラムを提供する。

なお、上記の例では、ルールのヘッド(効果)に「!」を付して、家畜に毒を食べさせる解をグローバルスコープで排除しているが、右辺のボディのいずれかの条件に付した場合には、付された条件が「ありえない」という事実が論理プログラムまたは一時文脈に存在すること、もしくは、付された条件が「ありえない」とする自動証明の成功(メモリ中の論理プログラムまたは一時文脈のルールを用いた)を要求する条件文となる。
このルールの条件としての「!・・・」の具体的な解釈(コンピュータによる実現)は、頭に「!」のついた事実(固定文字列)の検索(範囲は論理プログラムおよび一時文脈のメモリ)については、単純な文字列一致であり、実現方法は自明である。一方の自動証明については、頭に「!」のついたルール(上記15行目のようなルール)の「!」を省いたルールによって、同じく「!」を省いた「・・・」が証明できればその条件を充たすことにする等という実現方法でもよい。この証明の実現方法については、特許文献1がすでに出願公開になっているので参照されたい。
総じて、このような意味論(コンピュータの解釈)は、従来のPROLOG等では実現できていなかったものであり、現実的な問題の正確で簡潔な表現とコンピュータ処理による解決とを非常に容易にするものである。

また、本発明の請求項7は、
請求項1から6のいずれか一項に記載のコンピュータプログラムを用いた装置を提供する。

また、本発明の請求項8は、
請求項1から6のいずれか一項又は図2に記載のコンピュータプログラムを用いた方法を提供する。
As explained above, claim 2 of the present invention is
To provide a computer program characterized by uniformly prioritizing (or uniformly subordinating) a knowledge expression meaning "impossible" to a corresponding affirmative expression.
In the "preferred" case, if you want to prove to the "impossible" side, the search cost for the computer program to check the absence of the affirmative expression is unnecessary. Even if the opposite policy of "subordination" (affirmative expression priority) is adopted, the same cost reduction effect can be obtained.
In addition, in the conditional expression of the rule, conventional NOT (absence of evidence and failure of automatic proof) can be written together with knowledge expression meaning "impossible". is clearly necessary and useful, whether or not exclusion as "is necessary/unnecessary.
In this case, for example, the knowledge expression meaning "impossible" can be (!...), and the conventional knowledge expression meaning NOT can be (...).
This conventional NOT (above, …) in a method that allows literals that embed variables in natural language is the inversion of logic (exists/automatic proof False if it can, and true if it does not exist and cannot be automatically proved), and if the variable exists in the literal, it means that the variable binding that satisfies the condition that can be removed by NOT is excluded from the solution candidates of the rule ( similar to conventional PROLOG).
This exclusion (~) means that the knowledge expression (!), which means "impossible", identifies and detects contradictions in the global scope through the fixed character string that is the basis, and eliminates the path of binding and automatic proof ( Contrary to what we are trying to base on (the fact that there is no variable), we do not detect whether it is inconsistent with the concrete fixed string (the fact that there is no variable), etc. (In terms of implementation, by managing a set of value pairs that must not be bound to the variable pairs on the rules, even if the condition "~$X is a man" becomes "$ This function can be realized even if the set of solution candidates for $X, such as "X is Japanese," appears before the first appearance (usually on the left side of the body).
It should be noted that it is difficult or expensive to express the same knowledge content as the above list only by using this conventional NOT (...) as the condition of the body part. This is because the combination of livestock and poison through the N-argument is viewed as an economic and ethical problem. This is because we must be able to express the nuance that we do not regard the ideas that are meant after the N-stage reasoning as problematic.

In addition, claim 3 of the present invention is
3. A computer program according to claim 1 or 2, characterized in that logic translation is performed with priority given to the most recent user input.
Here, the inversion of logic is classified into the following three types.
1) Conversion from a positive expression to an expression meaning "impossible" and vice versa 2) Conversion adding or deleting an affirmative expression 3) Adding or deleting an expression meaning "impossible" Intention The reason for giving priority to the "latest user input" is to reflect the more specific or the latest recognition facts of the user who knows the site and the situation in the knowledge inference.
Specifically, in line with the latest "user input", in the case of 1), delete or comment out (with reason and timestamp) the expression with the opposite meaning from the memory that stores the logic program or temporary context. be able to. It would be advantageous to have an optional logical program protection mode, in which only the logical program can be suppressed from being deleted or commented out at runtime (temporary context can be changed).
If ``impossible'' is given priority, even if affirmative sentences are left as they are when translating to ``impossible'', the overall logic of the logic program as a whole does not change, but from the point of view of computational speed and readability. It is advantageous to delete or comment out, and if you comment out and add the reason and time stamp as the comment automatically as in the example below, the version management of the logic program and temporary context at the time of inference execution is also become easier.

Example: ///It's nice weather today///2017.5.1_12:21:21 The user entered "!It's nice weather today" and the same fact was added to the temporary context. As a result of giving priority to input, it is confirmed and proven by the reverse question (dynamic question from the computer to the user) in Patent Document 2 and the forward inference (automatic inference by computer) in Patent Document 3 due to user input. It is advantageous to ensure overall consistency, logic, and predictability by treating the fact (temporary context) as similar to the latest user input and prioritizing it over the opposite knowledge representation. is.

Therefore, claim 4 of the present invention is
characterized by deleting the expression of the opposite meaning from the memory storing the logic program or the temporary context when translating into logic,
A computer program according to claim 3 is provided.
This improves the readability of the logic program and temporary context after deletion, and facilitates the human and mechanical organization of comprehensive logic.
Here, the "logical program" means contents such as 15 to 21 in the list above, and the "temporary context" means, in addition to this, the fact that the user expresses a specific problem case. It is what was input and added to the memory (and the fact that the memory was added dynamically (=at the time of execution) in the reverse question and forward inference in Patent Documents 2 and 3) (same throughout the specification).

In addition, claim 5 of the present invention is
Characterized by commenting out the expression of the opposite meaning from the memory that stores the logic program or the temporary context when translating into logic,
A computer program according to claim 3 is provided.
This makes it possible to visualize the process of organizing the logic of the logic program and the temporary context after commenting out, facilitating mechanical arrangement of the general logic and version management (of the logic program and the temporary context) by humans or machines.
In addition, claim 6 of the present invention is
6. The computer program according to claim 5, wherein a time stamp or causal event identification information is automatically added to the comment.

In the above example, the head (effect) of the rule is added with "!" to exclude the solution of poisoning livestock in the global scope. case, the fact that the attached condition is "impossible" exists in the logical program or the temporary context, or the success of the automatic proof that the attached condition is "impossible" (the logic program in memory or the temporary context is a conditional statement that requires
A specific interpretation of "! ) is a simple string match, and its implementation is self-explanatory. On the other hand, with regard to automatic certification, the rule that omits the "!" in the rule with "!" An implementation method such as satisfying the condition if possible may be used. For a method of realizing this proof, please refer to Patent Document 1, which has already been published.
In general, such semantics (computer interpretation) has not been possible with conventional PROLOG, etc., and greatly facilitates the accurate and concise expression and computational solution of real-world problems. It is.

In addition, claim 7 of the present invention is
An apparatus using a computer program according to any one of claims 1 to 6 is provided.

Moreover, claim 8 of the present invention is
A method using a computer program according to any one of claims 1 to 6 or according to figure 2 is provided.

本発明の一実施形態による、論理プログラム(固定的な事実及びルール)、利用者によりすでに追加されている一時文脈、利用者により新たに追加される事実(一時文脈)及び利用者により新たに追加される質問文、の関係について説明する図である。A logic program (fixed facts and rules), a temporary context already added by the user, a fact newly added by the user (temporary context) and a new addition by the user according to an embodiment of the present invention It is a figure explaining the relationship of the question sentence to be made. 図1等を実施するためのコンピュータプログラムの最も基本的な処理フローチャート(方法としてのステップ)を説明する図である。2 is a diagram for explaining the most basic processing flowchart (steps as a method) of a computer program for implementing FIG. 1 and the like; FIG. 実施するコンピュータとしての一般的な構成を示す説明図である。It is an explanatory view showing a general configuration as a computer to implement.

本発明は、特許文献1の論理型AI(PROLOGのサブセット+α)と知識表現(ほぼ自然言語で記述できる)を用いた自動アイディア合成システムとして実施することができる。この詳細な構成やアルゴリズム内容は本発明の本質ではないので、ここでは詳述しない。 The present invention can be implemented as an automatic idea synthesizing system using the logical AI (subset of PROLOG + α) and knowledge expression (which can be described in almost natural language) of Patent Document 1. Since the detailed configuration and algorithm contents are not the essence of the present invention, they will not be described in detail here.

図1は、本発明の一実施例による、論理プログラム(固定的な事実及びルール)、利用者によりすでに追加されている一時文脈、利用者により新たに追加される事実(一時文脈)及び利用者により新たに追加される質問文、の関係について説明する図である。メモリ内配列の15行目から21行目までを表示し、残りは省略している。一時文脈は22行目以降に格納している。
15行目には、「ありえない」のルールとしての表現である、「!$Xに$Yを食べさせて儲ける :- $Xは家畜 ; $Yは毒 ;」 が存在し、家畜であることが分かっている$Xの値(例えば「ヤギ」)と毒であることがわかっている$Yの値(例えば「ヒ素のついた紙」)との組み合わせ(値組)が、「$Xに$Yを食べさせて儲ける」の変数組($X,$Y)を同時に束縛することを排除(制限)する知識表現となっている。

図2は、図1等を実施するためのコンピュータプログラムの最も基本的な前向き推論の処理フローチャート(方法としてのステップ)を説明する図である。
ステップS1は、〇〇〇(なんらかの固定文字列)を、前向き/後ろ向き推論の根拠として用いようとしている場面(実行環境のプログラムの中)で起動される。
ステップS2では、頭に「!」をつけた「!〇〇〇」が、論理プログラム又は一時文脈に事実として存在しないかメモリ内を検索する。
ステップS3で、存在すれば、「ありえない」こととなるので、根拠として用いれないと決定する(S7)が、存在しない場合は、ステップS4でさらなる自動確認を行う。
ステップS4は、メモリに格納した論理プログラム又は一時文脈中のいずれかの「!□□□:-・・・」型のルールについて、「!」をとった「□□□:-・・・」ルールで〇〇〇をメモリ中の知識から自動証明できないか自動確認する。
ステップS5では、自動証明できることが確認できた場合にはやはり、根拠として用いられないと決定し(S7)、そうでない場合には、根拠として用いることを決定する(S6)。
実際には、ステップ4において、特許文献1(出願公開済)で詳述している多長一致などの特別なユニフィケーション(単一化)やバックトラックを含む後ろ向き推論も行うことがさまざまな面で有利であるが、本明細書の主旨とは異なるので(また、通常のPROLOGの探索でもある程度代用できるため)、ここでは詳述はしない(出願公開されているので参照されたい)。

図3は、実施するコンピュータとしての一般的な構成を示す説明図である。ここには本発明に固有の特徴はないため詳述はしない。
FIG. 1 shows a logic program (fixed facts and rules), a temporary context already added by the user, a fact newly added by the user (temporary context) and the user It is a diagram for explaining the relationship between question sentences newly added by . The 15th to 21st lines of the in-memory array are shown, and the rest are omitted. Temporary contexts are stored from the 22nd line onwards.
On the 15th line, there is an expression as an "impossible" rule, "!Make $X eat $Y :- $X is livestock; $Y is poison;" A combination (value pair) of a value of $X known to be poisonous (e.g., "goat") and a value of $Y known to be poisonous (e.g., "paper with arsenic") is It is a knowledge expression that excludes (restricts) simultaneous binding of the variable set ($X, $Y) of "feed $Y and make money".

FIG. 2 is a diagram illustrating a processing flowchart (steps as a method) of the most basic forward inference of a computer program for implementing FIG. 1 and the like.
Step S1 is activated in a scene (in the execution environment program) where OO (some fixed character string) is to be used as a basis for forward/backward reasoning.
In step S2, the memory is searched to see if "!000" prefixed with "!" actually exists in the logic program or temporary context.
In step S3, if it exists, it means "impossible", so it is determined that it cannot be used as a basis (S7), but if it does not exist, further automatic confirmation is performed in step S4.
In step S4, for a rule of type "!□□□:-..." in either the logic program stored in the memory or in the temporary context, "□□□:-..." Automatically check whether 〇〇〇 can be automatically proved from the knowledge in the memory by the rule.
In step S5, if it can be confirmed that it can be automatically proved, it is determined that it is not used as a basis (S7), and if not, it is determined that it is used as a basis (S6).
In fact, in step 4, special unification (unification) such as multi-length matching detailed in Patent Document 1 (application published) and backward inference including backtracking are also performed in various aspects. Although it is advantageous, it is not the subject of this specification (and since ordinary PROLOG searches can be substituted to some extent), it will not be described in detail here (see the published application).

FIG. 3 is an explanatory diagram showing a general configuration as a computer that implements. Since there are no unique features of the present invention here, it will not be described in detail.

4 本発明で用いられる一般的なコンピュータ(利用者専用のパーソナルコンピュータ、共有ファイルサーバー、Webサーバー)
4a~4k 一般的なコンピュータ4(利用者専用のパーソナルコンピュータ、等)の一般的な構成要素
11 論理プログラム(固定的事実とルール)
12 データ(論理プログラムに隣接してすでに配列型メモリに追加されている一時文脈)
13 新しい事実(一時文脈)1個と質問1個
14 右辺の3個以上の条件が成立したら左辺の命題の成立を自動確認(自動追加&通知)するという意味のルール
15 新しい事実も加味した2つの回答(ただし、本発明により、1つの回答候補が削除されている)
S1 一実施例において、事実〇〇〇、又は、変数を含まない/なくなった条件〇〇〇を根拠として用いようとしている場面/状態を検出するステップ
S2 同じ実施例において、事実!〇〇〇が、メモリ内の論理プログラム又は一時文脈に事実として存在しないか検索するステップ
S3 S2で事実!〇〇〇が、メモリ内に存在した場合にステップS7に遷移し、存在しない場合にステップS4に遷移するステップ
S4 メモリに格納した論理プログラム又は一時文脈中のいずれかの「!□□□:-・・・」型のルールについて、「!」をとった「□□□:-・・・」ルールで〇〇〇をメモリ中の知識から自動証明できないか自動確認するステップ
S5 S4において、「!」をとったいずれかの「□□□:-・・・」ルールで自動証明できる場合、ステップS7に遷移し、いずれのルールでも自動証明できなかった場合にステップS6に遷移するステップ
S6 〇〇〇を根拠として採用を決定するステップ
S7 〇〇〇を根拠として不採用を決定するステップ
4 General computer used in the present invention (user-dedicated personal computer, shared file server, web server)
4a-4k general components of a general computer 4 (user-dedicated personal computer, etc.) 11 logic program (fixed facts and rules)
12 data (temporary context already added to array memory adjacent to the logic program)
13 1 new fact (temporary context) and 1 question 14 A rule that means that if 3 or more conditions on the right side are satisfied, the establishment of the proposition on the left side is automatically confirmed (automatically added & notified) 15 Added new facts 2 1 answer (but 1 answer candidate has been deleted by the present invention)
S1 In one embodiment, the step S2 of detecting situations/situations that are going to be based on the fact 〇〇 or the condition 〇〇 that does not contain/misses variables. In the same embodiment, the fact! Fact! If 〇〇〇 exists in the memory, the process proceeds to step S7; otherwise, the process proceeds to step S4. ..." type rule, in step S5 S4 for automatically confirming whether or not 〇〇〇 can be automatically proved from the knowledge in the memory by the "□□□:-..." rule without the "!" If automatic proof is possible with any of the "□□□:-..." rules that take "", the process moves to step S7, and if none of the rules can automatically prove it, the process moves to step S6. Step S7 to decide to hire based on 〇 Step to decide not to hire based on 〇〇〇

Claims (8)

コンピュータプログラムであって、
利用者が入力する質問文、事実、ルールの条件もしくはルールの効果、又は、前記コン
ピュータプログラムと異なる所与の論理プログラムの事実、ルールの条件もしくルールの
効果において、
証拠事実の存在もしくは自動証明の成功としての肯定(真)並びにその否定(証拠事実
の不存在かつ自動証明失敗/不能)以外に、
否定する証拠事実の存在もしくは否定する自動証明の成功を意味する所定の記号を許容
し、
CPUが、
変数を最初から含まないもしくは変数束縛により含まなくなった肯定表現を根拠として
用いる際に、
CPUが、
該肯定表現に前記所定の記号を加えた表現が存在しないかつ自動証明できないことを自
動確認して、
CPUが、
肯定表現に前記所定の記号を加えた表現が存在する又は自動証明できる場合に
該肯定表現の使用を制限するようにした
コンピュータプログラム。
A computer program,
In a question, fact, rule condition or rule effect entered by a user, or in the fact, rule condition or rule effect of a given logic program different from said computer program,
In addition to the affirmation (true) as the existence of evidence facts or the success of automatic proof and its denial (absence of evidence facts and automatic proof failure/impossibility),
allowing a predetermined symbol signifying the existence of a contradicting fact of evidence or the success of a contradicting automatic proof,
CPU
When using an affirmative expression that does not include the variable from the beginning or does not include it due to variable binding,
CPU
automatically confirming that an expression obtained by adding the predetermined symbol to the affirmative expression does not exist and cannot be automatically proved;
CPU
When an expression obtained by adding the predetermined symbol to the affirmative expression exists or can be automatically proved
A computer program adapted to limit the use of said affirmative expressions .
CPUが、
所定の記号を加えた否定表現を、
対応する該所定の記号を加えない肯定表現よりも
一律に論理的に優先させることを特徴とする
請求項1に記載のコンピュータプログラム。
CPU
A negative expression with a given sign added ,
It is characterized by uniformly logically prioritizing an affirmative expression that does not add the corresponding predetermined symbol.
2. A computer program as claimed in claim 1 .
CPUが、
事実についての肯定および否定に関する論理の翻意を
最新の利用者入力を優先させて行うことを特徴とする
請求項1又は2に記載のコンピュータプログラム。
CPU
3. A computer program as claimed in claim 1 or 2, for translating logic regarding affirmative and negative facts, prioritizing the most recent user input.
CPUが、
前記論理翻意時に
否定への翻意の場合に肯定表現をもしくは肯定への翻意の場合に否定表現を
格納されたメモリから
削除することを特徴とする、
請求項3に記載のコンピュータプログラム。
CPU
When rephrasing the above logic
Affirmative expression in case of conversion to negative or negative expression in case of conversion to positive
characterized by deleting from stored memory,
4. A computer program as claimed in claim 3.
CPUが、
前記論理翻意時に
否定への翻意の場合に肯定表現をもしくは肯定への翻意の場合に否定表現を
格納されたメモリから
コメントアウトすることを特徴とする、
請求項3に記載のコンピュータプログラム。
CPU
When rephrasing the above logic
Affirmative expression in case of conversion to negative or negative expression in case of conversion to positive
characterized by commenting out from stored memory,
4. A computer program as claimed in claim 3.
CPUが、
コメントに、タイムスタンプ又は原因が利用者入力である旨
自動付与することを特徴とする
請求項5に記載のコンピュータプログラム。
CPU
6. The computer program according to claim 5, wherein the comment is automatically given a time stamp or that the reason is user input .
CPUを備える装置であって、CPUに
請求項1から6のいずれか一項に記載のコンピュータプログラムを実行させる装置。
Apparatus comprising a CPU, for causing the CPU to execute a computer program according to any one of claims 1 to 6.
装置が備えるCPUに、
請求項1から6のいずれか一項に記載のコンピュータプログラムを実行させる方法。
In the CPU provided in the device,
A method for executing a computer program according to any one of claims 1-6 .
JP2017092057A 2017-05-04 2017-05-04 Method, computer program and apparatus for implementing negation in logic programming Active JP7253760B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017092057A JP7253760B2 (en) 2017-05-04 2017-05-04 Method, computer program and apparatus for implementing negation in logic programming

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017092057A JP7253760B2 (en) 2017-05-04 2017-05-04 Method, computer program and apparatus for implementing negation in logic programming

Publications (2)

Publication Number Publication Date
JP2018190182A JP2018190182A (en) 2018-11-29
JP7253760B2 true JP7253760B2 (en) 2023-04-07

Family

ID=64479690

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017092057A Active JP7253760B2 (en) 2017-05-04 2017-05-04 Method, computer program and apparatus for implementing negation in logic programming

Country Status (1)

Country Link
JP (1) JP7253760B2 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080097748A1 (en) 2004-11-12 2008-04-24 Haley Systems, Inc. System for Enterprise Knowledge Management and Automation
JP2016505953A (en) 2012-12-10 2016-02-25 ヴィディテック エージー Rule-based data processing system and method

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0298078A4 (en) * 1987-01-20 1989-12-12 Ultimate Media Entpr Inc Expert knowledge system development tool.
US5159662A (en) * 1990-04-27 1992-10-27 Ibm Corporation System and method for building a computer-based rete pattern matching network

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080097748A1 (en) 2004-11-12 2008-04-24 Haley Systems, Inc. System for Enterprise Knowledge Management and Automation
JP2016505953A (en) 2012-12-10 2016-02-25 ヴィディテック エージー Rule-based data processing system and method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
徳山駿平,Prologにおける否定の述語「not」,金沢大学,2017年03月20日,pp.1-19,URL:https://geolog.mydns.jp/www.geocities.jp/philosophyoflawinkanazawa/thesis.html,[検索日2022年2月18日]

Also Published As

Publication number Publication date
JP2018190182A (en) 2018-11-29

Similar Documents

Publication Publication Date Title
US11227121B2 (en) Utilizing machine learning models to identify insights in a document
Alon et al. code2vec: Learning distributed representations of code
Srinivasa-Desikan Natural Language Processing and Computational Linguistics: A practical guide to text analysis with Python, Gensim, spaCy, and Keras
Ben Abdessalem Karaa et al. Automatic builder of class diagram (ABCD): an application of UML generation from functional requirements
Witte et al. Flexible Ontology Population from Text: The OwlExporter.
Zhou et al. Joint extraction of multiple relations and entities by using a hybrid neural network
Deliot Publishing the British national bibliography as linked open data
EP3333731A1 (en) Method and system for creating an instance model
Guy et al. The PENG ASP system: architecture, language and authoring tool
Jaafar et al. A survey and comparative study of Arabic NLP architectures
Aguiar et al. Text classification in legal documents extracted from lawsuits in Brazilian courts
JP2014211725A (en) Method, device, and computer program for processing knowledge or information
Chopra et al. "@ alex, this fixes# 9": Analysis of Referencing Patterns in Pull Request Discussions
Bouttaz et al. A policy-based approach to context dependent natural language generation
JP7253760B2 (en) Method, computer program and apparatus for implementing negation in logic programming
Calle Gallego et al. QUARE: towards a question-answering model for requirements elicitation
Camargo et al. Applying a data-centric framework for developing model transformations
Ramsay et al. Machine Learning for Emotion Analysis in Python: Build AI-powered tools for analyzing emotion using natural language processing and machine learning
Arulmohan et al. Extracting domain models from textual requirements in the era of large language models
Craig Science gateways for humanities, arts, and social science
Ellul et al. Notarypedia: A knowledge graph of historical notarial manuscripts
Wyner et al. dARe–Using argumentation to explain conclusions from a controlled natural language knowledge base
Li et al. Ask to Understand: Question Generation for Multi-hop Question Answering
Abdul-Kader et al. Automatic Web-Based Question Answer Generation System for Online Feedable New-Born Chatbot
Buscaldi et al. Citation prediction by leveraging transformers and natural language processing heuristics

Legal Events

Date Code Title Description
A80 Written request to apply exceptions to lack of novelty of invention

Free format text: JAPANESE INTERMEDIATE CODE: A80

Effective date: 20170602

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170803

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210125

A917 Reason for reinstatement of right to file examination request

Free format text: JAPANESE INTERMEDIATE CODE: A917

Effective date: 20210125

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220322

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220523

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20220920

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20221121

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20230119

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20230221

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20230320

R150 Certificate of patent or registration of utility model

Ref document number: 7253760

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150