title: Native Prolog Shell
body: <p>Recently I tried the book "Building Expert Systems in Prolog" which is freely available at <a href="http://www.amzi.com/ExpertSystemsInProlog" rel="nofollow">http://www.amzi.com/ExpertSystemsInProlog</a>.</p>
  
  <p>There is a code called native shell at the appendix along with a bird identification database. The problem is that after consulting with the shell and running:</p>
  
  <p>main.</p>
  
  <p>load.</p>
  
  <p>solve.</p>
  
  <p>It asks "nostrils:external_tubular?" </p>
  
  <p>If you answer no, then an stack overflow occurs. The problem is probably at the section blow:</p>
  
  <pre><code>prove(true,_) :- !.
  prove((Goal,Rest),Hist) :-
      prov(Goal,[Goal|Hist]),
      prove(Rest,Hist).
  prove(Goal,Hist) :-
      prov(Goal,[Goal|Hist]).
  
  prov(true,_) :- !.
  prov(menuask(X,Y,Z),Hist) :- menuask(X,Y,Z,Hist), !.
  prov(ask(X,Y),Hist) :- ask(X,Y,Hist), !.
  prov(Goal,Hist) :-
      clause(Goal,Body),
      prove(Body,Hist).
  </code></pre>
  
  <p>Can somebody please please help me? Any help is highly appreciated.</p>
  
  <p>Full code of the shell: <a href="http://www.amzi.com/ExpertSystemsInProlog/code/native/native.pro" rel="nofollow">http://www.amzi.com/ExpertSystemsInProlog/code/native/native.pro</a></p>
  
  <p>Full code for database: <a href="http://www.amzi.com/ExpertSystemsInProlog/code/native/birds.nkb" rel="nofollow">http://www.amzi.com/ExpertSystemsInProlog/code/native/birds.nkb</a></p>
  
  <p>I'm using swi prolog.</p>