Commit 562ba603 authored by Joaquin Arias's avatar Joaquin Arias

Query also human output

parent b69e2252
......@@ -64,8 +64,6 @@ program under the stable model semantic.
:- use_module(clp_clpq).
:- use_module(library(formulae)).
:- op(700, fx, [not,(?=), (??), (?)]).
%% ------------------------------------------------------------- %%
......@@ -132,9 +130,8 @@ main_solve(Q0) :-
process_query(Q0,Q,Query), varset(Q,Vars),
pretty_term([],D1,par(Vars,Q),par(PVars,PQ)),
list_to_conj(PQ,ConjPQ),
format('QUERY:\n?- ~p.\n',ConjPQ),
print_query(PQ),
statistics(runtime,_),
if(solve(Query, [], StackOut, Model),nl,(print('\nfalse\n\n'),fail)),
......
......@@ -6,6 +6,7 @@
allways_ask_for_more_models/0,
init_counter/0,
increase_counter/0,
print_query/1, % query
print_justification_tree/1, % justification tree
print_model/1, % model
print_unifier/2, % bindings
......@@ -167,6 +168,20 @@ increase_counter :-
retractall(answer_counter(N)),
assert(answer_counter(N1)).
:- pred print_query(Query) #"Print the @var{Query}".
:- use_module(library(formulae)).
print_query(Query) :-
format('QUERY:\n',[]),
( current_option(human,on) ->
print('I would like to know if'),
print_human_body(Query)
;
list_to_conj(Query,ConjPQ),
format('?- ~p.\n',[ConjPQ])
).
:- pred print_justification_tree(StackOut) #"Print the justification
tree using @var{StackOut}, the final call stack".
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment