[go: up one dir, main page]

JP7048032B2 - Data generator, data generation method, and program - Google Patents

Data generator, data generation method, and program Download PDF

Info

Publication number
JP7048032B2
JP7048032B2 JP2019026737A JP2019026737A JP7048032B2 JP 7048032 B2 JP7048032 B2 JP 7048032B2 JP 2019026737 A JP2019026737 A JP 2019026737A JP 2019026737 A JP2019026737 A JP 2019026737A JP 7048032 B2 JP7048032 B2 JP 7048032B2
Authority
JP
Japan
Prior art keywords
node
decomposition
data
sdd
graph structure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2019026737A
Other languages
Japanese (ja)
Other versions
JP2020135305A (en
Inventor
健吾 中村
正彬 西野
周平 伝住
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.)
University of Tokyo NUC
NTT Inc
NTT Inc USA
Original Assignee
Nippon Telegraph and Telephone Corp
University of Tokyo NUC
NTT Inc USA
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 Nippon Telegraph and Telephone Corp, University of Tokyo NUC, NTT Inc USA filed Critical Nippon Telegraph and Telephone Corp
Priority to JP2019026737A priority Critical patent/JP7048032B2/en
Publication of JP2020135305A publication Critical patent/JP2020135305A/en
Application granted granted Critical
Publication of JP7048032B2 publication Critical patent/JP7048032B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

本発明は、論理関数をコンパクトかつ扱いやすい形で表現する知識コンパイレーションに関連するものである。 The present invention relates to a knowledge composition that expresses a logical function in a compact and easy-to-use form.

知識コンパイレーションとは、論理関数をコンパクトかつ扱いやすい形で表現する手法に関する分野である。ここで「扱いやすい」というのは、その表現形の下で、論理関数に関する問い合わせ(以下、クエリとよぶ)や、他の論理関数との論理演算が高速にできる、という意味である。 Knowledge compilation is a field related to methods for expressing logical functions in a compact and easy-to-use form. Here, "easy to handle" means that a query related to a logical function (hereinafter referred to as a query) and a logical operation with another logical function can be performed at high speed under the expression form.

このような表現形は、集積回路の論理設計や検証で昔から用いられている他、ベイジアンネットワークによる確率推論や、通信ネットワークの信頼性の最大化など数理最適化にも用いられる。そのような表現形は多数提案されているが、中でも非特許文献1の項分岐決定図(Sentential Decision Diagram、以下SDDとよぶ)は、コンパクトさと扱いやすさを両方備えており、近年幅広い応用分野で実際に使われている。 Such expressions have long been used in the logical design and verification of integrated circuits, and are also used in mathematical optimization such as probability inference by Bayesian networks and maximization of reliability of communication networks. Many such phenotypes have been proposed, but among them, the Sentential Decision Diagram (hereinafter referred to as SDD) of Non-Patent Document 1 has both compactness and ease of handling, and has a wide range of application fields in recent years. It is actually used in.

Adnan Darwiche. SDD: a new canonical representation of propositional knowledge bases. In Proceedings of the Twenty-Fifth AAAI Conference on Artificial Intelligence, pp. 819-826, 2011.Adnan Darwiche. SDD: a new canonical representation of propositional knowledge bases. In Proceedings of the Twenty-Fifth AAAI Conference on Artificial Intelligence, pp. 819-826, 2011. Randal E. Bryant. Graph-based algorithms for Boolean function manipulation. IEEE Transactions on Computers, Vol. C-35, pp. 677-691, 1986.Randal E. Bryant. Graph-based algorithms for Boolean function manipulation. IEEE Transactions on Computers, Vol. C-35, pp. 677-691, 1986.

知識コンパイレーションで考えられる論理関数の表現形は、ひとたびある論理関数を表現するものを作ってしまえば、その論理関数に関するクエリを解いたり、他の論理関数と組み合わせたりする操作が、その表現形のままでできる。しかし、論理関数をその表現形で表現したときの大きさがどの程度になるかは一般にはわからない。 The expression form of a logical function that can be considered in knowledge compilation is that once a logical function is expressed, the operation of solving a query related to that logical function or combining it with another logical function is the expression form. You can do it as it is. However, it is generally unknown how large a logical function will be when expressed in its phenotype.

実際、論理関数によっては表現のサイズが非常に大きくなってしまい、計算機のメモリに載らなくなってしまう例が存在する。また、例えメモリに載ったとしても、表現のサイズが大きいために種々のクエリや論理関数との組み合わせ演算に時間がかかってしまうことがある。そこで、なるべくサイズが小さくなり、かつクエリを解いたり他の論理関数と組み合わせたりする操作がより高速になるような表現形を作り出す技術が検討されている。 In fact, depending on the logical function, there is an example in which the size of the expression becomes very large and cannot be stored in the memory of the computer. Moreover, even if it is stored in the memory, it may take a long time to perform a combination operation with various queries and logical functions due to the large size of the expression. Therefore, a technique for creating a phenotype that is as small as possible and that makes the operation of solving a query or combining with other logical functions faster is being studied.

非特許文献1のSDDは、非特許文献2の二分決定図(Binary Decision Diagram、以下BDDとよぶ)の構造を一般化して、BDDと同様な機能性(クエリや他の論理関数との組み合わせへの対応)を備えつつBDDよりも省サイズを実現したデータ構造である。しかし、SDDをもってしてもまだサイズが大きくなってしまう論理関数は多数存在する。そこで、SDDと同様の機能性を有しつつ、SDDよりもさらに小さな表現を実現する表現形が必要とされている。 The SDD of Non-Patent Document 1 generalizes the structure of the binary decision diagram (hereinafter referred to as BDD) of Non-Patent Document 2 and has the same functionality as BDD (combination with queries and other logical functions). It is a data structure that realizes a smaller size than BDD while providing (corresponding to). However, there are many logical functions whose size is still large even with SDD. Therefore, there is a need for a phenotype that has the same functionality as SDD but realizes a smaller expression than SDD.

本発明は上記の点に鑑みてなされたものであり、論理関数をコンパクトかつ扱いやすい形で表現する手法において、SDDよりもさらに小さな表現を実現する表現形を得る技術を提供することを目的とする。 The present invention has been made in view of the above points, and an object of the present invention is to provide a technique for obtaining a phenotype that realizes a smaller expression than SDD in a method for expressing a logical function in a compact and easy-to-use form. do.

開示の技術によれば、所定の木構造に従って論理関数の分解を表現したグラフ構造データを生成するデータ生成装置であって、
前記論理関数を分解する際の変数順序を特定する順序木に基づいて、前記論理関数の分解の中で構造が同一な分解を表す複数の部分構造が特定された場合に、当該複数の部分構造の中から選択される1つの部分構造を代表部分構造として、
残りの前記構造が同一の部分構造の親ノードに対応するグラフ構造中のデータが、前記代表部分構造に対応するグラフ構造データをポインタにより共有するように、前記論理関数に対応するグラフ構造データを生成する構築部、を備えるデータ生成装置が提供される。
According to the disclosed technique, it is a data generator that generates graph structure data expressing the decomposition of a logical function according to a predetermined tree structure.
Based on the order tree that specifies the variable order when decomposing the logical function, when a plurality of substructures representing the same decomposition are specified in the decomposition of the logical function, the plurality of substructures are specified. As a representative substructure, one substructure selected from the above is used as a representative substructure.
The graph structure data corresponding to the logical function is shared so that the remaining data in the graph structure corresponding to the parent node of the same partial structure shares the graph structure data corresponding to the representative partial structure by the pointer. A data generation device including a building unit for generating is provided.

開示の技術によれば、論理関数をコンパクトかつ扱いやすい形で表現する手法において、SDDよりもさらに小さな表現を実現する表現形を得る技術が提供される。 According to the disclosed technique, there is provided a technique for obtaining a phenotype that realizes a smaller expression than SDD in a method for expressing a logical function in a compact and easy-to-use form.

SDDを説明するための図である。It is a figure for demonstrating SDD. 第1の実施の形態におけるデータ構造変換装置100の構成図である。It is a block diagram of the data structure conversion apparatus 100 in 1st Embodiment. 装置のハードウェア構成の例を示す図である。It is a figure which shows the example of the hardware composition of a device. 前処理部M02の全体処理フローである。This is the overall processing flow of the preprocessing unit M02. 第1の実施の形態における動作の例を示す図である。It is a figure which shows the example of the operation in 1st Embodiment. ステップS023におけるアルゴリズムの例を示す図である。It is a figure which shows the example of the algorithm in step S023. 変換部M03の動作に対応するアルゴリズムの例を示す図である。It is a figure which shows the example of the algorithm corresponding to the operation of the conversion unit M03. 構文木の例を示す図である。It is a figure which shows the example of the syntax tree. 第2の実施の形態におけるデータ構造変換装置100の構成図である。It is a block diagram of the data structure conversion apparatus 100 in 2nd Embodiment. 構築部M13の動作に対応するアルゴリズムの例を示す図である。It is a figure which shows the example of the algorithm corresponding to the operation of the construction part M13. 構築部M13の動作に対応するアルゴリズムの例を示す図である。It is a figure which shows the example of the algorithm corresponding to the operation of the construction part M13. 構築部M13の動作に対応するアルゴリズムの例を示す図である。It is a figure which shows the example of the algorithm corresponding to the operation of the construction part M13. 構築部M13の動作に対応するアルゴリズムの例を示す図である。It is a figure which shows the example of the algorithm corresponding to the operation of the construction part M13. 構築部M13の動作に対応するアルゴリズムの例を示す図である。It is a figure which shows the example of the algorithm corresponding to the operation of the construction part M13. モデルカウントのアルゴリズムの例を示す図である。It is a figure which shows the example of the model count algorithm.

以下、図面を参照して本発明の実施の形態(本実施の形態)を説明する。以下で説明する実施の形態は一例に過ぎず、本発明が適用される実施の形態は、以下の実施の形態に限られるわけではない。 Hereinafter, embodiments of the present invention (the present embodiments) will be described with reference to the drawings. The embodiments described below are merely examples, and the embodiments to which the present invention is applied are not limited to the following embodiments.

(SDDについて)
本実施の形態では、SDDの構造を改良した構造を提供するものであるので、まずはSDDについて説明する。
(About SDD)
Since the present embodiment provides a structure in which the structure of the SDD is improved, the SDD will be described first.

まず、論理関数とは、真(true)か偽(false)の二値をとる変数を複数引数にとり、真か偽のどちらかの値を返す関数である。論理関数fが引数にとる変数たちをX、その分割をY、Zとすると、fは、Yの変数のみからなる部分論理関数p,...,pとZの変数たちのみからなる部分論理関数s,...,sを用いて下記のように分解することができる。 First, a logical function is a function that takes a variable that takes a binary value of true (true) or false (false) as a plurality of arguments and returns either a true or false value. Assuming that the variables taken by the logical function f as arguments are X and their divisions are Y and Z, f consists of only the variables of the partial logical functions p 1 , ..., P n and Z consisting only of the variables of Y. It can be decomposed as follows using the partial logic functions s 1 , ..., s n .

f(X)=[p(Y)∧s(Z)]∨・・・∨[p(Y)∧s(Z)]
ここで、A∧Bは論理積(AかつB)、A∨Bは論理和(AまたはB)である。特にここでは、p,...,pが互いに素、すなわち、p(Y)とp(Y)が同時に真となるようなi≠jとYの変数たちへの真偽の割り当てが存在しないような分解を考えることにする。なお、このような分解は常に可能である。
f (X) = [p 1 (Y) ∧ s 1 (Z)] ∨ ・ ・ ・ ∨ [ pn (Y) ∧ s n (Z)]
Here, A∧B is a logical product (A and B), and A∨B is a logical sum (A or B). Especially here, the truth of the variables i ≠ j and Y such that p 1 , ..., pn are relatively prime, that is, p i (Y) and p j (Y) are true at the same time. Let us consider a decomposition in which no allocation exists. It should be noted that such decomposition is always possible.

