Largest Integer Consisting of Unique Triple Primes

Goal: Find the largest integer where all triples are unique and prime.

For instance the number 94199 the triples would be 941, 419, 199. The goal was to find the largest number where all of the triples are prime where no triple prime is repeated. This problem was posed as a challenge to secure an interview. I decided to use Prolog since I like to have fun with logic programming.

The interview was cordial.

The answer is:

?- solution.
Largest value is 9419919379773971911373313179
true.

The code: