blob: 1a7b17cecfa80ba5130d5efc473d89b6aad3a128 [file] [log] [blame]
% An example source file to be tested.
% Add common rules missing in Prolog Cafe.
memberchk(X, [H|T]) :-
(X = H) -> true ; memberchk(X, T).
% A rule that can succeed/backtrack multiple times.
super_users(1001).
super_users(1002).
% Deterministic rule that pass/fail only once.
is_super_user(X) :- memberchk(X, [1001, 1002]).
% Another rule that can pass 5 times.
multi_users(101).
multi_users(102).
multi_users(103).
multi_users(104).
multi_users(105).
% Okay, single deterministic fact.
single_user(abc).
% Wrap calls to gerrit repository, to be redefined in tests.
change_owner(X) :- gerrit:change_owner(X).
% To test is_owner without gerrit:change_owner,
% we should redefine change_owner.
is_owner(X) :- change_owner(X).