Note that there are some explanatory texts on larger screens.

plurals
  1. POCrossword solver in PROLOG
    text
    copied!<p>The creole of Paradise Island has 14 words: "abandon", "abalone", "anagram", "boat", "boatman", "child", "connect", "elegant", "enhance", "island", "man", "sand", "sun", and "woman". </p> <p>The Paradise Times have published this crossword:</p> <p><a href="https://i.stack.imgur.com/q5wmk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q5wmk.png" alt="The Paradise Times Crossword"></a></p> <p>The crossword contains some of the 14 words but no other words. </p> <p><strong>Write a Prolog program</strong> that starts from</p> <pre><code>word(X) :- member(X, [ [a,b,a,n,d,o,n], [a,b,a,l,o,n,e], [a,n,a,g,r,a,m], [b,o,a,t], [b,o,a,t,m,a,n], [c,h,i,l,d], [c,o,n,n,e,c,t], [e,l,e,g,a,n,t], [e,n,h,a,n,c,e], [i,s,l,a,n,d], [m, a, n], [s,a,n,d], [s,u,n], [w, o, m, a, n] ]). solution(H1,H2,H3,V1,V2,V3) :- </code></pre> <p>and defines the predicate <code>solution</code> in such a way that</p> <pre><code>solution(H1,H2,H3,V1,V2,V3) </code></pre> <p>is true if and only if <code>H1</code>, <code>H2</code>, <code>H3</code>, <code>V1</code>, <code>V2</code>, and <code>V3</code> are valid words of Paradise Island which form a valid crossword when written into the grid given above. (For example, the second letter of <code>H1</code> should coincide with the second letter of <code>V1</code>.)</p> <p>Use the query</p> <pre><code>?- solution(H1,H2,H3,V1,V2,V3). </code></pre> <p>to solve the crossword. Find all solutions to the crossword.</p> <p>Hint: You might want to start from a smaller crossword and a less rich lexicon.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload