• 検索結果がありません。

Adding a NAND gate

ドキュメント内 組合せ的文字列分解 (ページ 51-62)

IfP ends with any of

$, #, x2a, xab0xa, a, xac0xa, x4a, $0, #0, x7a, b0, xa¯axa, c0, x3a, x6a,

$, #, x2a, xab0xa, a, xac0xa, x4a, $0, #0, x7a, b0, xa¯axa, c0, x6a, x3a,

$, #, x2a, xab0xa, a, xac0xa, x4a, $0, #0, x7a, b0, xa¯axa, c0, x9a

followed by

$00, #00, xbbxb, b0, xbb0xb, ¯b, xb, $000, #000, xccxc, c0, xcc0xc, ¯c, xc,

then¯a must be a complete factor in the prefix ofP encodingτ, soτ must make the output of Ci−1 labelled afalse. Since¯b, c,¯ xb, xc, xbbxb andxccxc are complete factors butb, c, xb¯bxb, xccx¯ c, xjb andxjc for j > 1 are not, P encodes the assignment to the inputs of Ci that makes them true or false according toτ.

Since these are all the possibilities for howP can end, each diverse palindromic factorization ofSi encodes some assignment to the inputs ofCi. This gives us the following lemma:

Lemma 15. If we have a string Si−1 that represents Ci−1 and Ci is obtained from Ci−1 by splitting an output ofCi−1 into two outputs, then in constant time we can append symbols to Si−1 to obtain a stringSithat representsCi.

Since$,$0,$00,$000,#and#0do not occur inSi−1and occur as pairs of consecutive charac-ters inSi0, they must each be complete factors in any palindromic factorization ofSi0. Therefore, any diverse palindromic factorization ofSi0 consists of

1. a diverse palindromic factorization ofSi−10 , 2. $, #,

3. a diverse palindromic factorization ofx3c0a01xc0a1xc0a1xc0a01x5c0, 4. $0, #0,

5. a diverse palindromic factorization ofx7c0a02xc0a2xc0a2xc0a02x9c0, 6. $00, #00,

7. a diverse palindromic factorization ofx11c0b0xc0bxc0¯bxc0b0x13c0.

Ifa1is a complete factor in the factorization ofSi−10 , then the diverse palindromic factoriza-tion of

x3c0a01xc0a1xc0a1xc0a01x5c0

must include either

a01, xc0a1xc0, a1, xc0a01xc0 or a01, xc0a1xc0, a1, xc0, a01.

Notice that in the former case, the factorization need not containxc0. Ifa1 is a complete factor in the factorization ofSi−10 , then the diverse palindromic factorization of

x3c0a01xc0a1xc0a1xc0a01x5c0

must include either

xc0a01xc0, a1, xc0a1xc0, a01 or a01, xc0, a1, xc0a1xc0, a01.

Again, in the former case, the factorization need not containxc0. Symmetric propositions hold fora2andb.

We set

Si00 =Si0$#x15c0a01xc0c0xc0b0x17c0 $††#††x19c0a02xc0dxc0b0x21c0 ,

where$,#,$††,#††,c0 anddare symbols we use only here. Any diverse palindromic factor-ization ofSi00consists of

1. a diverse palindromic factorization ofSi0, 2. $, #,

3. a diverse palindromic factorization ofx15c0a01xc0c0xc0b0x17c0, 4. $††, #††,

5. a diverse palindromic factorization ofx19c0a02xc0dxc0b0x21c0.

Sincea1anda2label outputs inCi−10 split from the same output inCi−1, it follows thata1is a complete factor in a diverse palindromic factorization ofSi−10 if and only if a2 is. Therefore, we need consider only four cases:

Case 1: The factorization ofSi−10 includesa1,a2andbas complete factors, so the factorization ofSi0 includes as complete factors eitherxc0a01xc0, ora01 andxc0; eitherxc0a02xc0, ora02 andxc0; eitherxc0b0xc0, orb0 andxc0; andb0. Trying all the combinations — there are only four, sincexc0 can appear as a complete factor at most once — shows that any diverse palindromic factorization ofSi00includes one of

