How to insert facts into the knowledge base in prolog permanently


I would like to know how to insert new facts into the knowledge base permanently. I know there is asserta () and assertz (), however they retain the facts within the knowledge base until the prolog process is completed.

For example I have a code where I ask for the data to be inserted as done by the console:

inserta_grupo:-write('Introduzca el nombre de la banda: '),read(B),write('introduzca los generos que toca: '),read(G),asserta(grupo(B,G)).

So that as a result in the knowledge base obtain for example:

asked by k1k4ss0 03.01.2019 в 19:46

0 answers