Files
mercury/tests/declarative_debugger/shallow_2.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

56 lines
1006 B
Mathematica

%---------------------------------------------------------------------------%
% vim: ts=4 sw=4 et ft=mercury
%---------------------------------------------------------------------------%
:- module shallow_2.
:- interface.
:- pred p(string::in, int::in, int::out) is det.
:- pred q(string::in, int::in, int::out) is det.
:- pred r(string::in, int::in, int::out) is det.
:- implementation.
:- import_module shallow_3.
p(S, M, N) :-
( if pp(S, 1, M) then
N = 1
else
N = -11
).
:- pred pp(string::in, int::in, int::out) is multi.
pp(S, M, N) :-
a(S, M, N).
pp(S, M, N) :-
b(S, M, N).
q(S, M, N) :-
( if a(S, M, -1) then
N = 11
else
N = 2
).
r(S, M, N) :-
( if
not a(S, M, -3),
b(S, M, 5)
then
N = 23
else
N = 0
).
% shallow_3 defines:
%
% :- pred a(string::in, int::in, int::out) is multi.
%
% a(_, X, X).
% a(_, _, 0).
%
% :- pred b(string::in, int::in, int::out) is det.
%
% b(_, _, 5).