7.6 Well Founded Semantics
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • Tabled execution (SLG resolution)
        • Well Founded Semantics
          • undefined/0
          • call_residual_program/2
          • call_delays/2
          • delays_residual_program/2
          • Well founded semantics and the toplevel
    • Packages

7.6.1 Well founded semantics and the toplevel

The toplevel supports two modes for reporting that it is undefined whether the current answer is true. The mode is selected by the Prolog flag toplevel_list_wfs_residual_program. If true, the toplevel uses call_delays/2 and delays_residual_program/2 to find the conditional answers used and the residual program associated with these answers. It then prints the residual program, followed by the answer and the conditional answers. For undefined/0, this results in the following output:

?- undefined.
% WFS residual program
    undefined :-
        tnot(undefined).
undefined.

If the toplevel_list_wfs_residual_program is false, any undefined answer is a conjunction with undefined/0. See the program and output below.

:- table p/0, q/0.

p :- tnot(q).
q :- tnot(p).
?- p.
% WFS residual program
    p :-
        tnot(q).
    q :-
        tnot(p).
p.

?- set_prolog_flag(toplevel_list_wfs_residual_program, false).
true.

?- p.
undefined.