JP2014211725A - Method, device, and computer program for processing knowledge or information - Google Patents

Method, device, and computer program for processing knowledge or information Download PDF

Info

Publication number
JP2014211725A
JP2014211725A JP2013087008A JP2013087008A JP2014211725A JP 2014211725 A JP2014211725 A JP 2014211725A JP 2013087008 A JP2013087008 A JP 2013087008A JP 2013087008 A JP2013087008 A JP 2013087008A JP 2014211725 A JP2014211725 A JP 2014211725A
Authority
JP
Japan
Prior art keywords
variable
character string
processing method
pattern
character
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.)
Granted
Application number
JP2013087008A
Other languages
Japanese (ja)
Other versions
JP6263858B2 (en
Inventor
中村 圭介
Keisuke Nakamura
圭介 中村
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.)
KNOWREL SYSTEM Inc
Original Assignee
KNOWREL SYSTEM Inc
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 KNOWREL SYSTEM Inc filed Critical KNOWREL SYSTEM Inc
Priority to JP2013087008A priority Critical patent/JP6263858B2/en
Publication of JP2014211725A publication Critical patent/JP2014211725A/en
Application granted granted Critical
Publication of JP6263858B2 publication Critical patent/JP6263858B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models

Landscapes

  • Engineering & Computer Science (AREA)
  • Machine Translation (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Artificial Intelligence (AREA)

Abstract

PROBLEM TO BE SOLVED: To automatically process knowledge expressed in a form of natural language with an embedded variable by a computer in a same manner as PROLOG.SOLUTION: When a person inputs "fact", "rule", or "goal" as in PROLOG, a constant part and a variable part of contents which serve as "literal" of PROLOG are discriminated by a character type, a delimiter, or an escape character, and are inputted into a computer. While dealing with the variable as what may straddle boundaries, such as a subject and a predicate of a sentence, computer executes an automatic simplification processing, automatic derivation processing, or both on a sentence included in the input.

Description

本発明は、知識や情報を処理する方法、特に自然言語で表現された知識や情報をその自然言語の「まま」処理する方法、装置及びコンピュータプログラムに関するものである。   The present invention relates to a method for processing knowledge and information, and more particularly to a method, apparatus, and computer program for processing knowledge and information expressed in a natural language “as is” in the natural language.

知識や情報を処理する方法、特に自然言語で表現された知識や情報をその自然言語の「まま」処理する方法としては、自然言語で表現された知識や情報をもとに論理型プログラミング言語PROLOGと同様の述語論理レベルの演繹(例えば、三段論法等によりYES/NO形式の問い(いわゆるクローズドクエスチョン形式)に答えること)や解探索(例えば、指定した条件(いわゆるオープンクエスチョン形式)に合致する解の集合を求めること)や手続的解釈、等を、PROLOGと同様の自動単一化処理(ユニフィケーション)や自動導出処理(バックトラックを伴う後ろ向き推論。なお、導出過程を表示した場合は自動証明処理となる)等によって行おうとする下記特許文献1がある。
この特許文献に記載された技術内容の実現により、利用者が、自分の言葉で普通に(オントロジーや表現記法の標準化に配慮せず、格の出現順序も自由に)作った文章や、世界中の人々がネットワーク上に公開した自然言語による記事を普通に引用したり参照したり(例えば、コピーペーストやURL指定する等)するだけで、その元の自然言語のまま、利用者による演繹や解探索等(すなわち、自動単一化処理、自動導出処理、等)の知識源とすることができるようになる。こうして、この特許文献1により、全く形式化されていない自然言語レベルの知識や情報の、一般人(例えば、数学の授業で「変数」を教えられた中学生程度以上ではあるが、情報処理や知識処理の専門家ではない人々)による利用・応用について、格段の進歩が期待されていた。
As a method of processing knowledge and information, in particular, as a method of processing knowledge and information expressed in a natural language “as is” in the natural language, a logical programming language PROLOG based on the knowledge and information expressed in the natural language Predicate logic level deductions (such as answering a YES / NO question (so-called closed question form) by means of triple theory, etc.) or solution search (eg, a solution that matches a specified condition (so-called open question form)) ), Procedural interpretation, etc., automatic unification processing (unification) and automatic derivation processing (reverse inference with backtracking) similar to PROLOG. If the derivation process is displayed, automatic proof processing There is the following Patent Document 1 to be performed by:
Through the realization of the technical contents described in this patent document, users can create texts that they normally use in their own words (without considering the standardization of ontology and expression notation, and the order of appearance of cases) By simply quoting or referring to articles in natural language published by people on the network (for example, by copying and pasting, specifying URLs, etc.), the user can perform deductions and solutions in the original natural language. It becomes possible to use it as a knowledge source for searching or the like (that is, automatic unification processing, automatic derivation processing, etc.). Thus, according to this patent document 1, natural language level knowledge and information that are not formalized at all, for example, more than junior high school students who have been taught “variables” in mathematics classes, but information processing and knowledge processing Great progress has been expected in the use and application by non-experts).

しかし、上記特許文献1の技術の実現には困難な点がいくつかあった。すなわち、「動詞(主語,目的語,いつ,どこで)」等と格構造が「,」(コンマ)で区切られている(したがって、「引数」の順番によりそれぞれの役割(格)が決まっている)従来のPROLOGとは異なり、「X」(全角の大文字(文字種)による変数識別子の例)、「$X」(半角や全角のエスケープ文字($)と変数識別子(X)の例)、「${行為主体}」(エスケープ文字($)とデリミタ({・・・})と変数識別子「行為主体」の例)等として表現された変数を自然言語の文中に埋め込んで「$Xと$Yは$Zが好き」等と表現した場合、「太郎と次郎と三郎はカレーが好き」を根拠とした変数組($X,$Y,$Z)の解候補は、コンピュータが一通り「だけ」挙げればよいのではなく、「($X,$Y,$Z)=(太郎と次郎,三郎,カレー)及び(太郎,次郎と三郎,カレー)」等と複数の解候補を列挙してそれぞれの解としての可能性を検査・検証できなければ、知識源からコンピュータが網羅的に演繹したり解探索したりしたこと(すなわち、PROLOGにおけるユニフィケーション(自動単一化処理)やバックトラックを伴う後ろ向き推論(自動導出処理)を完全に行ったこと)にはならない。   However, there are some difficulties in realizing the technology of Patent Document 1. That is, "verb (subject, object, when, where)" etc. and case structure are separated by "," (comma) (thus each role (case) is determined by the order of "arguments" ) Unlike conventional PROLOG, “X” (an example of a variable identifier using full-width capital letters (character type)), “$ X” (an example of a half-width or full-width escape character ($) and a variable identifier (X)), “ Variables expressed as “$ {acting entity}” (escape character ($), delimiter ({...}), Variable identifier “acting entity”, etc.) are embedded in a natural language sentence, and “$ X and $ When Y expresses $ Z, etc., the solution candidate for the variable pair ($ X, $ Y, $ Z) based on “Taro, Jiro, and Saburo like curry” "($ X, $ Y, $ Z) = (thick And Jiro, Saburo, Curry) and (Taro, Jiro and Saburo, Curry) "and other candidates, and if the possibility of each solution cannot be examined and verified, the computer will be comprehensive from the knowledge sources It is not a deduction or a solution search (that is, unification in PROLOG (automatic unification processing) or backward inference with backtracking (automatic derivation processing) is completely performed).

つまり、「太郎と次郎と三郎はカレーが好き」等といった一つの事実(PROLOGにおけるファクト「FACT」)に対して、前述した特許文献1で問題にした着眼点(表記ゆれの吸収の為等)とは異なる(しかも、PROLOGの通常のバックトラックによって複数の解候補を網羅するため(それは、あくまで格構造に縛られた範囲を網羅するため)に必要ないずれの着眼点とも当然に異なる)着眼点で複数の単一化の可能性がでてくるそのすべての単一化をコンピュータが試してみることが必要になる。   In other words, for the fact that “Taro, Jiro, and Saburo like curry” and the like (the fact “FACT” in PROLOG), the point of interest in the above-mentioned Patent Document 1 (for the purpose of absorbing notation fluctuation) Different from (and naturally different from any point of focus necessary to cover multiple solution candidates by the normal backlog of PROLOG (to cover the range bound by the case structure)) In this respect, it is necessary for the computer to try all the unifications that have the possibility of multiple unifications.

これは、自然言語で表現された事実(変数を含む事実(例えば、「$Xは$Xである。」)又は含まない事実(例えば、「太郎と次郎と三郎はカレーが好き。」))との自動単一化処理だけではなく、PROLOGのホーン節(ルール)のヘッド部に相当する(多くの場合に束縛すべき変数を含むような)自然言語表現との単一化(すなわち、変数を含みうるもの同士の単一化)や、その単一化による束縛値(例:X←太郎と次郎、等)のボディ部の変数(スコープが同じである変数)への波及について、網羅的な自動導出処理のためのバックトラックとの関係上さらに複雑な問題となるため、自然言語に変数を埋め込む形式で表現した知識(事実(=ファクト、「FACT」)やルールやゴール)をPROLOG同様に自動処理することを困難にしていた(「困難性A」と呼ぶ)。
また、特許文献1におけるような、表記ゆれに対するロバスト性に考慮した応用的な実装(文の表層的/意味的な類似性を根拠とした知識の導出過程への類推適用)や、現状の多くの自然言語システムで導入されているハイブリッドな知識表現の在り方(書換/推論ルール、辞書(意味論、語用論、等)、コーパス分析(n−gram統計、共起頻度、共起確率表現、等)の組合せ)は、推論結果の基となった知識集合の見やすい表示や導出の流れの直観的なトレースを複雑/困難にし、述語論理学の学習用途や個人的な哲学・ポリシー等の研究用途のためには、役立ちにくいものになっていた。
This is a fact expressed in a natural language (a fact including a variable (for example, “$ X is $ X”) or a fact not including a variable (for example, “Taro, Jiro, and Saburo like curry”)). As well as unification with natural language expressions (ie, including variables to be bound in many cases) corresponding to the head part of the PROLOG horn clause (rule). , And the spillover of bound values (eg, X ← Taro and Jiro, etc.) to body variables (variables with the same scope) Since it becomes a more complicated problem due to the relationship with backtracking for automatic derivation processing, knowledge (facts (= facts, “FACT”), rules and goals) expressed in the form of embedding variables in natural language is similar to PROLOG. To automatically process It had to flame (referred to as the "difficulties A").
In addition, as described in Patent Document 1, applied implementation considering robustness against notation fluctuation (application of analogy to knowledge derivation process based on the surface / semantic similarity of sentences), and many current situations Hybrid knowledge representation (rewriting / inference rules, dictionaries (semantics, pragmatics, etc.), corpus analysis (n-gram statistics, co-occurrence frequency, co-occurrence probability representation) Etc.) is a combination of comprehensible / difficult intuitive display of the knowledge set that is the basis of the inference result and intuitive tracing of the derivation flow, and research on predicate logic learning applications, personal philosophy, policy, etc. For use, it was difficult to use.

特開2006−024045号公報JP 2006-024405 A

したがって、本発明が解決しようとする課題は、課題1)上記した実現上の「困難性A」を克服して、自然言語に変数を埋め込む形式で表現した知識をコンピュータでPROLOG同様に自動処理することを実施可能にし、これにより自然言語を知識源として述語論理レベルの網羅的な演繹や解探索(自動単一化処理、自動導出処理、そのための後ろ向き推論、バックトラック、等)を実現することである。ここで、自動導出処理には、ボディ部単一化後のヘッド部変数の書換が必要となり、さらにボディ部の手続的解釈まで行う場合はヘッド部及びボディ部における「より左」のリテラルの単一化に応じて「より右」のリテラル内(さらに、「手続的解釈」でコマンド操作を行う場合は「コマンド」内も)の変数の書き換えが必要となる場合がある。   Therefore, the problem to be solved by the present invention is the problem 1) Overcoming the above-mentioned “difficulty A” in realization, and automatically processing the knowledge expressed in the form of embedding variables in natural language in the same way as PROLOG. This makes it possible to implement comprehensive deductions and solution searches (automatic unification processing, automatic derivation processing, backward inference, backtracking, etc.) at the predicate logic level using natural language as a knowledge source. It is. Here, the automatic derivation process requires rewriting of the head part variable after unifying the body part. Furthermore, when performing procedural interpretation of the body part, a single “left” literal in the head part and body part is used. Depending on the unification, it may be necessary to rewrite the variables in the “more right” literal (and in the “command” when the command operation is performed by “procedural interpretation”).

また、別の課題は、課題2)変数が格構造に縛られないという仕様の利点をより広範に生かし、課題3)格構造に縛られない(ある意味、自由であるが故に過酷な)条件下での処理を高速化し、課題4)学習用途や研究用途等のために根拠(証明過程、推論パス、用いた知識集合、等)を見やすく表示することである。   Another issue is that issue 2) takes advantage of the specifications that variables are not bound to case structure more widely, and task 3) is not bound to case structure (in a sense, it is harsh because it is free) (4) Displaying the basis (proof process, inference path, knowledge set used, etc.) in an easy-to-see manner for learning use and research use.