このような分解を再帰的に行うことで、コンパクトかつ扱いやすい表現形を実現したのがSDDである。このとき、どのように変数を分割してゆくかを定めるのがvtreeとよばれる木構造である。vtreeは、最も下にあるノード(以下、葉とよぶ)の各々が1つの変数に対応し、それ以外のノード(以下、内部節点とよぶ)の各々はエッジで繋がれた下のノード(以下、子ノードとよぶ)をちょうど2つ持つような木構造である。各々の内部節点は、変数を、左の子ノード以下にある葉たちに対応する変数と、右の子ノード以下にある葉たちに対応する変数に分割することを表す。なお、vtreeのノードを「節点」と称してもよい。 SDD has realized a compact and easy-to-use phenotype by recursively performing such decomposition. At this time, it is a tree structure called vtree that determines how the variables are divided. In vtree, each of the lowest nodes (hereinafter referred to as leaves) corresponds to one variable, and each of the other nodes (hereinafter referred to as internal nodes) is connected by an edge to the lower node (hereinafter referred to as "leaf"). , Called a child node) is a tree structure that has exactly two. Each internal node represents dividing the variable into a variable corresponding to the leaves below the left child node and a variable corresponding to the leaves below the right child node. The vtree node may be referred to as a "node".

vtreeの例を図1(a)に示す。このvtreeは、まず4つの変数{A,B,C,D}を左側の{A,B}と右側の{C,D}に分割し、次いで左側の{A,B}をさらに{B}と{A}に、右側の{C,D}をさらに{D}と{C}に分割することを表す。vtreeの各ノードには、図1(a)のように番号をつけておく。 An example of vtree is shown in FIG. 1 (a). This vtree first divides the four variables {A, B, C, D} into the left {A, B} and the right {C, D}, then the left {A, B} further {B}. And {A}, and {C, D} on the right side is further divided into {D} and {C}. Each node of vtree is numbered as shown in FIG. 1 (a).

vtreeを用いると、SDDとそれが表す論理関数は次のように再帰的に定義できる。「vtree vに従うSDD」は、次の3種類のうちのいずれかである。ここで、SDD αに対し、αが表す論理関数を<α>と表す。 Using vtree, SDD and the logical functions it represents can be recursively defined as follows. "SDD according to vtree v" is one of the following three types. Here, for SDD α, the logical function represented by α is represented as <α>.

Figure 0007048032000001
は、それ自体がSDDである。ここで、
Figure 0007048032000001
Is itself an SDD. here,

Figure 0007048032000002
すなわち恒真関数、
Figure 0007048032000002
That is, a tautological function,

Figure 0007048032000003
すなわち恒偽関数である。これらのSDDは以下では定数とよぶ。
Figure 0007048032000003
That is, it is a constant false function. These SDDs are referred to below as constants.

・変数Xに対し、vが変数Xに対応する葉であるならば、Xや¬Xはvに従うSDDである。<X>=X(Xが真ならば真、そうでなければ偽という関数)、<¬X>=¬X(Xが真なら偽、そうでなければ真という関数)である。これらのSDDは以下ではリテラルとよぶ。 -For variable X, if v is the leaf corresponding to variable X, then X and ¬X are SDDs that follow v. <X> = X (function true if X is true, false otherwise), <¬X> = ¬X (function false if X is true, true otherwise). These SDDs are referred to below as literals.

・p,...,pはvの左の子ノード以下に従うSDDで、<p>,...,<p>は互いに素、s,...,sはvの右の子ノード以下に従うSDDとする。このとき、これらを各々ペアにした{(p,s),...,(p,s)}はvに従うSDDである。このSDDは(<p>∧<s>)∨...∨(<p>∧<s>)という論理関数を表す。このようなSDDを以下では分解ノードとよぶ。 • p 1 , ..., pn are SDDs that follow the left child node and below of v, <p 1 >, ..., < pn > are relatively prime, and s 1 , ..., s n are v. Let SDD follow the child nodes to the right of. At this time, {(p 1 , s 1 ), ..., ( pn , s n )} in which these are paired are SDDs according to v. This SDD represents a logical function (<p 1 > ∧ <s 1 >) ∨ ... ∨ (< pn > ∧ <s n >). Such SDDs are hereinafter referred to as decomposition nodes.

計算機上では、定数やリテラルは定数長のデータとしてそのまま表現され、分解ノードは、従うvtreeのノード番号と、配列(p´,s´),...,(p´,s´)との組で表現される。ここで、配列の各要素(p´,s´)は、分解の1つのペア(p,s)を表していて、もしpやsが定数やリテラルのSDDならばそれがそのままp´やs´に格納され、分解ノードならばp´やs´はそのノードへのポインタである。 On the computer, constants and literals are expressed as data of constant length, and the decomposition node is the node number of the vtree to follow and the array ( p'1 , s'1), ..., ( p'n , s'. It is expressed as a pair with n ). Here, each element of the array (p'i, s'i ) represents one pair of decompositions (pi i, s i), if p i or s i is a constant or literal SDD. Is stored in p'i or s'i as it is, and if it is a decomposition node, p'i or s'i is a pointer to that node.

図1(b)は、論理関数f=(A∧B)∨(B∧C)∨(C∧D)を表す、図1(a)のvtreeに従うSDDの例を図示したものである。図中では各分解ノードは丸で表現され、それが従うvtreeのノード番号は丸の中に書かれている。また、分解ノードがもつ各ポインタペアは丸から伸びる矢印で表現される。図1(b)において、各分解ノードから伸びる各矢印の先にある2つの四角の組がペア(p,s)に相当する。2つの四角のうち左側の四角がpに相当し、右側の四角がsに相当する。 FIG. 1 (b) illustrates an example of an SDD according to vtree in FIG. 1 (a), which represents the logical function f = (A∧B) ∨ (B∧C) ∨ (C∧D). In the figure, each decomposition node is represented by a circle, and the node number of the vtree that it follows is written in the circle. In addition, each pointer pair of the decomposition node is represented by an arrow extending from the circle. In FIG. 1 (b), the pair of two squares at the tip of each arrow extending from each decomposition node corresponds to a pair ( pi, s i ) . Of the two squares, the square on the left side corresponds to pi, and the square on the right side corresponds to s i .

図1(b)のSDDでは、関数fは最初に((¬A∧B)∧C)∨((A∧B)∧true)∨(¬B∧(C∧D))という形で{A,B}と{C,D}に分解されている。同様に、図1(d)は、論理関数f=(A∧B)∨(C∧D)を表す、図1(c)のvtreeに従うSDDの例である。 In the SDD of FIG. 1 (b), the function f first takes the form of ((¬A∧B) ∧C) ∨ ((A∧B) ∧true) ∨ (¬B∧ (C∧D)) {A , B} and {C, D}. Similarly, FIG. 1 (d) is an example of an SDD according to vtree in FIG. 1 (c) representing the logical function f = (A∧B) ∨ (C∧D).

SDDは次のような操作ができる。論理関数fに対して、fをtrueにするような、変数へのtrueとfalseの割り当て方の総数をfのモデルカウントとよぶ。SDDが与えられたときに、そのSDDが表す論理関数のモデルカウントを計算するのはSDDサイズに比例した時間でできる。論理関数のモデルカウントはベイジアンネットワークによる確率推論や、ネットワーク信頼性の推定などに応用がある。 SDD can perform the following operations. For the logical function f, the total number of methods of assigning true and false to variables such that f is true is called the model count of f. Given an SDD, the model count of the logical function represented by that SDD can be calculated in a time proportional to the SDD size. The model count of a logical function has applications such as probability inference by Bayesian network and estimation of network reliability.

次に、論理関数fとgを論理和∨や論理積∧などの演算で組み合わせることも、SDDのままで可能である。より具体的には、関数fを表すSDD αと関数gを表すSDD βが与えられれば、αとβが同じvtreeに従う限り、f∨gやf∧gなどの関数を表すSDDをαとβから効率的に作れる。この操作は論理関数からSDDを作る際に直接使えるほか、集積回路などのシステムの論理設計や検証でも頻繁に用いられる。 Next, it is also possible to combine the logical functions f and g by operations such as logical sum ∨ and logical product ∧ with the SDD as it is. More specifically, given an SDD α representing a function f and an SDD β representing a function g, as long as α and β follow the same vtree, the SDDs representing functions such as f∨g and f∧g are α and β. Can be made efficiently from. This operation can be used directly when creating an SDD from a logical function, and is also frequently used in the logical design and verification of systems such as integrated circuits.

SDDが小さな表現を達成するポイントの一つに、もし分解の途中で全く同じ論理関数が部分関数として複数出てきたとしても、その論理関数を表すSDDは一つだけ作ればよい、という点が挙げられる。これを部分構造の共有とよぶ。図1(d)のSDDでは、番号6がついた分解ノードはC∧Dという論理関数を表しているが、このノードは2箇所から(ポインタで)参照されている。これは、論理関数を分解する途中でC∧Dという関数が2回出てきたことを意味するが、この場合でも、C∧Dを表現する分解ノードは一つあればよい。 One of the points where SDD achieves a small expression is that even if multiple identical logical functions appear as partial functions in the middle of decomposition, only one SDD representing that logical function needs to be created. Can be mentioned. This is called partial structure sharing. In the SDD of FIG. 1 (d), the decomposition node numbered 6 represents the logical function C∧D, but this node is referenced from two places (by a pointer). This means that the function C∧D appears twice in the middle of decomposing the logical function, but even in this case, only one decomposition node representing C∧D is required.

しかし、前述したように、SDDをもってしてもまだサイズが大きくなってしまう論理関数は多数存在する。そこで、SDDと同様の機能性を有しつつ、SDDよりもさらに小さな表現を実現する表現形が必要とされている。以下、そのような表現形を提供する技術を本発明の実施の形態として説明する。 However, as mentioned above, there are many logical functions whose size is still large even with SDD. Therefore, there is a need for a phenotype that has the same functionality as SDD but realizes a smaller expression than SDD. Hereinafter, a technique for providing such a phenotype will be described as an embodiment of the present invention.

(実施の形態の概要)
本実施の形態では、SDDの構造を考える際に、全く同じ論理関数が出てきた場合に部分構造の共有を起こすのに加えて、ある特定の種類の変数の置き換えによって同じ論理関数を表現するようになる場合にも部分構造の共有を起こすように、表現形を改良する。これにより、従来のSDDと比べて部分構造の共有を起こせる場所が増えるため、SDDより小さな論理関数の表現を得られる。
(Outline of embodiment)
In this embodiment, when considering the structure of SDD, in addition to causing sharing of substructures when the exact same logical function appears, the same logical function is expressed by replacing a specific kind of variable. Improve the phenotype so that the partial structure is shared even when it becomes. As a result, the number of places where the partial structure can be shared increases as compared with the conventional SDD, so that the expression of the logical function smaller than that of the SDD can be obtained.

