Repeated string concatenation
A quick browse through the SWI-Prolog manual finds atomics_to_string/3:

atomics_to_string(+List, +Separator, -String)
Creates a string just like atomics_to_string/2, but inserts Separator between each pair of inputs. For example:
?- atomics_to_string([gnu, &quot;gnat&quot;, 1], ', ', A).
A = &quot;gnu, gnat, 1&quot;