I would like to replace a sequence of tokens in a DCG grammar in Prolog. In other words replace the sequence or sublist A: [a,a,a,a] by the sublist B: [b].  

chain --> chain\_where\_sublist\_A\_is\_replaced\_by\_sublist\_B but entirely using the DCG formalism.

For example: [c,a,a,a,a,d] gives [c,b,d]