interpreter :-
    interpreter_prompt,
    read(Goal),
    interpreter(Goal).

interpreter_prompt :- write('Next Command ?-- ').

interpreter(exit) :- !.
interpreter(Goal) :-
    ground(Goal), !,
    solve_ground(Goal),
    interpreter.
interpreter(Goal) :-
    solve(Goal),
    interpreter.

solve_ground(Goal) :-
    call(Goal),
    !,
    writeln('True :)').
solve_ground(_) :- writeln('False :(').

solve(Goal) :-
    call(Goal),
    writeln(Goal),
    fail.
solve(_) :- writeln('No more solutions :/').
