:- add_rule( reverse_list if original_list([X|Rest]) and reversed_list(Y) then remove(original_list(_)) and remove(reversed_list(Y)) and add(original_list(Rest)) and add(reversed_list([X|Y]))). :- add_rule( print_reversed if original_list([]) and reversed_list(Y) then print('The reversed list is: ') and print(Y) and print('\n') and end). :- add(original_list([a,b,c])). :- add(reversed_list([])).