Pergunta

Rewriting system is a set of rules in the form of $A \leftrightarrow B$. If we apply that rule to a string $w$ we replace any substring $A$ in $w$ with a substring $B$ and vice versa.

Given a starting string $AAABB$ can we derive $BAAB$ in the system with the following rules:

  • $A \leftrightarrow BA$
  • $BABA \leftrightarrow AABB$
  • $AAA \leftrightarrow AB$
  • $BA \leftrightarrow AB$

Is there a general algorithm for that?

Foi útil?

Solução

Notice that the parity of the number of $A$s does not change. Since one string contains an odd number $A$ and the other even, they are not reachable.

I believe in general (for an arbitrary set of rules, not your specific example), this is likely to be an undecidable problem. If the transforms are one way(i.e rules of the form $A \to BA$) it is so , for eg see: Tag System.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a cs.stackexchange
scroll top