a01, xc0c0xc0, b0, . . . , a02, xc0, d, xc0b0xc0, a01, xc0c0xc0, b0, . . . , xc0a02xc0, d, xc0b0xc0,

with the latter only possible ifxc0 appears earlier in the factorization.

Case 2: The factorization ofSi−10 includesa1,a2andbas complete factors, so the factorization ofSi0includes as complete factors eitherxc0a01xc0, ora01andxc0; eitherxc0a02xc0, ora02andxc0;b0; and eitherxc0b0xc0, orb0andxc0. Trying all the combinations shows that any diverse palindromic factorization ofSi00includes one of

a01, xc0, c0, xc0b0xc0, . . . , a02, xc0dxc0, b0, xc0a01xc0, c0, xc0b0xc0, . . . , a02, xc0dxc0, b0,

with the latter only possible ifxc0 appears earlier in the factorization.

Case 3: The factorization ofSi−10 includesa1,a2andbas complete factors, so the factorization of Si0 includes as complete factorsa01; a02; either xc0b0xc0, or b0 and xc0; and b0. Trying all the combinations shows that any diverse palindromic factorization ofSi00 includes one of

xc0a01xc0, c0, xc0, b0, . . . , xc0a02xc0, d, xc0b0xc0, xc0a01xc0, c0, xc0b0xc0, . . . , xc0a02xc0, d, xc0b0xc0,

with the latter only possible ifxc0 appears earlier in the factorization.

Case 4: The factorization ofSi−10 includesa1,a2andbas complete factors, so the factorization ofSi0includes as complete factorsa01;a02;b0; and eitherxc0b0xc0, orb0andxc0. Trying all the com-binations shows that any diverse palindromic factorization ofSi00 that extends the factorization ofSi0 includes one of

xc0a01xc0, c0, xc0b0xc0, . . . , xc0a02xc0, d, xc0, b0, xc0a01xc0, c0, xc0b0xc0, . . . , xc0a02xc0, d, xc0b0xc0,

with the latter only possible ifxc0 appears earlier in the factorization.

Summing up, any diverse palindromic factorization ofSi00 always includesxc0 and includes eitherxc0c0xc0 if the factorization ofSi−10 includesa1,a2 andb as complete factors, orc0 other-wise.

We set

Si000 =Si00$†††#†††x23c0c00xc0c0xc0c0xc0c00x25c0 ,

where$†††and#†††are symbols we use only here. Any diverse palindromic factorization ofSi000 consists of

1. a diverse palindromic factorization ofSi00, 2. $†††, #†††,

3. a diverse palindromic factorization ofx23c0c00xc0c0xc0c0xc0c00x25c0.

Since xc0 must appear as a complete factor in the factorization of Si00, if c0 is a complete factor in the factorization ofSi00, then the factorization of

x23c0c00xc0c0xc0c0xc0c00x25c0

must include

c00, xc0c0xc0, c0, xc0c00xc0; otherwise, it must include

xc0c00xc0, c0, xc0c0xc0, c00.

That is, the factorization of x23c0c00xc0c0xc0c0xc0c00x25c0 includes c00, xc0 and xc0c00xc0 but notc00 or xc0c00xc0, if and only if the factorization of Si00 includes c0; otherwise, it includes c00, xc0 and xc0c00xc0 but notc00orxc0c00xc0.

We set

Si =Si000$#xccxcc00xcc00xccxc,

where $, #, c, c and xc are symbols that do not appear in Si000. Any diverse palindromic factorization ofSi consists of

1. a diverse palindromic factorization ofSi000, 2. $, #,

3. a diverse palindromic factorization ofxccxcc00xcc00xccxc.

Since exactly one ofc00andc00must appear as a complete factor in the factorization ofSi000, the factorization of

xccxcc00xcc00xccxc must be either

xc, c, xcc00xc, c00, xccxc or

xccxc, c00, xcc00xc, c, xc.

Thus if c00 is a complete factor in the factorization of Si000, then c, xc and xc¯cxc are complete factors in the factorization ofSibut¯c,xccxcandxjcare not forj >1; otherwise,¯c,xcandxccxc are complete factors butc,xccx¯ candxjcare not forj >1.