これを可能にするために、本実施の形態では、SDDが従うvtreeノード番号を差分的に管理することとしている。この技術により、従来のSDDでは共有できなかった、形は同じだが変数の名前が異なる部分構造も、共有できるようになって表現のサイズが削減できる。また、SDDと同様の機能性を担保できる。特に、この技術を導入したことにより新たに共有が起こった部分構造を再び解(ほど)くことなく、論理関数に関するクエリを解いたり、他の論理関数と組み合わせたりできる。 In order to make this possible, in the present embodiment, the vtree node numbers that the SDD follows are managed differentially. With this technology, substructures with the same shape but different variable names, which could not be shared with conventional SDDs, can be shared and the size of the expression can be reduced. Moreover, the same functionality as SDD can be guaranteed. In particular, by introducing this technology, it is possible to solve queries related to logical functions or combine them with other logical functions without resolving (unraveling) the substructures that have newly been shared.

<"ある特定の種類の変数の置き換え"について>
ここで、本実施の形態に係る技術のポイントである「ある特定の種類の変数の置き換え」について説明する。例えば、図1(b)のSDDでは、下側中央の番号1がついたノードはA∧Bという論理関数を表し、下側右の番号5がついたノードはC∧Dという論理関数を表す。
<About "Replacement of certain types of variables">
Here, "replacement of a specific type of variable", which is a point of the technique according to the present embodiment, will be described. For example, in the SDD of FIG. 1 (b), the node with the number 1 in the lower center represents the logical function A∧B, and the node with the number 5 on the lower right represents the logical function C∧D. ..

また、図1(a)のvtreeで、1番のノード以下の部分構造(以下、vtreeのあるノード以下の部分構造をあるノードの部分木とよぶ)と5番のノードの部分木は変数以外は全く同じ構造をしており、BをD、AをCに置き換えることによって1番の部分木を5番の部分木に書き換えられる。 Further, in the vtree of FIG. 1 (a), the substructure of the node No. 1 and below (hereinafter, the substructure of the node and below of the node with vtree is referred to as the subtree of a node) and the subtree of the node No. 5 are other than variables. Has exactly the same structure, and by replacing B with D and A with C, the first subtree can be rewritten to the fifth subtree.

ここで、同様の変数の置き換えをA∧Bという論理関数に対して行うと、C∧Dとなる。さらに、図1(b)のSDDで下側中央の番号1のノード以下の構造に同様の変数の置き換え(B→D、A→C)を行うと、下側右の番号5のノード以下の構造そのものが得られる。このように、ある2つの分解ノードについて、従うvtreeの構造が一致して、そこから導かれる変数の置き換えの下で同一な論理関数を表しているならば、それらの分解ノードは変数の名前以外全く同じ構造を有している。そのような2つの分解ノードを、以下では合同である、とよぶことにする。図1(b)のSDDで下側中央の1番のノードと下側右の5番のノードは合同である。 Here, if the same variable replacement is performed for the logical function A∧B, it becomes C∧D. Further, when the same variable is replaced (B → D, A → C) in the structure below the node with the number 1 in the lower center in the SDD of FIG. 1 (b), the node with the number 5 or less on the lower right is replaced. The structure itself is obtained. Thus, for two decomposition nodes, if the following vtree structures match and represent the same logical function under the variable substitutions derived from them, then those decomposition nodes are other than the name of the variable. It has exactly the same structure. Such two decomposition nodes will be referred to below as congruent. In the SDD of FIG. 1 (b), the lower center node No. 1 and the lower right node No. 5 are congruent.

<VS-SDDについて>
上記のような合同な分解ノードを一つにまとめて、部分構造の共有を起こさせるように改良したSDDが、本実施の形態における変数シフトSDD(Variable Shift SDD、以下VS-SDDとよぶ)である。VS-SDDの技術は以下の通りである。
<About VS-SDD>
The SDD improved to bring together the above-mentioned congruent decomposition nodes into one and cause sharing of the partial structure is the variable shift SDD (Variable Shift SDD, hereinafter referred to as VS-SDD) in the present embodiment. be. The VS-SDD technology is as follows.

SDDでは、各分解ノードは従うvtreeノードの番号を明示的に保持するとともに、各リテラルはそのまま保持されている。しかし、合同な分解ノードは違うvtreeノードに従っており、それ以下の部分構造中のリテラルも異なるので、もし合同な分解ノードを一つにまとめるのであれば、これらの情報は明示的に保持してはならない。これを解決する技術が、従うvtreeノードの番号を「差分的に」保持するという手法であり、VS-SDDの技術の原型である。 In SDD, each decomposition node explicitly holds the number of the vtree node to follow, and each literal is kept as it is. However, the congruent decomposition nodes follow different vtree nodes, and the literals in the substructures below them are also different, so if you want to combine the congruent decomposition nodes into one, you should explicitly retain this information. It doesn't become. The technology to solve this is a method of "differentiately" holding the number of the vtree node to be followed, which is the prototype of the VS-SDD technology.

以降、本発明の実施に形態として、第1の実施の形態と第2の実施の形態を説明する。第1の実施の形態では、まずVS-SDDの構造について説明しながら通常のSDDをVS-SDDに変換する手順について説明する。第2の実施の形態では、論理関数を直接VS-SDDの表現形に変換する手順ついて説明する。 Hereinafter, the first embodiment and the second embodiment will be described as embodiments of the present invention. In the first embodiment, a procedure for converting a normal SDD into a VS-SDD will be described while first explaining the structure of the VS-SDD. In the second embodiment, a procedure for directly converting a logical function into a VS-SDD phenotype will be described.

(第1の実施の形態)
<装置構成>
図2は、第1の実施の形態におけるデータ構造変換装置100の機能構成図である。データ構造変換装置100は、通常のSDDをVS-SDDに変換する装置である。図2に示すとおり、データ構造変換装置100は、入力部M01、前処理部M02、変換部M03、出力部M04を有する。各部の動作については後述する。なお、第1、第2の実施の形態では、あるデータ構造を変換してVS-SDDを生成するので、「データ構造変換装置」と称しているが、グラフ構造のデータであるVS-SDDを生成する装置であるのでこれを「データ生成装置」と称してもよい。
(First Embodiment)
<Device configuration>
FIG. 2 is a functional configuration diagram of the data structure conversion device 100 according to the first embodiment. The data structure conversion device 100 is a device that converts a normal SDD into VS-SDD. As shown in FIG. 2, the data structure conversion device 100 includes an input unit M01, a preprocessing unit M02, a conversion unit M03, and an output unit M04. The operation of each part will be described later. In the first and second embodiments, since a certain data structure is converted to generate VS-SDD, it is called a "data structure conversion device", but VS-SDD which is data of a graph structure is referred to. Since it is a device for generating data, it may be referred to as a "data generation device".

第1の実施の形態におけるデータ構造変換装置100は、例えば、コンピュータに、本実施の形態で説明する処理内容を記述したプログラムを実行させることにより実現可能である。このようにコンピュータとプログラムでデータ構造変換装置を実現できる点は第2の実施の形態でも同様である。 The data structure conversion device 100 according to the first embodiment can be realized by, for example, causing a computer to execute a program describing the processing contents described in the present embodiment. The point that the data structure conversion device can be realized by the computer and the program in this way is the same in the second embodiment.

データ構造変換装置100は、コンピュータに内蔵されるCPUやメモリ等のハードウェア資源を用いて、当該データ構造変換装置100で実施される処理に対応するプログラムを実行することによって実現することが可能である。上記プログラムは、コンピュータが読み取り可能な記録媒体(可搬メモリ等)に記録して、保存したり、配布したりすることが可能である。また、上記プログラムをインターネットや電子メール等、ネットワークを通して提供することも可能である。 The data structure conversion device 100 can be realized by executing a program corresponding to the processing performed by the data structure conversion device 100 by using hardware resources such as a CPU and a memory built in the computer. be. The above program can be recorded on a computer-readable recording medium (portable memory, etc.), stored, and distributed. It is also possible to provide the above program through a network such as the Internet or e-mail.

図3は、本実施の形態における上記コンピュータのハードウェア構成例を示す図である。図3のコンピュータは、それぞれバスBで相互に接続されているドライブ装置1000、補助記憶装置1002、メモリ装置1003、CPU1004、インタフェース装置1005、表示装置1006、及び入力装置1007等を有する。 FIG. 3 is a diagram showing an example of the hardware configuration of the computer according to the present embodiment. The computer of FIG. 3 has a drive device 1000, an auxiliary storage device 1002, a memory device 1003, a CPU 1004, an interface device 1005, a display device 1006, an input device 1007, and the like, which are connected to each other by a bus B, respectively.

当該コンピュータでの処理を実現するプログラムは、例えば、CD-ROM又はメモリカード等の記録媒体1001によって提供される。プログラムを記憶した記録媒体1001がドライブ装置1000にセットされると、プログラムが記録媒体1001からドライブ装置1000を介して補助記憶装置1002にインストールされる。但し、プログラムのインストールは必ずしも記録媒体1001より行う必要はなく、ネットワークを介して他のコンピュータよりダウンロードするようにしてもよい。補助記憶装置1002は、インストールされたプログラムを格納すると共に、必要なファイルやデータ等を格納する。 The program that realizes the processing in the computer is provided by, for example, a recording medium 1001 such as a CD-ROM or a memory card. When the recording medium 1001 storing the program is set in the drive device 1000, the program is installed in the auxiliary storage device 1002 from the recording medium 1001 via the drive device 1000. However, the program does not necessarily have to be installed from the recording medium 1001, and may be downloaded from another computer via the network. The auxiliary storage device 1002 stores the installed program and also stores necessary files, data, and the like.

メモリ装置1003は、プログラムの起動指示があった場合に、補助記憶装置1002からプログラムを読み出して格納する。CPU1004は、メモリ装置1003に格納されたプログラムに従って、当該データ構造変換装置100に係る機能を実現する。インタフェース装置1005は、ネットワークに接続するためのインタフェースとして用いられる。表示装置1006はプログラムによるGUI(Graphical User Interface)等を表示する。入力装置1007はキーボード及びマウス、ボタン、又はタッチパネル等で構成され、様々な操作指示を入力させるために用いられる。 The memory device 1003 reads and stores the program from the auxiliary storage device 1002 when the program is instructed to start. The CPU 1004 realizes the function related to the data structure conversion device 100 according to the program stored in the memory device 1003. The interface device 1005 is used as an interface for connecting to a network. The display device 1006 displays a GUI (Graphical User Interface) or the like by a program. The input device 1007 is composed of a keyboard, a mouse, buttons, a touch panel, and the like, and is used for inputting various operation instructions.

<データ構造変換装置100の動作>
以下、データ構造変換装置100の各部の動作について説明する。
<Operation of data structure conversion device 100>
Hereinafter, the operation of each part of the data structure conversion device 100 will be described.

入力部M01は、vtree v及びSDD αを外部から受け取る。入力された情報は、メモリ等の記憶手段に格納される。前処理部M02は、記憶手段からvを読み出し、vの各ノードに番号をつけ直し、vtreeの同一な部分木を検出する。変換部M03は、前処理部M02で処理したvを用いて、記憶手段から読み出したαをVS-SDD βへ変換する。出力部M04はβを出力する。 The input unit M01 receives vtree v and SDD α from the outside. The input information is stored in a storage means such as a memory. The preprocessing unit M02 reads v from the storage means, renumbers each node of v, and detects the same subtree of vtree. The conversion unit M03 converts α read from the storage means into VS-SDD β by using v processed by the preprocessing unit M02. The output unit M04 outputs β.

次に、前処理部M02の処理をより詳細に説明する。図4は、前処理部M02が実行する処理の手順を示すフローチャートである。 Next, the processing of the preprocessing unit M02 will be described in more detail. FIG. 4 is a flowchart showing a procedure of processing executed by the preprocessing unit M02.

