EXPLANATION BASED GENERALISATION

Download Report

Transcript EXPLANATION BASED GENERALISATION

EXPLANATION BASED
GENERALISATION
Ivan Bratko
TASK OF EBG
• Given:
• Domain theory
• Operationality criteria
• Training example
• Find: Generalisation of training instance and operational
definition of target concept
EXAMPLE OF EBG
Training example: gives (john, john, chocolate)
Proof:
gives (john, john, chocolate)
feels_sorry_for( john, john)
sad( john)
would_comnfort( Chocolate, john)
likes( john, chocolate)
GENERALISED PROOF
gives ( Person, Person, Thing)
feels_sorry_for( Person, Person)
would_comnfort( Thing, Person)
sad( Person)
likes( Person, Thing)
Operational
OPERATIONAL DEFINITION OF
TARGET CONCEPT
gives( Person, Person, Thing) :sad( Person),
likes( Person, Thing).
• This can be asserted into the program and used in
solving subsequent problems.
Explanation-based generalization
% ebg( Goal, GeneralizedGoal, SufficientCondition) :
% SufficientCondition in terms of operational predicates
% guarantees that generalization of Goal, GeneralizedGoal, is true.
% GeneralizedGoal must not be a variable
ebg( true, true, true) :- !.
ebg( Goal, GenGoal, GenGoal) :operational( GenGoal),
call( Goal).
ebg( (Goal1,Goal2), (Gen1,Gen2), Cond) :- !,
ebg( Goal1, Gen1, Cond1),
ebg( Goal2, Gen2, Cond2),
and( Cond1, Cond2, Cond). % Cond = (Cond1,Cond2) simplified
ebg( Goal, GenGoal, Cond) :not operational( Goal),
clause( GenGoal, GenBody),
copy_term( (GenGoal,GenBody), (Goal,Body)),
% Fresh copy of (GenGoal,GenBody)
ebg( Body, GenBody, Cond).
% and( Cond1, Cond2, Cond) if
% Cond is (possibly simplified) conjunction of Cond1 and Cond2
and( true, Cond, Cond) :- !.
% (true and Cond) <==> Cond
and( Cond, true, Cond) :- !.
% (Cond and true) <==> Cond
and( Cond1, Cond2, ( Cond1, Cond2)).
LIFT EXAMPLE
?- Goal = go( 3, 9, Moves),
GenGoal = go( Lev1, Lev2, GenMoves),
ebg( Goal, GenGoal, Cond),
asserta( ( GenGoal :- Cond ) ).
Goal = go( 3, 9, [up,up,up,up,up,up])
GenGoal = go( Lev1, Lev2, [up,up,up,up,up,up])
Cond = ( 0+1+1+1+1+1+1 =:= Lev2 - Lev1 )
Next time, go(5,11,Moves) is answered without search!