AssumeSi−1 representsCi−1. Letτ be an assignment to the inputs ofCi−1 and letP be a diverse palindromic factorization ofSi−1 encodingτ. By Lemma 15 we can extendP toP0 so that it encodes the assignment to the inputs ofCi−10 that makes them true or false according to τ. There are four cases to consider:

Case 1: τ makes the outputs ofCi−1 labelleda and b both true. ThenP0 concatenated with, e.g.,

$, #, x3c0, a01, xc0a1xc0, a1, xc0a01xc0, x4c0,

$0, #0, x7c0, a02, xc0a2xc0, a2, xc0a02xc0, x8c0,

$00, #00, x11c0, b0, xc0bxc0, ¯b, xc0b0xc0, x12c0

is a diverse palindromic factorizationP00ofSi0which, concatenated with, e.g.,

$, #, x15c0, a01, xc0c0xc0, b0, x17c0,

$††, #††, x19c0, a02, xc0, d, xc0b0xc0, x20c0

is a diverse palindromic factorizationP000 ofSi00which, concatenated with, e.g.,

$†††, #†††, x22c0, xc0c00xc0, c0, xc0c0xc0, c00, x25c0

is a diverse palindromic factorizationPofSi000 which, concatenated with

$, #, xccxc, c00, xcc00xc, ¯c, xc

is a diverse palindromic factorizationPofSiin whichc,¯ xcandxccxcare complete factors but c,xc¯cxcandxjcare not forj >1.

Case 2: τ makes the output of Ci−1 labelled a true but the output labelled b false. Then P0 concatenated with, e.g.,

$, #, x3c0, a01, xc0a1xc0, a1, xc0a01xc0, x4c0,

$0, #0, x7c0, a02, xc0a2xc0, a2, xc0a02xc0, x8c0,

$00, #00, x10c0, xc0b0xc0, b, xc0¯bxc0, b0, x13c0

is a diverse palindromic factorizationP00ofSi0which, concatenated with, e.g.,

$, #, x15c0, a01, xc0, c0, xc0b0xc0, x16c0,

$††, #††, x19c0, a02, xc0dxc0, b0, x21c0

is a diverse palindromic factorizationP000 ofSi00which, concatenated with, e.g.,

$†††, #†††, x23c0, c00, xc0c0xc0, c0, xc0c00xc0, x24c0

is a diverse palindromic factorizationPofSi000 which, concatenated with

$, #, xc, c, xcc00xc, c00, xc¯cxc

is a diverse palindromic factorizationPofSiin whichc,xc¯cxcandxcare complete factors but

¯

c,xccxcandxjcare not forj >1.

Case 3: τ makes the output of Ci−1 labelled a false but the output labelledb true. Then P0 concatenated with, e.g.,

$, #, x2c0, xc0a01xc0, a1, xc0a1xc0, a01, x5c0,

$0, #0, x6c0, xc0a02xc0, a2, xc0a2xc0, a02, x9c0,

$00, #00, x11c0, b0, xc0bxc0, ¯b, xc0b0xc0, x12c0

is a diverse palindromic factorizationP00ofSi0which, concatenated with, e.g.,

$, #, x14c0, xc0a01xc0, c0, xc0, b0, x17c0,

$††, #††, x18c0, xc0a02xc0, d, xc0b0xc0, x20c0

is a diverse palindromic factorizationP000 ofSi00which, concatenated with, e.g.,

$†††, #†††, x23c0, c00, xc0c0xc0, c0, xc0c00xc0, x24c0

is a diverse palindromic factorizationPofSi000 which, concatenated with

$, #, xc, c, xcc00xc, c00, xc¯cxc

is a diverse palindromic factorizationPofSiin whichc,xc¯cxcandxcare complete factors but

¯

c,xccxcandxjcare not forj >1.

Case 4: τ makes the outputs of Ci−1 labelleda andb both false. Then P0 concatenated with,

e.g.,

$, #, x2c0, xc0a01xc0, a1, xc0a1xc0, a01, x5c0,

$0, #0, x6c0, xc0a02xc0, a2, xc0a2xc0, a02, x9c0,