本発明は、かかる課題に鑑みてなされたものであり、請求項1は、
コンピュータが、論理型プログラミング言語PROLOGの機能の一部又は全部を自動的に行う方法であって、
人間が、PROLOGにおける「事実」、「ルール」又は「ゴール」の入力にあたり、PROLOGにおける「リテラル」にあたる内容(以降、「文」と呼ぶ)の定数部分と変数部分とを文字種、デリミタ又はエスケープ文字により区別してコンピュータに入力すること、
コンピュータが、文の主部、述部、主語、述語、目的語、補語、連用修飾語、連体修飾語又は文の境界をまたがりうるものとして変数を取扱いながら、上記「事実」、「ルール」又は「ゴール」の入力に含まれる文の自動単一化処理、自動導出処理又はその両方を行うこと、
を特徴とする処理方法を提供する。
ここで、「人間が、・・・定数部分と変数部分とを文字種、デリミタ又はエスケープ文字により区別してコンピュータに入力する」とは、人間が本発明によるアプリケーションソフト(処理系)の入力欄内やコマンドプロンプト後等に(フロントエンドプロセッサ等を介して又は介さずに)直接入力すること、インターネットブラウザや文章編集ソフト等からコピーペーストやカットペーストすること、別途入力して保存してあったテキストファイル等を読み込んだり、引用したり、参照したりすること等を含む。
また、「コンピュータが、文の主部、述部、主語、述語、目的語、補語、連用修飾語、連体修飾語又は文の境界をまたがりうるものとして変数を取扱い」とは、日本語等の助詞等や英語等の前置詞等を介した明示的な区切りのある格構造(構文解析結果や意味解析結果の階層構造に該当するものを含みうる)の境界(明示的な区切り)をまたがりうるだけでなく、英語等の例えばSV形式・SVO形式・SVOO形式・SVOC形式のSとVの境界、VとOの境界、VとCの境界等をまたがり得、重文や複文の文の境界等をもまたがり得るものとして取り扱うモードを含む(逆に、取り扱わないモードがあってもよい)。これらの場合、変数に入り得る解候補として、文全体や、文全体を構成する文字列から文としての文法構造による区切りの単位を無視して任意の部分文字列を抽出したもの、さらには階層的な参照構造をもつ複文・重文やもっと長い論文等の全体や、さらにそれらの任意の部分文字列が対象となる(なお、「文の境界」をもまたがりうるものとして取り扱う場合であって、知識源の集合を扱う(例えば、ファイルにまとめた知識源の集合を一括して読み込む、書き込む、参照する、等する)場合には、文の境界「以外」に知識源どうしの区切りが必要となるため、このような区切りとして、例えば、改行コードやタブコード等を用いることができる)。
これにより、自然言語に変数を埋め込む形式で表現した知識や情報も、普通の文章形式の知識や情報も、それらの間での現実的な相互活用の可能性が十分に開けた一元的な知識源として、両者を特に区別せずにコンピュータで自動処理することが可能になる(上記「困難性A」の克服)。
「現実的」な相互作用の可能性が「十分」に開けるためには、コンピュータによる自動処理が検索処理系として備えるべき1)検索式(パターンを指定する表現)の簡便性、2)十分な適合率(解の正確性)、3)十分な再現率(解候補を抽出する上での網羅性)を備えていなければならないが、本発明では、文中の自由な(すなわち、文法や意味の区切りに制限されない)場所に変数(複数種類でもよく複数回でもよい)の埋め込みを許容し(簡便性を確保し)つつも、PROLOGの知識処理手順(と内在する知識解釈方針)に基本的に沿うことにより、他の処理系におけるようなハイブリッドな知識処理手順(と、そのハイブリッドな処理手順に対応する複雑な知識解釈方針)によって起こりうる適合率(解の正確性)低下のリスクを回避しつつ、「文の主部、述部、主語、述語、目的語、補語、連用修飾語、連体修飾語又は文の境界をまたがりうるものとして変数を取扱」うことにより、自然言語の区切り表現(読点、句読点、カッコ、コンマ、ピリオド、等)や修飾的なフレーズ(形容詞句、副詞句、必須でない格の表現、等)による指定パターンの泣き別れ出現が原因となる不当な不一致(正規表現的なアンマッチ)を防ぎ、格構造の明示されない表層的な文字列表現間(検索式と知識源の間)での一定の再現性(解候補を抽出する上での網羅性)を確保可能としている。また、知識源となった自然言語の正確な文脈(前後の文字列)を損ないにくい一体的・連続的な引用・抽出(変数への解候補としての)も可能となり、結局、その透明性・単純性により推論の実質的な健全性(根拠や推論経緯の正当性)の確認・検証が手軽かつ容易となり、根拠がいつも明確であるという現実的な安心感を利用者にもたらし、全体として、変数が格構造に縛られない(さらに、格構造のルール(出現順序等)について知らなくてもよく、引数の順番が間違っているかもしれないという不安もない)という仕様の利点を十分に生かしきることを可能にする。
なお、本発明は日本語(一文字の情報量が多く、単語の間にスペースがない)を第一の対象にしているため、文字を処理単位、区切りの単位としている内容が多いが、英語等(一文字の情報量が少なく、一文の文字数は多いが、単語の間にスペースのあるもの)は、スペースで区切った単語を単位として同様の処理をすることも可能である。
This invention is made | formed in view of this subject, Claim 1 is
A method in which a computer automatically performs part or all of the functions of a logic programming language PROLOG,
When a human inputs "facts", "rules", or "goals" in PROLOG, the constant part and the variable part of the content (hereinafter referred to as "sentence") in PROLOG are referred to as the character type, delimiter or escape character. According to the input to the computer,
While the computer treats the variable as a sentence main part, predicate, subject, predicate, object, complement, conjunctive modifier, conjunctive modifier, or something that can cross sentence boundaries, the above "facts", "rules" or Performing automatic unification processing, automatic derivation processing, or both of sentences included in the input of “goal”;
A processing method is provided.
Here, “a human being inputs a constant part and a variable part into a computer by distinguishing them by a character type, a delimiter or an escape character” means that a human is in an input field of application software (processing system) according to the present invention. Input directly after command prompt (via or without front-end processor), copy paste or cut paste from internet browser or text editing software, etc. Including reading, quoting, referencing, etc.
In addition, “the computer treats variables as if they can cross the sentence main part, predicate, subject, predicate, object, complement, continuous modifier, joint modifier, or sentence boundary” It can only cross the boundaries (explicit delimiters) of case structures with explicit delimiters via prepositions such as particles and English (including those that fall under the hierarchical structure of syntax analysis results and semantic analysis results) Instead, it can cross the boundary between S and V in English, for example, SV format, SVO format, SVOO format, and SVOC format, V and O boundaries, V and C boundaries, etc. Includes a mode that is handled as possible (in contrast, there may be a mode that is not handled). In these cases, as candidate solutions that can be included in a variable, an arbitrary partial character string is extracted by ignoring the delimiter unit by the grammatical structure as a sentence from the whole sentence or the character string that constitutes the whole sentence, and the hierarchy The entire compound sentence / heavy sentence with a typical reference structure, a longer paper, etc., and any substrings of those are also targeted (note that it is treated as something that can straddle a sentence boundary, When handling a set of knowledge sources (for example, reading, writing, referencing, etc., a set of knowledge sources collectively in a file), it is necessary to separate the knowledge sources at a boundary other than the sentence boundary Therefore, for example, a line feed code or a tab code can be used as such a delimiter).
As a result, knowledge and information expressed in the form of embedding variables in natural language as well as knowledge and information in ordinary sentence format are fully integrated with the possibility of practical interoperability between them. As a source, it is possible to perform automatic processing by a computer without particularly distinguishing between the two (overcoming of the above “difficulty A”).
In order to open the possibility of “realistic” interaction “sufficiently”, automatic processing by a computer should be provided as a search processing system 1) simplicity of a search expression (expression specifying a pattern), 2) sufficient The accuracy (accuracy of the solution) and 3) sufficient reproducibility (exhaustiveness in extracting solution candidates) must be provided, but in the present invention, free (ie, grammar and meaning Basically in the PROLOG knowledge processing procedure (and the underlying knowledge interpretation policy) while allowing the embedding of variables (which may be multiple types or multiple times) in places (not limited to delimiters) By doing so, the risk of precision (solution accuracy) degradation that can be caused by hybrid knowledge processing procedures (and complex knowledge interpretation policies corresponding to the hybrid processing procedures) as in other processing systems is reduced. Avoiding natural language delimiters by handling variables as "sentences, predicates, subjects, predicates, objects, complements, collocation modifiers, collocation modifiers or sentences that can cross sentence boundaries" Unfair disagreement (regular expression) caused by crying appearance of specified patterns by expressions (reading marks, punctuation marks, parentheses, commas, periods, etc.) and modifier phrases (adjective phrases, adverb phrases, non-essential case expressions, etc.) (Unmatched), and a certain level of reproducibility (exhaustiveness in extracting solution candidates) between superficial character string expressions (between search formulas and knowledge sources) with no case structure specified. Yes. In addition, integrated and continuous citation and extraction (as candidate solutions to variables) that make it difficult to damage the exact context (character strings before and after) of the natural language that became the source of knowledge are possible. Simplicity makes it easy and easy to check and verify the substantial soundness of reasoning (the basis and justification of reasoning), and provides users with a real sense of security that the basis is always clear. Take full advantage of the specifications that variables are not bound to case structure (and you don't have to know about case structure rules (appearance order, etc., and there is no fear that the order of arguments may be wrong)) It is possible to come.
Since the present invention is primarily intended for Japanese (the amount of information for one character is large and there is no space between words), there are many contents that use characters as processing units and delimiters. (The amount of information of one character is small, the number of characters of one sentence is large, but there is a space between words), the same processing can be performed in units of words separated by spaces.

また、請求項2は、
前記自動単一化処理において、
変数を含みうる文であるパターン(定数部分と変数部分とを文字種、デリミタ又はエスケープ文字により区別したもの)と、変数を含まない文である定数文字列との単一化を、
パターン(例:$Xと$Yは$Zが好き)に最初(又は最後)に出現する変数(例:$X)の最長一致解(例:太郎と次郎)を求めて、該最長一致解の文字列を後ろ(又は前)から空文字になるまで削る過程(例:太郎と次郎>太郎と次>太郎と>太郎>太>空)を該パターンに代入してできる各新たなパターン(例:「太郎と次郎と$Yは$Zが好き」>「太郎と次と$Yは$Zが好き」>「太郎とと$Yは$Zが好き」>「太郎と$Yは$Zが好き」>「太と$Yは$Zが好き」>「と$Yは$Zが好き」)について、該新たなパターンができる前提となった削る過程の解の各状態($X=太郎と次郎>太郎と次>太郎と>太郎>太>空)をそれぞれ記憶しながら、
再帰的に同様に変数がなくなるまで繰り返し、
変数がなくなったときに単一化した各途中の解の状態(例:真($X=太郎と次郎,$Y=三郎),真($X=太郎,$Y=次郎と三郎))を結合して各単一化の答え(例:答え1=($X=太郎と次郎,$Y=三郎),答え2=($X=太郎,$Y=次郎と三郎)を得ることを特徴とする
請求項1に記載の処理方法を提供する。
ここで、「(又は最後)」は「(又は前)」に対応しており、最後に出現する変数から代入するときは、削り始めが前からとなる必要があることを意味する。
これにより、最長一致解から最短一致解に至るすべての可能性について確実に網羅した各解候補の状態を検証し、網羅的な答え(さらに絞りこまれた解候補の集合)を提供することが可能になる。
Claim 2
In the automatic unification process,
Unification of a pattern that can contain variables (constant part and variable part separated by character type, delimiter or escape character) and constant string that is a sentence that does not contain variables.
Find the longest matching solution (eg Taro and Jiro) of the variable (eg $ X) that appears first (or last) in the pattern (eg $ X and $ Y like $ Z) Each new pattern (eg, Taro and Jiro> Taro and Next> Taro and>Taro>Taro> Sky) is substituted into the pattern by cutting the character string from the back (or front) until it becomes an empty character (example: : "Taro and Jiro and $ Y like $ Z">"Taro and next and $ Y like $ Z">"Taro and $ Y like $ Z">"Taro and $ Y like $ Z ”>“ Thick and $ Y like $ Z ”and“ and $ Y like $ Z ”), each state of the solution of the scraping process ($ X = Taro and Jiro> Taro and Next> Taro and>Taro>Tha> Sky)
Repeat recursively until there are no more variables,
The state of each intermediate solution that is unified when there are no more variables (eg, true ($ X = Taro and Jiro, $ Y = Saburo), true ($ X = Taro, $ Y = Jiro and Saburo)) Combined to obtain each unification answer (example: answer 1 = ($ X = Taro and Jiro, $ Y = Saburo), answer 2 = ($ X = Taro, $ Y = Jiro and Saburo)) A processing method according to claim 1 is provided.
Here, “(or last)” corresponds to “(or previous)”, and means that when starting from the variable that appears last, it is necessary that the beginning of cutting be from the front.
In this way, it is possible to verify the status of each candidate solution that covers all the possibilities from the longest match solution to the shortest match solution, and to provide a comprehensive answer (a set of narrower solution candidates). It becomes possible.

また、請求項3は、
空文字になるまで徐々に削るかわりに、別途求めた最短一致解までしか徐々に削らないことを特徴とする
請求項2に記載の処理方法を提供する。
これにより、最短一致解未満の長さから「空」文字までの解探索の計算を節約することができ、自動処理の高速化が可能となる場合がある。
In addition, claim 3
3. The processing method according to claim 2, wherein instead of gradually cutting until an empty character is reached, only the shortest matching solution obtained separately is gradually cut.
As a result, it is possible to save the calculation of the solution search from the length less than the shortest matching solution to the “empty” character, and it may be possible to speed up the automatic processing.

また、請求項4は、
空文字になるまで徐々に削る際、
パターン中で該変数が最初(又は最後)に出現した直後(又は直前)の固定文字である1文字C(直後(又は直前)が別の変数でその解が空文字でないときは該別の変数に解候補として代入されている解候補の最初(又は最後)の1文字C)が該最長一致解に含まれる場合に、
該最長一致解の文字列の最後(又は最初)からそのCに最初にあたるまでの部分文字列をそのCを含め削ることを特徴とする
請求項2又は3に記載の処理方法を提供する。
ここで、「(又は最後)」は「(又は直前)」に対応しており、最後に出現する変数から代入するときは、削り始めが前からとなる必要があることを意味する。
これにより、変数の直後(又は直前)の固定文字にマッチしない解候補の列挙とその解候補を前提とした探索を節約することができ、自動処理の高速化が可能となる場合がある。
In addition, claim 4
When scraping gradually until it becomes an empty character,
1 character C (immediately after (or immediately before)) is another variable immediately after (or immediately before) the variable appears first (or last) in the pattern. When the first (or last) character C) of the solution candidate assigned as the solution candidate is included in the longest matching solution,
4. The processing method according to claim 2, wherein a part character string from the last (or first) of the character string of the longest matching solution to the first C is deleted including the C. 5.
Here, “(or last)” corresponds to “(or immediately preceding)”, and means that when starting from the last appearing variable, it is necessary to start from the front.
This saves enumeration of solution candidates that do not match a fixed character immediately after (or immediately before) a variable and a search based on the solution candidates, and may speed up automatic processing.

また、請求項5は、
前記自動単一化処理又は自動導出処理において、
前記「ゴール」(「サブゴール」を含む。以下同じ)となる束縛情報を求める際、
該「ゴール」を構成する各文について独立して束縛情報を求め
各束縛情報の積集合が空でない場合に戻り値真とその積集合を返す
請求項1から4のいずれか一項に記載の処理方法を提供する。
ここで、束縛情報とは、各変数に同時にそのような解候補を代入してみたか/すべきかということを示す情報である。各変数への一つの束縛の仕方を示す束縛情報は、「,」をAND結合と解釈することにより、「変数名1=値1,変数名2=値2,・・・,変数名N=値N」といったリスト形式で表現することができる一方、複数の束縛の仕方は、そのようなリストの集合として、あるいは、「,」ではなくAND/OR結合を明示して複数束縛間の共通部分をくくりだした形や、複数束縛の全体を標準化した連言標準形や選言標準形で表現することができる。
これにより、同時に満たすべきパターン(文)が複数あり、パターン(文)間で同名の変数には同じ解が入るべきとする問題形式の場合(例えば、ユーザからのそのようなAND結合問合せや、ルールのボディ部に複数の文がある場合)に、ルールのより右側のパターンについて、より左側のパターンの各単一化結果ごとに多大な全文探索処理を無駄に繰り返す可能性がすくなくなり、ボディ部をバックトラックしながら深さ優先探索する非効率(変数を自然言語に埋め込む形式においてより顕著な非効率)を回避し、同時に満たすべき各パターンごとの処理を単純化することができる。また、推論過程の表示や検証(完全性や健全性)をわかりやすく、容易にする。また、ルールの意味として必要な直観にとって余計であり定義されるべきでなかった順序性(ボディ部の文間の)が推論過程に副作用を与えることを防ぐことができる。
In addition, claim 5
In the automatic unification process or automatic derivation process,
When obtaining binding information for the “goal” (including “subgoal”, the same applies hereinafter)
5. The binding information is independently obtained for each sentence constituting the “goal”, and the return value true and the product set are returned when the product set of the binding information is not empty. 5. A processing method is provided.
Here, the binding information is information indicating whether or not such a solution candidate is assigned to each variable at the same time. Binding information indicating one binding method for each variable is obtained by interpreting “,” as an AND combination, “variable name 1 = value 1, variable name 2 = value 2,..., Variable name N = While it can be expressed in the form of a list such as “value N”, multiple binding methods can be expressed as a set of such lists, or by specifying an AND / OR combination instead of “,”. It can be expressed in the form of enclosing and the conjunction standard form or disjunctive standard form that standardizes the whole of multiple bindings.
Thereby, there are a plurality of patterns (sentences) to be satisfied at the same time, and in the case of a problem form that the same solution should enter the same name variable between patterns (sentences) (for example, such an AND join query from the user, When there is more than one sentence in the body of the rule), it is unlikely that the full-text search process for the pattern on the right side of the rule is wastefully repeated for each unification result of the pattern on the left side. It is possible to avoid the inefficiency of depth-first search while backtracking the part (more remarkable inefficiency in the form of embedding variables in a natural language), and to simplify the processing for each pattern to be satisfied at the same time. In addition, display and verify the inference process (completeness and soundness) in an easy-to-understand manner. Further, it is possible to prevent the orderness (between sentences in the body part), which is unnecessary for the intuition necessary for the meaning of the rule and should not be defined, from giving side effects to the inference process.

また、請求項6は、
前記自動単一化処理又は自動導出処理において、
前記「ゴール」となる束縛情報を求める際、
既存の束縛情報を最初に空とし、
「ゴール」が含む文集合を、既存の束縛情報の適用下で該一文が真となりうるかと該なりうるための追加の束縛情報について自動計算して該追加の束縛情報を該既存の束縛情報に加えながら該一文を除いて再帰的に小さくしていき、
真となりうるまま該文集合が空集合になったときの既存の束縛情報を「ゴール」となる束縛情報とする
請求項1から4のいずれか一項に記載の処理方法を提供する。
ここで、「再帰的に小さくしていき」とは、再帰が深くなるほど文集合が小さくかつ束縛情報が複雑になる(より多くの変数が束縛され、束縛する値の範囲がより絞られる)よう、例えば、C言語で再帰呼び出しをする処理や、独自に宣言し定義した深さ優先探索用のスタック構造(構造体の配列とスタックポインタ等)によって同等の再帰的処理を実現することをいう。
これにより、変数を自然言語に埋め込む形式で表現された、同時に満たすべき複数パターンのAND結合からなるオープンクエスチョンを自動処理する問題を、より単純かつ再帰的な同一構造を持つ部分問題へとシンプルに変換し、推論過程の表示や検証(完全性や健全性の)を容易にする。
In addition, claim 6
In the automatic unification process or automatic derivation process,
When seeking binding information to be the “goal”,
Empty the existing binding information first,
The sentence set included in the “goal” is automatically calculated with respect to whether or not the sentence can be true under the application of the existing binding information, and additional binding information for the sentence, and the additional binding information is converted into the existing binding information. While adding this sentence, recursively reduce it,
The processing method according to any one of claims 1 to 4, wherein existing binding information when the sentence set becomes an empty set while being true is used as binding information that becomes a "goal".
Here, “recursively reduce” means that as the recursion becomes deeper, the sentence set becomes smaller and the binding information becomes more complex (more variables are bound and the range of values to be bound is narrowed down). For example, equivalent recursive processing is realized by processing for recursively calling in C language or a stack structure for depth-first search (structure array and stack pointer, etc.) declared and defined independently.
This simplifies the problem of automatically processing open questions consisting of AND combinations of multiple patterns that should be satisfied at the same time, expressed in the form of embedding variables in natural language, into simpler and recursive partial problems with the same structure. Transform and facilitate inference process display and verification (completeness and soundness).

また、請求項7は、
前記自動単一化処理又は自動導出処理において、
変数を含まないパターンと変数を含まない事実との単一化を行う場合、
パターンと事実が文字列として一致する場合に真を返す、又は
パターンと事実が文字列として一致しない場合に偽を返す
請求項1から6のいずれか一項に記載の処理方法を提供する。
これにより、シンプルかつ迅速に探索を行うことができる。
なお、「変数を含まない事実」が句点等で区切られた複数の文を含む場合。「文字列としての一致」は、パターンの文字列が事実の文字列の部分に一致することであってもよいとするモードを設けることもできる。
これにより、同型の複数の情報を一つの事実にまとめて表現して探索の対象とすることができる。また、複数要素間のなんらかの順序性(例えば、大きさ、貴重さ、古さ・・・等)も表現しやすくなる。
In addition, claim 7
In the automatic unification process or automatic derivation process,
If you want to unify a pattern that does not contain a variable with a fact that does not contain a variable,
The processing method according to any one of claims 1 to 6, wherein true is returned when the pattern and fact match as a character string, or false is returned when the pattern and fact do not match as a character string.
Thereby, it can search simply and rapidly.
Note that “facts that do not include variables” include multiple sentences separated by punctuation marks. The “matching as a character string” may be provided with a mode in which the character string of the pattern may match the portion of the actual character string.
As a result, a plurality of pieces of information of the same type can be expressed together as one fact and can be searched. Moreover, it becomes easy to express some sort of order (for example, size, preciousness, oldness, etc.) between a plurality of elements.

また、請求項8は、
前記自動単一化処理又は自動導出処理において、
変数を含まないパターンとホーン節の変数を含まないヘッド部との単一化を行う場合、
パターンとヘッド部が文字列として一致する場合に、該ホーン節のボディ部をサブゴールとして請求項5又は6に記載の処理方法を適用した結果を返し、
一致しない場合に偽を返す
請求項1から7のいずれか一項に記載の処理方法を提供する。
これにより、変数を自然言語に埋め込む形式で表現するルールのヘッドが変数を含まない場合の健全な機械的解釈と、シームレスでわかりやすくかつシンプルで統一的な処理メカニズムと、対応する推論過程の説明を与えることができる。
In addition, claim 8
In the automatic unification process or automatic derivation process,
When unifying a pattern that does not include a variable and a head that does not include a horn clause variable,
When the pattern and the head portion are matched as a character string, the result of applying the processing method according to claim 5 or 6 is returned with the body portion of the horn clause as a subgoal,
A false method is returned if they do not match. The processing method according to claim 1 is provided.
As a result, sound mechanical interpretation when the head of a rule that expresses variables in a form embedded in natural language does not include variables, a seamless, easy-to-understand, simple and uniform processing mechanism, and explanation of the corresponding inference process Can be given.

また、請求項9は、
前記自動単一化処理又は自動導出処理において、
変数を含まないパターンと変数を含むヘッド部をもつホーン節との単一化を行う場合、
請求項2から4のいずれか一項に記載の処理方法における「定数文字列」として当該パターンを用いかつ同処理方法における「パターン」として当該ヘッド部を用いて処理して求めた各束縛情報について、
当該ホーン節のボディ部に適用したものを請求項5又は6に記載の処理方法の「サブゴール」として処理した結果が真となるものが存在すれば真を返す、又は
存在しなければ偽を返す
請求項1から8のいずれか一項に記載の処理方法を提供する。
これにより、変数を自然言語に埋め込む形式で表現するルールのヘッドが変数を含み、このルールを起動したパターンが変数を含まない場合に、ボディ部の変数の束縛範囲を事前に制限して、真偽判断の処理を高速化することができる。
また、健全な機械的解釈と、シームレスでわかりやすくかつシンプルで統一的な処理メカニズムと、対応する推論過程の説明を与えることができる。
In addition, claim 9
In the automatic unification process or automatic derivation process,
When unifying a pattern that does not contain a variable and a horn clause that has a head that contains a variable,
Each binding information obtained by processing using the pattern as a "constant character string" in the processing method according to any one of claims 2 to 4 and using the head unit as a "pattern" in the processing method ,
Returns true if there is a true result of processing as a “subgoal” of the processing method according to claim 5 or 6 when applied to the body part of the horn clause, or returns false if it does not exist A processing method according to any one of claims 1 to 8 is provided.
As a result, if the head of a rule that expresses a variable in the form of embedding it in a natural language includes a variable, and the pattern that triggered this rule does not include a variable, the bound range of the variable in the body part is limited in advance, and true It is possible to speed up the process of false determination.
It can also provide a sound mechanical interpretation, a seamless, easy-to-understand, simple and uniform processing mechanism, and an explanation of the corresponding inference process.

また、請求項10は、
前記自動単一化処理又は自動導出処理において、
変数を含むパターンと変数を含まない事実との単一化を行う場合、
請求項2から4のいずれか一項に記載の処理方法における「パターン」として当該パターンを用いかつ同処理方法における「定数文字列」として当該事実を用いて処理した結果を返す、
請求項1から9のいずれか一項に記載の処理方法を提供する。
これにより、パターンと(静的な)事実との間のすべての解候補(格変数への)が洗い出されて「結果」として返されるため、上記「困難性A」克服のための基礎的な機構をシンプルに与えることができ、推論過程の可視化や検証だけでなくさらにはルールの修正等といったユーザーの手を介した学習をも容易にする。
In addition, claim 10
In the automatic unification process or automatic derivation process,
When unifying a pattern that contains a variable with a fact that does not contain a variable,
A result of processing using the pattern as a “pattern” in the processing method according to claim 2 and using the fact as a “constant character string” in the processing method is returned.
A processing method according to any one of claims 1 to 9 is provided.
As a result, all the solution candidates (to the case variable) between the pattern and the (static) fact are identified and returned as “results”, so that the basics for overcoming the above “difficulty A” This makes it easy not only to visualize and verify the inference process, but also to facilitate learning through the user's hand, such as rule correction.

また、請求項11は、
前記自動単一化処理又は自動導出処理において、
変数を含むパターンと変数を含まないヘッド部をもつホーン節との単一化を行う場合、
請求項2から4のいずれか一項に記載の処理方法における「パターン」として当該パターンを用いかつ同処理方法における「定数文字列」として当該ヘッド部を用いて処理した結果を真とする束縛情報(C)が存在する場合で、かつ、当該ホーン節のボディ部を請求項5又は6に記載の処理方法の「サブゴール」として処理した結果が真の場合に当該束縛情報(C)とともに真を返す、
請求項1から10のいずれか一項に記載の処理方法を提供する。
これにより、変数を含むパターンと(変数を含まない静的な)ヘッドとの間のすべての解候補(各変数への)が洗い出されて「結果」として返されるため、上記「困難性A」克服のための基礎的な機構をシンプルに与えることができ、推論過程の可視化や検証だけでなくさらにはルールの修正等といったユーザーの手を介した学習をも容易にする。
また、より単純かつ再帰的な(または相互再帰的な)同一構造を持つ部分問題へとシンプルに変換し、推論過程の表示や検証(完全性や健全性の)を容易にする。
また、変数を自然言語に埋め込む形式で表現するルールのヘッドが変数を含まない場合の健全な機械的解釈と、シームレスでわかりやすくかつシンプルで統一的な処理メカニズムと、これらに該当する推論過程の説明を与えることができる。
In addition, claim 11
In the automatic unification process or automatic derivation process,
When unifying a pattern containing a variable and a horn clause with a head that does not contain a variable,
Binding information that uses the pattern as a "pattern" in the processing method according to any one of claims 2 to 4 and that uses the head portion as a "constant character string" in the processing method to make the result true If (C) is present, and if the result of processing the body part of the horn clause as a “subgoal” of the processing method according to claim 5 or 6 is true, true with the binding information (C) return,
A processing method according to any one of claims 1 to 10 is provided.
As a result, all the solution candidates (to each variable) between the pattern including the variable and the head (static including no variable) are identified and returned as a “result”. "The basic mechanism for overcoming can be provided simply, and not only visualization and verification of the inference process, but also learning through the user's hand, such as rule correction, is facilitated.
In addition, it is simply converted into a partial problem with the same structure that is simpler and more recursive (or mutually recursive), facilitating the display and verification (completeness and soundness) of the inference process.
In addition, a sound mechanical interpretation when the head of a rule expressing variables embedded in a natural language does not include a variable, a seamless, easy-to-understand, simple and unified processing mechanism, and the inference process corresponding to these An explanation can be given.

また、請求項12は、
前記自動単一化処理又は自動導出処理において、
変数を含むパターンと変数を含むヘッド部をもつホーン節との単一化を行う場合、
パターンとヘッド部の頭、尾又は両方に存在する文字数分の固定文字が一致していない場合に偽を返す、
請求項1から11のいずれか一項に記載の処理方法を提供する。
これにより、一律の探索に比して、明らかに大幅な計算量節約と処理速度向上が図れる。
In addition, claim 12
In the automatic unification process or automatic derivation process,
When unifying a pattern containing variables and a horn clause with a head containing variables,
Returns false if the pattern does not match the number of fixed characters in the head, head or both of the head part,
A processing method according to any one of claims 1 to 11 is provided.
As a result, the calculation amount can be significantly reduced and the processing speed can be improved as compared with the uniform search.

また、請求項13は、
前記自動単一化処理又は自動導出処理において、
変数を含む第一のパターンと変数を含むヘッド部をもつホーン節との単一化を行う場合、
パターンとヘッド部の頭及び尾に存在する文字数分の固定文字が一致している場合、
請求項5又は6に記載の処理方法における「サブゴール」として当該ホーン節のボディ部を適用した結果が真となる各束縛情報により当該ホーン節のヘッド部を束縛して得られる各第二のパターンについて、
第二のパターンが変数を含まない場合に、
請求項2から4のいずれか一項に記載の処理方法における「パターン」として第一のパターンを用いかつ同処理方法における「定数文字列」として第二のパターンを用いて処理した結果を返す、
請求項1から12のいずれか一項に記載の処理方法を提供する。
ここで、「第二のパターンが変数を含まない場合」とは、ホーン節(ルール)において、ヘッド部に含まれるすべての変数がボディ部「にも」含まれており、ボディ部のすべての変数が定数(固定文字列)で束縛された結果としてヘッド部のすべての変数も定数(固定文字列)で束縛(代入)されたことによりヘッド部の変数が消えてヘッド部が定数文字列と見なせるようになったことをいう。
これにより、変数を含むパターンと変数を含むヘッド部をもつホーン節(ルール)との単一化をシンプルな計算モデルにより、ユーザーがトレースしやすい流れで機械的・自動的に行うことができる。
すなわち、変数を含むパターンと変数を(各束縛情報により)含まなくなった(=定数文字列化した)ヘッド部との間のすべての解候補(パターンの各変数へ代入すべきもの)を洗い出して「結果」として返す形に、元々のより複雑な問題(変数対変数の単一化)を帰着(問題を変換)させることにより、上記「困難性A」克服のための基礎的な機構をシンプルに与え、思考プロセスとしても表現しやすいものにできている。また、この「帰着(問題の変換)」に当たって、より単純かつ再帰的な(または相互再帰的な)同一構造を持つ部分問題へとシンプルに変換しているため、推論過程の可視化や検証(完全性や健全性の)だけでなくルールの修正等といったユーザーの手を介した学習をも容易にする。
結局、変数を自然言語に埋め込む形式で表現するルールのヘッドが変数を含む場合の健全な機械的解釈と、シームレスでわかりやすくかつシンプルで統一的な処理メカニズムと、これらに該当する推論過程の説明を容易に与えることができる。
In addition, claim 13
In the automatic unification process or automatic derivation process,
When unifying the first pattern containing variables and the horn clause with the head containing variables,
If the pattern and the fixed characters for the number of characters in the head and tail of the head part match,
Each 2nd pattern obtained by constraining the head part of the said horn clause by each constraining information in which the result of applying the body part of the said horn clause is true as a "subgoal" in the processing method according to claim 5 or 6 about,
If the second pattern contains no variables,
A result of processing using the first pattern as the “pattern” in the processing method according to claim 2 and using the second pattern as the “constant character string” in the processing method is returned.
A processing method according to any one of claims 1 to 12 is provided.
Here, “when the second pattern does not include a variable” means that in the horn clause (rule), all the variables included in the head part are also included in the body part “all”. As a result of the variable being bound with a constant (fixed character string), all the variables in the head part are also bound (assigned) with the constant (fixed character string), so the head part variable disappears and the head part becomes a constant character string. It means that it can be considered.
As a result, unification of a pattern including a variable and a horn clause (rule) having a head including a variable can be mechanically and automatically performed by a simple calculation model in a flow that is easy for a user to trace.
That is, all the solution candidates (those that should be assigned to each variable of the pattern) between the pattern including the variable and the head portion (= constant character string) that no longer includes the variable (by each binding information) are identified. The basic mechanism for overcoming the above “Difficulty A” is simplified by reducing (transforming the problem) the original more complex problem (unification of variables vs. variables) into a form that is returned as a “result”. It is made easy to express as a thought process. In addition, in this “reduction (transformation of problem)”, since it is simply transformed into a partial problem with the same structure that is simpler and recursive (or mutually recursive), visualization and verification of the inference process (completely) (Such as sexuality and soundness) as well as learning through the user's hands, such as modifying rules.
After all, sound mechanical interpretation when the head of a rule that expresses variables in the form of embedding them in natural language includes variables, seamless, easy-to-understand, simple and unified processing mechanism, and explanation of the inference process corresponding to these Can be given easily.

また、請求項14は、
変数を含む事実が入力されることをコンピュータが制限することを特徴とする
請求項1から13のいずれか一項に記載の処理方法を提供する。
ここで、変数を含む事実(ルールでない知識源)とは、例えば、「$Xは$Xである。」(トートロジー的に恒真となる事実)や「$Xは$Yである。」(表層的な文型だけが合致していれば真となってしまう根拠のない事実)等がある。
これらがコンピュータに入力されることを制限することにより、パターン(変数を含みうる文)と事実(変数を含まない文(=固定文字列))との自動単一化処理の計算が単純になり、自動処理による高速な回答が可能となる。また、根拠のない事実を知識源に混入しにくくする。
In addition, claim 14
The processing method according to any one of claims 1 to 13, wherein the computer restricts input of facts including variables.
Here, the facts including variables (knowledge sources that are not rules) are, for example, “$ X is $ X” (a fact that is tautologically true) or “$ X is $ Y” ( There is a fact that there is no reason to be true if only the superficial sentence pattern matches.
By restricting these to be input to the computer, calculation of automatic unification processing of patterns (statements that can include variables) and facts (statements that do not include variables (= fixed character strings)) is simplified. Fast response by automatic processing is possible. It also makes it difficult to mix unfounded facts into knowledge sources.

また、請求項15は、
前記ルールがいわゆるホーン節と同様の形式であり、ヘッド部がボディ部に出現しない変数を含むことをコンピュータが制限することを特徴とする
請求項1から14のいずれか一項に記載の処理方法を提供する。
ここで、「ヘッド部がボディ部に出現しない変数を含むことをコンピュータが制限する」とは、ヘッド部が「$Xは素敵」であり、ボディ部が「$Yは強い,$Yは$Zに優しい,$Zは子供,$Yは賢い」といったように、ボディ部のすべての文中の変数(この例では、$Yと$Z)が束縛(代入)されても、ヘッド部の変数(この例では、$X)が束縛されないまま残るようなルールが知識源として入力されたり、記憶されたり、起動されたりすることをコンピュータが制限することをいう。このようなルールは、事実の場合と同様に、ヘッド部に束縛されない変数を残すことにつながるため、健全でない推論結果を生み出しやすく、推論のスピードをも低下させる原因となる。
こうしたルールがコンピュータに入力されることを制限することにより、パターン(変数を含みうる文)とヘッド部(請求項13により変数を含まない文(=固定文字列)の集合に帰着可能)との自動単一化処理の計算が単純になり、自動処理による高速な回答が可能となる。また、根拠のない推論結果を生み出しにくくする。
In addition, claim 15
The processing method according to any one of claims 1 to 14, wherein the rule is in a format similar to a so-called horn clause, and the computer restricts that the head portion includes a variable that does not appear in the body portion. I will provide a.
Here, “the computer restricts that the head part includes a variable that does not appear in the body part” means that the head part is “$ X is nice” and the body part is “$ Y is strong, $ Y is $ Even if the variables ($ Y and $ Z in this example) are bound (assigned) in all sentences in the body part, such as "Z-friendly, $ Z is a child, $ Y is smart" (In this example, it means that the computer restricts a rule such that $ X) remains unbound from being input, stored, or activated as a knowledge source. As in the case of the fact, such a rule leads to leaving a variable that is not bound to the head part, so that an unreasonable inference result is likely to be generated, and the inference speed is reduced.
By restricting such rules to be input to the computer, patterns (sentences that can contain variables) and head parts (which can be reduced to a set of sentences (= fixed character strings) that do not contain variables according to claim 13). The calculation of the automatic unification process is simplified, and a high-speed answer by the automatic process becomes possible. It also makes it difficult to produce unreasonable inference results.

また、請求項16は、
前記自動単一化処理又は自動導出処理において、
束縛されない変数が互いに残っているパターンとヘッド部又は事実との自動単一化処理を、
固定文字列として極小となる解の集合を求めて返すことにより行うことを特徴する、
請求項1から13のいずれか一項に記載の処理方法を提供する。
ここで、「固定文字列として極小となる解の集合」の例としては、「$Aは$B」と「$Cも$D」との間の自動単一化の結果として、{($A=”も”、$B=<空>、$C=<空>、$D=”は”),($A=空、$B=”も”、$C=”は”、$D=空)}という2つの解を提供することがある。
これにより、無限個の解が存在する場合にも解の例(特に最小のシンプルな例)を提供することが可能になる。
In addition, claim 16
In the automatic unification process or automatic derivation process,
Automatic unification of patterns and heads or facts with unbound variables remaining in each other,
It is performed by obtaining and returning a set of minimal solutions as a fixed character string,
A processing method according to any one of claims 1 to 13 is provided.
Here, as an example of “a set of solutions that are minimal as fixed character strings”, as a result of automatic unification between “$ A is $ B” and “$ C is also $ D”, {($ A = ”also”, $ B = <empty>, $ C = <empty>, $ D = ”is“) ”($ A = empty, $ B =“ also ”, $ C =” is ”, $ D = Empty)} may be provided.
This makes it possible to provide an example of a solution (particularly the smallest simple example) even when an infinite number of solutions exist.

また、請求項17は、
前記自動単一化処理又は自動導出処理において、
束縛されない変数が互いに残っているパターンとヘッド部又は事実との自動単一化処理を、
変数を含む文字列として極小となる解の集合を求めて返すことにより行うことを特徴する、
請求項1から13のいずれか一項に記載の処理方法を提供する。
ここで、「固定文字列として極小となる解の集合」の例としては、「$Aは$B」と「$Cも$D」との間の自動単一化の結果として、{($A=”$Cも”、$B=<自由>、$C=<自由>、$D=”は$B”),($A=<自由>、$B=”も$D”、$C=”$Aは”、$D=<自由>)}という2つの解を提供すること等がある。変数を束縛する値(変数に代入される値)の文字列長(ただし、変数が含まれる場合は変数の出現あたり1文字と見なす)の合計(解組みを通じた)が極小となるものと考えることができる。
これにより、無限個の解が存在する場合にも解の一般形を提供することが可能になる。
In addition, claim 17
In the automatic unification process or automatic derivation process,
Automatic unification of patterns and heads or facts with unbound variables remaining in each other,
It is performed by obtaining and returning a minimal solution set as a character string including variables,
A processing method according to any one of claims 1 to 13 is provided.
Here, as an example of “a set of solutions that are minimal as fixed character strings”, as a result of automatic unification between “$ A is $ B” and “$ C is also $ D”, {($ A = “$ C”, $ B = <free>, $ C = <free>, $ D = “$ B”), ($ A = <free>, $ B = “$ D”, $ C = “$ A is”, $ D = <freedom>)}, and so on. It is considered that the sum of the string length of the value that binds the variable (the value assigned to the variable) (however, if the variable is included, one character per occurrence of the variable) (through the assembly) is minimized be able to.
This makes it possible to provide a general form of a solution even when an infinite number of solutions exist.

また、請求項18は、
束縛されない変数が互いに残っているパターンとヘッド部又は事実との各文字列の頭及び尾に共通して存在する文字数分の固定文字が一致していない場合、
偽を返すことを特徴とする、
請求項16又は17に記載の処理方法を提供する。
これにより、単一化の可能性のない自動探索を節約し、自動処理を高速化することができる。
In addition, claim 18
If the fixed characters for the number of characters that exist in common at the beginning and tail of each character string in the pattern and the head part or the fact that the unbound variables remain in each other do not match,
It is characterized by returning false,
A processing method according to claim 16 or 17 is provided.
Thereby, it is possible to save the automatic search without the possibility of unification and to speed up the automatic processing.

また、請求項19は、
前記固定文字列又は変数を含む文字列として極小となる解の集合を求める際、
束縛されない変数が互いに残っているパターンとヘッド部又は事実とからなる両文字列(第一の文字列と第二の文字列とする)に含まれる各変数が、各文字列内では共通に束縛され、文字列間では独立に束縛されるものとしながら(あるいは、同名変数を共通に束縛するスコープを各文字列内のみ(あるいは、文字列間は変数のスコープ外)としながら)、
各変数に相手の文字列(第一の文字列中の変数には第二の文字列、第二の文字列中の変数には第一の文字列)のあらゆる部分文字列(<空>及び文字列全体も含む)又は自分自身を代入してみて両文字列が一致する場合を探す全探索により極小となる解の集合を求めることを特徴する、
請求項16又は17に記載の処理方法を提供する。
「又は自分自身を・・・代入」とは、文字列中の「$X」には「$X」そのものを代入することをいい、たまたま第一の文字列にも第二の文字列にも$X(互いのスコープは異なっている)が含まれるときは、第一の文字列の$Xと第二の文字列の$Xをあえて区別できるように(例えば、「$X1」と「$X2」、等として)代入することによっても明らかに健全な計算を行うことができる。
これにより、健全性と停止性(計算の有限性)を確保しながら解集合の一定の網羅性(問題(パターン対)の性質によっては完全性)を確保することができる。
In addition, claim 19
When obtaining a set of solutions that are minimal as a character string including the fixed character string or variable,
Variables included in both character strings (the first character string and the second character string) consisting of the pattern and the head part or the fact that unbound variables remain in each other are commonly bound in each character string. And while being bound independently between strings (or while the scope that binds the same name variable in common is only within each string (or between the strings is outside the scope of the variable))
For each variable, any substring (<empty>) and the other character string (the second character string for the variable in the first character string, the first character string for the variable in the second character string) (Including the entire character string), or by substituting itself and searching for a case where both character strings match, a search for a minimal solution is obtained by a full search,
A processing method according to claim 16 or 17 is provided.
“Or substitute yourself” means that “$ X” itself is assigned to “$ X” in the character string, and happens to be in both the first and second character strings. When $ X (the scopes of each other are different) is included, the $ X of the first character string and the $ X of the second character string can be distinguished from each other (for example, “$ X1” and “$$”). Substantial calculations can also be done by substituting (as X2 ", etc.).
As a result, it is possible to ensure a certain level of completeness of the solution set (completeness depending on the nature of the problem (pattern pair)) while ensuring soundness and stopping (finiteness of calculation).

また、請求項20は、
束縛されない変数が互いに残っているパターンとヘッド部又は事実とからなる両文字列そのものではなく、
束縛されない変数が互いに残っているパターンとヘッド部又は事実との各文字列の頭及び尾に共通して存在する文字数分の固定文字を両者から除いて残る二つの文字列に相当する両文字列について、
請求項19に記載の処理をする処理方法を提供する。
これにより、解集合の一定の網羅性(場合によっては完全性)を保ちながら全探索の空間を小さくでき、処理が高速化される。
例えば、「石川の$Aは$Bが好き。」と「石川の$Cも$Dアイスが好き。」との間の自動単一化の過程として、そのまま解を探すのではなく、頭尾の共通部分を削除して
”$Aは$B”

”$Cも$Dアイス”
とした上で、全探索により「$A」と「$B」それぞれに、”$Cも$Dアイス”の全ての部分文字列(これは、$Cや$Dといった変数(${・・・}形式の変数も同じ)は1文字とすると、6文字であるため、6×(6+1)/2+1(<空>分)+1(自分自身を代入分)=23通りある)を代入しつつ、同様に、「$C」と「$D」それぞれに”$Aは$B”の全ての部分文字列(これは、同様に3文字であるため、3×(3+1)/2+1+1=8通りある)を代入してみてできる全ての両文字列(23×23×8×8通り)について、両文字列が一致した場合(例えば、(
”もはアイス”,
”はもアイス”,
”$Aはもアイス”,
”$Cもはアイス”,
”$Aはも$Dアイス”
※ちなみに”$Cもは$Bアイス”は一致しない
)となった場合の代入組の集合{
($A=”も”、$B=”アイス”、$C=<空>、$D=”は”),
($A=<空>,$B=”もアイス”,$C=”は”,$D=<空>),
($A=”$A”,$B=”もアイス”,$C=”$Aは”,$D=<空>),
($A=”$Cも”,$B=”アイス”,$C=”$C”,$D=”は”),
($A=”$A”,$B=”も$Dアイス”,$C=”$Aは”,$D=”$D”)
}又は、各代入組の部分的代入の集合(例えば{
($A=”も”、$B=”アイス”),
($A=<空>,$B=”もアイス”),
($A=”$A”,$B=”もアイス”),
($A=”$Cも”,$B=”アイス”),
($A=”$A”,$B=”も$Dアイス”)
})
を解として答えることができる。
なお、$A=”$A”や$B=”も$Dアイス”は、$Aや$Dが自由であり、そこにどのような文字列を代入しても単一化できる(すなわち、無限の解があるということと、その無限個の解(文字列)の制約(正規表現的な形)のあり方)を示すことができる。
In addition, claim 20
It is not both strings consisting of patterns and heads or facts where unbound variables remain in each other,
Both character strings corresponding to the two character strings remaining after removing the fixed characters corresponding to the number of characters existing in common at the head and tail of each character string of the pattern and the head part or the fact that the variables that remain unbound remain. about,
A processing method for performing the processing according to claim 19 is provided.
As a result, the space for the entire search can be reduced while maintaining a certain level of completeness (in some cases, completeness) of the solution set, and the processing speed is increased.
For example, as a process of automatic unification between "Ishikawa's $ A likes $ B" and "Ishikawa's $ C likes $ D ice", instead of searching for a solution as it is, Delete the common part of "$ A is $ B"
And "$ C is also $ D ice"
In addition, all the partial character strings of “$ C and $ D ice” for each of “$ A” and “$ B” by full search (this is a variable such as $ C or $ D ($ {•• .} Variable is also the same as 6 characters, so 6 × (6 + 1) / 2 + 1 (<empty> minutes) +1 (substituting itself) = 23 types) Similarly, all the partial character strings of “$ A is $ B” for each of “$ C” and “$ D” (since this is also three characters, 3 × (3 + 1) / 2 + 1 + 1 = 8 ways When all the character strings (23 × 23 × 8 × 8) that can be obtained by substituting (A) are matched (for example, (
"Momo ice",
"Hamo ice",
"$ A is also iced",
"$ C is ice cream",
"$ A is $ D ice"
* By the way, “$ C is not the same as $ B ice”))
($ A = ”also”, $ B = “ice”, $ C = <empty>, $ D = ”is”),
($ A = <empty>, $ B = “also ice”, $ C = ”is”, $ D = <empty>),
($ A = “$ A”, $ B = “also ice”, $ C = “$ A is”, $ D = <empty>),
($ A = "$ C", $ B = "ice", $ C = "$ C", $ D = "")
($ A = “$ A”, $ B = “also $ D ice”, $ C = “$ A is”, $ D = “$ D”)
} Or a set of partial assignments for each assignment pair (e.g. {
($ A = "" and $ B = "ice"),
($ A = <empty>, $ B = "also ice"),
($ A = “$ A”, $ B = “also ice”),
($ A = "$ C", $ B = "ice"),
($ A = "$ A", $ B = "also $ D ice")
})
Can be answered as a solution.
Note that $ A = “$ A” and $ B = “$ D ice” are free to $ A and $ D, and can be unified by substituting any character string (that is, It is possible to show that there is an infinite solution and the constraint (regular expression form) of the infinite number of solutions (character strings).

また、請求項21は、
各変数に相手の文字列のあらゆる部分文字列(<空>及び文字列全体も含む)又は自分自身を代入してみて両文字列が一致する場合を探す全探索により極小となる解の集合を求める際、
変数に代入する部分文字列に変数が含まれる場合に、当該部分文字列に含まれる変数を両文字列にそれまで存在しなかった新しい変数で置き換えながら、該新しい変数に対しての同様の代入も以後再帰的に行いながら両文字列が一致する場合を探す全探索を行うことを特徴とする
請求項19又は20に記載の処理方法を提供する。
これにより、自文字列内の固定文字を相手文字列内の変数を介して反射的に自文字列内の変数に代入した解をも探す必要のある性格の問題(例えば、両文字列={”$Xは$X”,”い$Yう”}の場合では、解候補として($X=”いう”,$Y=”うはい”)を列挙できなければならない)について、解探索の健全性を維持したまま、解候補列挙の網羅性をより高めることができる。上の例では、両文字列(「パターン対」とも呼ぶ)={”$Xは$X”,”い$Yう”}から($X=”いう”,$Y=”うはい”)という解候補を列挙できることを、本発明により再帰的に($X=”い${Y1}う”)⇒(${Y1}=<空>)⇒($Y=”うはい”)という探索枝(探索木の一部であり、本発明に沿った幅優先探索の場合は有限回で生成可能である)を生成しうることによって、示すことができる。
「再帰的に・・・全探索」とは、例えば、各変数への各ありうる代入(前の請求項と同じ)を再帰的に繰り返す幅優先探索をしながら一致する代入系列(例えば、上記の($X=”い${Y1}う”)⇒(${Y1}=<空>)⇒($Y=”うはい”)、等)を列挙することである。最初の代入のバリエーションは、両文字列中の変数の種類がそれぞれ2個と3個であり文字列の長さがそれぞれ6字と7字(変数はまとめて1字と数える)であれば、2個×(7×(7+1)/2+1+1)+3個×(6×(6+1)/2+1+1)=60+69=129通りとなる。これらの枝から派生するさらなる枝の最長深さが均等になるように幅優先探索を行う場合、代入回数等によるリミッター(上限値と比較するプログラムステップ等)を設けることにより、一回一回の探索を適当な計算量に制限することができる(再帰性によって保証されなくなった停止性や応答速度の確保)。なお、深さ優先探索とした場合にも、深さの制限や代入回数等によって計算量を制限することができる。いずれも自己再帰や相互再帰による無限ループを、再帰的な関数の呼び出しを管理するスタック構造(構造体の配列)等を設けて、先祖(より根方向)となる枝の呼出しパラメータ(その代入系列(代入文脈)に応じた両文字列の状態表現を含んでいてもよい)を現在の呼出しパラメータと比較したりすることにより回避することができる。また、両文字列の頭尾に存在する固定文字列が共通して存在する文字数分一致しているかどうかなどにより、単一化しえない枝の枝刈りを行うこともできる。なお、制限した計算量(例えば代入百万回や探索深さ20以内)の探索により解が見つからなかった場合に「解なし(精度:代入百万回かつ探索深さ20以内)」として、見つかった場合に、「($X=”いう”,$Y=”うはい”),(・・・),・・・(但し、精度:代入百万回かつ探索深さ20以内)」等として探索精度を明示しながらユーザに答えることもできる。また、代入の制限回数以内かつ制限探索深さ以内で明らかに全探索できた場合(完全性のある場合)には、その旨を「解なし(全探索済)」あるいは「($X=”いう”,$Y=”うはい”),(・・・),・・・(全探索済)」等と明示して、ユーザに答えることもできる。
In addition, claim 21
Substitute all the substrings (including <empty> and the whole string) of the other party's character string for each variable, or try to find a case where both character strings match, and find a minimal set of solutions by full search When seeking
When a variable is included in a substring to be assigned to a variable, the same assignment to the new variable is performed while replacing the variable included in the substring with a new variable that did not exist in both strings. 21. The processing method according to claim 19 or 20, further comprising performing a full search to search for a case where both character strings match while performing recursively thereafter.
As a result, it is necessary to search for a solution in which a fixed character in the own character string is reflexively assigned to a variable in the own character string via a variable in the partner character string (for example, both character strings = { In the case of “$ X is $ X” and “$ Y”, it is necessary to be able to enumerate solution candidates ($ X = “say”, $ Y = “Yes”)). The completeness of enumerating solution candidates can be further improved while maintaining soundness. In the above example, both character strings (also referred to as “pattern pairs”) = {“$ X is $ X”, “yes $ Y”} ($ X = “say”, $ Y = ”yes”) That the solution candidates can be listed recursively according to the present invention ($ X = ”$$ {Y1}”) → ($ {Y1} = <empty>) → ($ Y = “Yes”) It can be shown by being able to generate branches (which are part of the search tree and can be generated in a finite number of times in the case of breadth-first search according to the present invention).
“Recursively ... full search” means, for example, an assignment sequence that matches each possible assignment to each variable (same as the previous claim) while performing a breadth-first search that recursively repeats (for example, the above-mentioned ($ X = “yes $ {Y1}”) → ($ {Y1} = <empty>) → ($ Y = “yes”), etc.). Variations of the first assignment are 2 and 3 variable types in both strings, respectively, and the string length is 6 and 7 characters respectively (variables are counted as 1 character) 2 × (7 × (7 + 1) / 2 + 1 + 1) + 3 × (6 × (6 + 1) / 2 + 1 + 1) = 60 + 69 = 129. When a breadth-first search is performed so that the longest depths of further branches derived from these branches are equal, a limiter based on the number of substitutions (program step for comparing with the upper limit value, etc.) is provided, so that each search is performed once. Can be limited to an appropriate amount of computation (ensuring stoppage and response speed that are no longer guaranteed by recursiveness). Even in the case of depth-first search, the amount of calculation can be limited by depth limitation, the number of substitutions, and the like. In each case, an infinite loop due to self-recursion or mutual recursion, a stack structure (array of structures) that manages recursive function calls, etc. are provided, and call parameters for the branches that become ancestors (more root direction) This may be avoided by comparing the state expression of both character strings according to (assignment context) with the current call parameter. Further, depending on whether or not the fixed character strings existing at the head and tail of both character strings match the number of characters existing in common, it is possible to perform pruning of branches that cannot be unified. If no solution is found by searching for a limited amount of calculation (for example, substitution 1 million times or search depth 20 or less), it is found as “no solution (accuracy: substitution 1 million times and search depth 20 or less)”. "($ X =" say ", $ Y =" yes "), (...), ... (however, accuracy: millions of substitutions and search depth within 20)" etc. It is also possible to answer the user while specifying the search accuracy. In addition, when the full search can be clearly performed within the limited number of substitutions and within the limited search depth (when there is completeness), “no solution (all searched)” or “($ X =”) It can also be answered to the user by clearly saying “, $ Y =“ Yes ””, (...),.

また、請求項22は、
変数に代入した結果についても、各文字列の頭及び尾に共通して存在する文字数分の固定文字を両者から除いて残る二つの文字列を、
「相手の文字列のあらゆる部分文字列(<空>及び文字列全体も含む)」の対象となるの「相手の文字列」として、探索が進むごとに、文字列の頭又は尾に存在する固定文字数が少なくすることを特徴とする、
請求項19〜21のいずれか一項に記載の処理方法を提供する。
これにより、探索を進めるごとに(先の枝にいくほど)枝の個数が少なくなり計算量を節約することができる。
In addition, claim 22
As for the result assigned to the variable, the two character strings remaining by removing the fixed characters corresponding to the number of characters existing in common at the head and tail of each character string,
Each time the search progresses, it is present at the head or tail of the character string as the “other character string” that is the target of “any substring of the other character string (including <empty>” and the entire character string). Featuring fewer fixed characters,
The processing method as described in any one of Claims 19-21 is provided.
As a result, the number of branches is reduced each time the search is advanced (as it goes to the previous branch), and the calculation amount can be saved.

また、請求項23は、
前記固定文字列又は変数を含む文字列として極小となる解の集合を求める際、
束縛されない変数が互いに残っているパターンとヘッド部又は事実とからなる両文字列(第一の文字列と第二の文字列とする)に含まれる各変数が、各文字列内では共通に束縛され、文字列間では独立に束縛されるものとしながら(あるいは、同名変数を共通に束縛するスコープを各文字列内のみ(あるいは、文字列間は変数のスコープ外)としながら)、
各変数に、固定文字列(空文字を含む)又は変数を含む文字列を再帰的に代入してみて解の集合を求める処理方法であって、
代入してみる変数を相手文字列の頭又は尾が固定文字である自文字列の対応する頭又は尾の変数に限定し、
代入値を、該頭である場合には該頭の固定文字もしくは固定文字列に続く新しい変数又は<空>とし、該尾である場合には新しい変数に続く該尾の固定文字もしくは固定文字列又は<空>とし、
変数に代入した結果について、各文字列の頭及び尾に共通して存在する文字数分の固定文字を両者から除くことを繰り返す、
ことを特徴とする請求項16又は17に記載の処理方法を提供する。
これにより、頭及び尾の固定文字の存在に着目して解の列挙範囲を(探索の網羅性を損なわずに)大幅に制限すること可能になり、大幅な計算量節約と高速化が可能になる。
In addition, claim 23 is
When obtaining a set of solutions that are minimal as a character string including the fixed character string or variable,
Variables included in both character strings (the first character string and the second character string) consisting of the pattern and the head part or the fact that unbound variables remain in each other are commonly bound in each character string. And while being bound independently between strings (or while the scope that binds the same name variable in common is only within each string (or between the strings is outside the scope of the variable))
A processing method for obtaining a set of solutions by recursively assigning a fixed character string (including an empty character) or a character string including a variable to each variable,
Limit the variable to be substituted to the corresponding head or tail variable of the subject string whose head or tail is a fixed character,
The substitution value is a new variable or <empty> following the initial fixed character or fixed character string if it is the head, or the fixed character or fixed character string following the new variable if it is the tail. Or <empty>
For the result of assigning to the variable, it is repeated to remove the fixed number of characters common to the head and tail of each character string from both,
The processing method according to claim 16 or 17, characterized in that:
This makes it possible to significantly limit the enumeration range of solutions (without impairing the comprehensiveness of search) by focusing on the presence of fixed characters at the head and tail, enabling significant computational savings and speedup. Become.

また、請求項24は、
前記固定文字列又は変数を含む文字列として極小となる解の集合を求める際、
束縛されない変数が互いに残っているパターンとヘッド部又は事実とからなる両文字列(第一の文字列と第二の文字列とする)に含まれる各変数が、各文字列内では共通に束縛され、文字列間では独立に束縛されるものとしながら(あるいは、同名変数を共通に束縛するスコープを各文字列内のみ(あるいは、文字列間は変数のスコープ外)としながら)、
各変数に、固定文字列(空文字を含む)を再帰的に代入してみて解の集合を求める処理方法であって、
各文字列の頭及び尾に存在する文字数分の共通する固定文字を除いてできる両文字列中の固定文字種(変数の識別子やデリミタを除いた文字種)だけを用いてできる束縛情報を、束縛する値の文字列長の合計が小さいものから順に列挙していくことにより求める、
請求項16又は17に記載の処理方法を提供する。
これにより、一定の性質をもった問題については、効率よく解に到達し、列挙することもできる。
In addition, claim 24
When obtaining a set of solutions that are minimal as a character string including the fixed character string or variable,
Variables included in both character strings (the first character string and the second character string) consisting of the pattern and the head part or the fact that unbound variables remain in each other are commonly bound in each character string. And while being bound independently between strings (or while the scope that binds the same name variable in common is only within each string (or between the strings is outside the scope of the variable))
A processing method for recursively assigning a fixed character string (including an empty character) to each variable to obtain a set of solutions,
Binds binding information that can be generated using only fixed character types (character types excluding variable identifiers and delimiters) in both character strings that can be generated by removing common fixed characters for the number of characters existing at the beginning and tail of each character string. Obtained by enumerating in order from the smallest total string length of values.
A processing method according to claim 16 or 17 is provided.
As a result, problems with a certain property can be efficiently reached and enumerated.

また、請求項25は、
求めた「変数を含む文字列として極小となる解の集合」をもとに、
当該ホーン節の変数を当該変数を含む文字列で一時的に書き換えてできるホーン節により探索を継続する請求項19〜24に記載の処理方法を提供する。
これにより、パターンとホーン節(ルール)のヘッド部とが単一化するために必要であることが計算された制約(上記の例では、変数「$C」が”$Aは”という形の文字列で束縛(代入)されることでしか単一化しえないという制約の働くような単一化方針(例えば、上記最後の代入組の場合)もある)を、そのホーン節のボディ部の探索プロセスに伝播することができ、探索を効率化することができる。
In addition, claim 25
Based on the calculated “a set of solutions that are minimal as strings containing variables”
The processing method according to any one of claims 19 to 24, wherein the search is continued by a horn clause that can be temporarily rewritten by a character string including the variable.
As a result, the constraint calculated in order to unify the pattern and the head part of the horn clause (rule) (in the above example, the variable “$ C” is in the form of “$ A is”). There is also a unification policy (for example, in the case of the last assignment set above) that can be unified only by being bound (assigned) with a character string. It can be propagated to the search process, and the search can be made efficient.

また、請求項26は、
求めた「変数を含む文字列として極小となる解の集合」をもとに、
「変数を含む文字列」の変数部分に、当該「変数を含む事実」の解組の集合としてあらかじめ定義された固定文字列組の集合の各要素を代入してできる固定文字列組の集合を返す、
請求項19〜25のいずれか一項に記載の処理方法を提供する。
これにより、変数(一個又は複数)を含む事実とその変数に埋めうる適切な答え(又は仮説)の集合とをひもづけたデータベース(例えば、「言葉方程式(登録商標)」「VLANK(登録商標)」中の知識源)と効率的に連携した解探索を行うことができる。また、似た文型をもつ大量の事実を、本発明の枠組みと連携させて効率的に管理することができる。
In addition, claim 26
Based on the calculated “a set of solutions that are minimal as strings containing variables”
A set of fixed character string sets made by substituting each element of the set of fixed character string sets defined in advance as a set of solution sets of the “facts including variables” to the variable portion of “character strings including variables” return,
The processing method as described in any one of Claims 19-25 is provided.
Thus, a database (for example, “word equation (registered trademark)”, “VLANK (registered trademark)) that associates a fact including variable (s) and a set of appropriate answers (or hypotheses) that can be embedded in the variable. It is possible to perform a solution search efficiently linked with the knowledge source in “ In addition, a large number of facts having similar sentence patterns can be efficiently managed in cooperation with the framework of the present invention.

また、請求項27は、
前記自動単一化処理又は自動導出処理において、
変数を含む第一のパターンと変数を含む第二のパターンとの自動単一化を行う場合、
両パターンの頭及び尾に存在する文字数分の固定文字が一致しており、かつ、同じ変数が各パターン内で一度しか出現しない場合、
無限個の解の存在を意味する情報を返す、
請求項1から26のいずれか一項に記載の処理方法を提供する。
In addition, claim 27
In the automatic unification process or automatic derivation process,
When performing automatic unification of a first pattern containing variables and a second pattern containing variables:
If the fixed characters for the number of characters in the head and tail of both patterns match and the same variable appears only once in each pattern,
Returns information indicating the existence of an infinite number of solutions,
A processing method according to any one of claims 1 to 26 is provided.

また、請求項28は、
請求項1から27のいずれか一項の方法を実行するための装置を提供する。
In addition, claim 28
An apparatus for performing the method of any one of claims 1 to 27 is provided.

また、請求項29は、
請求項1から27のいずれか一項の方法をコンピュータに実行させるためのコンピュータプログラムを提供する。
In addition, claim 29
A computer program for causing a computer to execute the method according to any one of claims 1 to 27 is provided.

本発明の効果は、各請求項について上述したとおりである。   The effects of the present invention are as described above for each claim.

図1は本発明を最も効果的に実施するネットワークシステムの全体図である。(実施例1)FIG. 1 is an overall view of a network system that most effectively implements the present invention. Example 1 図2は本発明を実施するコンピュータのハードウエア構成を示した説明図である。(実施例1)FIG. 2 is an explanatory diagram showing the hardware configuration of a computer that implements the present invention. Example 1 図3は本発明を実施する端末における画面表示の例を示した説明図である。(実施例1)FIG. 3 is an explanatory view showing an example of screen display in a terminal embodying the present invention. Example 1

本発明は、ネットワークに接続された/接続されてないあらゆる種類のコンピュータ(クラウドサーバー、大型汎用機、デスクトップPC、ノートPC、携帯端末、本発明専用機)において実施することができるが、一般的なマルチタスク機能とウィンドウ機能をもちインターネットに接続されたPCにより実現した形態により説明する。
図1は本発明を最も効果的に実施するそのネットワークシステムの全体図であり、コンテンツ管理装置1は、利用者PC2又は利用者兼管理者PC2により、本発明で取り扱うコンテンツ(ルールや事実)の投稿を受け付け、所定のポリシーによって共有アクセス権やコンテンツ提供優先順位を制御しながらコンテンツを配信する公知のファイル共有サーバーでよい。利用者PC2は、その利用者ごとに、その信じる内容(や検討したい内容)を自然言語で表現したコンテンツ(ルールや事実)を本発明の方法に沿って入力して記憶し本発明の方法によって処理するコンピュータ、携帯端末等である。
図2は本発明で用いるコンピュータのハードウエア構成を示した説明図である。これは計算機の構成としては一般的なものであり、本発明の特徴は、不揮発性メモリ2hに記憶されたプログラム3及びコンテンツデータ4の指示や記載に従い自然法則を用いてCPU2eで処理される処理の内容、及び、利用者との対話プロトコル(書式)の在り方にある。
図3は本発明を実施する端末における画面表示の例を示した説明図である。図では「?$Aしない」という問い(オープンクエスチョン形式)に対して、図示しない記憶したリストLの1行目の「されていやなことはなるべくしない」という事実を用いて「$A = されて嫌なことをなるべく/1/」という答えを列挙し、同様にリストLの9行目の「いじめをしない」という事実を用いて「$A = いじめ/9/」と答えている。
The present invention can be implemented in any kind of computer (cloud server, large general-purpose machine, desktop PC, notebook PC, portable terminal, dedicated machine of the present invention) connected / not connected to the network. A description will be given of a mode realized by a PC connected to the Internet having a multitask function and a window function.
FIG. 1 is an overall view of the network system that most effectively implements the present invention. A content management apparatus 1 is used for content (rules and facts) handled by a user PC 2 or a user / manager PC 2 in the present invention. It may be a known file sharing server that accepts posts and distributes content while controlling sharing access rights and content provision priority according to a predetermined policy. For each user, the user PC 2 inputs and stores contents (rules and facts) expressing the believed contents (or contents to be examined) in a natural language according to the method of the present invention, and stores them. A computer to be processed, a portable terminal, and the like.
FIG. 2 is an explanatory diagram showing the hardware configuration of a computer used in the present invention. This is a general computer configuration, and the feature of the present invention is that the CPU 2e uses natural laws in accordance with instructions and descriptions of the program 3 and content data 4 stored in the nonvolatile memory 2h. And the way of the interaction protocol (format) with the user.
FIG. 3 is an explanatory view showing an example of screen display in a terminal embodying the present invention. In the figure, in response to the question “Do not do $ A” (open question format), “$ A =” is made by using the fact that “does not do as much as possible” in the first line of the stored list L (not shown). In addition, the answer of “1/1 / as much as possible” is enumerated, and similarly, “$ A = bullying / 9 /” is answered using the fact that “not bullying” on the ninth line of the list L.

このような実施形態においては、C++言語等を介して製造されたコンピュータプログラムにより、コンピュータ(PC等)に可能なあらゆる動作を実施させることができる。したがって、自然法則を用いたコンピュータの公知の基本的な動作(レジスタやメモリやストレージへの記憶・取り出し、四則演算、比較、等)や既に開発環境等の標準ライブラリとなっている一般的な機能(変数やN次元配列への代入・比較・コピー、文字列や数値の操作/比較/表示、リスト構造・キュー構造・ハッシュ構造・ベクトル型等の操作、バイナリ―サーチやソート操作、正規表現によるパターンマッチ操作、ネットワーク通信操作、等)の実現方法については、本発明の本質(新規性や進歩性につながる独自の構成)とも異なり、当業者にもよく知られているので、詳述はしない。一方、このような一般的な機能を組み合わせて、本発明に固有の処理をどのような操作順序や記憶の仕方(アルゴリズムやデータ構造)で実現するかについては、以下に詳述する。このアルゴリズム等の説明、上記した課題解決手段の説明及び本発明の図面の説明を提供して開発の参考とさせることにより、標準レベルの職業的プログラマであれば、標準的なアプリケーションプログラム開発技法(C++によるGUIアプリケーション統合開発環境、等)を用いて、本発明の方法をコンピュータに実施させることが明らかに可能となり、また、この方法のための装置やプログラムを作成することも可能となる。   In such an embodiment, the computer (manufactured by a PC, etc.) can perform all possible operations by a computer program manufactured via a C ++ language or the like. Therefore, well-known basic operations of computers using natural laws (register / memory / storage / storage, four arithmetic operations, comparison, etc.) and general functions that are already standard libraries for development environments, etc. (Assignment / comparison / copy to variables and N-dimensional arrays, manipulation / comparison / display of character strings and numerical values, operations such as list structure / queue structure / hash structure / vector type, binary search, sort operation, regular expression The method for realizing pattern matching operation, network communication operation, etc.) is different from the essence of the present invention (unique configuration leading to novelty and inventive step), and is well known to those skilled in the art, so will not be described in detail. . On the other hand, in what operation sequence and storage method (algorithm and data structure) the processing unique to the present invention is realized by combining such general functions will be described in detail below. By providing a description of this algorithm and the like, a description of the above problem solving means, and a description of the drawings of the present invention for reference of development, if a professional programmer at a standard level, a standard application program development technique ( It is clearly possible to cause a computer to implement the method of the present invention using a GUI application integrated development environment using C ++, etc., and it is also possible to create an apparatus and a program for this method.

以下に示すアルゴリズムは、C言語/C++言語等を用いて所望の「関数」を新たに定義した上で関数呼出しを行うという標準的な構造化プログラミングをベースにしたアルゴリズムであり、当業者は、下記各関数の機能分担に応じた入出力や機能切り分けを行いながら(或いは、下記に示した仕様に沿って関数群をそのままコーディングすることにより)、本発明の解決手段に相当する処理手段(プログラムや計算機)を実現することが可能となる。   The algorithm shown below is an algorithm based on standard structured programming in which a desired “function” is newly defined using C language / C ++ language or the like, and a function call is performed. Processing means (program) corresponding to the solution means of the present invention while performing input / output and function separation according to the function sharing of each function below (or by coding a function group as it is in accordance with the specifications shown below) And a computer) can be realized.


■問い合わせPに対する知識リストLの処理アルゴリズム仕様
=====================================================================================================================
関数Q1(P:変数を含みうるパターン,L:知識リスト):★全請求項に共通するメイン関数の実施例1★

1.Lの最初の行の内容B(事実又はホーン節)を取り出す。
ただし、Lが空の場合(最初の行が取り出せなかった場合)、偽を出力して終了。

2.変数の束縛情報Cの初期値を空とし、下記関数H(P,B,C)を呼出し、真となる(=マッチする)束縛情報(=解集合)Cを出力。
真(=マッチした)の場合
真(はい)を出力する(マッチした内容Bの行番号も添えて出力する)。
偽の場合
何もしない。

3.Lの次の行の内容B’が
ある場合
・B←B’とし、2に移動する。
ない場合
・2で真を一度も出力していない場合は偽(いいえ)を出力。
・終了。

■ Processing algorithm specification of knowledge list L for query P
================================================== ================================================== =================
Function Q1 (P: pattern that can include variables, L: knowledge list): Example 1 of main function common to all claims
{
1. Take the contents B (facts or horn clause) of the first line of L.
However, if L is empty (if the first line could not be fetched), output false and end.

2. The initial value of the variable binding information C is emptied, and the following function H (P, B, C) is called to output true (= match) binding information (= solution set) C.
If true (= matched), true (yes) is output (the line number of the matched content B is also output).
If false, do nothing.

3. When there is a content B 'on the next line of L-B ← B' and move to 2.
If there is no-If you have never output true in step 2, output false (no).
・ End.
}


■問い合わせPに対する知識リストLの処理アルゴリズム仕様(事前固定文字列化版)
=====================================================================================================================
関数Q2(P:変数を含みうるパターン,L:知識リスト):★全請求項に共通するメイン関数の実施例2(事前固定文字列化版)★

(事前の固定文字列化)
1.{Lのみから演繹できるすべての文字列/その各文字列を演繹する根拠として用いたLの行番集合}を各行とする固定文字列テキストTを求める。
具体的には、上記関数Q1(”$A”,L)の出力系列(A=解1/根拠1,A=解2/根拠2,・・・)の要素を各行としてマージしたテキストTを求める。
求める途中で無限ループになる場合について、明示的な呼出管理スタック等を用いた無限ループ検出機能により演繹を部分的に省略する。
・例えば、ホーン節の真偽の確認をある変数束縛条件下でコンピュータが行う途中で
同じホーン節の真偽を同じ変数束縛条件下で確認しようとしていないかを、
構造体(確認中のホーン節識別子,現在の変数束縛条件)をメンバーとする呼出管理スタックを管理し、
呼出し時にスタックの根に向かって同じ組み合わせがないかリニアサーチすることにより
無限ループを検出する。

(固定文字列のみである故にQ1よりシンプルな方法(関数F)で解集合を求める)
2.テキストTの各行tにつき、下記関数F(P,t,C)が真となるCをすべて出力する。

(最終結果の出力)
3.Cが一つでもあれば真を出力し、なければ偽を出力する。

■ Processing algorithm specification of knowledge list L for query P (pre-fixed character string version)
================================================== ================================================== =================
Function Q2 (P: pattern that can include variables, L: knowledge list): Example 2 of main function common to all claims (pre-fixed character string version)
{
(Prefixed string conversion in advance)
1. A fixed character string text T having {rows of all characters that can be deduced only from L / line number set of L used as a basis for deducting each character string} is obtained.
Specifically, a text T obtained by merging the elements of the output series (A = solution 1 / foundation 1, A = solution 2 / reason 2,...) Of the function Q1 (“$ A”, L) as each line. Ask.
In the case of an infinite loop in the middle of the search, the deduction is partially omitted by the infinite loop detection function using an explicit call management stack or the like.
・ For example, whether or not the computer is checking the truth of a horn clause under a certain variable constraint condition,
Manage the call management stack whose members are the structure (the horn clause identifier being confirmed and the current variable binding condition)
When calling, an infinite loop is detected by performing a linear search for the same combination toward the root of the stack.

(Since it is only a fixed character string, a solution set is obtained by a simpler method than Q1 (function F))
2. For each line t of the text T, all Cs for which the following function F (P, t, C) is true are output.

(Final result output)
3. If there is even one C, true is output, otherwise false is output.
}


■問い合わせPに対する、一の事実(固定文字列)又はホーン節B(但し、ヘッドに含まれるすべての変数がボディにも存在)の処理アルゴリズム仕様
=====================================================================================================================
関数H(P:変数を含みうるパターン,B:一の事実(固定文字列)又はホーン節,C:変数の束縛情報):★請求項1〜15の発明で使用する関数の実施例1−1★


Pが変数を含まない場合{
Bが事実である場合{
P=Bの場合は、真を返す。
そうでない場合は偽を返す。

Bがホーン節である場合{
Bのヘッド部が変数を含まない場合{
P=Bのヘッド部の場合は、関数D(Bのボディ部,E)の真偽を返す。
そうでない場合は偽を返す。

Bのヘッド部が変数を含む場合{
F(Bのヘッド部,P,C1)を真とする各C1について、
関数D(Bのボディ部にC1を適用したもの,E)の結果が真となるC1があれば、
真を返す。
そうでない場合は偽を返す。



Pが変数を含む場合{
Bが事実である場合{
F(P,B,C1)が真となるC1が存在すれば、そのようなすべてのC1をCに加えて真を返す。
そのようなC1が存在しなければ、偽を返す。

Bがホーン節である場合{
Bのヘッド部が変数を含まない場合{
F(P,Bのヘッド部,C1)を真とするC1が存在する場合で、かつ
関数D(Bのボディ部,E)が真であれば、そのようなすべてのC1をCに加えて真を返す。
そうでない場合は偽を返す。

Bのヘッド部が変数を含む場合{

★請求項12の発明を実施する場合★
//高速化の工夫(オプション)開始
PとBのヘッド部の頭及び尾に存在する文字数分の固定文字が一致していない場合{
偽を返す。
}//高速化の工夫(オプション)終了

★請求項13の発明の実施★
PとBのヘッド部の頭及び尾に存在する文字数分の固定文字が一致している場合{
関数D(Bのボディ部,E)の結果が真となるE中のいずれかの束縛情報Gについて、
関数F(P,Bのヘッド部をGで束縛したもの(固定文字列になるはず),C1)を真とするC1があれば
そのようなすべてのC1をCに加えて真を返す。
そのようなC1が存在しない場合は偽を返す。





■ Processing algorithm specification of one fact (fixed character string) or Horn clause B (however, all variables included in the head also exist in the body) for the query P
================================================== ================================================== =================
Function H (P: pattern including variable, B: one fact (fixed character string) or Horn clause, C: variable binding information): Example 1 of function used in inventions of claims 1 to 15 1 *

{
If P contains no variables {
If B is true {
Returns true if P = B.
Otherwise it returns false.
}
If B is a horn clause {
When the head of B does not contain a variable {
In the case of the head portion of P = B, the true / false of the function D (B body portion, E) is returned.
Otherwise it returns false.
}
When the head of B contains variables {
For each C1 in which F (head part of B, P, C1) is true,
If there is C1 for which the result of the function D (the body part of B applied with C1, E) is true,
Returns true.
Otherwise it returns false.
}
}
}
If P contains a variable {
If B is true {
If there is C1 for which F (P, B, C1) is true, add all such C1 to C and return true.
If no such C1 exists, return false.
}
If B is a horn clause {
When the head of B does not contain a variable {
If C1 with F (P, B head, C1) is true and if function D (B body, E) is true, then add all such C1 to C Returns true.
Otherwise it returns false.
}
When the head of B contains variables {

★ When carrying out the invention of claim 12 ★
// Start device for speeding up (optional) When fixed characters for P and B heads and tails do not match {
Returns false.
} // Speed-up device (option) finished

★ Implementation of Claim 13 of the Invention ★
When the fixed characters corresponding to the number of characters in the head and tail of the head part of P and B match {
For any binding information G in E for which the result of the function D (B body part, E) is true,
If there is C1 that makes the function F (the head part of P, B bound by G (should be a fixed character string), C1) true, add all such C1 to C and return true.
Returns false if no such C1 exists.
}
}
}
}
}


■ホーン節のボディ部(又は変数を共有する重文の問い合わせ)の解集合の列挙アルゴリズム仕様
=====================================================================================================================
呼出例
→関数D("$Aと$Bは友達だ,$Aは人間,$Bは人間", E);
戻り例
←真(E=((A=花子,B=太郎),(A=太郎,B=次郎),(A=次郎,B=三郎)))
=====================================================================================================================
関数D(J:ボディ部(又は変数を共有する重文の問い合わせ),E:解集合):★請求項6の発明で使用する関数の実施例1−2A★
※ただし、知識源全体Lはグローバル変数に格納して参照可能とする

1.J中の最初の文Mを取り出す。最初の文が存在しない場合真を返す。

2.知識源全体Lに対して、前記関数Q1(M,L)又はQ2(M,L)を呼び出す。
結果が偽のときは
偽を返す。
真のとき
Mが変数を含まない場合
何もしない。
Mが変数を含む場合
Mを真とするためにとりうる束縛情報の集合Cを記憶する。
※真とするために束縛不要の変数は、その旨を明示的に示すこともできる。
※束縛値が無限集合でありながら真とするために一定の条件を要求する場合は、その条件を付記することもできる。

3.J中の次の文M’を取り出す。存在しない場合、真(E=束縛情報の集合C)を返す。

4.知識源全体Lに対して、前記関数Q1(M’,L)又はQ2(M’,L)を呼び出す。
結果が偽のときは
偽を返す。
真のとき
M’が変数を含まない場合
何もしない。
M’が変数を含む場合
M’を真とするためにとりうる束縛情報の集合C’と記憶してあった集合Cとの積集合を新たなCとする。
但し、元々の集合Cが空集合でなく積集合をとって空集合となったときは偽を返す。
※真とするために束縛不要の変数は、その旨を明示的に示すこともできる。
※束縛値が無限集合でありながら真とするために一定の条件を要求する場合は、その条件を付記することもできる。

5.3に戻る。



関数D2(J:ボディ部(又は変数を共有する重文の問い合わせ),E:解集合):★請求項6の発明で使用する関数の別の実施例1−2B(関数の再帰呼び出しを用い束縛情報を他の文に波及させることにより高速化を図ったもの)★

1.J中の最初の文Mを取り出す。Mが存在しない場合真を返す。

2.知識源全体Lに対して、Q1(M,L)又はQ2(M,L)を呼び出す。
結果が偽のときは
偽を返す。
真のとき
Mが変数を含まない場合
Jの次の文がなければ真を返し
あれば次の文を新たなMとし2に戻る。
Mが変数を含む場合
Jの次の文がなければ、とりうる束縛情報をEに格納して真を返し
あればとりうる束縛情報を集合Cとして記憶する。


3.Eを空にし、集合C中の各束縛情報Kについて
再帰呼び出しD2(KによりJの次の文以降を束縛してできるボディ部J’,E’)を実行する
結果が真のときは
Eに、真となったそのKかつE’を加える

4.各Kについて一度も真となっていないときは偽を返し、一度でも真となっているときは真(E)を返す


関数D3(J:ボディ部(又は変数を共有する重文の問い合わせ),E:解集合):★請求項5の発明で使用する関数の実施例1−3★

1.J中の最初の文M1を取り出す。最初の文が存在しない場合真を返す。

2.知識源全体Lに対して、Q1(M1,L)又はQ2(M1,L)を呼び出す。
結果が偽のときは
偽を返す。
真のとき
M1が変数を含まない場合
何もしない。
M1が変数を含む場合
とりうる束縛情報の集合C1を記憶する。

3.同様に、偽とならないうちはM2,M3・・・についてC2,C3・・・を求めていく。
偽となった場合は偽を返す。

4.残ったC1,C2,C3・・・Cnについて積集合Cを求めて、真(C)を返す。



■ Specification of enumeration algorithm for solution set of body part of Horn clause (or query of heavy sentence sharing variable)
================================================== ================================================== =================
Call example-> Function D ("$ A and $ B are friends, $ A is human, $ B is human", E);
Return example ← true (E = ((A = Hanako, B = Taro), (A = Taro, B = Jiro), (A = Jiro, B = Saburo))))
================================================== ================================================== =================
Function D (J: body part (or query of heavy sentence sharing variables), E: solution set): ★ Example of function used in invention of claim 6 1-2A ★
* However, the entire knowledge source L can be stored in a global variable for reference {
1. Take the first sentence M in J. Returns true if the first sentence does not exist.

2. The function Q1 (M, L) or Q2 (M, L) is called for the entire knowledge source L.
If the result is false, return false.
When true If M does not contain a variable Do nothing.
When M includes a variable, a set C of binding information that can be taken to make M true is stored.
* Variables that do not need to be bound to be true can be explicitly indicated.
* When a certain condition is required to be true while the bound value is an infinite set, the condition can be added.

3. Take out the next sentence M ′ in J. If not, return true (E = binding information set C).

4). The function Q1 (M ′, L) or Q2 (M ′, L) is called for the entire knowledge source L.
If the result is false, return false.
When true If M 'does not contain a variable, do nothing.
When M ′ includes a variable A new set C is a product set of a set C ′ of binding information that can be taken to make M ′ true and a stored set C.
However, when the original set C is not an empty set but a product set and becomes an empty set, false is returned.
* Variables that do not need to be bound to be true can be explicitly indicated.
* When a certain condition is required to be true while the bound value is an infinite set, the condition can be added.

Return to 5.3.

}

Function D2 (J: body part (or query of heavy sentence sharing variables), E: solution set): ★ Another embodiment of the function used in the invention of claim 6 1-2B (binding using recursive function call) Speeding up by spreading information to other sentences) ★
{
1. Take the first sentence M in J. Returns true if M does not exist.

2. Q1 (M, L) or Q2 (M, L) is called for the entire knowledge source L.
If the result is false, return false.
When true If M does not contain a variable Return true if there is no statement following J. If it is true, return the next sentence as a new M and return to 2.
If M contains a variable If there is no statement following J, the possible binding information is stored in E, and if true is returned, the possible binding information is stored as a set C.


3. E is emptied, and for each binding information K in set C, recursive call D2 (body part J ', E' formed by binding the next sentence after J with K) is executed. Add that K and E 'that became true

4). Returns false if each K has never been true, returns true (E) if it has never been true}

Function D3 (J: body part (or query of heavy sentence sharing variables), E: solution set): ★ Example 1-3 of function used in invention of claim 5 ★
{
1. Take the first sentence M1 in J. Returns true if the first sentence does not exist.

2. Q1 (M1, L) or Q2 (M1, L) is called for the entire knowledge source L.
If the result is false, return false.
When true If M1 does not contain a variable Do nothing.
When M1 includes a variable, a set C1 of possible binding information is stored.

3. Similarly, C2, C3... Are obtained for M2, M3.
If false, return false.

4). The product set C is obtained for the remaining C1, C2, C3... Cn, and true (C) is returned.
}



■問い合わせPに対する事実Sの多長一致解(複数も可)の列挙アルゴリズム仕様
=====================================================================================================================
呼出例
→関数F("$Aと$Bは友達だ","太郎と次郎と三郎は友達だ", "");

関数F(P:変数を含みうるパターン,S:定数文字列,C:変数の束縛情報):★請求項2の発明(ただし、「(又は最後)」と「又は前」を省いた実現例)で使用する関数の実施例1−4A★

(準備)
1.P中の変数の種類数Vと、出現する変数の名前N1,N2,・・・を出現順に求める

(Pがもともと変数を含まない場合への対応)
2.Vが0のときは、
⇒ P=Sのとき、真を返して終了。
⇒ P≠Sのとき、偽を返して終了。

(出力)
3.Vが1のときは、N1がP中に何回出現しようとも、PとSの単一化の解R1は1つしかないので、
⇒ マッチする場合、その唯一の解を「CかつN1=R1」として出力して、真を返して終了。
⇒ マッチしない場合、偽を返して終了。
※単一化そのものは、正規表現とのマッチ(同じ変数が二度以上出現する場合は後置参照あり)として実施可能

4.Vが2以上のとき
変数N1についての最長一致解R1で、P中の全てのN1を埋めてできるP’について
再帰呼び出しF(P’,S,CかつN1=R1)を実行
⇒ N1について最長一致解とした解集合が出力される

5.R1’←R1の最後の1文字を除いた文字列とし
P中の全てのN1をR1’で埋めてできるP’’について
再帰呼び出しF(P’’,S,CかつN1=R1’)を実行
⇒ N1について、最長一致解より1文字除いた解候補R1’とした解集合が出力される

6.R1’が
1文字以上の場合、(★請求項3では最短一致解の文字数より大きい場合)
⇒R1←R1’として5に戻る。
0文字の場合、(★請求項3では最短一致解の文字数である場合)
終了。


■ Enumeration algorithm specification of multi-length coincidence solution (s) of fact S for query P
================================================== ================================================== =================
Call example-> Function F ("$ A and $ B are friends", "Taro and Jiro and Saburo are friends", "");

Function F (P: pattern that can contain variables, S: constant character string, C: variable binding information): ★ Invention of claim 2 (however, “(or last)” and “or previous” are omitted) 1-4A of the function used in
{
(Preparation)
1. The number of types V of variables in P and the names of appearing variables N1, N2,.

(Corresponding to the case where P originally does not include a variable)
2. When V is 0,
⇒ When P = S, return true and end.
⇒ If P ≠ S, return false and end.

(output)
3. When V is 1, no matter how many times N1 appears in P, there is only one solution R1 for unifying P and S.
⇒ If there is a match, output the only solution as “C and N1 = R1”, return true, and end.
⇒ If there is no match, return false and exit.
* Unification itself can be performed as a match with a regular expression (if the same variable appears more than once, there is a postscript reference)

4). When V is 2 or more Execute recursive call F (P ', S, C and N1 = R1) for P' which can fill all N1 in P with longest matching solution R1 for variable N1 ⇒ Longest for N1 A solution set that matches is output

5. R1 ′ ← R1 is a character string excluding the last character. For P ″ in which all N1s in P are filled with R1 ′, a recursive call F (P ″, S, C and N1 = R1 ′) is made. Execution ⇒ For N1, a solution set is output as a solution candidate R1 ′ obtained by removing one character from the longest matching solution

6). When R1 'is 1 character or more (In case of ★ 3, the number of characters of the shortest matching solution is larger)
⇒ Return to 5 as R1 ← R1 '.
In the case of 0 characters (in the case of the number of characters of the shortest matching solution in claim 3)
End.
}


関数F(P:変数を含みうるパターン,S:定数文字列,C:変数の束縛情報):★請求項4の発明で使用する関数の実施例1−4B★
//P中で変数が最初に出現した直後の固定文字列の最初の文字Cに着目して高速化の工夫その1をした関数F

(準備)
1.P中の変数の種類数Vと、出現する変数の名前N1,N2,・・・を出現順に求める

(Pがもともと変数を含まない場合への対応)
2.Vが0のときは、
⇒ P=Sのとき、真を返して終了。
⇒ P≠Sのとき、偽を返して終了。

(出力)
3.Vが1のときは、N1がP中に何回出現しようとも、PとSの単一化の解R1は1つしかないので、
⇒ マッチする場合、その唯一の解を「CかつN1=R1」として出力して、TRUEを返して終了。
⇒ マッチしない場合、偽を返して終了。

4.(高速化の工夫その2。この処理は5以降でカバーされるため省いてもよい。★この工夫2は、請求項にはしていない★)
Vが2以上のときで、
すべての変数(N1(=N),N2,・・・)について最長一致モードでマッチしてみた解と
すべての変数(N1(=N),N2,・・・)について最短一致モードでマッチしてみた解と
が同一(N1=R1,N2=R2,・・・)のとき
⇒ その唯一の解を「CかつN1=R1かつN2=R2かつ・・・」として出力して終了する
そもそもマッチしなかった場合、
⇒ 偽を返して終了。
同一でないとき
⇒ 5に続く

5.Vが2以上のとき
変数N1についての最長一致解R1で、P中の全てのN1を埋めてできるP’について
再帰呼び出しF(P’,S,CかつN1=R1)を実行
⇒ N1について最長一致解とした解集合が出力される

6.P中で変数N1の後すぐに
変数N1(自分自身)が続くとき
⇒ 7以降で処理する
別の変数N2が続くとき
⇒ 7以降で処理する(ただし、7で1文字CはN2の解R2の最初の1文字とする)
固定文字が続くとき
⇒ 7以降で処理する

7.P中で変数N1が最初に出現した直後の固定文字である1文字C(直後が別の変数N2であるときはR2の最初の1文字C)が
最長一致解R1に含まれる場合
⇒ 1)R1’←R1の文字列の最後からそのCにあたるまでの部分文字列を削除した文字列
⇒ 2)P’’←R1’でP中のすべてのNを埋めてできるパターン
⇒ 3)再帰呼び出しF(P’’,S,CかつN1=R1’)を実行
⇒N1について一段階だけ短めの解が存在すれば出力できるはず
最長一致解R1に含まれない場合
⇒ N1についてはより短い解の列挙が終わったので、終了。

8.R1←R1’として7に戻る。


=====================================================================================================================

Function F (P: pattern that can include a variable, S: constant character string, C: variable binding information): Example 1-4B of a function used in the invention of claim 4
// Function F with the first device for speeding up, focusing on the first character C in the fixed character string immediately after the variable first appears in P
{
(Preparation)
1. The number of types V of variables in P and the names of appearing variables N1, N2,.

(Corresponding to the case where P originally does not include a variable)
2. When V is 0,
⇒ When P = S, return true and end.
⇒ If P ≠ S, return false and end.

(output)
3. When V is 1, no matter how many times N1 appears in P, there is only one solution R1 for unifying P and S.
⇒ If there is a match, output the only solution as “C and N1 = R1”, return TRUE and end.
⇒ If there is no match, return false and exit.

4). (Device 2 for speeding up. This process may be omitted since it is covered by 5 or later. ★ Device 2 is not claimed)
When V is 2 or more,
Match all the variables (N1 (= N), N2,...) In the longest match mode and match all variables (N1 (= N), N2,...) In the shortest match mode. If the solution you tried is the same (N1 = R1, N2 = R2,...) ⇒ Output the only solution as “C and N1 = R1 and N2 = R2 and. If not,
⇒ Return false and finish.
If not identical ⇒ Continue to 5

5. When V is 2 or more Execute recursive call F (P ', S, C and N1 = R1) for P' which can fill all N1 in P with longest matching solution R1 for variable N1 ⇒ Longest for N1 A solution set that matches is output

6). When variable N1 (self) continues immediately after variable N1 in P ⇒ Process after 7 When another variable N2 follows ⇒ Process after 7 (However, in 7 one character C is the solution of N2 R2 The first character of
When fixed characters continue ⇒ Process after 7

7). When the longest matching solution R1 contains 1 character C, which is a fixed character immediately after the first occurrence of variable N1 in P (or the first character C of R2 when it is another variable N2 immediately after) 1) R1 '← R1 character string from which the partial character string from the end of the character string to the C is deleted ⇒ 2) Pattern that can be filled with all N in P with P''←R1' ⇒ 3) Recursive call F (P ″, S, C and N1 = R1 ′)
⇒ Should be output if there is a short solution for N1, if it is not included in the longest matching solution R1 ⇒ Since N1 has finished enumerating shorter solutions, it ends.

8). Return to 7 as R1 ← R1 ′.
}

================================================== ================================================== =================

本発明は、中学校前後から大人までにおける述語論理学自体の教育、一般の知識・情報の整理・交換・共有、事実(主張も含む)とルールからなる集合(哲学やマインドセット)の妥当性の検証に用いることができる。   The present invention teaches predicate logic itself from junior high school to adults, organizes, exchanges and shares general knowledge and information, and the validity of a set (philosophy and mindset) consisting of facts (including claims) and rules. Can be used for verification.

1 コンテンツ管理装置
2 利用者PC又は利用者兼管理者PC
3 本発明によるプログラム
4 コンテンツデータ(ルールや事実の集合)
1 Content management device 2 User PC or user / administrator PC
3 Program according to the present invention 4 Content data (a set of rules and facts)

Claims (29)

コンピュータが、論理型プログラミング言語PROLOGの機能の一部又は全部を自動的に行う方法であって、
人間が、PROLOGにおける「事実」、「ルール」又は「ゴール」の入力にあたり、PROLOGにおける「リテラル」にあたる内容(以降、「文」と呼ぶ)の定数部分と変数部分とを文字種、デリミタ又はエスケープ文字により区別してコンピュータに入力すること、
コンピュータが、文の主部、述部、主語、述語、目的語、補語、連用修飾語、連体修飾語又は文の境界をまたがりうるものとして変数を取扱いながら、上記「事実」、「ルール」又は「ゴール」の入力に含まれる文の自動単一化処理、自動導出処理又はその両方を行うこと、
を特徴とする処理方法。
A method in which a computer automatically performs part or all of the functions of a logic programming language PROLOG,
When a human inputs "facts", "rules", or "goals" in PROLOG, the constant part and the variable part of the content (hereinafter referred to as "sentence") in PROLOG are referred to as the character type, delimiter or escape character. According to the input to the computer,
While the computer treats the variable as a sentence main part, predicate, subject, predicate, object, complement, conjunctive modifier, conjunctive modifier, or something that can cross sentence boundaries, the above "facts", "rules" or Performing automatic unification processing, automatic derivation processing, or both of sentences included in the input of “goal”;
A processing method characterized by the above.
前記自動単一化処理において、
変数を含みうる文であるパターン(定数部分と変数部分とを文字種、デリミタ又はエスケープ文字により区別したもの)と、変数を含まない文である定数文字列との単一化を、
パターン(例:$Xと$Yは$Zが好き)に最初(又は最後)に出現する変数(例:$X)の最長一致解(例:太郎と次郎)を求めて、該最長一致解の文字列を後ろ(又は前)から空文字になるまで削る過程(例:太郎と次郎>太郎と次>太郎と>太郎>太>空)を該パターンに代入してできる各新たなパターン(例:「太郎と次郎と$Yは$Zが好き」>「太郎と次と$Yは$Zが好き」>「太郎とと$Yは$Zが好き」>「太郎と$Yは$Zが好き」>「太と$Yは$Zが好き」>「と$Yは$Zが好き」)について、該新たなパターンができる前提となった削る過程の解の各状態($X=太郎と次郎>太郎と次>太郎と>太郎>太>空)をそれぞれ記憶しながら、
再帰的に同様に変数がなくなるまで繰り返し、
変数がなくなったときに単一化した各途中の解の状態(例:真($X=太郎と次郎,$Y=三郎),真($X=太郎,$Y=次郎と三郎))を結合して各単一化の答え(例:答え1=($X=太郎と次郎,$Y=三郎),答え2=($X=太郎,$Y=次郎と三郎)を得ることを特徴とする
請求項1に記載の処理方法。
In the automatic unification process,
Unification of a pattern that can contain variables (constant part and variable part separated by character type, delimiter or escape character) and constant string that is a sentence that does not contain variables.
Find the longest matching solution (eg Taro and Jiro) of the variable (eg $ X) that appears first (or last) in the pattern (eg $ X and $ Y like $ Z) Each new pattern (eg, Taro and Jiro> Taro and Next> Taro and>Taro>Taro> Sky) is substituted into the pattern by cutting the character string from the back (or front) until it becomes an empty character (example: : "Taro and Jiro and $ Y like $ Z">"Taro and next and $ Y like $ Z">"Taro and $ Y like $ Z">"Taro and $ Y like $ Z ”>“ Thick and $ Y like $ Z ”and“ and $ Y like $ Z ”), each state of the solution of the scraping process ($ X = Taro and Jiro> Taro and Next> Taro and>Taro>Tha> Sky)
Repeat recursively until there are no more variables,
The state of each intermediate solution that is unified when there are no more variables (eg, true ($ X = Taro and Jiro, $ Y = Saburo), true ($ X = Taro, $ Y = Jiro and Saburo)) Combined to obtain each unification answer (example: answer 1 = ($ X = Taro and Jiro, $ Y = Saburo), answer 2 = ($ X = Taro, $ Y = Jiro and Saburo)) The processing method according to claim 1.
空文字になるまで徐々に削るかわりに、別途求めた最短一致解までしか徐々に削らないことを特徴とする
請求項2に記載の処理方法。
The processing method according to claim 2, wherein instead of gradually cutting until an empty character is reached, only the shortest matching solution obtained separately is gradually cut.
空文字になるまで徐々に削る際、
パターン中で該変数が最初(又は最後)に出現した直後(又は直前)の固定文字である1文字C(直後(又は直前)が別の変数でその解が空文字でないときは該別の変数に解候補として代入されている解候補の最初(又は最後)の1文字C)が該最長一致解に含まれる場合に、
該最長一致解の文字列の最後(又は最初)からそのCに最初にあたるまでの部分文字列をそのCを含め削ることを特徴とする
請求項2又は3に記載の処理方法。
When scraping gradually until it becomes an empty character,
1 character C (immediately after (or immediately before)) is another variable immediately after (or immediately before) the variable appears first (or last) in the pattern. When the first (or last) character C) of the solution candidate assigned as the solution candidate is included in the longest matching solution,
The processing method according to claim 2 or 3, wherein a partial character string from the last (or first) of the character string of the longest matching solution to the first corresponding to the C is deleted including the C.
前記自動単一化処理又は自動導出処理において、
前記「ゴール」(「サブゴール」を含む。以下同じ)となる束縛情報を求める際、
該「ゴール」を構成する各文について独立して束縛情報を求め
各束縛情報の積集合が空でない場合に戻り値真とその積集合を返す
請求項1から4のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When obtaining binding information for the “goal” (including “subgoal”, the same applies hereinafter)
5. The binding information is independently obtained for each sentence constituting the “goal”, and the return value true and the product set are returned when the product set of the binding information is not empty. 5. Processing method.
前記自動単一化処理又は自動導出処理において、
前記「ゴール」となる束縛情報を求める際、
既存の束縛情報を最初に空とし、
「ゴール」が含む文集合を、既存の束縛情報の適用下で該一文が真となりうるかと該なりうるための追加の束縛情報について自動計算して該追加の束縛情報を該既存の束縛情報に加えながら該一文を除いて再帰的に小さくしていき、
真となりうるまま該文集合が空集合になったときの既存の束縛情報を「ゴール」となる束縛情報とする
請求項1から4のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When seeking binding information to be the “goal”,
Empty the existing binding information first,
The sentence set included in the “goal” is automatically calculated with respect to whether or not the sentence can be true under the application of the existing binding information, and additional binding information for the sentence, and the additional binding information is converted into the existing binding information. While adding this sentence, recursively reduce it,
The processing method according to any one of claims 1 to 4, wherein the existing binding information when the sentence set becomes an empty set while being true is used as binding information that becomes a "goal".
前記自動単一化処理又は自動導出処理において、
変数を含まないパターンと変数を含まない事実との単一化を行う場合、
パターンと事実が文字列として一致する場合に真を返す、又は
パターンと事実が文字列として一致しない場合に偽を返す
請求項1から6のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
If you want to unify a pattern that does not contain a variable with a fact that does not contain a variable,
The processing method according to any one of claims 1 to 6, wherein true is returned when the pattern and fact match as a character string, or false is returned when the pattern and fact do not match as a character string.
前記自動単一化処理又は自動導出処理において、
変数を含まないパターンとホーン節の変数を含まないヘッド部との単一化を行う場合、
パターンとヘッド部が文字列として一致する場合に、該ホーン節のボディ部をサブゴールとして請求項5又は6に記載の処理方法を適用した結果を返し、
一致しない場合に偽を返す
請求項1から7のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When unifying a pattern that does not include a variable and a head that does not include a horn clause variable,
When the pattern and the head portion are matched as a character string, the result of applying the processing method according to claim 5 or 6 is returned with the body portion of the horn clause as a subgoal,
The processing method according to any one of claims 1 to 7, wherein false is returned when they do not match.
前記自動単一化処理又は自動導出処理において、
変数を含まないパターンと変数を含むヘッド部をもつホーン節との単一化を行う場合、
請求項2から4のいずれか一項に記載の処理方法における「定数文字列」として当該パターンを用いかつ同処理方法における「パターン」として当該ヘッド部を用いて処理して求めた各束縛情報について、
当該ホーン節のボディ部に適用したものを請求項5又は6に記載の処理方法の「サブゴール」として処理した結果が真となるものが存在すれば真を返す、又は
存在しなければ偽を返す
請求項1から8のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When unifying a pattern that does not contain a variable and a horn clause that has a head that contains a variable,
Each binding information obtained by processing using the pattern as a "constant character string" in the processing method according to any one of claims 2 to 4 and using the head unit as a "pattern" in the processing method ,
Returns true if there is a true result of processing as a “subgoal” of the processing method according to claim 5 or 6 when applied to the body part of the horn clause, or returns false if it does not exist The processing method according to any one of claims 1 to 8.
前記自動単一化処理又は自動導出処理において、
変数を含むパターンと変数を含まない事実との単一化を行う場合、
請求項2から4のいずれか一項に記載の処理方法における「パターン」として当該パターンを用いかつ同処理方法における「定数文字列」として当該事実を用いて処理した結果を返す、
請求項1から9のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When unifying a pattern that contains a variable with a fact that does not contain a variable,
A result of processing using the pattern as a “pattern” in the processing method according to claim 2 and using the fact as a “constant character string” in the processing method is returned.
The processing method according to any one of claims 1 to 9.
前記自動単一化処理又は自動導出処理において、
変数を含むパターンと変数を含まないヘッド部をもつホーン節との単一化を行う場合、
請求項2から4のいずれか一項に記載の処理方法における「パターン」として当該パターンを用いかつ同処理方法における「定数文字列」として当該ヘッド部を用いて処理した結果を真とする束縛情報(C)が存在する場合で、かつ、当該ホーン節のボディ部を請求項5又は6に記載の処理方法の「サブゴール」として処理した結果が真の場合に当該束縛情報(C)とともに真を返す、
請求項1から10のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When unifying a pattern containing a variable and a horn clause with a head that does not contain a variable,
Binding information that uses the pattern as a "pattern" in the processing method according to any one of claims 2 to 4 and that uses the head portion as a "constant character string" in the processing method to make the result true If (C) is present, and if the result of processing the body part of the horn clause as a “subgoal” of the processing method according to claim 5 or 6 is true, true with the binding information (C) return,
The processing method according to any one of claims 1 to 10.
前記自動単一化処理又は自動導出処理において、
変数を含むパターンと変数を含むヘッド部をもつホーン節との単一化を行う場合、
パターンとヘッド部の頭、尾又は両方に存在する文字数分の固定文字が一致していない場合に偽を返す、
請求項1から11のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When unifying a pattern containing variables and a horn clause with a head containing variables,
Returns false if the pattern does not match the number of fixed characters in the head, head or both of the head part,
The processing method according to any one of claims 1 to 11.
前記自動単一化処理又は自動導出処理において、
変数を含む第一のパターンと変数を含むヘッド部をもつホーン節との単一化を行う場合、
パターンとヘッド部の頭及び尾に存在する文字数分の固定文字が一致している場合、
請求項5又は6に記載の処理方法における「サブゴール」として当該ホーン節のボディ部を適用した結果が真となる各束縛情報により当該ホーン節のヘッド部を束縛して得られる各第二のパターンについて、
第二のパターンが変数を含まない場合に、
請求項2から4のいずれか一項に記載の処理方法における「パターン」として第一のパターンを用いかつ同処理方法における「定数文字列」として第二のパターンを用いて処理した結果を返す、
請求項1から12のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When unifying the first pattern containing variables and the horn clause with the head containing variables,
If the pattern and the fixed characters for the number of characters in the head and tail of the head part match,
Each 2nd pattern obtained by constraining the head part of the said horn clause by each constraining information in which the result of applying the body part of the said horn clause is true as a "subgoal" in the processing method according to claim 5 or 6 about,
If the second pattern contains no variables,
A result of processing using the first pattern as the “pattern” in the processing method according to claim 2 and using the second pattern as the “constant character string” in the processing method is returned.
The processing method according to any one of claims 1 to 12.
変数を含む事実が入力されることをコンピュータが制限することを特徴とする
請求項1から13のいずれか一項に記載の処理方法。
The processing method according to claim 1, wherein the computer restricts input of facts including variables.
前記ルールがいわゆるホーン節と同様の形式であり、ヘッド部がボディ部に出現しない変数を含むことをコンピュータが制限することを特徴とする
請求項1から14のいずれか一項に記載の処理方法。
The processing method according to any one of claims 1 to 14, wherein the rule is in a format similar to a so-called horn clause, and the computer restricts that the head portion includes a variable that does not appear in the body portion. .
前記自動単一化処理又は自動導出処理において、
束縛されない変数が互いに残っているパターンとヘッド部又は事実との自動単一化処理を、
固定文字列として極小となる解の集合を求めて返すことにより行うことを特徴する、
請求項1から13のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
Automatic unification of patterns and heads or facts with unbound variables remaining in each other,
It is performed by obtaining and returning a set of minimal solutions as a fixed character string,
The processing method according to any one of claims 1 to 13.
前記自動単一化処理又は自動導出処理において、
束縛されない変数が互いに残っているパターンとヘッド部又は事実との自動単一化処理を、
変数を含む文字列として極小となる解の集合を求めて返すことにより行うことを特徴する、
請求項1から13のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
Automatic unification of patterns and heads or facts with unbound variables remaining in each other,
It is performed by obtaining and returning a minimal solution set as a character string including variables,
The processing method according to any one of claims 1 to 13.
束縛されない変数が互いに残っているパターンとヘッド部又は事実との各文字列の頭及び尾に共通して存在する文字数分の固定文字が一致していない場合、
偽を返すことを特徴とする、
請求項16又は17に記載の処理方法。
If the fixed characters for the number of characters that exist in common at the beginning and tail of each character string in the pattern and the head part or the fact that the unbound variables remain in each other do not match,
It is characterized by returning false,
The processing method according to claim 16 or 17.
前記固定文字列又は変数を含む文字列として極小となる解の集合を求める際、
束縛されない変数が互いに残っているパターンとヘッド部又は事実とからなる両文字列(第一の文字列と第二の文字列とする)に含まれる各変数が、各文字列内では共通に束縛され、文字列間では独立に束縛されるものとしながら(あるいは、同名変数を共通に束縛するスコープを各文字列内のみ(あるいは、文字列間は変数のスコープ外)としながら)、
各変数に相手の文字列(第一の文字列中の変数には第二の文字列、第二の文字列中の変数には第一の文字列)のあらゆる部分文字列(<空>及び文字列全体も含む)又は自分自身を代入してみて両文字列が一致する場合を探す全探索により極小となる解の集合を求めることを特徴する、
請求項16又は17に記載の処理方法。
When obtaining a set of solutions that are minimal as a character string including the fixed character string or variable,
Variables included in both character strings (the first character string and the second character string) consisting of the pattern and the head part or the fact that unbound variables remain in each other are commonly bound in each character string. And while being bound independently between strings (or while the scope that binds the same name variable in common is only within each string (or between the strings is outside the scope of the variable))
For each variable, any substring (<empty>) and the other character string (the second character string for the variable in the first character string, the first character string for the variable in the second character string) (Including the entire character string), or by substituting itself and searching for a case where both character strings match, a search for a minimal solution is obtained by a full search,
The processing method according to claim 16 or 17.
束縛されない変数が互いに残っているパターンとヘッド部又は事実とからなる両文字列そのものではなく、
束縛されない変数が互いに残っているパターンとヘッド部又は事実との各文字列の頭及び尾に共通して存在する文字数分の固定文字を両者から除いて残る二つの文字列に相当する両文字列について、
請求項19に記載の処理をする処理方法。
It is not both strings consisting of patterns and heads or facts where unbound variables remain in each other,
Both character strings corresponding to the two character strings remaining after removing the fixed characters corresponding to the number of characters existing in common at the head and tail of each character string of the pattern and the head part or the fact that the variables that remain unbound remain. about,
A processing method for performing the processing according to claim 19.
各変数に相手の文字列のあらゆる部分文字列(<空>及び文字列全体も含む)又は自分自身を代入してみて両文字列が一致する場合を探す全探索により極小となる解の集合を求める際、
変数に代入する部分文字列に変数が含まれる場合に、当該部分文字列に含まれる変数を両文字列にそれまで存在しなかった新しい変数で置き換えながら、該新しい変数に対しての同様の代入も以後再帰的に行いながら両文字列が一致する場合を探す全探索を行うことを特徴とする、
請求項19又は20に記載の処理方法。
Substitute all the substrings (including <empty> and the whole string) of the other party's character string for each variable, or try to find a case where both character strings match, and find a minimal set of solutions by full search When seeking
When a variable is included in a substring to be assigned to a variable, the same assignment to the new variable is performed while replacing the variable included in the substring with a new variable that did not exist in both strings. Is also performed recursively thereafter to perform a full search to find a case where both character strings match,
The processing method according to claim 19 or 20.
変数に代入した結果についても、各文字列の頭及び尾に共通して存在する文字数分の固定文字を両者から除いて残る二つの文字列を、
「相手の文字列のあらゆる部分文字列(<空>及び文字列全体も含む)」の対象となるの「相手の文字列」として、探索が進むごとに、文字列の頭又は尾に存在する固定文字数が少なくすることを特徴とする、
請求項19〜21のいずれか一項に記載の処理方法。
As for the result assigned to the variable, the two character strings remaining by removing the fixed characters corresponding to the number of characters existing in common at the head and tail of each character string,
Each time the search progresses, it is present at the head or tail of the character string as the “other character string” that is the target of “any substring of the other character string (including <empty>” and the entire character string). Featuring fewer fixed characters,
The processing method according to any one of claims 19 to 21.
前記固定文字列又は変数を含む文字列として極小となる解の集合を求める際、
束縛されない変数が互いに残っているパターンとヘッド部又は事実とからなる両文字列(第一の文字列と第二の文字列とする)に含まれる各変数が、各文字列内では共通に束縛され、文字列間では独立に束縛されるものとしながら(あるいは、同名変数を共通に束縛するスコープを各文字列内のみ(あるいは、文字列間は変数のスコープ外)としながら)、
各変数に、固定文字列(空文字を含む)又は変数を含む文字列を再帰的に代入してみて解の集合を求める処理方法であって、
代入してみる変数を相手文字列の頭又は尾が固定文字である自文字列の対応する頭又は尾の変数に限定し、
代入値を、該頭である場合には該頭の固定文字もしくは固定文字列に続く新しい変数又は<空>とし、該尾である場合には新しい変数に続く該尾の固定文字もしくは固定文字列又は<空>とし、
変数に代入した結果について、各文字列の頭及び尾に共通して存在する文字数分の固定文字を両者から除くことを繰り返す、
ことを特徴とする請求項16又は17に記載の処理方法。
When obtaining a set of solutions that are minimal as a character string including the fixed character string or variable,
Variables included in both character strings (the first character string and the second character string) consisting of the pattern and the head part or the fact that unbound variables remain in each other are commonly bound in each character string. And while being bound independently between strings (or while the scope that binds the same name variable in common is only within each string (or between the strings is outside the scope of the variable))
A processing method for obtaining a set of solutions by recursively assigning a fixed character string (including an empty character) or a character string including a variable to each variable,
Limit the variable to be substituted to the corresponding head or tail variable of the subject string whose head or tail is a fixed character,
The substitution value is a new variable or <empty> following the initial fixed character or fixed character string if it is the head, or the fixed character or fixed character string following the new variable if it is the tail. Or <empty>
For the result of assigning to the variable, it is repeated to remove the fixed number of characters common to the head and tail of each character string from both,
The processing method according to claim 16 or 17, characterized in that:
前記固定文字列又は変数を含む文字列として極小となる解の集合を求める際、
束縛されない変数が互いに残っているパターンとヘッド部又は事実とからなる両文字列(第一の文字列と第二の文字列とする)に含まれる各変数が、各文字列内では共通に束縛され、文字列間では独立に束縛されるものとしながら(あるいは、同名変数を共通に束縛するスコープを各文字列内のみ(あるいは、文字列間は変数のスコープ外)としながら)、
各変数に、固定文字列(空文字を含む)を再帰的に代入してみて解の集合を求める処理方法であって、
各文字列の頭及び尾に存在する文字数分の共通する固定文字を除いてできる両文字列中の固定文字種(変数の識別子やデリミタを除いた文字種)だけを用いてできる束縛情報を、束縛する値の文字列長の合計が小さいものから順に列挙していくことにより求める、
請求項16又は17に記載の処理方法。
When obtaining a set of solutions that are minimal as a character string including the fixed character string or variable,
Variables included in both character strings (the first character string and the second character string) consisting of the pattern and the head part or the fact that unbound variables remain in each other are commonly bound in each character string. And while being bound independently between strings (or while the scope that binds the same name variable in common is only within each string (or between the strings is outside the scope of the variable))
A processing method for recursively assigning a fixed character string (including an empty character) to each variable to obtain a set of solutions,
Binds binding information that can be generated using only fixed character types (character types excluding variable identifiers and delimiters) in both character strings that can be generated by removing common fixed characters for the number of characters existing at the beginning and tail of each character string. Obtained by enumerating in order from the smallest total string length of values.
The processing method according to claim 16 or 17.
求めた「変数を含む文字列として極小となる解の集合」をもとに、
当該ホーン節の変数を当該変数を含む文字列で一時的に書き換えてできるホーン節により探索を継続する請求項19〜24に記載の処理方法。
Based on the calculated “a set of solutions that are minimal as strings containing variables”
The processing method according to any one of claims 19 to 24, wherein the search is continued by a horn clause that can be temporarily rewritten by a character string including the variable.
求めた「変数を含む文字列として極小となる解の集合」をもとに、
「変数を含む文字列」の変数部分に、当該「変数を含む事実」の解組の集合としてあらかじめ定義された固定文字列組の集合の各要素を代入してできる固定文字列組の集合を返す、
請求項19〜25のいずれか一項に記載の処理方法。
Based on the calculated “a set of solutions that are minimal as strings containing variables”
A set of fixed character string sets made by substituting each element of the set of fixed character string sets defined in advance as a set of solution sets of the “facts including variables” to the variable portion of “character strings including variables” return,
The processing method according to any one of claims 19 to 25.
前記自動単一化処理又は自動導出処理において、
変数を含む第一のパターンと変数を含む第二のパターンとの自動単一化を行う場合、
両パターンの頭及び尾に存在する文字数分の固定文字が一致しており、かつ、同じ変数が各パターン内で一度しか出現しない場合、
無限個の解の存在を意味する情報を返す、
請求項1から26のいずれか一項に記載の処理方法。
In the automatic unification process or automatic derivation process,
When performing automatic unification of a first pattern containing variables and a second pattern containing variables:
If the fixed characters for the number of characters in the head and tail of both patterns match and the same variable appears only once in each pattern,
Returns information indicating the existence of an infinite number of solutions,
The processing method according to any one of claims 1 to 26.
請求項1から27のいずれか一項の方法を実行するための装置。   28. Apparatus for carrying out the method of any one of claims 1 to 27. 請求項1から27のいずれか一項の方法をコンピュータに実行させるためのコンピュータプログラム。   A computer program for causing a computer to execute the method according to any one of claims 1 to 27.
JP2013087008A 2013-04-17 2013-04-17 Method, apparatus and computer program for processing knowledge and information Expired - Fee Related JP6263858B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013087008A JP6263858B2 (en) 2013-04-17 2013-04-17 Method, apparatus and computer program for processing knowledge and information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013087008A JP6263858B2 (en) 2013-04-17 2013-04-17 Method, apparatus and computer program for processing knowledge and information

Publications (2)

Publication Number Publication Date
JP2014211725A true JP2014211725A (en) 2014-11-13
JP6263858B2 JP6263858B2 (en) 2018-01-24

Family

ID=51931454

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013087008A Expired - Fee Related JP6263858B2 (en) 2013-04-17 2013-04-17 Method, apparatus and computer program for processing knowledge and information

Country Status (1)

Country Link
JP (1) JP6263858B2 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016071942A1 (en) * 2014-11-05 2016-05-12 株式会社マルセイ Method for processing knowledge or information, device, and computer program
JP2017130070A (en) * 2016-01-20 2017-07-27 株式会社マルセイ Method, computer program, and device for computer to infer by dialog
JP2018032275A (en) * 2016-08-25 2018-03-01 ナレルシステム株式会社 Method, computer program and device for processing logic program that allows character string including variable as literal
JP2018060298A (en) * 2016-10-03 2018-04-12 ナレルシステム株式会社 Computer program, apparatus, and method for output based on text
US10073838B2 (en) 2016-02-12 2018-09-11 Wipro Limited Method and system for enabling verifiable semantic rule building for semantic data
JP2018190180A (en) * 2017-05-03 2018-11-29 ナレルシステム株式会社 Method, computer program and device for processing knowledge expression

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61279928A (en) * 1985-06-05 1986-12-10 Agency Of Ind Science & Technol Parallel processing system for prolog program
JPH10320408A (en) * 1997-05-19 1998-12-04 Meidensha Corp And/or attribute retrieving method and character string comparing method for data base system
JP2001306614A (en) * 2000-04-20 2001-11-02 Omron Corp Character, string retrieving method and character string retrieving device using the same method
JP2006024045A (en) * 2004-07-08 2006-01-26 Knowrel System Inc Inferring method, inferring system, and computer program thereof
JP2006259919A (en) * 2005-03-15 2006-09-28 Fuji Xerox Co Ltd Device for supporting input of character string

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS61279928A (en) * 1985-06-05 1986-12-10 Agency Of Ind Science & Technol Parallel processing system for prolog program
JPH10320408A (en) * 1997-05-19 1998-12-04 Meidensha Corp And/or attribute retrieving method and character string comparing method for data base system
JP2001306614A (en) * 2000-04-20 2001-11-02 Omron Corp Character, string retrieving method and character string retrieving device using the same method
JP2006024045A (en) * 2004-07-08 2006-01-26 Knowrel System Inc Inferring method, inferring system, and computer program thereof
JP2006259919A (en) * 2005-03-15 2006-09-28 Fuji Xerox Co Ltd Device for supporting input of character string

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
有川節夫: "機械学習から機械発見へ", 人工知能学会誌, vol. 第11巻,第6号, JPN6017009804, 1 November 1996 (1996-11-01), JP, pages 865 - 873, ISSN: 0003523313 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016071942A1 (en) * 2014-11-05 2016-05-12 株式会社マルセイ Method for processing knowledge or information, device, and computer program
JP2017130070A (en) * 2016-01-20 2017-07-27 株式会社マルセイ Method, computer program, and device for computer to infer by dialog
US10073838B2 (en) 2016-02-12 2018-09-11 Wipro Limited Method and system for enabling verifiable semantic rule building for semantic data
JP2018032275A (en) * 2016-08-25 2018-03-01 ナレルシステム株式会社 Method, computer program and device for processing logic program that allows character string including variable as literal
JP2018060298A (en) * 2016-10-03 2018-04-12 ナレルシステム株式会社 Computer program, apparatus, and method for output based on text
JP7020659B2 (en) 2016-10-03 2022-02-16 ナレルシステム株式会社 Computer programs, devices and methods to output based on text
JP2018190180A (en) * 2017-05-03 2018-11-29 ナレルシステム株式会社 Method, computer program and device for processing knowledge expression
JP7313646B2 (en) 2017-05-03 2023-07-25 ナレルシステム株式会社 Method, computer program and apparatus for processing knowledge representation

Also Published As

Publication number Publication date
JP6263858B2 (en) 2018-01-24

Similar Documents

Publication Publication Date Title
US10496749B2 (en) Unified semantics-focused language processing and zero base knowledge building system
Duma et al. Generating natural language from linked data: Unsupervised template extraction
US10332012B2 (en) Knowledge driven solution inference
JP6263858B2 (en) Method, apparatus and computer program for processing knowledge and information
Borsje et al. Semi-automatic financial events discovery based on lexico-semantic patterns
Verbruggen et al. Semantic programming by example with pre-trained models
CN111382571A (en) Information extraction method, system, server and storage medium
Schouten et al. Heracles: A framework for developing and evaluating text mining algorithms
Chen et al. Data extraction via semantic regular expression synthesis
Potoniec et al. Swift linked data miner: Mining OWL 2 EL class expressions directly from online RDF datasets
Feuto et al. Domain specific language based on the SBVR standard for expressing business rules
JP7239959B2 (en) Method, computer program and apparatus for automatically synthesizing ideas from natural language text
WO2016071942A1 (en) Method for processing knowledge or information, device, and computer program
Pinto et al. Lessons from building stackspot ai: A contextualized ai coding assistant
JP6924461B2 (en) How to process logical programs that allow strings containing variables as literals, computer programs and devices
Sevilla et al. Enriched semantic graphs for extractive text summarization
JP2017102628A (en) Method for processing knowledge and information, computer program for the same, and processing device
Schüller Adjudication of coreference annotations via answer set optimisation
JP6905729B2 (en) Search pruning methods, computer programs and equipment
Emani et al. Improving open information extraction for semantic web tasks
WO2020026229A2 (en) Proposition identification in natural language and usage thereof
Razorenov et al. A new formal approach to semantic parsing of instructions and to file manager design
JP2017111411A (en) Method for education, study or research, computer program for the same and processor
Zhou et al. Building a process description repository with knowledge acquisition
Wang et al. A Method for Automatic Code Comment Generation Based on Different Keyword Sequences

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160418

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20160704

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170411

A601 Written request for extension of time

Free format text: JAPANESE INTERMEDIATE CODE: A601

Effective date: 20170610

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170613

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: 20171121

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20171204

R150 Certificate of patent or registration of utility model

Ref document number: 6263858

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees