List learn membership


Problem definition for learning list membership.

Source: PROLOG programming for artificial intelligence, 3rd Edition, Harlow, 2001, ISBN 0-201-40375-7.


Program source code:


% Figure 19.5  Problem definition for learning list membership.
% Problem definition for learning about member(X,L)
backliteral( member(X,L), [L:list], [X:item] ).  % Background literal
% Refinement of terms
term( list, [X|L], [ X:item, L:list]).
term( list, [], []).
prolog_predicate( fail).          % No background predicate in Prolog
start_clause( [ member(X,L) ] / [ X:item, L:list] ).
% Positive and negative examples
ex( member( a, [a])).
ex( member( b, [a,b])).
ex( member( d, [a,b,c,d,e])).
nex( member( b, [a])).
nex( member( d, [a,b])).
nex( member( f, [a,b,c,d,e])).


pl/prolog/pllib/list_learn_membership.txt · ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna) Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0