Files
mercury/tests/declarative_debugger/ho3.m
Zoltan Somogyi ecb5e4a9e6 Update the style of many test cases.
tests/declarative_debugger/*.m:
tests/exceptions/*.m:
tests/general/*.m:
tests/grade_subdirs/*.m:
tests/purity/*.m:
tests/submodules/*.m:
tests/typeclasses/*.m:
    Update programming style.

tests/declarative_debugger/*.inp:
    Update line numbers in breakpoint commands.
tests/declarative_debugger/*.exp:
    Update expected line numbers.

tests/exceptions/Mercury.options:
tests/general/Mercury.options:
    Disable some warnings that are irrelevant to the test.
2021-07-25 23:26:17 +10:00

45 lines
793 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module ho3.
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
:- implementation.
:- import_module list.
main(!IO) :-
( if p(1) then
S1 = ""
else
S1 = "\\+ "
),
( if p(2) then
S2 = ""
else
S2 = "\\+ "
),
io.write_strings([S1, "p(1).\n", S2, "p(2).\n"], !IO).
:- pred p(int::in) is semidet.
p(N) :-
q(0, Q),
Q(N).
:- pred q(int::in, pred(int)::out(pred(in) is semidet)) is multi.
q(N, x(N)).
q(N, y(N)).
:- pred x(int::in, int::in) is semidet.
x(A, A).
:- pred y(int::in, int::in) is semidet.
y(_, -1).