Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of...

31
Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001

Transcript of Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of...

Page 1: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Tackling Post’s Correspondence Problem

Ling Zhao

Department of Computing Science

University of Alberta

July 31, 2001

Page 2: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Preconceptions

• Easy to state, impossible to solve!

• Some instances can be solved

• Purely theoretical problem before

• A few solving methods were raised recently Lorentz, R.J., Creating difficult instances of the Post Correspondence Problem, (CG2000), 145-159, 2000.

Page 3: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

An example of a PCP instance

1 2 3

100 0 1

1 100 00

Rules:

1. Select pairs

2. Make the concatenated top string and bottom string identical

1

100

1

2

0

100

3

1

00

3

1

00

1

100

1

1

100

1

2

0

100

1001100100100

1001100100100

Instance solved!

Page 4: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Definitions

Given an alphabet ={0, 1}, one instance of Post’s correspondence problem of size s is a finite set of pairs of strings (gi , hi) ( i = 1…s, s

1) over the alphabet . A solution of length n 1 to this instance is a sequence i1 i2 ... in of selections such that the strings gi1gi2 ... gin and

hi1hi2 ... hin formed by concatenation are identical. Size: the number of pairs Width: the length of longest string

Optimal solution: the solution with shortest length

Optimal length: the length of the optimal solution

Configuration: the longer portion that one side goes beyond the other.

Configuration is either at the top or at the bottom.

Page 5: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Theoretical place

• Raised by Emil L. Post in 1946 as an classic undecidable problem

• Bounded version is NP-complete • The PCP of size 2 is decidable • The PCP of size 7 is undecidable • Open problem: decidability of PCP of size

between 3 and 6• Application: to prove the undecidability of other

problems

Page 6: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Facts & Motivations

• Some PCP instances have no solutions

• Some instances have solutions

• Some instances have more than one optimal solution

• Only a small portion of instances have long optimal solutions (the difficult instances).

Page 7: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Progress in three directions

1. Searching optimal solutions efficiently and quickly

2. Prove instances with no solutions

3. Creating difficult instances

Page 8: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Search optimal solutions

• Basically a single-agent search problem

• Traditional search techniques and methods can be migrated to solve PCP instances

• Due to the special characteristics of PCP, some new application-dependent methods are invented

Page 9: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Search optimal solutions (cont’d)

• Iterative-deepening depth-first search

• Cache scheme

• Mask method

• Bidirectional probing

• Heuristic pruning

Page 10: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Mask method

Critical configuration: a non-empty configuration that can be fully matched or be turned over.

1 2 3

100 0 1

1 100 00

Two critical configurations at the top: ‘1’ and ’10’

Mask method: use the possibility of ending the configurations on one side to prune nodes

Page 11: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Mask method

1 2 3 4

01 00 1 001

0 011 101 1

1. Find all critical configurations

2. Test whether these configuration are valid, i.e., possible to be generated

1. Only one critical configuration at the top exist: ’10’.

2. It can not be generated because configuration ’01’ at the bottom in its reversal can not lead to a solution

3. It has the top mask

1 2 3 4

10 00 1 100

0 110 101 1

Reversal:

Page 12: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Bidirectional pruning

• Let P: (gi , hi ) ( i = 1…s) be a PCP instance. P’s

reversal is (giR, hi

R) ( i = 1…s), while giR, hi

R are

the reversals of string gi and hi respectively.

• A PCP instance has the same solvability as its reversal in the sense that it has a solution if and only if its reversal has, and it has the same number of optimal solutions and the same optimal length as its reversal.

Page 13: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Bidirectional pruning

• Solving any direction is enough

• Yet search difficulties in two directions may differ greatly

• Using probing scheme to decide which direction is promising

• Predicting correctly in most cases because of the stable branching factors

Page 14: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Heuristic pruning

• Learned from the well-known search algorithms such as A* and IDA*

• But use the heuristic value to prune hopeless nodes c: a configuration g(c): current depth for c h(c): heuristic value for c if ( g(c) + h(c) > depth threshold ) then c can be pruned

Page 15: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Heuristic pruning example

1. Suppose a configuration in the top has 81 bits and its depth is 60.

2. Search depth threshold is 100.

3. The maximum shrinking length in every step is 2.

4. Impossible to get a solution below depth 100. This configuration can be pruned.

