mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-19 15:54:18 +00:00
Estimated hours taken: 2 Branches: main Replace "is" with "=". Add field names where relevant. Replace integers with counters where relevant.
20 lines
381 B
Mathematica
20 lines
381 B
Mathematica
% Test the warning for duplicate calls.
|
|
:- module duplicate_call.
|
|
|
|
:- interface.
|
|
|
|
:- pred dup_call(int::in, int::in, int::out) is det.
|
|
|
|
:- pred called(int::in, int::in, int::out) is det.
|
|
|
|
:- implementation.
|
|
:- import_module int.
|
|
|
|
dup_call(Int1, Int2, Int) :-
|
|
called(Int1, Int2, Int3),
|
|
called(Int1, Int2, Int4),
|
|
Int = Int3 + Int4.
|
|
|
|
called(Int1, Int2, Int) :-
|
|
Int = Int1 + Int2.
|