ステップS021において、前処理部M02は記憶手段から読み出したvtree vを入力する。図1(a)等に例示したように、vは葉に変数が対応した二分木である。 In step S021, the preprocessing unit M02 inputs the vtree v read from the storage means. As illustrated in FIG. 1 (a) and the like, v is a binary tree in which variables correspond to leaves.

ステップS022において、vtree vの各ノードを一定の規則で辿って、その辿った順番に従って1から順に番号をつける。ここで、本実施の形態における「一定の規則」とは、次の3つの操作を各ノードで決められた順番で行う、ということである。 In step S022, each node of vtree v is traced according to a certain rule, and numbers are assigned in order from 1 according to the traced order. Here, the "constant rule" in the present embodiment means that the following three operations are performed in the order determined by each node.

・(L)左の子ノードの部分木を再帰的に辿る。 -(L) Recursively trace the subtree of the child node on the left.

・(R)右の子ノードの部分木を再帰的に辿る。 -(R) Recursively trace the subtree of the child node on the right.

・(N)自分自身のノードを辿る。 ・ (N) Follow your own node.

特に、各ノードで(N)→(L)→(R)という順番で操作を行って得られる順番を行きがけ順とよぶ。例として、図1(a)のvtreeの行きがけ順による番号づけを図5(a)(左側)に示す。以降の説明は行きがけ順を用いて行うが、行きがけ順以外でも「一定の規則」の下で順番づけする限りはどの方法でもよい。例えば、通りがけ順や帰りがけ順を用いてもよい。 In particular, the order obtained by operating each node in the order of (N) → (L) → (R) is called the destination order. As an example, the numbering of vtrees in FIG. 1 (a) according to the order of destination is shown in FIG. 5 (a) (left side). The following explanation will be given using the order of destinations, but any method other than the order of destinations may be used as long as the order is set under "certain rules". For example, a passing order or a returning order may be used.

ポイントは、このような規則で番号づけを行うと、木の各辺で両端のノード番号の差を考えたときに(これを差分番号づけとよぶ)、同一な部分木では差分番号づけも同一になる、ということである。例えば、図5(a)の右側は、左側に示す行きがけ順のノード番号に対して差分番号づけを描いたものであるが、行きがけ順番号2の部分木と5の部分木では、その差分番号づけは全く同じになっていることが分かる。 When numbering according to such a rule, the point is that when considering the difference between the node numbers at both ends on each side of the tree (this is called difference numbering), the difference numbering is also the same for the same subtree. It means that it will be. For example, the right side of FIG. 5A depicts the difference numbering for the node numbers in the order of destination shown on the left side, but in the subtree of the order number 2 and the subtree of the order number 5, the difference number is drawn. It can be seen that the nodes are exactly the same.

ステップS023において、前処理部M02は、同一な構造を有するvtree部分の検出を行う。より具体的には、vの同一な部分木を、例えば図6に示すAlgorithm 1で示されるようなvに対する再帰的手続きの処理を実行することで検出する。 In step S023, the pretreatment unit M02 detects a vtree portion having the same structure. More specifically, the same subtree of v is detected, for example, by executing a recursive procedure process for v as shown by Algorithm 1 shown in FIG.

図6に示すAlgorithm 1は、vtree vを入力とし、vのノードをキーとする連想配列eを出力する。vtreeノードwに対し、e(w)の値は、vのノードで部分木の構造がwの部分木と一致するもののうちノード番号が最も小さいものである。 The Algorithm 1 shown in FIG. 6 takes vtree v as an input and outputs an associative array e using the node of v as a key. For the vtree node w, the value of e (w) is the node of v having the smallest node number among those whose subtree structure matches the subtree of w.

eは次のような性質をもつ。eは、v中の2つのvtreeノードu、wに対して、uの部分木とvの部分木の構造が一致するときに限りe(u)=e(v)となるような連想配列である。アルゴリズムの内部ではUniqTableという別の連想配列を用いる。UniqTableは、もしすでに部分木が一致するノードを処理していればそのノードを返す連想配列である。図6において、1行目~6行目に示すように、処理対象のvが葉でない限り、vの左の子ノードのvtreeと右の子ノードのvtreeに対してAlgorithm 1が適用され、7行目から9行目に示すように、UniqTableにより、もしすでに部分木が一致するノードを処理していればそのノードがe(v)の値になる。 e has the following properties. e is an associative array such that e (u) = e (v) only when the structures of the subtree of u and the subtree of v match for the two vtree nodes u and w in v. be. Inside the algorithm, another associative array called UniqTable is used. UniqTable is an associative array that returns a node whose subtrees match if it has already been processed. In FIG. 6, as shown in the 1st to 6th lines, as long as the v to be processed is not a leaf, Algorithm 1 is applied to the vtree of the left child node and the vtree of the right child node of v, and 7 As shown in the 9th line from the line, if the node whose subtree matches is already processed by UniqTable, that node becomes the value of e (v).

図4のステップS024において、前処理部M02は、ステップS022とS023で取得した、vの行きがけ順番号づけと連想配列eを出力する。変換部M03では、この新たな番号づけがされたvが使用される。 In step S024 of FIG. 4, the preprocessing unit M02 outputs the destination order numbering and associative array e of v acquired in steps S022 and S023. In the conversion unit M03, this newly numbered v is used.

次に、変換部M03の処理について説明する。ここでは、vtreeノード番号の差分を用いることが本技術のキーポイントである。 Next, the processing of the conversion unit M03 will be described. Here, it is a key point of the present technology to use the difference of vtree node numbers.

まず、変換部M03により生成されるVS-SDDとはどのような表現形なのかを、SDDから1ステップずつ変換することで示す。続いて、擬似コードを示す。1ステップずつ変換する動作も、擬似コードに基づく動作もいずれも変換部M03の動作の例である。 First, the phenotype of VS-SDD generated by the conversion unit M03 is shown by converting from SDD step by step. Then, the pseudo code is shown. Both the operation of converting step by step and the operation based on the pseudo code are examples of the operation of the conversion unit M03.

変換部M03は、まず、各分解ノードで従うvtreeノード番号を明示的に保持する代わりに、分解ノードを指す各ポインタに、指す先の分解ノードが従うvtreeノード番号と、指す元のノードが従うvtreeノード番号の差をもたせる。次に、各リテラルをそのまま保持する代わりに、そのリテラルの変数に対応する葉のvtreeノードの番号と、そのリテラルを分解としてもつ分解ノードが従うvtreeノード番号の差をもたせる。ここで使用するvtreeノード番号は、前処理部M02で得た行きがけ順番号づけによるものである。 First, instead of explicitly holding the vtree node number to be followed by each decomposition node, the conversion unit M03 follows each pointer pointing to the decomposition node with the vtree node number to be followed by the destination node and the original node to be pointed to. Have a difference in vtree node numbers. Next, instead of keeping each literal as it is, it has a difference between the vtree node number of the leaf corresponding to the variable of the literal and the vtree node number followed by the decomposition node having the literal as the decomposition. The vtree node number used here is based on the destination order numbering obtained by the preprocessing unit M02.

上記の処理を実行した具体例として、図1(b)のSDDに、図5(a)にあるvtreeの行きがけ順番号づけを考えた上で、vtree番号の差分化を行なった構造を図5(b)に示す。例えば、図5(b)において、一番左側の中段のポインタに付けられた差である「1」は、指す先の分解ノードが従うvtreeノード番号2から、指す元のノードが従うvtreeノード番号1を引いた差である。また、左下端にあったリテラルB(図1(b))は、Bに対応する葉のvtreeノードの番号3と、そのリテラルを分解(要素)としてもつ分解ノードが従うvtreeノード番号2の差である1になる。 As a specific example of executing the above processing, FIG. 5 shows a structure in which the vtree numbers are differentiated in the SDD of FIG. 1 (b) after considering the vtree destination order numbering shown in FIG. 5 (a). Shown in (b). For example, in FIG. 5 (b), the difference "1" attached to the pointer in the middle row on the leftmost side is the vtree node number 2 followed by the decomposed node to be pointed to, and the vtree node number followed by the original node to be pointed to. It is the difference minus 1. Further, the literal B (FIG. 1 (b)) at the lower left end is the difference between the vtree node number 3 of the leaf corresponding to B and the vtree node number 2 followed by the decomposition node having the literal as the decomposition (element). Becomes one.

図5(b)に示すように、もとのSDDで合同だったノード以下の構造は、上の手続きで導入したvtreeノード番号の差も含めて全く同一な構造へと変換される。例えば、図5(b)において、下側中央と下側右の分解ノードは元々合同であったが、変換後にはそれ以下の構造も含めて全く同一になっている。変換部M03は、こうして生ずる同一な部分構造を共有するようにデータ構造を変換することで、ノード数の削減を達成する。 As shown in FIG. 5 (b), the structures below the nodes that were congruent in the original SDD are converted into exactly the same structure including the difference in the vtree node numbers introduced in the above procedure. For example, in FIG. 5B, the lower center and the lower right decomposition nodes were originally congruent, but after conversion, they are exactly the same including the structures below them. The conversion unit M03 achieves a reduction in the number of nodes by converting the data structure so as to share the same partial structure thus generated.

図5(b)で生じた同一な部分構造を共有することにより得られる構造を図5(c)に示す。図5(c)に示すように、図5(b)において、一番上の分解ノードの中央と右の2つの要素(部分木の根ノード)のそれぞれから伸びるポインタの先の2つの分解ノード及びその先にある4つの要素が、図5(c)においては、一つの分解ノード及びその先の2つの要素からなる構造を共有する形になっている。 The structure obtained by sharing the same partial structure generated in FIG. 5 (b) is shown in FIG. 5 (c). As shown in FIG. 5 (c), in FIG. 5 (b), the two decomposition nodes at the tip of the pointer extending from each of the center and the right two elements (subtree root node) of the top decomposition node and their respective. In FIG. 5C, the four elements mentioned above share a structure consisting of one decomposition node and the two elements beyond it.

このように、vtreeノード番号の差を用いた変換を行って、それにより生じた同一な部分構造を共有することによって得られる構造をVS-SDDとよぶ。 In this way, the structure obtained by performing conversion using the difference in vtree node numbers and sharing the same partial structure generated by the conversion is called VS-SDD.

変換部M03は、vtreeノード番号の差を用いるよう変換することと同一な部分構造を共有することを同時並行で行うこととしてもよい。そのような処理を実行する変換部M03の処理手順を示すAlgorithm 2を図7に示す。なお、vtreeノード番号の差を用いるよう変換することと同一な部分構造を共有することを同時並行で行う処理は、図5を参照して説明した上記の処理と本質的には同じである。 The conversion unit M03 may simultaneously perform conversion to use the difference in vtree node numbers and share the same partial structure. FIG. 7 shows Algorithm 2 showing the processing procedure of the conversion unit M03 that executes such processing. It should be noted that the process of simultaneously converting to use the difference in vtree node numbers and sharing the same partial structure is essentially the same as the above process described with reference to FIG.

ここで、SDD αに対して、αが従うvtreeノードをv(α)と表し、vtreeノードvに対してその行きがけ順による番号をnum(v)とする。 Here, for SDD α, the vtree node that α follows is represented as v (α), and for vtree node v, the number according to the order of destination is num (v).

