title: go/0 Undefined procedure save/1
body: <p>swi-prolog 5.10.2</p>
  
  <p>I have typed this prolog program in. However, when I run option a I get the following error.</p>
  
  <pre><code>go/0 Undefined Procedure save/1
  </code></pre>
  
  <p>I am sure that save is a proper keyword predicate, and the path to the file does exist as well. Not sure where I am going wrong here. </p>
  
  <pre><code>What does the /0 /1 mean in go and save?
  </code></pre>
  
  <p>Source code</p>
  
  <pre><code>/* Shopping list */
  
  go:-reconsult('~/projects/prolog/chap7/shopping.pl'),
      write('a: See list'), nl,
      write('b: Add to list'), nl,
      write('c: Delete from list'), nl,
      read(Choice),
      choice(Choice),
      save('~/projects/prolog/chap7/shopping.pl').
  
  /*
    facts for shopping
  */
  item(potatoes).
  item(bread).
  item(coffee).
  
  /*
    Rules for shopping list
  */
  choice(a):-listing(item), nl.
  choice(b):-write('Enter an item: '),
          read(Item),
          assert(item(Item)).
  choice(c):-write('Item to delete: '),
          read(Item),
          retract(item(Item)).
  choice(_):-write('Incorrect entry.'), nl.
  </code></pre>
  
  <p>Many thanks in advance,</p>