function Current-Best-Learning(examples, h) returns a hypothesis or fail
if examples is empty then
return h
e ← First(examples)
if e is consistent with h then
return Current-Best-Learning(Rest(examples), h)
else if e is a false positive for h then
for each h' in specializations of h consistent with examples seen so far do
h'' ← Current-Best-Learning(Rest(examples), h')
if h'' ≠ fail then return h''
else if e is a false negative for h then
for each h' in generalizations of h consistent with examples seen so far do
h'' ← Current-Best-Learning(Rest(examples), h')
if h'' ≠ fail then return h''
return fail
Figure ?? The current-best-hypothesis learning algorithm. It searches for a consistent hypothesis that fits all the examples and backtracks when no consistent specialization/generalization can be found. To start the algorithm, any hypothesis can be passed in; it will be specialized or generalized as needed.