mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
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.
56 lines
1006 B
Mathematica
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).
|