/* Learning min/2 - finding a minimal element of a list */ /* This task requires negative examples. Otherwise the membership reletion would be learnt. This is because memb/2 subsumes min/2, i.e. the minimal element of a list must be a member of the list. */ background([min/2,components/3,less/2]). propositional([[]]). /* Positive examples of the target predicate */ min('[1,2,3]',1). min('[3,2,1]',1). min('[2,1,3]',1). min('[2,3,1]',1). min('[3,1,2]',1). min('[2,3]',2). min('[1,3]',1). min('[3,1]',1). min('[2,1]',1). min('[1,2]',1). min('[1]',1). min('[2]',2). min('[3]',3). /* Negative examples of the target predicate */ neg(min('[3,2,1]',3)). neg(min('[1,2]',2)). /* Background knowledge */ less(1,2). less(2,3). less(1,3). components('[1,2,3]',1,'[2,3]'). components('[3,2,1]',3,'[2,1]'). components('[2,3,1]',2,'[3,1]'). components('[1,3,2]',1,'[3,2]'). components('[2,1,3]',2,'[1,3]'). components('[3,1,2]',3,'[1,2]'). components('[2,3]',2,'[3]'). components('[3,2]',3,'[2]'). components('[1,3]',1,'[3]'). components('[3,1]',3,'[1]'). components('[2,1]',2,'[1]'). components('[1,2]',1,'[2]'). components('[1]',1,[]). components('[2]',2,[]). components('[3]',3,[]).