title: Prolog query with default for missing values
body: <p>Say I have the following database in Prolog.</p>
  
  <pre><code>person(fred).
  person(bob).
  person(alice).
  
  alias(fred,"Frederick the Great").
  alias(bob,"Spongey").
  </code></pre>
  
  <p>Now I want to be able to search for aliases but get the original name back as a default when there is no alias available.</p>
  
  <p>Eg. to get </p>
  
  <pre><code>fred, "Frederick the Great"
  bob, "Spongey"
  alice, alice
  </code></pre>
  
  <p>back</p>
  
  <p>My first try was to add another clause for the alias predicate.</p>
  
  <pre><code>alias(X,X).
  </code></pre>
  
  <p>But this gives me </p>
  
  <pre><code>fred,"Frederick the Great"
  fred, fred
  bob, "Spongey"
  bob, bob
  alice, alice
  </code></pre>
  
  <p>But I don't want the non-alias version when there is an alias available.</p>
  
  <p>How would I do this in Prolog?</p>