図7に示すとおり、このアルゴリズムは、SDD αを入力とし、αをVS-SDDに変換した構造を出力する。アルゴリズムの内部では、前処理部M02で得られた連想配列eを用いている。前述したとおり、連想配列eは、vtree vのノードwに対し、e(w)の値が、vのノードで部分木の構造がwの部分木と一致するもののうちノード番号が最も小さいものであるような連想配列である。 As shown in FIG. 7, this algorithm takes SDD α as an input and outputs a structure obtained by converting α into VS-SDD. Inside the algorithm, the associative array e obtained by the preprocessing unit M02 is used. As described above, the associative array e has the smallest node number among the nodes whose value e (w) matches the node w whose subtree structure is w with respect to the node w of vtree v. It is an associative array as there is.

データ構造変換装置100上(つまりコンピュータ上)では、分解ノードのVS-SDDは配列{(p´,s´),...,(p´,s´)}で表現される。ここで各p´は、対応する要素pが定数の場合はそのもの、リテラルの場合はvtreeノード番号の差と否定リテラル(¬)かどうかを表すフラグとのペア、分解ノードの場合はvtreeノード番号の差とそのVS-SDDへのポインタのペアである。s´も同様である。 On the data structure converter 100 (that is, on the computer), the VS-SDD of the decomposition node is represented by an array {( p'1 , s'1), ..., ( p'n , s'n ) } . .. Here, each p'i is itself when the corresponding element p i is a constant, a pair of a vtree node number difference and a flag indicating whether it is a negative literal (¬ ) in the case of a literal, and vtreee in the case of a decomposition node. A pair of node numbers and their pointers to VS-SDD. The same applies to s'i .

Algorithm 2の中で、6行目が、対応する要素のpが定数の場合にp´をその定数とする処理である。7、8行目が、リテラルをvtreeノード番号の差に変換する処理である。7、8行目で使用されている「num(v(p))-num(v(α))」は、p(=リテラル)が従うvtreeノードの番号(つまり、当該リテラルに対応するvtreeノードの番号)から、p(=リテラル)を指す元のvtreeノードの番号を引いた差である。9行目が、pが分解ノードの場合に、vtreeノード番号の差と、当該分解ノードのVS-SDDへのポインタ(VS(p))のペアをp´とする処理を示す。 In Algorithm 2, the sixth line is a process in which p'i is a constant when the p i of the corresponding element is a constant. The 7th and 8th lines are the processes of converting literals into differences in vtree node numbers. The "num (v (v (pi ))-num (v (α))" used in the 7th and 8th lines corresponds to the vtree node number (that is, the literal) to which p i ( = literal) follows. It is the difference obtained by subtracting the number of the original vtree node pointing to pi (= literal) from the vtree node number). The ninth line shows the process of setting the difference between the vtree node numbers and the pair of the pointer (VS ( pi )) to the VS-SDD of the decomposition node as p'i when p i is the decomposition node.

図7に示すとおり、アルゴリズムの内部ではConvTableとUniqTableという2つの連想配列を用いる。 As shown in FIG. 7, two associative arrays, ConvTable and UniqTable, are used inside the algorithm.

ConvTableは、入力のSDD αのノードと、出力のVS-SDDのノードとの対応関係を保持する。UniqTableは、もしすでに合同な部分構造が処理されていたらその部分構造のVS-SDDへのポインタを返すような連想配列である。ここで、前処理部M02で作った連想配列eが、vtreeの部分木の構造が同一であるか判定するために用いられている。もしまだ合同な部分構造が処理されていなければ(12行目)、13行目でCreateNewNodeで新たな分解ノードのVS-SDDを作成する。 The ConvTable maintains a correspondence between the input SDD α node and the output VS-SDD node. UniqTable is an associative array that returns a pointer to the VS-SDD of the substructure if the congruent substructure has already been processed. Here, the associative array e created by the preprocessing unit M02 is used to determine whether the structure of the vtree subtree is the same. If the congruent substructure has not been processed yet (line 12), create a new decomposition node VS-SDD with CreateNewNode on line 13.

例えば、図1(b)のSSDと図5(a)のvtreeが入力された際に、図5(c)に示すように{(p´,s´),...,(p´,s´)}(四角のペアのそれぞれ)に定数、差分、ポインタと差分、等がセットされる。また、図1(b)のSSDにおいて、vtreeノード番号5に従う分解ノードの処理の際には、その左側の分解ノードと合同となるので、UniqTableにより、その左側の分解ノードに対応するVS-SDDへのポインタが返される。よって、図5(c)のように、合同な構造を共有した構造が得られる。 For example, when the SSD of FIG. 1 (b) and the vtree of FIG. 5 (a) are input, {( p'1 , s'1), ..., (p) as shown in FIG. 5 (c). Constants, differences, pointers and differences, etc. are set in'n , s'n )} (each of a pair of squares). Further, in the SSD of FIG. 1B, when the decomposition node according to vtree node number 5 is processed, it is congruent with the decomposition node on the left side thereof. Therefore, the VS-SDD corresponding to the decomposition node on the left side by UniqTable. A pointer to is returned. Therefore, as shown in FIG. 5C, a structure sharing a congruent structure can be obtained.

(第2の実施の形態)
<第2の実施の形態の概要>
次に、第2の実施の形態を説明する。第2の実施の形態では、論理関数をVS-SDDに直接変換するデータ構造変換装置200が提供される。
(Second embodiment)
<Outline of the second embodiment>
Next, a second embodiment will be described. In the second embodiment, a data structure conversion device 200 that directly converts a logical function into VS-SDD is provided.

第2の実施の形態において、論理関数は、定数(trueやfalse)や変数と、否定演算(¬)、及び、論理和(∨)、論理積(∧)、排他的論理和("+")などの二項演算との組み合わせで表現されるものとし、入力としてはその構文木、及びvtreeが与えられる(なお、本明細書のテキストでは、記載の便宜上、排他的論理和の記号(〇の中に+を入れた記号)を"+"と表した)。すなわち、どのような構造と順番で各種論理演算を適用するかが分かっている状態で、当該論理関数が与えられるものとする。 In the second embodiment, the logical function is a constant (true or false) or variable, a negative operation (¬), a logical sum (∨), a logical product (∧), and an exclusive OR ("+". It shall be expressed in combination with a binary operation such as), and its syntax tree and vtree are given as input (note that in the text of this specification, the exclusive OR symbol (〇) is given for convenience of description. The symbol) with + inside is expressed as "+"). That is, it is assumed that the logical function is given in a state where the structure and order in which the various logical operations are applied are known.

例えば、(A∧B)∨(B∧C)∨(C∧D)という論理関数であれば、図8の構文木に示すように、まずAとBの論理積をとり、次にBとCの論理積をとり、次にCとDの論理積をとり、次に、AとBの論理積とBとCの論理積をとり、最後にそれら全ての論理和をとる、という順番で計算すればよい、ということが分かっているものとする。 For example, in the case of a logical function (A∧B) ∨ (B∧C) ∨ (C∧D), first take the logical product of A and B, and then B Take the logical product of C, then the logical product of C and D, then the logical product of A and B, the logical product of B and C, and finally the logical sum of all of them, and so on. It is assumed that you know that you should calculate.

なお、例えば(A∧B)∨(B∧C)∨(C∧D)などの論理関数が文字列として与えられたとしても、文字列に対して構文解析を行うことで論理演算の構造や順番を特定することは一般的な技術である。従って、データ構造変換装置200に文字列としての論理関数を入力し、データ構造変換装置200が構文解析を行って、構文木を計算し、その構文木を使用することとしてもよい。 Even if a logical function such as (A∧B) ∨ (B∧C) ∨ (C∧D) is given as a character string, the structure of the logical operation can be obtained by parsing the character string. Specifying the order is a common technique. Therefore, a logical function as a character string may be input to the data structure conversion device 200, the data structure conversion device 200 may perform parsing, calculate a syntax tree, and use the syntax tree.

(A∧B)∨(B∧C)∨(C∧D)を例にとると、データ構造変換装置200は、図8の構文木に従って、下の階層から上の階層に向けて順番に処理を行う。すなわち、まず、A∧B、B∧C、C∧DそれぞれのVS-SDDを作成し、次に、当該VS-SDDを使用して(A∧B)∨(B∧C)のVS-SDDを作成し、最後にその結果のVS-SDDとC∧DのVS-SDDとを使って(A∧B)∨(B∧C)∨(C∧D)のVS-SDDを作成する。このVS-SDDの作成において、後述する論理演算のアルゴリズム(Algorithm 3~5)を使用する。なお、A、B、C、DそれぞれのVS-SDDはA、B、C、Dであるから、例えば、A∧BのVS-SDDは、AというVS-SDDとBというVS-SDDに対して、後述する論理演算を行うことで得られる。 Taking (A∧B) ∨ (B∧C) ∨ (C∧D) as an example, the data structure conversion device 200 processes in order from the lower layer to the upper layer according to the syntax tree of FIG. I do. That is, first, VS-SDDs of A∧B, B∧C, and C∧D are created, and then VS-SDD of (A∧B) ∨ (B∧C) is used using the VS-SDD. And finally create VS-SDD of (A∧B) ∨ (B∧C) ∨ (C∧D) using the resulting VS-SDD and VS-SDD of C∧D. In creating this VS-SDD, an algorithm (Algorithm 3 to 5) for logical operations described later is used. Since the VS-SDDs of A, B, C, and D are A, B, C, and D, for example, VS-SDD of A∧B is relative to VS-SDD of A and VS-SDD of B. It can be obtained by performing a logical operation described later.

第2の実施の形態におけるデータ構造変換装置200は、上記の処理を効率良く行うために、VS-SDD α、βが与えられたときに、αが表す論理関数の否定を表すVS-SDDや、αが表す論理関数とβが表す論理関数の論理和、論理積、排他的論理和を表すVS-SDDを、VS-SDDの表現形を保ったまま効率よく計算できる。 In the data structure conversion device 200 according to the second embodiment, in order to efficiently perform the above processing, VS-SDD representing the denial of the logical function represented by α when VS-SDD α, β is given, or VS-SDD. VS-SDD, which represents the logical sum, logical product, and exclusive logical sum of the logical function represented by α and β, can be efficiently calculated while maintaining the expression form of VS-SDD.

<装置構成、動作>
第2の実施の形態における、論理関数を直接VS-SDDに変換するデータ構造変換装置200の構成図を図9に示す。
<Device configuration and operation>
FIG. 9 shows a configuration diagram of a data structure conversion device 200 that directly converts a logical function into VS-SDD in the second embodiment.

図9に示すとおり、データ構造変換装置200は、入力部M11、前処理部M12、構築部M13、出力部M14を有する。 As shown in FIG. 9, the data structure conversion device 200 has an input unit M11, a preprocessing unit M12, a construction unit M13, and an output unit M14.

入力部M11は、vtree vと論理関数f(ここでは構文木の形式)を受け取る。入力された情報は、メモリ等の記憶手段に格納される。前処理部M12は、記憶手段からvを読み出し、vの各ノードに番号をつけ直し、vtreeの同一な部分木を検出する。構築部M13は、前処理部M12で処理したvを用いて、fをVS-SDD αへ変換する。出力部M14は、αを出力する。前処理部M12の処理はSDDをVS-SDDに変換するシステムの前処理部M02の処理と全く同じなので、以降は構築部M13の処理を説明する。 The input unit M11 receives vtree v and a logical function f (here, in the form of a syntax tree). The input information is stored in a storage means such as a memory. The preprocessing unit M12 reads v from the storage means, renumbers each node of v, and detects the same subtree of vtree. The construction unit M13 converts f into VS-SDD α by using v processed by the preprocessing unit M12. The output unit M14 outputs α. Since the processing of the preprocessing unit M12 is exactly the same as the processing of the preprocessing unit M02 of the system that converts SDD to VS-SDD, the processing of the construction unit M13 will be described below.