$00, #00, x10c0, xc0b0xc0, b, xc0¯bxc0, b0, x13c0

is a diverse palindromic factorizationP00ofSi0which, concatenated with, e.g.,

$, #, x14c0, xc0a01xc0, c0, xc0b0xc0, x16c0,

$††, #††, x18c0, xc0a02xc0, d, xc0, b0, x21c0

is a diverse palindromic factorizationP000 ofSi00which, concatenated with, e.g.,

$†††, #†††, x23c0, c00, xc0c0xc0, c0, xc0c00xc0, x24c0

is a diverse palindromic factorizationPofSi000 which, concatenated with

$, #, xc, c, xcc00xc, c00, xc¯cxc

is a diverse palindromic factorizationPofSiin whichc,xc¯cxcandxcare complete factors but

¯

c,xccxcandxjcare not forj >1.

Notice that in all casesPencodes the assignment to the inputs ofCi that makes them true or false according toτ. SinceCi−1 andCi have the same inputs, each assignment to the inputs ofCi is encoded by some diverse palindromic factorization ofSi.

Now let P be a diverse palindromic factorization of Si and let τ be the assignment to the inputs ofCi−1that is encoded by a prefix ofP. LetPˆ be a diverse palindromic factorization of Si−10 . Sincea1anda2 are obtained by splittingainSi−1, it follows thata1 is a complete factor ofPˆif and only if a2 is. Therefore, in what follows we only consider any diverse palindromic factorizationP ofSiin which either botha1 anda2 are complete factors, or neithera1nora2is a complete factor.

LetP0 be the prefix ofP that is a diverse palindromic factorization ofSi000. Case A:Suppose the factorization of

x23c0c00xc0c0xc0c0xc0c00x25c0

in P0 includes c00 as a complete factor, which is the case if and only if P includesc,¯ xc and xccxcas complete factors but notc,xc¯cxcandxjcforj >1. We will show thatτ must make the outputs ofCi−1 labelledaandb true. Let P00 be the prefix ofP0 that is a diverse palindromic factorization ofSi00. Sincec00is a complete factor in the factorization of

x23c0c00xc0c0xc0c0xc0c00x25c0

inP0, so isc0. Therefore,c0 is not a complete factor in the factorization of x15c0a01xc0c0xc0b0x17c0

inP00, soa01 andb0 are.

LetP000be the prefix ofP00that is a diverse palindromic factorization ofSi0. Sincea01 andb0 are complete factors later inP00, they are not complete factors inP000. Therefore,a1 and¯bare complete factors in the factorizations of

x3c0a01xc0a1xc0a1xc0a01x5c0 and x11c0b0xc0bxc0¯bxc0b0x13c0

in P000, so they are not complete factors in the prefix P of P that is a diverse palindromic factorization ofSi−10 . Since we builtSi−10 fromSi−1 with Lemma 15, it follows that a1 and b are complete factors in the prefix ofP that encodesτ. Therefore,τ makes the outputs ofCi−1

labelledaandbtrue.

Case B:Suppose the factorization of

x23c0c00xc0c0xc0c0xc0c00x25c0

inP0 does not includec00 as a complete factor, which implies that it does includexc0c00xc0 as a complete factor. Since, as noted earlier, we can assume thata1 is a complete factor ofP if and only ifa2 is, it follows that the factorization of

x23c0c00xc0c0xc0c0xc0c00x25c0

must include

c00, xc0c0xc0, c0, xc0c00xc0.

Then,P must includexc,candc00as complete factors. We will show thatτ must make at least

one of the outputs of Ci−1 labelled a or b false. LetP00 be the prefix of P0 that is a diverse palindromic factorization ofSi00. Sincexc0c0xc0 is a complete factor in the factorization of

x23c0c00xc0c0xc0c0xc0c00x25c0

inP0,c0 is a complete factor in the factorization of x15c0a01xc0c0xc0b0x17c0

inP00. Then, the factorization of

x15c0a01xc0c0xc0b0x17c0

must include one of the following three:

