:- module(phone_db,[response/2,add_phone/2]). response(Name, []) :- form_empty_value(Name), !. response(Name, ['Phone number for ', bf(Name), ' is ', Info, --]) :- phone(Name,Info), !. response(Name, ['No phone number available for ', bf(Name), '.', --]). add_phone(Name, Phone) :- assert(phone(Name, Phone)). %% Database :- dynamic phone/2. phone('CLIP', '336-7448'). phone('Paco', '554-5225'). phone('Daniel', '460-0569'). export_address(Address) :- tell('phone_db.addr'), write(Address), told. :- save_active_module(phone_db, Address, export_address(Address)).