構築部M13は、vtree v及び前処理部M12の出力をもとに、論理関数f内の論理演算の構造と順番(これらは構文木の情報として持っている)に従って、前述したように各種論理演算を繰り返し適用する。構築部M13が実行する論理演算として、否定演算、二項演算を以下に説明する。 Based on the output of vtree v and the preprocessing unit M12, the construction unit M13 has various logics as described above according to the structure and order of the logical operations in the logical function f (these are held as information of the syntax tree). Apply the operation repeatedly. Negation operations and binary operations will be described below as logical operations executed by the construction unit M13.

構築部M13は、VS-SDDにおける否定演算を、図10におけるAlgorithm 3により実行する。 The construction unit M13 executes a negative operation in VS-SDD by Algorithm 3 in FIG.

図10に示すように、VS-SDD αに対して、αが従うvtreeノード番号をjαとすれば、Negate(α,jα,true)が返す結果が、αが表す論理関数の否定を表すVS-SDDとなる。 As shown in FIG. 10, if the vtree node number that α follows is j α for VS-SDD α, the result returned by Negate (α, j α , true) is the negation of the logical function represented by α. It becomes VS-SDD to represent.

Algorithm 3におけるConvTableは演算結果を保存しておくための連想配列であり、ConvTable(α,true)にはαの否定を表すVS-SDDノードへのポインタを保存し、ConvTable(α,false)にはαへのポインタを保存しておく。 ConvTable in Algorithm 3 is an associative array for storing the calculation result, and ConvTable (α, true) stores a pointer to the VS-SDD node that represents the negation of α, and ConvTable (α, false) stores the pointer to the VS-SDD node. Saves a pointer to α.

UniqTableは、演算した結果がすでに計算された結果のノードと一致した場合に、そのノードへのポインタを返す連想配列である。図10に示すAlgorithm 3の内容はより詳細には下記のとおりである。 UniqTable is an associative array that returns a pointer to a node that has already been calculated when the result of the calculation matches the node of the result that has already been calculated. The contents of Algorithm 3 shown in FIG. 10 are as follows in more detail.

まず、1、2行目においては,既に同じα、flgに対してNegate(α,・,flg)を計算しているならば、その計算結果へのポインタを返す。これにより同じ計算が二度以上行われることを防ぐ。 First, in the first and second lines, if Negate (α ,,, flg) has already been calculated for the same α and flg, a pointer to the calculation result is returned. This prevents the same calculation from being performed more than once.

そうでなければ、4行目以下で実際に否定の演算を行う。論理関数fが{(p,s),...,(p,s)}と分解されているならば,論理関数¬fは{(p,¬s),...,(p,¬s)}と分解される。すなわち、p側はそのままにして、s側に否定の演算を行うことで、大元の関数の否定が計算できる。 If not, the negative operation is actually performed in the fourth line and below. If the logical function f is decomposed into {(p 1 , s 1 ), ..., ( pn , s n )}, then the logical function ¬f is {(p 1 , ¬s 1 ) ,. ., (P n , ¬s n )}. That is, the negation of the original function can be calculated by performing the negation operation on the si side while leaving the p i side as it is.

まず、6-9行目でp側の計算を行う。p側はそのままにするので、定数やリテラルなら変更を加えず、そうでない場合もflg=falseのNegateを実行することでそのまま同じものを返す。 First, the calculation on the pi side is performed on the 6th to 9th lines. Since the pi side is left as it is, if it is a constant or literal, it is not changed, and if it is not, the same thing is returned as it is by executing Negate of flg = false.

次に10-13行目でs側の計算を行う。s側はもしflg=falseならばpと同様に変更を加えないが、flg=trueならば、もしsが定数やリテラルならばそのまま否定を計算し(11行目)、そうでなければそれ以下のノードの否定を再帰的に計算する(13行目)。最後に15、16行目で、もしまだ合同な部分構造が既に現れていなければ新たな分解ノードのVS-SDDを作成する。合同な部分構造を処理済みであればそれに対応するVS-SDDへのポインタを返す。 Next, the calculation on the si side is performed on the 10th to 13th lines. If s i is flg = false, it does not change like p i , but if flg = true, if s i is a constant or a literal, it calculates the negation as it is (line 11), otherwise. If so, the negation of the nodes below it is calculated recursively (line 13). Finally, on lines 15 and 16, if the congruent substructure has not already appeared, a new decomposition node VS-SDD is created. If the congruent substructure has been processed, a pointer to the corresponding VS-SDD is returned.

構築部M13は、VS-SDDが2つ与えられたときの、論理和や論理積、排他的論理和などの二項演算を、図11A~Cに示すAlgorithm 4により実行する。 The construction unit M13 executes a binary operation such as a logical sum, a logical product, and an exclusive logical sum when two VS-SDDs are given, according to Algorithm 4 shown in FIGS. 11A to 11C.

図11A~Cに示すように、VS-SDD α,βに対して、従うvtreeノード番号をそれぞれjα、jβとすれば、Apply(α,β,false,false,jα,jβ,〇)が返す結果が、α、βが表す論理関数に〇を適用した論理関数を表すVS-SDDとなる。なお、〇には論理和∨、論理積∧、排他的論理和+などの二項演算が入るものとする。 As shown in FIGS. 11A to 11C, if the vtree node numbers to be followed for VS-SDD α and β are j α and j β , respectively, Apply (α, β, false, false, j α , j β , The result returned by 〇) is VS-SDD representing a logical function obtained by applying 〇 to the logical function represented by α and β. In addition, it is assumed that binary operations such as logical sum ∨, logical product ∧, and exclusive OR + are entered in 〇.

Algorithm 4でも連想配列は2つ用いられており、ConvTableは演算結果を保存しておくため、UniqTableは演算済みのノードたちを格納するために使われる。擬似コード中で、3行目のLCAは、2つのvtreeノード番号x、yが入力されたときに、番号xのノードと番号yのノードからそれぞれ根の方向に木を辿ったときにどちらでも訪れるノードの中で、最も深いもの(最近共通祖先)を返す関数である。 Two associative arrays are also used in Algorithm 4, ConvTable is used to store the operation result, and UniqTable is used to store the calculated nodes. In the pseudocode, the LCA on the third line is either when two vtree node numbers x and y are entered and the tree is traced from the node with the number x and the node with the number y to the root respectively. A function that returns the deepest node (recently common ancestor) to visit.

また、35行目のConsistentは、入力されたVS-SDDが表す論理関数がfalseでないかどうかを判定する関数で、その擬似コードはAlgorithm 5(図12)に示される。通常のSDDにおける同様の演算(Apply演算)と異なる点は、VS-SDDでは今注目しているノード(αとβ)が従うvtreeノードの番号(jα,jβ)を常に追跡するという点である。図11A~Cに示すAlgorithm 4の内容はより詳細には下記のとおりである。 The Consistency on the 35th line is a function for determining whether or not the logical function represented by the input VS-SDD is not false, and its pseudo code is shown in Algorithm 5 (FIG. 12). The difference from the same operation (Apply operation) in normal SDD is that VS-SDD always tracks the vtree node number (j α , j β ) that the node (α and β) of interest follows. Is. The contents of Algorithm 4 shown in FIGS. 11A to 11C are as follows in more detail.

1-5行目は前処理である。ここでvと¬vはリテラルを表している。6-8行目では、もしαとβが両方定数か、片方が定数で片方がリテラルか,もしくは両方とも同じ変数に関するリテラルであれば、その演算結果α○βをすぐに返す。 Lines 1-5 are preprocessing. Where v and ¬v represent literals. In lines 6-8, if α and β are both constants, one is a constant and one is a literal, or both are literals related to the same variable, the operation result α ○ β is returned immediately.

また、9、10行目では、既に同様の計算が行われていればその計算結果へのポインタを返すことにより、全く同じ計算を二度以上行うことを防ぐ。このとき、ConvTableの第5、6引数として,jαとjβの代わりに4、5行目で計算したeαとeβを使うことで、合同性から生じる実質的に等価な演算を二度以上行うことも防いでいる。これらいずれにも当てはまらないならば12行目以降で実際に演算を行う。 Further, in the 9th and 10th lines, if the same calculation has already been performed, a pointer to the calculation result is returned to prevent the exact same calculation from being performed twice or more. At this time, by using e α and e β calculated in the 4th and 5th lines instead of j α and j β as the 5th and 6th arguments of ConvTable, two substantially equivalent operations resulting from congruence can be performed. It also prevents doing more than once. If none of these apply, the actual calculation is performed from the 12th line onward.

vtree vαに従うαとvβに従うβの演算結果のVS-SDDは、vtree LCA(vα,vβ)に従う。そこで、12-23行目では、まずαとβの、LCA(vα,vβ)での分解をα´とβ´で格納しておいて、以降の計算はα´とβ´を用いて進める。
以降は、α´={(p,s),...,(p,s)},β´={(q,r),...,(q,r)}に対して、α´○β´の結果は{(p∧q,s○r),...,(p∧q,s○r),...,(p∧q,s○r),...,(p∧q,s○r)}となることを用いる。
The VS-SDD of the operation result of α according to vtree v α and β according to v β follows vtree LCA (v α , v β ). Therefore, in the 12th to 23rd lines, the decomposition of α and β by LCA (v α , v β ) is stored in α'and β', and the subsequent calculations use α'and β'. And proceed.
After that, α'= {(p 1 , s 1 ), ..., ( pn , sn) } , β'= {(q 1 , r 1 ), ..., (q m , r m ) )}, The result of α'○ β'is {(p 1 ∧ q 1 , s 1 ○ r 1 ), ..., (p 1 ∧ q m , s 1 ○ r m ), ... , (P n ∧ q 1 , s n ○ r 1 ), ..., ( pn ∧ q m , s n ○ r m )}.

各α´中の(p,s,f{p,i},f{s,i})とβ´中の(q,r,f{q,l},f{r,l})の組に対して、26-30,32,33行目で必要な変換を行い、34行目でp∧qを計算する。 (P i , s i , f {p, i} , f {s, i} ) in each α'and (q l , r l , f {q, l} , f {r, l in β' } ) Perform the necessary conversions on lines 26-30, 32, and 33, and calculate pi ∧ q l on line 34.

もしp∧qがfalseになってしまったら、対応するs○rを計算する意味がないので、35行目のConsistentでこれを判定して、もしfalseでなければ36行目でs○rを計算する。37-40行目で変換を行って、41行目で(p∧q,s○r)を計算結果に加える。 If p i ∧ q l becomes false, there is no point in calculating the corresponding si ○ r l , so judge this with the Consistent on the 35th line, and if it is not false, on the 36th line. s i ○ r l is calculated. The conversion is performed on the 37th to 40th lines, and (pi ∧ q l , s i ○ r l ) is added to the calculation result on the 41st line.

42-43行目では、Algorithm 3と同様に、まだ合同な部分構造が現れていなければ新たな分解ノードのVS-SDDを生成する。また、合同な部分構造を処理済みであれば、そのVS-SDDへのポインタを返す。 In lines 42-43, similar to Algorithm 3, a new decomposition node VS-SDD is generated if a congruent partial structure has not yet appeared. If the congruent substructure has been processed, a pointer to the VS-SDD is returned.

