Files(5)

NAME
FileName.pl - input file for Progol

DESCRIPTION
All input for Progol is read from a single file which has a ".pl" suffix. The contents of this file are usually:

    1. Progol commands
        including mode declarations and parameter settings.

    2. Background knowledge
        as a set of Prolog clauses.

    3. Positive examples
        as a set of definite clauses (not necessarily ground unit clauses).

    4. Negative examples
        as a set of ground negative literals.
Comments can appear anywhere in the file provided they are prefaced by a "%" sign.

EXAMPLES
Here is an example input file for learning list membership.

:- set(c,2)?
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Learns recursive clauses for member(Element,List)
:- modeh(1,member(-constant,+clist))?
:- modeb(1,+constant = #constant)?
:- modeb(1,+clist = [-constant|-clist])?
:- modeb(1,member(-constant,+clist))?
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Types
clist([]).
clist([H|T]) :- constant(H), clist(T).
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Positive examples
member(0,[0]).
member(0,[0,0]).
member(0,[1,0]).
member(0,[2,0]).
member(1,[0,1]).
member(1,[1,1]).
member(1,[1]).
member(1,[2,1]).
member(2,[2,2]).
member(2,[2]).
member(2,[3,2]).
member(3,[2,3]).
member(3,[3]).
member(4,[3,4,5]).
member(3,[4,2,3]).
member(4,[4]).
% member(X,[X|_]).
% member(X,[_,X|_]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Negative examples
:- member(0,[1,2]).
:- member(0,[1]).
:- member(1,[0]).
:- member(2,[3]).
:- member(2,[]).
:- member(3,[]).

SEE ALSO
set/2, mode/2