PCP → CFG Ambiguity (pcp2cfg)

An interactive tool for the reduction PCP ⇒ CFG Ambiguity.
Build or import a PCP instance (dominoes), generate the grammar G_D, and explore derivations via T and B.

PCP instance (dominoes)

Each domino i is a pair (t_i, b_i). The tool assigns a new terminal a_i used as an index marker in the grammar.
k = 0
Index prefix:

Workspace (sequence of dominoes)

Drop tiles here in order. You can reorder or delete individual tiles.
Sync with the index sequence input below.

MPCP Solver (bounded)

PCP is undecidable. This solver performs a bounded search and may fail even if a solution exists.



Generated CFG G_D

The grammar is constructed from your dominoes using the classical reduction PCP ⇒ AMB_CFG.

Derivation explorer


This builds two derivations: S⇒T⇒* and S⇒B⇒*. Matching outputs witness ambiguity.
Tree T S ⇒ T ⇒* …
Tree B S ⇒ B ⇒* …
Reminder: this tool does not decide PCP or CFG ambiguity. It helps you explore the reduction and witness ambiguity when a solution is found.