(効果について)
VS-SDDの効果は端的には、SDDと比べて表現がコンパクトになり、それに従って種々のクエリや他の論理関数との組み合わせなどの処理も高速になるという点に集約される。まずVS-SDDのサイズに関して説明した後に、モデルカウント及び他の論理関数との組み合わせについて説明する。
(About the effect)
The effect of VS-SDD is simply that the expression is more compact than SDD, and the processing such as various queries and combinations with other logical functions is speeded up accordingly. First, the size of VS-SDD will be described, and then the model count and the combination with other logical functions will be described.

まずVS-SDDのサイズについて、VS-SDDをSDDから作るアルゴリズム(Algorithm 2(図7))で行なっていることは、vtreeノード番号の差を考えた結果同一になった部分構造を共有する、というだけなので、SDDをVS-SDDに変換する際にサイズが大きくなることはない。さらに、SDDよりVS-SDDの方が表現のサイズが指数倍小さくなるような論理関数も存在する。 First, regarding the size of VS-SDD, what is done by the algorithm for making VS-SDD from SDD (Algorithm 2 (Fig. 7)) shares the same partial structure as a result of considering the difference in vtree node numbers. Therefore, the size does not increase when converting SDD to VS-SDD. Further, there is also a logical function in which the size of the expression of VS-SDD is exponentially smaller than that of SDD.

次に、VS-SDDにおけるモデルカウントについて説明する。VS-SDD αが与えられたとき、αが表す論理関数のモデルカウントはAlgorithm 6(図13)により計算できる。Algorithm 6の中で、整数jに対しnum-1(j)は(行きがけ順)ノード番号がjであるようなvtreeノードを表す。また、vtreeノードwに対して、l(w)はwを根とするvtreeの部分木内に存在する葉の数である。前述したとおり、vtreeノードvに対して、vやvはその左の子ノードや右の子ノードのことである。VS-SDDにおけるモデルカウントでは、vtreeノード番号の差を考えることにより新たに共有されたノードも一度しか走査しないことから、通常のSDDにおけるモデルカウントよりサイズが小さくなった分高速に動作する。 Next, the model count in VS-SDD will be described. Given VS-SDD α, the model count of the logical function represented by α can be calculated by Algorithm 6 (FIG. 13). In Algorithm 6, for an integer j, num -1 (j) represents a vtree node such that the node number is j (in the order of destination). Also, for vtree node w, l (w) is the number of leaves present in the vtree subtree rooted at w. As described above, for vtree node v, v l and v r are child nodes on the left and child nodes on the right. In the model count in VS-SDD, the newly shared node is also scanned only once by considering the difference in vtree node numbers, so that the model count operates at a higher speed because the size is smaller than the model count in normal SDD.

最後に、VS-SDDにおける、他の論理関数との組み合わせの操作(Apply演算)について説明する。VS-SDDを用いて論理関数同士の論理積や論理和、排他的論理和などをとるアルゴリズムはAlgorithm 4(図11A~C)に示した通りである。VS-SDDにおけるApply演算でも、モデルカウントの計算と同様に、新たにノードが共有されたことによって、SDDにおけるApply演算で二回以上計算を行っていた部分を一回のみにする効果があり、サイズが小さくなった分高速に動作する。 Finally, the operation (Apply operation) in combination with other logical functions in VS-SDD will be described. The algorithm for taking the logical product, OR, exclusive OR, etc. of logical functions using VS-SDD is as shown in Algorithm 4 (FIGS. 11A to 11C). In the Apply operation in VS-SDD, as in the model count calculation, the new node is shared, which has the effect of reducing the part that was calculated more than once in the Apply operation in SDD to only once. It operates faster because of its smaller size.

(実施の形態のまとめ)
以上、説明したように、本明細書には少なくとも下記の各項に記載された装置、方法、データ構造、及びプログラムが記載されている。
(第1項)
所定の木構造に従って論理関数の分解を表現したグラフ構造データを生成するデータ生成装置であって、
前記論理関数を分解する際の変数順序を特定する順序木に基づいて、前記論理関数の分解の中で構造が同一な分解を表す複数の部分構造が特定された場合に、当該複数の部分構造の中から選択される1つの部分構造を代表部分構造として、
残りの前記構造が同一の部分構造の親ノードに対応する前記グラフ構造中のデータが、前記代表部分構造に対応するグラフ構造データをポインタにより共有するように、前記論理関数に対応するグラフ構造データを生成する構築部、を備える
データ生成装置。
(第2項)
予め定められた規則に従って、前記順序木の各節点に節点番号を付与し、前記順序木の各辺の両端のノードに付された前記節点番号の差分に基づいて前記順序木の中で構造が同一な部分木を特定する前処理部をさらに備え、
前記構築部は、前記前処理部で特定した構造が同一な部分木を用いて、前記構造が同一な複数の部分構造を特定する
第1項記載のデータ生成装置。
(第3項)
前記構築部は、前記論理関数に対応するSDDを表すグラフ構造データを入力として、
前記入力されたグラフ構造データ中にリテラルを表すデータが含まれる場合は、当該リテラルに対応する前記節点番号と当該リテラルを含む分解ノードに対応する分解を表す前記部分木の根ノードの節点番号との差分におきかえるとともに、
前記入力されたグラフ構造データ中に他の分解ノードへのポインタが含まれる場合は、前処理部で特定した構造が同一な部分木に対応する部分構造であるグラフ構造データが既に構築されている場合には、当該ポインタの指す先が、当該既に構築されたグラフ構造データの情報格納先となるようにポインタを変更する
第2項記載のデータ生成装置。
(第4項)
前記構築部は、前記順序木により特定される変数の分解の順序に従い、各変数の分解に対応する前記グラフ構造データを生成するものであり、
前記グラフ構造データは、その分解の要素がリテラルの場合は、当該リテラルに対応する前記節点番号と当該リテラルを含む分解ノードに対応する分解を表す前記部分木の根ノードの節点番号との差分の値を格納し、
その分解の要素が定数の場合は定数を格納し、
その分解の要素が他の分解を参照するものである場合は、前処理部で特定した構造が同一な部分木に対応する部分構造であるグラフ構造データが既に構築されている場合には、当該ポインタの指す先を当該既に構築されたグラフ構造データの情報格納先を指すポインタの情報を格納し、そうでない場合には、前記他の分解に対応するグラフ構造データを作成すると共に当該他の分解に対応するグラフ構造データの情報格納先を指すポインタの情報を格納することにより生成される
第2項記載のデータ生成装置。
(第5項)
所定の木構造に従って論理関数の分解を表現したグラフ構造データを生成するデータ生成装置が実行するデータ生成方法であって、
前記論理関数を分解する際の変数順序を特定する順序木に基づいて、前記論理関数の分解の中で構造が同一な分解を表す複数の部分構造が特定された場合に、当該複数の部分構造の中から選択される1つの部分構造を代表部分構造として、
残りの前記構造が同一の部分構造の親ノードに対応する前記グラフ構造中のデータが、前記代表部分構造に対応するグラフ構造データをポインタにより共有するように、前記論理関数に対応するグラフ構造データを生成する構築ステップ、を備える
データ生成方法。
(第6項)
所定の木構造に従って論理関数の分解を表現するグラフ構造のデータ構造であって、
前記所定の木構造における葉の変数に対応する要素の値を、当該葉に対応する前記所定の木構造における節点の節点番号と当該要素を持つノードが従う前記所定の木構造における節点の節点番号との差とし、
ポインタを有する要素の値を、当該ポインタが指す先のノードが従う前記所定の木構造の節点の節点番号と当該要素を持つノードが従う前記所定の木構造の節点の節点番号との差、及び当該ポインタとした
データ構造。
(第7項)
コンピュータを、第1項ないし第4項のうちいずれか1項に記載のデータ生成装置の各部として機能させるためのプログラム。
(Summary of embodiments)
As described above, the present specification describes at least the devices, methods, data structures, and programs described in the following sections.
(Section 1)
A data generator that generates graph structure data that expresses the decomposition of logical functions according to a predetermined tree structure.
Based on the order tree that specifies the variable order when decomposing the logical function, when a plurality of substructures representing the same decomposition are specified in the decomposition of the logical function, the plurality of substructures are specified. As a representative substructure, one substructure selected from the above is used as a representative substructure.
The graph structure data corresponding to the logical function so that the remaining data in the graph structure corresponding to the parent node of the same partial structure shares the graph structure data corresponding to the representative partial structure by the pointer. A data generator, including a construction unit that produces.
(Section 2)
A node number is assigned to each node of the order tree according to a predetermined rule, and a structure is formed in the order tree based on the difference of the node numbers attached to the nodes at both ends of each side of the order tree. Further equipped with a pretreatment section that identifies the same subtree,
The data generation device according to paragraph 1, wherein the construction unit uses a subtree having the same structure specified by the pretreatment unit to specify a plurality of substructures having the same structure.
(Section 3)
The construction unit receives graph structure data representing the SDD corresponding to the logical function as an input.
If the input graph structure data contains data representing a literal, the difference between the node number corresponding to the literal and the node number of the root node of the subtree representing the decomposition corresponding to the decomposition node containing the literal. As well as replacing it with
If the input graph structure data includes a pointer to another decomposition node, the graph structure data that is a partial structure corresponding to the subtree whose structure specified by the preprocessing unit is the same has already been constructed. In this case, the data generation device according to the second paragraph, which changes the pointer so that the point pointed to by the pointer becomes the information storage destination of the graph structure data already constructed.
(Section 4)
The construction unit generates the graph structure data corresponding to the decomposition of each variable according to the order of decomposition of the variables specified by the order tree.
When the element of the decomposition is a literal, the graph structure data is the value of the difference between the node number corresponding to the literal and the node number of the root node of the subtree representing the decomposition corresponding to the decomposition node including the literal. Store and
If the element of the decomposition is a constant, store the constant and
When the element of the decomposition refers to another decomposition, if the graph structure data in which the structure specified by the preprocessing unit is a partial structure corresponding to the same subtree has already been constructed, the relevant The point pointed to by the pointer stores the information of the pointer pointing to the information storage destination of the already constructed graph structure data. If not, the graph structure data corresponding to the other decomposition is created and the other decomposition is performed. The data generation device according to Section 2, which is generated by storing information of a pointer pointing to an information storage destination of graph structure data corresponding to.
(Section 5)
It is a data generation method executed by a data generator that generates graph structure data that expresses the decomposition of a logical function according to a predetermined tree structure.
Based on the order tree that specifies the variable order when decomposing the logical function, when a plurality of substructures representing the same decomposition are specified in the decomposition of the logical function, the plurality of substructures are specified. As a representative substructure, one substructure selected from the above is used as a representative substructure.
The graph structure data corresponding to the logical function so that the remaining data in the graph structure corresponding to the parent node of the same partial structure shares the graph structure data corresponding to the representative partial structure by the pointer. A construction step, which includes a data generation method.
(Section 6)
It is a data structure of a graph structure that expresses the decomposition of a logical function according to a predetermined tree structure.
The value of the element corresponding to the leaf variable in the predetermined tree structure is the node number of the node in the predetermined tree structure corresponding to the leaf and the node number of the node in the predetermined tree structure followed by the node having the element. As a difference with
The value of the element having the pointer is the difference between the node number of the node of the predetermined tree structure followed by the node pointed to by the pointer and the node number of the node of the predetermined tree structure followed by the node having the element. The data structure used as the pointer.
(Section 7)
A program for making a computer function as each part of the data generation device according to any one of the items 1 to 4.

以上、本実施の形態について説明したが、本発明はかかる特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。 Although the present embodiment has been described above, the present invention is not limited to such a specific embodiment, and various modifications and changes can be made within the scope of the gist of the present invention described in the claims. It is possible.