1 2 3

110 0 1

1 111 01

Page 16: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Heuristic pruning facts

• The simple heuristic can reduce the number of visited node by roughly 80%

• Complicated heuristic value can be obtained by pre-computing the matching results of shorter configurations (similar to the pattern database in 15-puzzle).

• Influence the use of move ordering

Page 17: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Prove instances with no solutions

• Filters

• Mask method

• Exclusion method

• Pattern method

Page 18: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Filters

1. Prefix/postfix filter 000 0 1

1 100 0

000 100 1

0 10 0

101 1 01

10 01 0

2. Length balance filter

3. Element balance filter

Page 19: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Mask method

• The mask method is also useful to prove an instance has no solutions

• the masks of one instance and its reversal are interdependent. The discovering process of masks need to be iterated until no changes come out.

Page 20: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Exclusion method

Basic idea: exclude pairs that can not be used

1 2 3

1 0 101

0 001 1

When starting from pair 2, the following selection can only be pair 1 or pair 2.

Reason: Any combinations of the bottom strings in pair 1 and pair 2 can not generate a substring ‘101’, the top string in pair 3.

Page 21: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Pattern method

• Basic idea: If a configuration has a prefix, and any path starting from it always generates a configuration having such prefix, it leads to no solutions. 4 types of patterns:Type 1: prefix pattern αA =>αBType 2: postfix pattern Aα = > BαType 3: infix pattern AαB => CαD Type 4: prefix & postfix pattern αAβ=>αBβ

This method is very difficult to be automated!

Page 22: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Creating difficult instances

• Combination of a random instance generator and a solver

• A strong PCP solver has more chance to discover hard PCP instances.

• It can find optimal solutions very quickly and reject instances with no solutions earlier.

Page 23: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Creating difficult instances

• Use the number of visited nodes and cutoff nodes as the threshold.

• Prohibit instances having one pair consisting of all zeros or ones.

• Neighboring effects: replacing the infrequently used pair in the solution may generate a harder instance. 1010 101 1 110

1 1111 1011 01

1010 010 1 110

1 1111 1011 01Optimal length=120 Optimal length=200

Page 24: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Experimental results

• All methods discussed above were implemented except the pattern method.

• Can only give qualitative evaluations on the improvements derived from the mask method and the exclusion method.

• Bidirectional probing is crucial to some instances.

• Even a simple heuristic function can improve efficiency greatly.

Page 25: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Experimental results

• Go through all unexamined instances of size 3 and width 3. Now in this subclass only one instance is still unsolved (1).

• Strengthen the conjecture that the hardest instance in this subclass is (2) with optimal length of 75.

10 0 001

0 001 1

100 0 1

1 100 0

(1) (2)

Page 26: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Experimental results

• Create more than 100 hard instances of size 4 and width 4 with optimal lengths more than 100.

• Two instances set new PCP instance records:

101 1 010

1 01 1101Optimal length=216

hardest in PCP[3,4]

1010 11 0 01

100 1011 1 0Optimal length=256

hardest in PCP[4,4]

Page 27: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Difficulties & Differences

• Theoretically not all instances can be solved by a program.

• Unbounded search space is different from the normal single-agent search problems or two-play games.

• Small branching factor. For an instance in PCP[3], typically its branching factor is a little more than 1.

Page 28: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Speculations

• The mask method, the exclusion method and bidirectional probing are done earlier in the solving scheme and cost little overhead.

• The more properties discovered, the easier to solve!

Page 29: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

What’s the use of PCP?

• Provide a new and different test bed for search enhancements: iterative deepening, cache scheme, heuristic pruning, bidirectional search, etc.

• The data gathered through practical approaches may result in the breakthrough in theory, i.e., proving the decidablity of PCP[3].

Page 30: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Future work

• One instance is still unresolved.

• The pattern method need automated

• Incorporate more enhancements, e.g. complicated heuristic and bidirectional search.

• Continue examining the subclasses PCP[3,4], PCP[3,5] and so on.

Page 31: Tackling Post’s Correspondence Problem Ling Zhao Department of Computing Science University of Alberta July 31, 2001.

Links

• PCP websites http://www.cs.ualberta.ca/~zhao/PCP/intro.htm

http://www.informatik.uni-leipzig.de/~pcp/

• PCP Paper

Tackling Post’s correspondence problem