xc0a01xc0, c0, xc0b0xc0, (5.1) xc0a01xc0, c0, xc0, b0, (5.2) a01, xc0, c0, xc0b0xc0. (5.3) Case B-a: Assume the factorization ofx15c0a01xc0c0xc0b0x17c0 includes (5.1). LetP000 be the prefix ofP00 that is a diverse palindromic factorization ofSi0. Sincea01 and b0 are not complete factors later inP00, they are complete factors inP000. Therefore, there are five combinations of factorizations of

x3c0a01xc0a1xc0a1xc0a01x5c0 and x11c0b0xc0bxc0¯bxc0b0x13c0

inP000, as follows:

Case B-a1: The factorizations include

xc0a01xc0, a1, xc0a1xc0, a01 andxc0b0xc0, b, xc0¯bxc0, b0.

In this case, a1 and b are not complete factors in the prefix of P that encodes τ. Therefore,τ makes both the outputs ofCi−1labelledaandbfalse.

Case B-a2: The factorizations include

xc0a01xc0, a1, xc0a1xc0, a01andb0, xc0bxc0, ¯b, xc0, b0.

In this case,a1 is not a complete factor andb is a complete factor in the prefix ofP that encodesτ. Therefore,τ makes the outputs ofCi−1labelledafalse andbtrue.

Case B-a3: The factorizations include

a01, xc0a1xc0, a1, xc0, a01 andxc0b0xc0, b, xc0¯bxc0, b0.

In this case,a1 is a complete factor andbis not a complete factor in the prefix ofP that encodesτ. Therefore,τ makes the outputs ofCi−1labelledatrue andbfalse.

Case B-a4: The factorizations include

a01, xc0, a1, xc0a1xc0, a01 andxc0b0xc0, b, xc0¯bxc0, b0.

In this case, a1 and b are not complete factors in the prefix of P that encodes τ. Therefore,τ makes both the outputs ofCi−1labelledaandbfalse.

Case B-a5: The factorizations include

xc0a01xc0, a1, xc0a1xc0, a01andb0, xc0, b, xc0¯bxc0, b0.

In this case, a1 and b are not complete factors in the prefix of P that encodes τ. Therefore,τ makes both the outputs ofCi−1labelledaandbfalse.

Case B-b: Assume the factorization ofx15c0a01xc0c0xc0b0x17c0 includes (5.2). Let P00 be the prefix ofP0 that is a diverse palindromic factorization ofSi00. LetP000 be the prefix ofP00that is a diverse palindromic factorization ofSi0. Since a01 andxc0b0xc0 are not complete factors later inP00, they are complete factors inP000. Therefore, the factorizations of

x3c0a01xc0a1xc0a1xc0a01x5c0 and x11c0b0xc0bxc0¯bxc0b0x13c0

must include

xc0a01xc0, a1, xc0a1xc0, a01 andb0, xc0bxc0, ¯b, xc0b0xc0

inP000. Thena1 is not a complete factor andbis a complete factor in the prefix ofP that encodesτ. Therefore,τ makes the outputs ofCi−1labelledafalse andbtrue.

Case B-c: Assume the factorization ofx15c0a01xc0c0xc0b0x17c0 includes (5.3). LetP00 be the prefix ofP0 that is a diverse palindromic factorization ofSi00. LetP000 be the prefix ofP00that is

a diverse palindromic factorization ofSi0. Since xc0a01xc0 andb0 are not complete factors later inP00, they are complete factors inP000. Therefore, the factorizations of

x3c0a01xc0a1xc0a1xc0a01x5c0 and x11c0b0xc0bxc0¯bxc0b0x13c0 must include

a01, xc0a1xc0, a1, xc0a01xc0 andxc0b0xc0, b, xc0¯bxc0, b0

inP000. Thena1 is a complete factor andb is not a complete factor in the prefix ofP that encodesτ. Therefore,τ makes the outputs ofCi−1labelledatrue andbfalse.

The above arguments give the following lemma.

Lemma 16. If we have a string Si−1 that represents Ci−1 and Ci is obtained from Ci−1 by making two outputs of Ci−1 the inputs of a new NAND gate, then in constant time we can append symbols toSi−1 to obtain a stringSithat representsCi.

ドキュメント内 組合せ的文字列分解 (ページ 51-62)

関連したドキュメント