100、200 データ構造変換装置
M01、M11 入力部
M02、M12 前処理部
M03、M13 変換部
M04、M14 出力部
1000 ドライブ装置
1002 補助記憶装置
1003 メモリ装置
1004 CPU
1005 インタフェース装置
1006 表示装置
1007 入力装置
100, 200 Data structure conversion device M01, M11 Input unit M02, M12 Preprocessing unit M03, M13 Conversion unit M04, M14 Output unit 1000 Drive device 1002 Auxiliary storage device 1003 Memory device 1004 CPU
1005 Interface device 1006 Display device 1007 Input device

Claims (6)

所定の木構造に従って論理関数の分解を表現したグラフ構造データを生成するデータ生成装置であって、
前記論理関数を分解する際の変数順序を特定する順序木に基づいて、前記論理関数の分解の中で構造が同一な分解を表す複数の部分構造が特定された場合に、当該複数の部分構造の中から選択される1つの部分構造を代表部分構造として、
残りの前記構造が同一の部分構造の親ノードに対応するグラフ構造中のデータが、前記代表部分構造に対応するグラフ構造データをポインタにより共有するように、前記論理関数に対応するグラフ構造データを生成する構築部、を備える
データ生成装置。
A data generator that generates graph structure data that expresses the decomposition of logical functions according to a predetermined tree structure.
Based on the order tree that specifies the variable order when decomposing the logical function, when a plurality of substructures representing the same decomposition are specified in the decomposition of the logical function, the plurality of substructures are specified. As a representative substructure, one substructure selected from the above is used as a representative substructure.
The graph structure data corresponding to the logical function is shared so that the remaining data in the graph structure corresponding to the parent node of the same partial structure shares the graph structure data corresponding to the representative partial structure by the pointer. A data generator with a building unit to generate.
予め定められた規則に従って、前記順序木の各節点に節点番号を付与し、前記順序木の各辺の両端のノードに付された前記節点番号の差分に基づいて前記順序木の中で構造が同一な部分木を特定する前処理部をさらに備え、
前記構築部は、前記前処理部で特定した構造が同一な部分木を用いて、前記構造が同一な複数の部分構造を特定する
請求項1記載のデータ生成装置。
A node number is assigned to each node of the order tree according to a predetermined rule, and a structure is formed in the order tree based on the difference of the node numbers attached to the nodes at both ends of each side of the order tree. Further equipped with a pretreatment section that identifies the same subtree,
The data generation device according to claim 1, wherein the construction unit uses a subtree having the same structure specified by the pretreatment unit to specify a plurality of substructures having the same structure.
前記構築部は、前記論理関数に対応するSDDを表すグラフ構造データを入力として、
前記入力されたグラフ構造データ中にリテラルを表すデータが含まれる場合は、当該リテラルに対応する前記節点番号と当該リテラルを含む分解ノードに対応する分解を表す前記部分木の根ノードの節点番号との差分におきかえるとともに、
前記入力されたグラフ構造データ中に他の分解ノードへのポインタが含まれる場合は、前処理部で特定した構造が同一な部分木に対応する部分構造であるグラフ構造データが既に構築されている場合には、当該ポインタの指す先が、当該既に構築されたグラフ構造データの情報格納先となるようにポインタを変更する
請求項2記載のデータ生成装置。
The construction unit receives graph structure data representing the SDD corresponding to the logical function as an input.
If the input graph structure data contains data representing a literal, the difference between the node number corresponding to the literal and the node number of the root node of the subtree representing the decomposition corresponding to the decomposition node containing the literal. As well as replacing it with
If the input graph structure data includes a pointer to another decomposition node, the graph structure data that is a partial structure corresponding to the subtree whose structure specified by the preprocessing unit is the same has already been constructed. In this case, the data generation device according to claim 2, wherein the pointer is changed so that the point pointed to by the pointer becomes the information storage destination of the graph structure data already constructed.
前記構築部は、前記順序木により特定される変数の分解の順序に従い、各変数の分解に対応する前記グラフ構造データを生成するものであり、
前記グラフ構造データは、その分解の要素がリテラルの場合は、当該リテラルに対応する前記節点番号と当該リテラルを含む分解ノードに対応する分解を表す前記部分木の根ノードの節点番号との差分の値を格納し、
その分解の要素が定数の場合は定数を格納し、
その分解の要素が他の分解を参照するものである場合は、前処理部で特定した構造が同一な部分木に対応する部分構造であるグラフ構造データが既に構築されている場合には、当該ポインタの指す先を当該既に構築されたグラフ構造データの情報格納先を指すポインタの情報を格納し、そうでない場合には、前記他の分解に対応するグラフ構造データを作成すると共に当該他の分解に対応するグラフ構造データの情報格納先を指すポインタの情報を格納することにより生成される
請求項2記載のデータ生成装置。
The construction unit generates the graph structure data corresponding to the decomposition of each variable according to the order of decomposition of the variables specified by the order tree.
When the element of the decomposition is a literal, the graph structure data is the value of the difference between the node number corresponding to the literal and the node number of the root node of the subtree representing the decomposition corresponding to the decomposition node including the literal. Store and
If the element of the decomposition is a constant, store the constant and
When the element of the decomposition refers to another decomposition, if the graph structure data in which the structure specified by the preprocessing unit is a partial structure corresponding to the same subtree has already been constructed, the relevant The destination pointed to by the pointer stores the information of the pointer pointing to the information storage destination of the already constructed graph structure data. If not, the graph structure data corresponding to the other decomposition is created and the other decomposition is performed. The data generation device according to claim 2, which is generated by storing information of a pointer pointing to an information storage destination of graph structure data corresponding to.
所定の木構造に従って論理関数の分解を表現したグラフ構造データを生成するために、コンピュータにプログラムを実行させることにより、前記コンピュータが実行するデータ生成方法であって、
前記論理関数を分解する際の変数順序を特定する順序木に基づいて、前記論理関数の分解の中で構造が同一な分解を表す複数の部分構造が特定された場合に、当該複数の部分構造の中から選択される1つの部分構造を代表部分構造として、
残りの前記構造が同一の部分構造の親ノードに対応するグラフ構造中のデータが、前記代表部分構造に対応するグラフ構造データをポインタにより共有するように、前記論理関数に対応するグラフ構造データを、前記コンピュータが生成する構築ステップ、を備える
データ生成方法。
A data generation method executed by a computer by causing a computer to execute a program in order to generate graph structure data expressing the decomposition of a logical function according to a predetermined tree structure.
Based on the order tree that specifies the variable order when decomposing the logical function, when a plurality of substructures representing the same decomposition are specified in the decomposition of the logical function, the plurality of substructures are specified. As a representative substructure, one substructure selected from the above is used as a representative substructure.
The graph structure data corresponding to the logical function is shared so that the remaining data in the graph structure corresponding to the parent node of the same partial structure shares the graph structure data corresponding to the representative partial structure by the pointer. A data generation method comprising, said computer -generated construction steps.
コンピュータを、請求項1ないし4のうちいずれか1項に記載のデータ生成装置の各部として機能させるためのプログラム。 A program for making a computer function as each part of the data generation device according to any one of claims 1 to 4.
JP2019026737A 2019-02-18 2019-02-18 Data generator, data generation method, and program Active JP7048032B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2019026737A JP7048032B2 (en) 2019-02-18 2019-02-18 Data generator, data generation method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2019026737A JP7048032B2 (en) 2019-02-18 2019-02-18 Data generator, data generation method, and program

Publications (2)

Publication Number Publication Date
JP2020135305A JP2020135305A (en) 2020-08-31
JP7048032B2 true JP7048032B2 (en) 2022-04-05

Family

ID=72263162

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2019026737A Active JP7048032B2 (en) 2019-02-18 2019-02-18 Data generator, data generation method, and program

Country Status (1)

Country Link
JP (1) JP7048032B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114510609B (en) * 2022-02-17 2024-07-23 腾讯科技(深圳)有限公司 Method, device, equipment, medium and program product for generating structured data

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100275169A1 (en) 2009-04-27 2010-10-28 Synopsys, Inc. Adaptive state-to-symbolic transformation in a canonical representation
JP2014154107A (en) 2013-02-13 2014-08-25 Fujitsu Ltd Binary decision graph processing system and method
WO2015087957A1 (en) 2013-12-12 2015-06-18 国立大学法人 東京工業大学 Logic circuit generation device and method

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100275169A1 (en) 2009-04-27 2010-10-28 Synopsys, Inc. Adaptive state-to-symbolic transformation in a canonical representation
JP2014154107A (en) 2013-02-13 2014-08-25 Fujitsu Ltd Binary decision graph processing system and method
WO2015087957A1 (en) 2013-12-12 2015-06-18 国立大学法人 東京工業大学 Logic circuit generation device and method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
湊真一、外1名,ゼロサプレス型二分決定グラフを用いたトランザクションデータベースの効率的解析手法,電子情報通信学会論文誌,Vol.J89-D,No.2,社団法人電子情報通信学会,2006年02月01日,pp.172-182
西野 正彬、外3名,グラフ部分構造列挙のためのゼロサプレス型項分岐決定図の効率的な構築法,情報処理学会 研究報告 アルゴリズム(AL),日本,情報処理学会,2016年09月16日,p.1-8
青木 洋士、外2名,写像枝を用いた系列二分決定グラフの効率化,情報処理学会 研究報告 アルゴリズム(AL),日本,情報処理学会,2013年05月10日,p.1-8

Also Published As

Publication number Publication date
JP2020135305A (en) 2020-08-31

Similar Documents

Publication Publication Date Title
Björklund et al. Set partitioning via inclusion-exclusion
Ahuja et al. Improved time bounds for the maximum flow problem
Cerinšek et al. Generalized two-mode cores
Ong Quantitative semantics of the lambda calculus: Some generalisations of the relational model
Naumov et al. Parallel depth-first search for directed acyclic graphs
Sioutis et al. An efficient approach for tackling large real world qualitative spatial networks
JP7048032B2 (en) Data generator, data generation method, and program
Baswana et al. Incremental algorithm for maintaining a DFS tree for undirected graphs
JP6451997B2 (en) Arithmetic execution apparatus, method, and program
Minato π DD: a new decision diagram for efficient problem solving in permutation space
Jung et al. Efficient operations between mdds and constraints
Baumgartner et al. Term-graph anti-unification
Bhattiprolu et al. Extending Parikh’s theorem to weighted and probabilistic context-free grammars
Formenti et al. MDDs boost equation solving on discrete dynamical systems
Panagiotou et al. Exact-size sampling of enriched trees in linear time
Szykuła et al. An extremal series of eulerian synchronizing automata
Duch et al. Selection by rank in K‐dimensional binary search trees
Glinskih et al. On Tseitin formulas, read-once branching programs and treewidth
Vaidyanathan Faster strongly polynomial algorithms for the unbalanced transportation problem and assignment problem with monge costs
Biswas et al. Sublinear-Space Approximation Algorithms for Max r-SAT
Ancona et al. Path problems in structured graphs
Beneš et al. Symbolic coloured SCC decomposition
Chowdhury et al. Non-zero multi-valued decision diagram (NZMDD) based synthesis of multi-valued logic (MVL) functions
Kaplan et al. Soft heaps simplified
Chen et al. A new 2-approximation algorithm for rSPR distance

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7426

Effective date: 20190221

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20190221

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20210204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20211215

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20211221

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220221

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220314

R150 Certificate of patent or registration of utility model

Ref document number: 7048032

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350