swi-prolog 5.10.2
このプロローグプログラムを入力しました。しかし、オプションaを実行すると、次のエラーが発生します。
go/0 Undefined Procedure save/1
saveは適切なキーワード述語であり、ファイルへのパスも存在すると確信しています。ここでどこが間違っているのかわかりません。
What does the /0 /1 mean in go and save?
ソースコード
/* 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.
よろしくお願いします。