% Derived rule example.
%
% The inner implication is represented directly as quoted formula data.
% var(y) is not a eyeprolog variable; it is a ground term that names
% a variable placeholder inside the quoted formula.

% Output declarations: host-supplied goals select the relations written to this example's golden output.
%% ?- type(X0, X1).

%% ?- implication(X0, X1).

%% ?- holds_result(X0, X1).


% Program structure: facts set up the scenario, and rules derive the queried conclusions.
type(minka, cat).
type(charly, dog).

% Derivation rules: each rule below contributes one logical step toward the displayed results.
implication(type(var(y), dog), holds_result(test, true)) :-
  type(_x, cat).

holds_result(test, true) :-
  implication(type(var(y), dog), holds_result(test, true)),
  type(_y, dog).
