List learn membership

Description

Problem definition for learning list membership.

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

Download

Program source code: list_learn_membership.pl

Listing

% 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])).

Comments

pl/prolog/pllib/list_learn_membership.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0